| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 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 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1142 int offset = property->kind() == ObjectLiteral::Property::GETTER ? 2 : 3; | 1142 int offset = property->kind() == ObjectLiteral::Property::GETTER ? 2 : 3; |
| 1143 EmitSetHomeObject(expression, offset, property->GetSlot()); | 1143 EmitSetHomeObject(expression, offset, property->GetSlot()); |
| 1144 } | 1144 } |
| 1145 } | 1145 } |
| 1146 } | 1146 } |
| 1147 | 1147 |
| 1148 | 1148 |
| 1149 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { | 1149 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
| 1150 Comment cmnt(masm_, "[ ObjectLiteral"); | 1150 Comment cmnt(masm_, "[ ObjectLiteral"); |
| 1151 | 1151 |
| 1152 Handle<FixedArray> constant_properties = expr->constant_properties(); | 1152 Handle<FixedArray> constant_properties = |
| 1153 expr->GetOrBuildConstantProperties(isolate()); |
| 1153 __ LoadP(r6, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1154 __ LoadP(r6, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 1154 __ LoadSmiLiteral(r5, Smi::FromInt(expr->literal_index())); | 1155 __ LoadSmiLiteral(r5, Smi::FromInt(expr->literal_index())); |
| 1155 __ mov(r4, Operand(constant_properties)); | 1156 __ mov(r4, Operand(constant_properties)); |
| 1156 int flags = expr->ComputeFlags(); | 1157 int flags = expr->ComputeFlags(); |
| 1157 __ LoadSmiLiteral(r3, Smi::FromInt(flags)); | 1158 __ LoadSmiLiteral(r3, Smi::FromInt(flags)); |
| 1158 if (MustCreateObjectLiteralWithRuntime(expr)) { | 1159 if (MustCreateObjectLiteralWithRuntime(expr)) { |
| 1159 __ Push(r6, r5, r4, r3); | 1160 __ Push(r6, r5, r4, r3); |
| 1160 __ CallRuntime(Runtime::kCreateObjectLiteral); | 1161 __ CallRuntime(Runtime::kCreateObjectLiteral); |
| 1161 } else { | 1162 } else { |
| 1162 Callable callable = CodeFactory::FastCloneShallowObject( | 1163 Callable callable = CodeFactory::FastCloneShallowObject( |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1271 context()->PlugTOS(); | 1272 context()->PlugTOS(); |
| 1272 } else { | 1273 } else { |
| 1273 context()->Plug(r3); | 1274 context()->Plug(r3); |
| 1274 } | 1275 } |
| 1275 } | 1276 } |
| 1276 | 1277 |
| 1277 | 1278 |
| 1278 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { | 1279 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
| 1279 Comment cmnt(masm_, "[ ArrayLiteral"); | 1280 Comment cmnt(masm_, "[ ArrayLiteral"); |
| 1280 | 1281 |
| 1281 Handle<ConstantElementsPair> constant_elements = expr->constant_elements(); | 1282 Handle<ConstantElementsPair> constant_elements = |
| 1283 expr->GetOrBuildConstantElements(isolate()); |
| 1282 bool has_fast_elements = | 1284 bool has_fast_elements = |
| 1283 IsFastObjectElementsKind(expr->constant_elements_kind()); | 1285 IsFastObjectElementsKind(expr->constant_elements_kind()); |
| 1284 | 1286 |
| 1285 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE; | 1287 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE; |
| 1286 if (has_fast_elements && !FLAG_allocation_site_pretenuring) { | 1288 if (has_fast_elements && !FLAG_allocation_site_pretenuring) { |
| 1287 // If the only customer of allocation sites is transitioning, then | 1289 // If the only customer of allocation sites is transitioning, then |
| 1288 // we can turn it off if we don't have anywhere else to transition to. | 1290 // we can turn it off if we don't have anywhere else to transition to. |
| 1289 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; | 1291 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; |
| 1290 } | 1292 } |
| 1291 | 1293 |
| (...skipping 1478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2770 | 2772 |
| 2771 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 2773 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
| 2772 | 2774 |
| 2773 DCHECK(interrupt_address == | 2775 DCHECK(interrupt_address == |
| 2774 isolate->builtins()->OnStackReplacement()->entry()); | 2776 isolate->builtins()->OnStackReplacement()->entry()); |
| 2775 return ON_STACK_REPLACEMENT; | 2777 return ON_STACK_REPLACEMENT; |
| 2776 } | 2778 } |
| 2777 } // namespace internal | 2779 } // namespace internal |
| 2778 } // namespace v8 | 2780 } // namespace v8 |
| 2779 #endif // V8_TARGET_ARCH_PPC | 2781 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |