}
+void UnaryOperation::RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle) {
+ // TODO(olivf) If this Operation is used in a test context, then the
+ // expression has a ToBoolean stub and we want to collect the type
+ // information. However the GraphBuilder expects it to be on the instruction
+ // corresponding to the TestContext, therefore we have to store it here and
+ // not on the operand.
+ set_to_boolean_types(oracle->ToBooleanTypes(expression()->test_id()));
+}
+
+
bool UnaryOperation::ResultOverwriteAllowed() {
switch (op_) {
case Token::BIT_NOT:
}
+void BinaryOperation::RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle) {
+ // TODO(olivf) If this Operation is used in a test context, then the right
+ // hand side has a ToBoolean stub and we want to collect the type information.
+ // However the GraphBuilder expects it to be on the instruction corresponding
+ // to the TestContext, therefore we have to store it here and not on the
+ // right hand operand.
+ set_to_boolean_types(oracle->ToBooleanTypes(right()->test_id()));
+}
+
+
bool BinaryOperation::ResultOverwriteAllowed() {
switch (op_) {
case Token::COMMA:
}
// TODO(rossberg): this should move to its own AST node eventually.
- void RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle);
+ virtual void RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle);
byte to_boolean_types() const { return to_boolean_types_; }
BailoutId id() const { return id_; }
lower_type_(Type::None(), isolate),
id_(GetNextId(isolate)),
test_id_(GetNextId(isolate)) {}
+ void set_to_boolean_types(byte types) { to_boolean_types_ = types; }
private:
Handle<Type> upper_type_;
TypeFeedbackId UnaryOperationFeedbackId() const { return reuse(id()); }
+ virtual void RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle);
+
protected:
UnaryOperation(Isolate* isolate,
Token::Value op,
Maybe<int> fixed_right_arg() const { return fixed_right_arg_; }
void set_fixed_right_arg(Maybe<int> arg) { fixed_right_arg_ = arg; }
+ virtual void RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle);
+
protected:
BinaryOperation(Isolate* isolate,
Token::Value op,