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

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

Issue 2219303002: [ic] Don't share LoadGlobalIC slots inside typeof and outside typeof. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | test/cctest/test-api-interceptors.cc » ('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 0dd6f1d5dabacfaa57fbf33007a96771ef3a87d8..10a7b08e24e36f44302c7674bf0e33e28e5b3c42 100644
--- a/src/ast/ast-numbering.cc
+++ b/src/ast/ast-numbering.cc
@@ -19,7 +19,9 @@ class AstNumberingVisitor final : public AstVisitor<AstNumberingVisitor> {
yield_count_(0),
properties_(zone),
slot_cache_(zone),
+ slot_cache_inside_typeof_(zone),
dont_optimize_reason_(kNoReason),
+ typeof_mode_(NOT_INSIDE_TYPEOF),
catch_prediction_(HandlerTable::UNCAUGHT) {
InitializeAstVisitor(isolate);
}
@@ -62,7 +64,9 @@ class AstNumberingVisitor final : public AstVisitor<AstNumberingVisitor> {
template <typename Node>
void ReserveFeedbackSlots(Node* node) {
node->AssignFeedbackVectorSlots(isolate_, properties_.get_spec(),
- &slot_cache_);
+ typeof_mode_ == INSIDE_TYPEOF
+ ? &slot_cache_inside_typeof_
+ : &slot_cache_);
}
BailoutReason dont_optimize_reason() const { return dont_optimize_reason_; }
@@ -74,7 +78,9 @@ class AstNumberingVisitor final : public AstVisitor<AstNumberingVisitor> {
AstProperties properties_;
// The slot cache allows us to reuse certain feedback vector slots.
FeedbackVectorSlotCache slot_cache_;
+ FeedbackVectorSlotCache slot_cache_inside_typeof_;
BailoutReason dont_optimize_reason_;
+ TypeofMode typeof_mode_;
HandlerTable::CatchPrediction catch_prediction_;
DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
@@ -216,9 +222,13 @@ void AstNumberingVisitor::VisitThrow(Throw* node) {
void AstNumberingVisitor::VisitUnaryOperation(UnaryOperation* node) {
+ Token::Value op = node->op();
+ TypeofMode old_typeof_mode = typeof_mode_;
IncrementNodeCount();
+ if (op == Token::TYPEOF) typeof_mode_ = INSIDE_TYPEOF;
node->set_base_id(ReserveIdRange(UnaryOperation::num_ids()));
Visit(node->expression());
+ typeof_mode_ = old_typeof_mode;
}
« no previous file with comments | « no previous file | test/cctest/test-api-interceptors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698