Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: src/ast.cc

Issue 17444011: Fix to_boolean type feedback for unary and binary ops (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/ast.h ('K') | « src/ast.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.cc
diff --git a/src/ast.cc b/src/ast.cc
index f2ec67f69b7efb899e937089759f2f5d6a6c9cb5..01fbf7e21b6d2550b35465a430272b277061d21d 100644
--- a/src/ast.cc
+++ b/src/ast.cc
@@ -288,6 +288,15 @@ void TargetCollector::AddTarget(Label* target, Zone* zone) {
}
+void UnaryOperation::RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle) {
+ // TODO(oli) If this Operation is used in a test context, then the expression
Jakob Kummerow 2013/06/24 15:06:35 nit: the identifier in the parentheses should be t
+ // has a ToBool stub and we want to collect this information. However the
Jakob Kummerow 2013/06/24 15:06:35 nit: s/ToBool/ToBoolean/
+ // GraphBuilder expects it to be on the instruction corresponding to the
+ // TestContext, therefore we have to store it here and not on the operand.
+ to_boolean_types_ = oracle->ToBooleanTypes(expression()->test_id());
+}
+
+
bool UnaryOperation::ResultOverwriteAllowed() {
switch (op_) {
case Token::BIT_NOT:
@@ -299,6 +308,16 @@ bool UnaryOperation::ResultOverwriteAllowed() {
}
+void BinaryOperation::RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle) {
+ // TODO(oli) If this Operation is used in a test context, then the right
+ // hand side has a ToBool stub and we want to collect this 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.
+ to_boolean_types_ = oracle->ToBooleanTypes(right()->test_id());
+}
+
+
bool BinaryOperation::ResultOverwriteAllowed() {
switch (op_) {
case Token::COMMA:
« src/ast.h ('K') | « src/ast.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698