| 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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 | 417 |
| 418 | 418 |
| 419 void ObjectLiteral::Property::set_emit_store(bool emit_store) { | 419 void ObjectLiteral::Property::set_emit_store(bool emit_store) { |
| 420 emit_store_ = emit_store; | 420 emit_store_ = emit_store; |
| 421 } | 421 } |
| 422 | 422 |
| 423 bool ObjectLiteral::Property::emit_store() const { return emit_store_; } | 423 bool ObjectLiteral::Property::emit_store() const { return emit_store_; } |
| 424 | 424 |
| 425 void ObjectLiteral::AssignFeedbackVectorSlots(FeedbackVectorSpec* spec, | 425 void ObjectLiteral::AssignFeedbackVectorSlots(FeedbackVectorSpec* spec, |
| 426 FeedbackVectorSlotCache* cache) { | 426 FeedbackVectorSlotCache* cache) { |
| 427 MaterializedLiteral::AssignFeedbackVectorSlots(spec, cache); |
| 428 |
| 427 // This logic that computes the number of slots needed for vector store | 429 // This logic that computes the number of slots needed for vector store |
| 428 // ics must mirror FullCodeGenerator::VisitObjectLiteral. | 430 // ics must mirror FullCodeGenerator::VisitObjectLiteral. |
| 429 int property_index = 0; | 431 int property_index = 0; |
| 430 for (; property_index < properties()->length(); property_index++) { | 432 for (; property_index < properties()->length(); property_index++) { |
| 431 ObjectLiteral::Property* property = properties()->at(property_index); | 433 ObjectLiteral::Property* property = properties()->at(property_index); |
| 432 if (property->is_computed_name()) break; | 434 if (property->is_computed_name()) break; |
| 433 if (property->IsCompileTimeValue()) continue; | 435 if (property->IsCompileTimeValue()) continue; |
| 434 | 436 |
| 435 Literal* key = property->key()->AsLiteral(); | 437 Literal* key = property->key()->AsLiteral(); |
| 436 Expression* value = property->value(); | 438 Expression* value = property->value(); |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 } | 768 } |
| 767 | 769 |
| 768 bool ArrayLiteral::IsFastCloningSupported() const { | 770 bool ArrayLiteral::IsFastCloningSupported() const { |
| 769 return depth() <= 1 && | 771 return depth() <= 1 && |
| 770 values()->length() <= | 772 values()->length() <= |
| 771 ConstructorBuiltinsAssembler::kMaximumClonedShallowArrayElements; | 773 ConstructorBuiltinsAssembler::kMaximumClonedShallowArrayElements; |
| 772 } | 774 } |
| 773 | 775 |
| 774 void ArrayLiteral::AssignFeedbackVectorSlots(FeedbackVectorSpec* spec, | 776 void ArrayLiteral::AssignFeedbackVectorSlots(FeedbackVectorSpec* spec, |
| 775 FeedbackVectorSlotCache* cache) { | 777 FeedbackVectorSlotCache* cache) { |
| 778 MaterializedLiteral::AssignFeedbackVectorSlots(spec, cache); |
| 779 |
| 776 // This logic that computes the number of slots needed for vector store | 780 // This logic that computes the number of slots needed for vector store |
| 777 // ics must mirror FullCodeGenerator::VisitArrayLiteral. | 781 // ics must mirror FullCodeGenerator::VisitArrayLiteral. |
| 778 for (int array_index = 0; array_index < values()->length(); array_index++) { | 782 for (int array_index = 0; array_index < values()->length(); array_index++) { |
| 779 Expression* subexpr = values()->at(array_index); | 783 Expression* subexpr = values()->at(array_index); |
| 780 DCHECK(!subexpr->IsSpread()); | 784 DCHECK(!subexpr->IsSpread()); |
| 781 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; | 785 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; |
| 782 | 786 |
| 783 // We'll reuse the same literal slot for all of the non-constant | 787 // We'll reuse the same literal slot for all of the non-constant |
| 784 // subexpressions that use a keyed store IC. | 788 // subexpressions that use a keyed store IC. |
| 785 literal_slot_ = spec->AddKeyedStoreICSlot(); | 789 literal_slot_ = spec->AddKeyedStoreICSlot(); |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1082 const char* CallRuntime::debug_name() { | 1086 const char* CallRuntime::debug_name() { |
| 1083 #ifdef DEBUG | 1087 #ifdef DEBUG |
| 1084 return NameForNativeContextIntrinsicIndex(context_index_); | 1088 return NameForNativeContextIntrinsicIndex(context_index_); |
| 1085 #else | 1089 #else |
| 1086 return is_jsruntime() ? "(context function)" : function_->name; | 1090 return is_jsruntime() ? "(context function)" : function_->name; |
| 1087 #endif // DEBUG | 1091 #endif // DEBUG |
| 1088 } | 1092 } |
| 1089 | 1093 |
| 1090 } // namespace internal | 1094 } // namespace internal |
| 1091 } // namespace v8 | 1095 } // namespace v8 |
| OLD | NEW |