| 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 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 } | 680 } |
| 681 | 681 |
| 682 constant_properties_ = constant_properties; | 682 constant_properties_ = constant_properties; |
| 683 } | 683 } |
| 684 | 684 |
| 685 bool ObjectLiteral::IsFastCloningSupported() const { | 685 bool ObjectLiteral::IsFastCloningSupported() const { |
| 686 // The FastCloneShallowObject builtin doesn't copy elements, and object | 686 // The FastCloneShallowObject builtin doesn't copy elements, and object |
| 687 // literals don't support copy-on-write (COW) elements for now. | 687 // literals don't support copy-on-write (COW) elements for now. |
| 688 // TODO(mvstanton): make object literals support COW elements. | 688 // TODO(mvstanton): make object literals support COW elements. |
| 689 return fast_elements() && has_shallow_properties() && | 689 return fast_elements() && has_shallow_properties() && |
| 690 properties_count() <= ConstructorBuiltinsAssembler:: | 690 properties_count() <= |
| 691 kMaximumClonedShallowObjectProperties; | 691 ConstructorBuiltins::kMaximumClonedShallowObjectProperties; |
| 692 } | 692 } |
| 693 | 693 |
| 694 ElementsKind ArrayLiteral::constant_elements_kind() const { | 694 ElementsKind ArrayLiteral::constant_elements_kind() const { |
| 695 return static_cast<ElementsKind>(constant_elements()->elements_kind()); | 695 return static_cast<ElementsKind>(constant_elements()->elements_kind()); |
| 696 } | 696 } |
| 697 | 697 |
| 698 void ArrayLiteral::InitDepthAndFlags() { | 698 void ArrayLiteral::InitDepthAndFlags() { |
| 699 DCHECK_LT(first_spread_index_, 0); | 699 DCHECK_LT(first_spread_index_, 0); |
| 700 | 700 |
| 701 if (depth_ > 0) return; | 701 if (depth_ > 0) return; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 // Remember both the literal's constant values as well as the ElementsKind. | 785 // Remember both the literal's constant values as well as the ElementsKind. |
| 786 Handle<ConstantElementsPair> literals = | 786 Handle<ConstantElementsPair> literals = |
| 787 isolate->factory()->NewConstantElementsPair(kind, elements); | 787 isolate->factory()->NewConstantElementsPair(kind, elements); |
| 788 | 788 |
| 789 constant_elements_ = literals; | 789 constant_elements_ = literals; |
| 790 } | 790 } |
| 791 | 791 |
| 792 bool ArrayLiteral::IsFastCloningSupported() const { | 792 bool ArrayLiteral::IsFastCloningSupported() const { |
| 793 return depth() <= 1 && | 793 return depth() <= 1 && |
| 794 values()->length() <= | 794 values()->length() <= |
| 795 ConstructorBuiltinsAssembler::kMaximumClonedShallowArrayElements; | 795 ConstructorBuiltins::kMaximumClonedShallowArrayElements; |
| 796 } | 796 } |
| 797 | 797 |
| 798 void ArrayLiteral::RewindSpreads() { | 798 void ArrayLiteral::RewindSpreads() { |
| 799 values_->Rewind(first_spread_index_); | 799 values_->Rewind(first_spread_index_); |
| 800 first_spread_index_ = -1; | 800 first_spread_index_ = -1; |
| 801 } | 801 } |
| 802 | 802 |
| 803 void ArrayLiteral::AssignFeedbackSlots(FeedbackVectorSpec* spec, | 803 void ArrayLiteral::AssignFeedbackSlots(FeedbackVectorSpec* spec, |
| 804 LanguageMode language_mode, | 804 LanguageMode language_mode, |
| 805 FeedbackSlotCache* cache) { | 805 FeedbackSlotCache* cache) { |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1116 #ifdef DEBUG | 1116 #ifdef DEBUG |
| 1117 return is_jsruntime() ? NameForNativeContextIntrinsicIndex(context_index_) | 1117 return is_jsruntime() ? NameForNativeContextIntrinsicIndex(context_index_) |
| 1118 : function_->name; | 1118 : function_->name; |
| 1119 #else | 1119 #else |
| 1120 return is_jsruntime() ? "(context function)" : function_->name; | 1120 return is_jsruntime() ? "(context function)" : function_->name; |
| 1121 #endif // DEBUG | 1121 #endif // DEBUG |
| 1122 } | 1122 } |
| 1123 | 1123 |
| 1124 } // namespace internal | 1124 } // namespace internal |
| 1125 } // namespace v8 | 1125 } // namespace v8 |
| OLD | NEW |