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

Unified Diff: src/ast/ast-numbering.cc

Issue 2673383002: [ic] Encode LoadGlobalIC's typeof mode in slot kind instead of code object's flags. (Closed)
Patch Set: Addressed comments and added check to FCG Created 3 years, 10 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
« no previous file with comments | « src/ast/ast.cc ('k') | src/builtins/builtins.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast-numbering.cc
diff --git a/src/ast/ast-numbering.cc b/src/ast/ast-numbering.cc
index 001911fcef78776f979d51bb6faf346f67b4c2b1..198b1f806772d2931719fcb11184f9444b8a4a0a 100644
--- a/src/ast/ast-numbering.cc
+++ b/src/ast/ast-numbering.cc
@@ -37,6 +37,7 @@ class AstNumberingVisitor final : public AstVisitor<AstNumberingVisitor> {
AST_NODE_LIST(DEFINE_VISIT)
#undef DEFINE_VISIT
+ void VisitVariableProxy(VariableProxy* node, TypeofMode typeof_mode);
void VisitVariableProxyReference(VariableProxy* node);
void VisitPropertyReference(Property* node);
void VisitReference(Expression* expr);
@@ -187,10 +188,15 @@ void AstNumberingVisitor::VisitVariableProxyReference(VariableProxy* node) {
node->set_base_id(ReserveIdRange(VariableProxy::num_ids()));
}
+void AstNumberingVisitor::VisitVariableProxy(VariableProxy* node,
+ TypeofMode typeof_mode) {
+ VisitVariableProxyReference(node);
+ node->AssignFeedbackVectorSlots(properties_.get_spec(), typeof_mode,
+ &slot_cache_);
+}
void AstNumberingVisitor::VisitVariableProxy(VariableProxy* node) {
- VisitVariableProxyReference(node);
- ReserveFeedbackSlots(node);
+ VisitVariableProxy(node, NOT_INSIDE_TYPEOF);
}
@@ -252,7 +258,12 @@ void AstNumberingVisitor::VisitThrow(Throw* node) {
void AstNumberingVisitor::VisitUnaryOperation(UnaryOperation* node) {
IncrementNodeCount();
node->set_base_id(ReserveIdRange(UnaryOperation::num_ids()));
- Visit(node->expression());
+ if ((node->op() == Token::TYPEOF) && node->expression()->IsVariableProxy()) {
+ VariableProxy* proxy = node->expression()->AsVariableProxy();
+ VisitVariableProxy(proxy, INSIDE_TYPEOF);
+ } else {
+ Visit(node->expression());
+ }
}
« no previous file with comments | « src/ast/ast.cc ('k') | src/builtins/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698