OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |