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

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

Issue 2487483004: Only treat possible eval calls going through 'with' as special. (Closed)
Patch Set: Fix ast-graph-builder 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 882 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 } 893 }
894 894
895 void Call::AssignFeedbackVectorSlots(Isolate* isolate, FeedbackVectorSpec* spec, 895 void Call::AssignFeedbackVectorSlots(Isolate* isolate, FeedbackVectorSpec* spec,
896 FeedbackVectorSlotCache* cache) { 896 FeedbackVectorSlotCache* cache) {
897 ic_slot_ = spec->AddCallICSlot(); 897 ic_slot_ = spec->AddCallICSlot();
898 } 898 }
899 899
900 Call::CallType Call::GetCallType() const { 900 Call::CallType Call::GetCallType() const {
901 VariableProxy* proxy = expression()->AsVariableProxy(); 901 VariableProxy* proxy = expression()->AsVariableProxy();
902 if (proxy != NULL) { 902 if (proxy != NULL) {
903 if (is_possibly_eval()) { 903 if (proxy->var()->IsUnallocated()) {
904 return POSSIBLY_EVAL_CALL;
905 } else if (proxy->var()->IsUnallocated()) {
906 return GLOBAL_CALL; 904 return GLOBAL_CALL;
907 } else if (proxy->var()->IsLookupSlot()) { 905 } else if (proxy->var()->IsLookupSlot()) {
908 return proxy->var()->mode() == DYNAMIC ? WITH_CALL : OTHER_CALL; 906 return proxy->var()->mode() == DYNAMIC ? WITH_CALL : OTHER_CALL;
909 } 907 }
910 } 908 }
911 909
912 if (expression()->IsSuperCallReference()) return SUPER_CALL; 910 if (expression()->IsSuperCallReference()) return SUPER_CALL;
913 911
914 Property* property = expression()->AsProperty(); 912 Property* property = expression()->AsProperty();
915 if (property != nullptr) { 913 if (property != nullptr) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
947 // static 945 // static
948 bool Literal::Match(void* literal1, void* literal2) { 946 bool Literal::Match(void* literal1, void* literal2) {
949 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); 947 const AstValue* x = static_cast<Literal*>(literal1)->raw_value();
950 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); 948 const AstValue* y = static_cast<Literal*>(literal2)->raw_value();
951 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || 949 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) ||
952 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); 950 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber());
953 } 951 }
954 952
955 } // namespace internal 953 } // namespace internal
956 } // namespace v8 954 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698