Revision: 15319
Author: [email protected]
Date: Tue Jun 25 04:49:46 2013
Log: Fix to_boolean type feedback for unary and binary ops
BUG=
[email protected], [email protected]
Review URL: https://codereview.chromium.org/17444011
http://code.google.com/p/v8/source/detail?r=15319
Modified:
/branches/bleeding_edge/src/ast.cc
/branches/bleeding_edge/src/ast.h
=======================================
--- /branches/bleeding_edge/src/ast.cc Mon Jun 24 03:37:59 2013
+++ /branches/bleeding_edge/src/ast.cc Tue Jun 25 04:49:46 2013
@@ -286,6 +286,16 @@
}
targets_.Add(target, zone);
}
+
+
+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() {
@@ -297,6 +307,16 @@
return false;
}
}
+
+
+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() {
=======================================
--- /branches/bleeding_edge/src/ast.h Mon Jun 24 03:37:59 2013
+++ /branches/bleeding_edge/src/ast.h Tue Jun 25 04:49:46 2013
@@ -383,7 +383,7 @@
}
// 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_; }
@@ -395,6 +395,7 @@
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_;
@@ -1840,6 +1841,8 @@
BailoutId MaterializeFalseId() { return materialize_false_id_; }
TypeFeedbackId UnaryOperationFeedbackId() const { return reuse(id()); }
+
+ virtual void RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle);
protected:
UnaryOperation(Isolate* isolate,
@@ -1883,6 +1886,8 @@
TypeFeedbackId BinaryOperationFeedbackId() const { return reuse(id()); }
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,
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.