| 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" |
| 11 #include "src/ast/scopes.h" | 11 #include "src/ast/scopes.h" |
| 12 #include "src/base/hashmap.h" | 12 #include "src/base/hashmap.h" |
| 13 #include "src/builtins/builtins-constructor.h" | 13 #include "src/builtins/builtins-constructor.h" |
| 14 #include "src/builtins/builtins.h" | 14 #include "src/builtins/builtins.h" |
| 15 #include "src/code-stubs.h" | 15 #include "src/code-stubs.h" |
| 16 #include "src/contexts.h" | 16 #include "src/contexts.h" |
| 17 #include "src/conversions.h" | 17 #include "src/conversions.h" |
| 18 #include "src/elements.h" | 18 #include "src/elements.h" |
| 19 #include "src/objects/literal-objects.h" |
| 19 #include "src/property-details.h" | 20 #include "src/property-details.h" |
| 20 #include "src/property.h" | 21 #include "src/property.h" |
| 21 #include "src/string-stream.h" | 22 #include "src/string-stream.h" |
| 22 #include "src/type-info.h" | 23 #include "src/type-info.h" |
| 23 | 24 |
| 24 namespace v8 { | 25 namespace v8 { |
| 25 namespace internal { | 26 namespace internal { |
| 26 | 27 |
| 27 // ---------------------------------------------------------------------------- | 28 // ---------------------------------------------------------------------------- |
| 28 // Implementation of other node functionality. | 29 // Implementation of other node functionality. |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 | 665 |
| 665 bool ObjectLiteral::IsFastCloningSupported() const { | 666 bool ObjectLiteral::IsFastCloningSupported() const { |
| 666 // The FastCloneShallowObject builtin doesn't copy elements, and object | 667 // The FastCloneShallowObject builtin doesn't copy elements, and object |
| 667 // literals don't support copy-on-write (COW) elements for now. | 668 // literals don't support copy-on-write (COW) elements for now. |
| 668 // TODO(mvstanton): make object literals support COW elements. | 669 // TODO(mvstanton): make object literals support COW elements. |
| 669 return fast_elements() && has_shallow_properties() && | 670 return fast_elements() && has_shallow_properties() && |
| 670 properties_count() <= ConstructorBuiltinsAssembler:: | 671 properties_count() <= ConstructorBuiltinsAssembler:: |
| 671 kMaximumClonedShallowObjectProperties; | 672 kMaximumClonedShallowObjectProperties; |
| 672 } | 673 } |
| 673 | 674 |
| 675 ElementsKind ArrayLiteral::constant_elements_kind() const { |
| 676 return static_cast<ElementsKind>(constant_elements()->elements_kind()); |
| 677 } |
| 678 |
| 674 void ArrayLiteral::InitDepthAndFlags() { | 679 void ArrayLiteral::InitDepthAndFlags() { |
| 675 DCHECK_LT(first_spread_index_, 0); | 680 DCHECK_LT(first_spread_index_, 0); |
| 676 | 681 |
| 677 if (depth_ > 0) return; | 682 if (depth_ > 0) return; |
| 678 | 683 |
| 679 int constants_length = values()->length(); | 684 int constants_length = values()->length(); |
| 680 | 685 |
| 681 // Fill in the literals. | 686 // Fill in the literals. |
| 682 bool is_simple = true; | 687 bool is_simple = true; |
| 683 int depth_acc = 1; | 688 int depth_acc = 1; |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1082 const char* CallRuntime::debug_name() { | 1087 const char* CallRuntime::debug_name() { |
| 1083 #ifdef DEBUG | 1088 #ifdef DEBUG |
| 1084 return NameForNativeContextIntrinsicIndex(context_index_); | 1089 return NameForNativeContextIntrinsicIndex(context_index_); |
| 1085 #else | 1090 #else |
| 1086 return is_jsruntime() ? "(context function)" : function_->name; | 1091 return is_jsruntime() ? "(context function)" : function_->name; |
| 1087 #endif // DEBUG | 1092 #endif // DEBUG |
| 1088 } | 1093 } |
| 1089 | 1094 |
| 1090 } // namespace internal | 1095 } // namespace internal |
| 1091 } // namespace v8 | 1096 } // namespace v8 |
| OLD | NEW |