| 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 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // Calls going through 'with' always use DYNAMIC rather than DYNAMIC_LOCAL | 906 // Calls going through 'with' always use DYNAMIC rather than DYNAMIC_LOCAL |
| 909 // or DYNAMIC_GLOBAL. | 907 // or DYNAMIC_GLOBAL. |
| 910 return proxy->var()->mode() == DYNAMIC ? WITH_CALL : OTHER_CALL; | 908 return proxy->var()->mode() == DYNAMIC ? WITH_CALL : OTHER_CALL; |
| 911 } | 909 } |
| 912 } | 910 } |
| 913 | 911 |
| 914 if (expression()->IsSuperCallReference()) return SUPER_CALL; | 912 if (expression()->IsSuperCallReference()) return SUPER_CALL; |
| 915 | 913 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 // static | 947 // static |
| 950 bool Literal::Match(void* literal1, void* literal2) { | 948 bool Literal::Match(void* literal1, void* literal2) { |
| 951 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 949 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
| 952 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 950 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
| 953 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || | 951 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || |
| 954 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 952 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
| 955 } | 953 } |
| 956 | 954 |
| 957 } // namespace internal | 955 } // namespace internal |
| 958 } // namespace v8 | 956 } // namespace v8 |
| OLD | NEW |