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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/ast/compile-time-value.h" | 7 #include "src/ast/compile-time-value.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/builtins/builtins-constructor.h" | 9 #include "src/builtins/builtins-constructor.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 int offset = property->kind() == ObjectLiteral::Property::GETTER ? 2 : 3; | 1128 int offset = property->kind() == ObjectLiteral::Property::GETTER ? 2 : 3; |
1129 EmitSetHomeObject(expression, offset, property->GetSlot()); | 1129 EmitSetHomeObject(expression, offset, property->GetSlot()); |
1130 } | 1130 } |
1131 } | 1131 } |
1132 } | 1132 } |
1133 | 1133 |
1134 | 1134 |
1135 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { | 1135 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
1136 Comment cmnt(masm_, "[ ObjectLiteral"); | 1136 Comment cmnt(masm_, "[ ObjectLiteral"); |
1137 | 1137 |
1138 Handle<FixedArray> constant_properties = expr->constant_properties(); | 1138 Handle<FixedArray> constant_properties = |
| 1139 expr->GetOrBuildConstantProperties(isolate()); |
1139 int flags = expr->ComputeFlags(); | 1140 int flags = expr->ComputeFlags(); |
1140 if (MustCreateObjectLiteralWithRuntime(expr)) { | 1141 if (MustCreateObjectLiteralWithRuntime(expr)) { |
1141 __ Push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 1142 __ Push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
1142 __ Push(Smi::FromInt(expr->literal_index())); | 1143 __ Push(Smi::FromInt(expr->literal_index())); |
1143 __ Push(constant_properties); | 1144 __ Push(constant_properties); |
1144 __ Push(Smi::FromInt(flags)); | 1145 __ Push(Smi::FromInt(flags)); |
1145 __ CallRuntime(Runtime::kCreateObjectLiteral); | 1146 __ CallRuntime(Runtime::kCreateObjectLiteral); |
1146 } else { | 1147 } else { |
1147 __ movp(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 1148 __ movp(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
1148 __ Move(rbx, Smi::FromInt(expr->literal_index())); | 1149 __ Move(rbx, Smi::FromInt(expr->literal_index())); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1254 context()->PlugTOS(); | 1255 context()->PlugTOS(); |
1255 } else { | 1256 } else { |
1256 context()->Plug(rax); | 1257 context()->Plug(rax); |
1257 } | 1258 } |
1258 } | 1259 } |
1259 | 1260 |
1260 | 1261 |
1261 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { | 1262 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
1262 Comment cmnt(masm_, "[ ArrayLiteral"); | 1263 Comment cmnt(masm_, "[ ArrayLiteral"); |
1263 | 1264 |
1264 Handle<ConstantElementsPair> constant_elements = expr->constant_elements(); | 1265 Handle<ConstantElementsPair> constant_elements = |
| 1266 expr->GetOrBuildConstantElements(isolate()); |
1265 bool has_constant_fast_elements = | 1267 bool has_constant_fast_elements = |
1266 IsFastObjectElementsKind(expr->constant_elements_kind()); | 1268 IsFastObjectElementsKind(expr->constant_elements_kind()); |
1267 | 1269 |
1268 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE; | 1270 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE; |
1269 if (has_constant_fast_elements && !FLAG_allocation_site_pretenuring) { | 1271 if (has_constant_fast_elements && !FLAG_allocation_site_pretenuring) { |
1270 // If the only customer of allocation sites is transitioning, then | 1272 // If the only customer of allocation sites is transitioning, then |
1271 // we can turn it off if we don't have anywhere else to transition to. | 1273 // we can turn it off if we don't have anywhere else to transition to. |
1272 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; | 1274 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; |
1273 } | 1275 } |
1274 | 1276 |
(...skipping 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2685 DCHECK_EQ( | 2687 DCHECK_EQ( |
2686 isolate->builtins()->OnStackReplacement()->entry(), | 2688 isolate->builtins()->OnStackReplacement()->entry(), |
2687 Assembler::target_address_at(call_target_address, unoptimized_code)); | 2689 Assembler::target_address_at(call_target_address, unoptimized_code)); |
2688 return ON_STACK_REPLACEMENT; | 2690 return ON_STACK_REPLACEMENT; |
2689 } | 2691 } |
2690 | 2692 |
2691 } // namespace internal | 2693 } // namespace internal |
2692 } // namespace v8 | 2694 } // namespace v8 |
2693 | 2695 |
2694 #endif // V8_TARGET_ARCH_X64 | 2696 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |