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 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 POSSIBLY_EVAL_CALL; |
901 } else if (proxy->var()->IsUnallocated()) { | 901 } else if (proxy->var()->IsUnallocated()) { |
902 return GLOBAL_CALL; | 902 return GLOBAL_CALL; |
903 } else if (proxy->var()->IsLookupSlot()) { | 903 } else if (proxy->var()->IsLookupSlot()) { |
904 return LOOKUP_SLOT_CALL; | 904 return proxy->var()->mode() == DYNAMIC ? WITH_CALL : OTHER_CALL; |
Michael Starzinger
2016/11/10 15:20:27
Can we add a brief comment here saying that "DYNAM
| |
905 } | 905 } |
906 } | 906 } |
907 | 907 |
908 if (expression()->IsSuperCallReference()) return SUPER_CALL; | 908 if (expression()->IsSuperCallReference()) return SUPER_CALL; |
909 | 909 |
910 Property* property = expression()->AsProperty(); | 910 Property* property = expression()->AsProperty(); |
911 if (property != nullptr) { | 911 if (property != nullptr) { |
912 bool is_super = property->IsSuperAccess(); | 912 bool is_super = property->IsSuperAccess(); |
913 if (property->key()->IsPropertyName()) { | 913 if (property->key()->IsPropertyName()) { |
914 return is_super ? NAMED_SUPER_PROPERTY_CALL : NAMED_PROPERTY_CALL; | 914 return is_super ? NAMED_SUPER_PROPERTY_CALL : NAMED_PROPERTY_CALL; |
(...skipping 28 matching lines...) Expand all Loading... | |
943 // static | 943 // static |
944 bool Literal::Match(void* literal1, void* literal2) { | 944 bool Literal::Match(void* literal1, void* literal2) { |
945 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 945 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
946 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 946 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
947 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || | 947 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || |
948 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 948 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
949 } | 949 } |
950 | 950 |
951 } // namespace internal | 951 } // namespace internal |
952 } // namespace v8 | 952 } // namespace v8 |
OLD | NEW |