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/full-codegen/full-codegen.h" | 7 #include "src/full-codegen/full-codegen.h" |
8 #include "src/ast/compile-time-value.h" | 8 #include "src/ast/compile-time-value.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1564 if (!result_saved) { | 1564 if (!result_saved) { |
1565 PushOperand(r3); | 1565 PushOperand(r3); |
1566 result_saved = true; | 1566 result_saved = true; |
1567 } | 1567 } |
1568 VisitForAccumulatorValue(subexpr); | 1568 VisitForAccumulatorValue(subexpr); |
1569 | 1569 |
1570 __ LoadSmiLiteral(StoreDescriptor::NameRegister(), | 1570 __ LoadSmiLiteral(StoreDescriptor::NameRegister(), |
1571 Smi::FromInt(array_index)); | 1571 Smi::FromInt(array_index)); |
1572 __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); | 1572 __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); |
1573 EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); | 1573 EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); |
1574 Handle<Code> ic = | 1574 CallKeyedStoreIC(); |
1575 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | |
1576 CallIC(ic); | |
1577 | 1575 |
1578 PrepareForBailoutForId(expr->GetIdForElement(array_index), | 1576 PrepareForBailoutForId(expr->GetIdForElement(array_index), |
1579 BailoutState::NO_REGISTERS); | 1577 BailoutState::NO_REGISTERS); |
1580 } | 1578 } |
1581 | 1579 |
1582 // In case the array literal contains spread expressions it has two parts. The | 1580 // In case the array literal contains spread expressions it has two parts. The |
1583 // first part is the "static" array which has a literal index is handled | 1581 // first part is the "static" array which has a literal index is handled |
1584 // above. The second part is the part after the first spread expression | 1582 // above. The second part is the part after the first spread expression |
1585 // (inclusive) and these elements gets appended to the array. Note that the | 1583 // (inclusive) and these elements gets appended to the array. Note that the |
1586 // number elements an iterable produces is unknown ahead of time. | 1584 // number elements an iterable produces is unknown ahead of time. |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2117 break; | 2115 break; |
2118 } | 2116 } |
2119 case KEYED_PROPERTY: { | 2117 case KEYED_PROPERTY: { |
2120 PushOperand(r3); // Preserve value. | 2118 PushOperand(r3); // Preserve value. |
2121 VisitForStackValue(prop->obj()); | 2119 VisitForStackValue(prop->obj()); |
2122 VisitForAccumulatorValue(prop->key()); | 2120 VisitForAccumulatorValue(prop->key()); |
2123 __ Move(StoreDescriptor::NameRegister(), r3); | 2121 __ Move(StoreDescriptor::NameRegister(), r3); |
2124 PopOperands(StoreDescriptor::ValueRegister(), | 2122 PopOperands(StoreDescriptor::ValueRegister(), |
2125 StoreDescriptor::ReceiverRegister()); | 2123 StoreDescriptor::ReceiverRegister()); |
2126 EmitLoadStoreICSlot(slot); | 2124 EmitLoadStoreICSlot(slot); |
2127 Handle<Code> ic = | 2125 CallKeyedStoreIC(); |
2128 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | |
2129 CallIC(ic); | |
2130 break; | 2126 break; |
2131 } | 2127 } |
2132 } | 2128 } |
2133 context()->Plug(r3); | 2129 context()->Plug(r3); |
2134 } | 2130 } |
2135 | 2131 |
2136 | 2132 |
2137 void FullCodeGenerator::EmitStoreToStackLocalOrContextSlot( | 2133 void FullCodeGenerator::EmitStoreToStackLocalOrContextSlot( |
2138 Variable* var, MemOperand location) { | 2134 Variable* var, MemOperand location) { |
2139 __ StoreP(result_register(), location, r0); | 2135 __ StoreP(result_register(), location, r0); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2261 : Runtime::kStoreKeyedToSuper_Sloppy)); | 2257 : Runtime::kStoreKeyedToSuper_Sloppy)); |
2262 } | 2258 } |
2263 | 2259 |
2264 | 2260 |
2265 void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { | 2261 void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { |
2266 // Assignment to a property, using a keyed store IC. | 2262 // Assignment to a property, using a keyed store IC. |
2267 PopOperands(StoreDescriptor::ReceiverRegister(), | 2263 PopOperands(StoreDescriptor::ReceiverRegister(), |
2268 StoreDescriptor::NameRegister()); | 2264 StoreDescriptor::NameRegister()); |
2269 DCHECK(StoreDescriptor::ValueRegister().is(r3)); | 2265 DCHECK(StoreDescriptor::ValueRegister().is(r3)); |
2270 | 2266 |
2271 Handle<Code> ic = | |
2272 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | |
2273 EmitLoadStoreICSlot(expr->AssignmentSlot()); | 2267 EmitLoadStoreICSlot(expr->AssignmentSlot()); |
2274 CallIC(ic); | 2268 CallKeyedStoreIC(); |
2275 | 2269 |
2276 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); | 2270 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); |
2277 context()->Plug(r3); | 2271 context()->Plug(r3); |
2278 } | 2272 } |
2279 | 2273 |
2280 | 2274 |
2281 void FullCodeGenerator::CallIC(Handle<Code> code, TypeFeedbackId ast_id) { | 2275 void FullCodeGenerator::CallIC(Handle<Code> code, TypeFeedbackId ast_id) { |
2282 ic_total_count_++; | 2276 ic_total_count_++; |
2283 __ Call(code, RelocInfo::CODE_TARGET, ast_id); | 2277 __ Call(code, RelocInfo::CODE_TARGET, ast_id); |
2284 } | 2278 } |
(...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3350 context()->PlugTOS(); | 3344 context()->PlugTOS(); |
3351 } | 3345 } |
3352 } else { | 3346 } else { |
3353 context()->Plug(r3); | 3347 context()->Plug(r3); |
3354 } | 3348 } |
3355 break; | 3349 break; |
3356 } | 3350 } |
3357 case KEYED_PROPERTY: { | 3351 case KEYED_PROPERTY: { |
3358 PopOperands(StoreDescriptor::ReceiverRegister(), | 3352 PopOperands(StoreDescriptor::ReceiverRegister(), |
3359 StoreDescriptor::NameRegister()); | 3353 StoreDescriptor::NameRegister()); |
3360 Handle<Code> ic = | |
3361 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | |
3362 EmitLoadStoreICSlot(expr->CountSlot()); | 3354 EmitLoadStoreICSlot(expr->CountSlot()); |
3363 CallIC(ic); | 3355 CallKeyedStoreIC(); |
3364 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); | 3356 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); |
3365 if (expr->is_postfix()) { | 3357 if (expr->is_postfix()) { |
3366 if (!context()->IsEffect()) { | 3358 if (!context()->IsEffect()) { |
3367 context()->PlugTOS(); | 3359 context()->PlugTOS(); |
3368 } | 3360 } |
3369 } else { | 3361 } else { |
3370 context()->Plug(r3); | 3362 context()->Plug(r3); |
3371 } | 3363 } |
3372 break; | 3364 break; |
3373 } | 3365 } |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3731 | 3723 |
3732 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 3724 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
3733 | 3725 |
3734 DCHECK(interrupt_address == | 3726 DCHECK(interrupt_address == |
3735 isolate->builtins()->OnStackReplacement()->entry()); | 3727 isolate->builtins()->OnStackReplacement()->entry()); |
3736 return ON_STACK_REPLACEMENT; | 3728 return ON_STACK_REPLACEMENT; |
3737 } | 3729 } |
3738 } // namespace internal | 3730 } // namespace internal |
3739 } // namespace v8 | 3731 } // namespace v8 |
3740 #endif // V8_TARGET_ARCH_PPC | 3732 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |