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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 int offset = property->kind() == ObjectLiteral::Property::GETTER ? 2 : 3; | 1089 int offset = property->kind() == ObjectLiteral::Property::GETTER ? 2 : 3; |
1090 EmitSetHomeObject(expression, offset, property->GetSlot()); | 1090 EmitSetHomeObject(expression, offset, property->GetSlot()); |
1091 } | 1091 } |
1092 } | 1092 } |
1093 } | 1093 } |
1094 | 1094 |
1095 | 1095 |
1096 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { | 1096 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
1097 Comment cmnt(masm_, "[ ObjectLiteral"); | 1097 Comment cmnt(masm_, "[ ObjectLiteral"); |
1098 | 1098 |
1099 Handle<FixedArray> constant_properties = expr->constant_properties(); | 1099 Handle<FixedArray> constant_properties = |
| 1100 expr->GetOrBuildConstantProperties(isolate()); |
1100 int flags = expr->ComputeFlags(); | 1101 int flags = expr->ComputeFlags(); |
1101 // If any of the keys would store to the elements array, then we shouldn't | 1102 // If any of the keys would store to the elements array, then we shouldn't |
1102 // allow it. | 1103 // allow it. |
1103 if (MustCreateObjectLiteralWithRuntime(expr)) { | 1104 if (MustCreateObjectLiteralWithRuntime(expr)) { |
1104 __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 1105 __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
1105 __ push(Immediate(Smi::FromInt(expr->literal_index()))); | 1106 __ push(Immediate(Smi::FromInt(expr->literal_index()))); |
1106 __ push(Immediate(constant_properties)); | 1107 __ push(Immediate(constant_properties)); |
1107 __ push(Immediate(Smi::FromInt(flags))); | 1108 __ push(Immediate(Smi::FromInt(flags))); |
1108 __ CallRuntime(Runtime::kCreateObjectLiteral); | 1109 __ CallRuntime(Runtime::kCreateObjectLiteral); |
1109 } else { | 1110 } else { |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1218 context()->PlugTOS(); | 1219 context()->PlugTOS(); |
1219 } else { | 1220 } else { |
1220 context()->Plug(eax); | 1221 context()->Plug(eax); |
1221 } | 1222 } |
1222 } | 1223 } |
1223 | 1224 |
1224 | 1225 |
1225 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { | 1226 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
1226 Comment cmnt(masm_, "[ ArrayLiteral"); | 1227 Comment cmnt(masm_, "[ ArrayLiteral"); |
1227 | 1228 |
1228 Handle<ConstantElementsPair> constant_elements = expr->constant_elements(); | 1229 Handle<ConstantElementsPair> constant_elements = |
| 1230 expr->GetOrBuildConstantElements(isolate()); |
1229 bool has_constant_fast_elements = | 1231 bool has_constant_fast_elements = |
1230 IsFastObjectElementsKind(expr->constant_elements_kind()); | 1232 IsFastObjectElementsKind(expr->constant_elements_kind()); |
1231 | 1233 |
1232 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE; | 1234 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE; |
1233 if (has_constant_fast_elements && !FLAG_allocation_site_pretenuring) { | 1235 if (has_constant_fast_elements && !FLAG_allocation_site_pretenuring) { |
1234 // If the only customer of allocation sites is transitioning, then | 1236 // If the only customer of allocation sites is transitioning, then |
1235 // we can turn it off if we don't have anywhere else to transition to. | 1237 // we can turn it off if we don't have anywhere else to transition to. |
1236 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; | 1238 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; |
1237 } | 1239 } |
1238 | 1240 |
(...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2696 isolate->builtins()->OnStackReplacement()->entry(), | 2698 isolate->builtins()->OnStackReplacement()->entry(), |
2697 Assembler::target_address_at(call_target_address, unoptimized_code)); | 2699 Assembler::target_address_at(call_target_address, unoptimized_code)); |
2698 return ON_STACK_REPLACEMENT; | 2700 return ON_STACK_REPLACEMENT; |
2699 } | 2701 } |
2700 | 2702 |
2701 | 2703 |
2702 } // namespace internal | 2704 } // namespace internal |
2703 } // namespace v8 | 2705 } // namespace v8 |
2704 | 2706 |
2705 #endif // V8_TARGET_ARCH_X87 | 2707 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |