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

Side by Side Diff: src/ast/ast.cc

Issue 2487483004: Only treat possible eval calls going through 'with' as special. (Closed)
Patch Set: Fix AstGraphBuilder Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/ast/ast.h" 5 #include "src/ast/ast.h"
6 6
7 #include <cmath> // For isfinite. 7 #include <cmath> // For isfinite.
8 8
9 #include "src/ast/compile-time-value.h" 9 #include "src/ast/compile-time-value.h"
10 #include "src/ast/prettyprinter.h" 10 #include "src/ast/prettyprinter.h"
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 890
891 void Call::AssignFeedbackVectorSlots(Isolate* isolate, FeedbackVectorSpec* spec, 891 void Call::AssignFeedbackVectorSlots(Isolate* isolate, FeedbackVectorSpec* spec,
892 FeedbackVectorSlotCache* cache) { 892 FeedbackVectorSlotCache* cache) {
893 ic_slot_ = spec->AddCallICSlot(); 893 ic_slot_ = spec->AddCallICSlot();
894 } 894 }
895 895
896 Call::CallType Call::GetCallType() const { 896 Call::CallType Call::GetCallType() const {
897 VariableProxy* proxy = expression()->AsVariableProxy(); 897 VariableProxy* proxy = expression()->AsVariableProxy();
898 if (proxy != NULL) { 898 if (proxy != NULL) {
899 if (is_possibly_eval()) { 899 if (is_possibly_eval()) {
900 return POSSIBLY_EVAL_CALL; 900 return proxy->var()->mode() == DYNAMIC ? POSSIBLY_EVAL_THROUGH_WITH_CALL
901 : POSSIBLY_EVAL_CALL;
901 } else if (proxy->var()->IsUnallocated()) { 902 } else if (proxy->var()->IsUnallocated()) {
902 return GLOBAL_CALL; 903 return GLOBAL_CALL;
903 } else if (proxy->var()->IsLookupSlot()) { 904 } else if (proxy->var()->IsLookupSlot()) {
904 return proxy->var()->mode() == DYNAMIC ? WITH_CALL : OTHER_CALL; 905 return proxy->var()->mode() == DYNAMIC ? WITH_CALL : OTHER_CALL;
905 } 906 }
906 } 907 }
907 908
908 if (expression()->IsSuperCallReference()) return SUPER_CALL; 909 if (expression()->IsSuperCallReference()) return SUPER_CALL;
909 910
910 Property* property = expression()->AsProperty(); 911 Property* property = expression()->AsProperty();
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 // static 944 // static
944 bool Literal::Match(void* literal1, void* literal2) { 945 bool Literal::Match(void* literal1, void* literal2) {
945 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); 946 const AstValue* x = static_cast<Literal*>(literal1)->raw_value();
946 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); 947 const AstValue* y = static_cast<Literal*>(literal2)->raw_value();
947 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || 948 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) ||
948 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); 949 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber());
949 } 950 }
950 951
951 } // namespace internal 952 } // namespace internal
952 } // namespace v8 953 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698