| 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.h" | 5 #include "src/ast.h" |
| 6 | 6 |
| 7 #include <cmath> // For isfinite. | 7 #include <cmath> // For isfinite. |
| 8 #include "src/builtins.h" | 8 #include "src/builtins.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/contexts.h" | 10 #include "src/contexts.h" |
| (...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 } else if (proxy->var()->IsUnallocatedOrGlobalSlot()) { | 754 } else if (proxy->var()->IsUnallocatedOrGlobalSlot()) { |
| 755 return GLOBAL_CALL; | 755 return GLOBAL_CALL; |
| 756 } else if (proxy->var()->IsLookupSlot()) { | 756 } else if (proxy->var()->IsLookupSlot()) { |
| 757 return LOOKUP_SLOT_CALL; | 757 return LOOKUP_SLOT_CALL; |
| 758 } | 758 } |
| 759 } | 759 } |
| 760 | 760 |
| 761 if (expression()->IsSuperCallReference()) return SUPER_CALL; | 761 if (expression()->IsSuperCallReference()) return SUPER_CALL; |
| 762 | 762 |
| 763 Property* property = expression()->AsProperty(); | 763 Property* property = expression()->AsProperty(); |
| 764 return property != NULL ? PROPERTY_CALL : OTHER_CALL; | 764 if (property != nullptr) { |
| 765 bool is_super = property->IsSuperAccess(); |
| 766 if (property->key()->IsPropertyName()) { |
| 767 return is_super ? NAMED_SUPER_PROPERTY_CALL : NAMED_PROPERTY_CALL; |
| 768 } else { |
| 769 return is_super ? KEYED_SUPER_PROPERTY_CALL : KEYED_PROPERTY_CALL; |
| 770 } |
| 771 } |
| 772 |
| 773 return OTHER_CALL; |
| 765 } | 774 } |
| 766 | 775 |
| 767 | 776 |
| 768 // ---------------------------------------------------------------------------- | 777 // ---------------------------------------------------------------------------- |
| 769 // Implementation of AstVisitor | 778 // Implementation of AstVisitor |
| 770 | 779 |
| 771 void AstVisitor::VisitDeclarations(ZoneList<Declaration*>* declarations) { | 780 void AstVisitor::VisitDeclarations(ZoneList<Declaration*>* declarations) { |
| 772 for (int i = 0; i < declarations->length(); i++) { | 781 for (int i = 0; i < declarations->length(); i++) { |
| 773 Visit(declarations->at(i)); | 782 Visit(declarations->at(i)); |
| 774 } | 783 } |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1144 bool Literal::Match(void* literal1, void* literal2) { | 1153 bool Literal::Match(void* literal1, void* literal2) { |
| 1145 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 1154 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
| 1146 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 1155 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
| 1147 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || | 1156 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || |
| 1148 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 1157 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
| 1149 } | 1158 } |
| 1150 | 1159 |
| 1151 | 1160 |
| 1152 } // namespace internal | 1161 } // namespace internal |
| 1153 } // namespace v8 | 1162 } // namespace v8 |
| OLD | NEW |