| 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 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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; |
| 915 } else { | 915 } else { |
| 916 return is_super ? KEYED_SUPER_PROPERTY_CALL : KEYED_PROPERTY_CALL; | 916 return is_super ? KEYED_SUPER_PROPERTY_CALL : KEYED_PROPERTY_CALL; |
| 917 } | 917 } |
| 918 } | 918 } |
| 919 | 919 |
| 920 return OTHER_CALL; | 920 return OTHER_CALL; |
| 921 } | 921 } |
| 922 | 922 |
| 923 CaseClause::CaseClause(Expression* label, ZoneList<Statement*>* statements, | 923 CaseClause::CaseClause(Expression* label, ZoneChunkList<Statement*>* statements, |
| 924 int pos) | 924 int pos) |
| 925 : Expression(pos, kCaseClause), | 925 : Expression(pos, kCaseClause), |
| 926 label_(label), | 926 label_(label), |
| 927 statements_(statements), | 927 statements_(statements), |
| 928 compare_type_(AstType::None()) {} | 928 compare_type_(AstType::None()) {} |
| 929 | 929 |
| 930 void CaseClause::AssignFeedbackVectorSlots(Isolate* isolate, | 930 void CaseClause::AssignFeedbackVectorSlots(Isolate* isolate, |
| 931 FeedbackVectorSpec* spec, | 931 FeedbackVectorSpec* spec, |
| 932 FeedbackVectorSlotCache* cache) { | 932 FeedbackVectorSlotCache* cache) { |
| 933 type_feedback_slot_ = spec->AddInterpreterCompareICSlot(); | 933 type_feedback_slot_ = spec->AddInterpreterCompareICSlot(); |
| 934 } | 934 } |
| 935 | 935 |
| 936 uint32_t Literal::Hash() { | 936 uint32_t Literal::Hash() { |
| 937 return raw_value()->IsString() | 937 return raw_value()->IsString() |
| 938 ? raw_value()->AsString()->hash() | 938 ? raw_value()->AsString()->hash() |
| 939 : ComputeLongHash(double_to_uint64(raw_value()->AsNumber())); | 939 : ComputeLongHash(double_to_uint64(raw_value()->AsNumber())); |
| 940 } | 940 } |
| 941 | 941 |
| 942 | 942 |
| 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 |