| 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_ARM | 5 #if V8_TARGET_ARCH_ARM |
| 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 1592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1603 | 1603 |
| 1604 if (!result_saved) { | 1604 if (!result_saved) { |
| 1605 PushOperand(r0); | 1605 PushOperand(r0); |
| 1606 result_saved = true; | 1606 result_saved = true; |
| 1607 } | 1607 } |
| 1608 VisitForAccumulatorValue(subexpr); | 1608 VisitForAccumulatorValue(subexpr); |
| 1609 | 1609 |
| 1610 __ mov(StoreDescriptor::NameRegister(), Operand(Smi::FromInt(array_index))); | 1610 __ mov(StoreDescriptor::NameRegister(), Operand(Smi::FromInt(array_index))); |
| 1611 __ ldr(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); | 1611 __ ldr(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); |
| 1612 EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); | 1612 EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); |
| 1613 Handle<Code> ic = | 1613 CallKeyedStoreIC(); |
| 1614 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | |
| 1615 CallIC(ic); | |
| 1616 | 1614 |
| 1617 PrepareForBailoutForId(expr->GetIdForElement(array_index), | 1615 PrepareForBailoutForId(expr->GetIdForElement(array_index), |
| 1618 BailoutState::NO_REGISTERS); | 1616 BailoutState::NO_REGISTERS); |
| 1619 } | 1617 } |
| 1620 | 1618 |
| 1621 // In case the array literal contains spread expressions it has two parts. The | 1619 // In case the array literal contains spread expressions it has two parts. The |
| 1622 // first part is the "static" array which has a literal index is handled | 1620 // first part is the "static" array which has a literal index is handled |
| 1623 // above. The second part is the part after the first spread expression | 1621 // above. The second part is the part after the first spread expression |
| 1624 // (inclusive) and these elements gets appended to the array. Note that the | 1622 // (inclusive) and these elements gets appended to the array. Note that the |
| 1625 // number elements an iterable produces is unknown ahead of time. | 1623 // number elements an iterable produces is unknown ahead of time. |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2112 break; | 2110 break; |
| 2113 } | 2111 } |
| 2114 case KEYED_PROPERTY: { | 2112 case KEYED_PROPERTY: { |
| 2115 PushOperand(r0); // Preserve value. | 2113 PushOperand(r0); // Preserve value. |
| 2116 VisitForStackValue(prop->obj()); | 2114 VisitForStackValue(prop->obj()); |
| 2117 VisitForAccumulatorValue(prop->key()); | 2115 VisitForAccumulatorValue(prop->key()); |
| 2118 __ Move(StoreDescriptor::NameRegister(), r0); | 2116 __ Move(StoreDescriptor::NameRegister(), r0); |
| 2119 PopOperands(StoreDescriptor::ValueRegister(), | 2117 PopOperands(StoreDescriptor::ValueRegister(), |
| 2120 StoreDescriptor::ReceiverRegister()); | 2118 StoreDescriptor::ReceiverRegister()); |
| 2121 EmitLoadStoreICSlot(slot); | 2119 EmitLoadStoreICSlot(slot); |
| 2122 Handle<Code> ic = | 2120 CallKeyedStoreIC(); |
| 2123 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | |
| 2124 CallIC(ic); | |
| 2125 break; | 2121 break; |
| 2126 } | 2122 } |
| 2127 } | 2123 } |
| 2128 context()->Plug(r0); | 2124 context()->Plug(r0); |
| 2129 } | 2125 } |
| 2130 | 2126 |
| 2131 | 2127 |
| 2132 void FullCodeGenerator::EmitStoreToStackLocalOrContextSlot( | 2128 void FullCodeGenerator::EmitStoreToStackLocalOrContextSlot( |
| 2133 Variable* var, MemOperand location) { | 2129 Variable* var, MemOperand location) { |
| 2134 __ str(result_register(), location); | 2130 __ str(result_register(), location); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2256 : Runtime::kStoreKeyedToSuper_Sloppy); | 2252 : Runtime::kStoreKeyedToSuper_Sloppy); |
| 2257 } | 2253 } |
| 2258 | 2254 |
| 2259 | 2255 |
| 2260 void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { | 2256 void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { |
| 2261 // Assignment to a property, using a keyed store IC. | 2257 // Assignment to a property, using a keyed store IC. |
| 2262 PopOperands(StoreDescriptor::ReceiverRegister(), | 2258 PopOperands(StoreDescriptor::ReceiverRegister(), |
| 2263 StoreDescriptor::NameRegister()); | 2259 StoreDescriptor::NameRegister()); |
| 2264 DCHECK(StoreDescriptor::ValueRegister().is(r0)); | 2260 DCHECK(StoreDescriptor::ValueRegister().is(r0)); |
| 2265 | 2261 |
| 2266 Handle<Code> ic = | |
| 2267 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | |
| 2268 EmitLoadStoreICSlot(expr->AssignmentSlot()); | 2262 EmitLoadStoreICSlot(expr->AssignmentSlot()); |
| 2269 CallIC(ic); | 2263 CallKeyedStoreIC(); |
| 2270 | 2264 |
| 2271 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); | 2265 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); |
| 2272 context()->Plug(r0); | 2266 context()->Plug(r0); |
| 2273 } | 2267 } |
| 2274 | 2268 |
| 2275 | 2269 |
| 2276 void FullCodeGenerator::CallIC(Handle<Code> code, | 2270 void FullCodeGenerator::CallIC(Handle<Code> code, |
| 2277 TypeFeedbackId ast_id) { | 2271 TypeFeedbackId ast_id) { |
| 2278 ic_total_count_++; | 2272 ic_total_count_++; |
| 2279 // All calls must have a predictable size in full-codegen code to ensure that | 2273 // All calls must have a predictable size in full-codegen code to ensure that |
| (...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3355 context()->PlugTOS(); | 3349 context()->PlugTOS(); |
| 3356 } | 3350 } |
| 3357 } else { | 3351 } else { |
| 3358 context()->Plug(r0); | 3352 context()->Plug(r0); |
| 3359 } | 3353 } |
| 3360 break; | 3354 break; |
| 3361 } | 3355 } |
| 3362 case KEYED_PROPERTY: { | 3356 case KEYED_PROPERTY: { |
| 3363 PopOperands(StoreDescriptor::ReceiverRegister(), | 3357 PopOperands(StoreDescriptor::ReceiverRegister(), |
| 3364 StoreDescriptor::NameRegister()); | 3358 StoreDescriptor::NameRegister()); |
| 3365 Handle<Code> ic = | |
| 3366 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | |
| 3367 EmitLoadStoreICSlot(expr->CountSlot()); | 3359 EmitLoadStoreICSlot(expr->CountSlot()); |
| 3368 CallIC(ic); | 3360 CallKeyedStoreIC(); |
| 3369 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); | 3361 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); |
| 3370 if (expr->is_postfix()) { | 3362 if (expr->is_postfix()) { |
| 3371 if (!context()->IsEffect()) { | 3363 if (!context()->IsEffect()) { |
| 3372 context()->PlugTOS(); | 3364 context()->PlugTOS(); |
| 3373 } | 3365 } |
| 3374 } else { | 3366 } else { |
| 3375 context()->Plug(r0); | 3367 context()->Plug(r0); |
| 3376 } | 3368 } |
| 3377 break; | 3369 break; |
| 3378 } | 3370 } |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3809 DCHECK(interrupt_address == | 3801 DCHECK(interrupt_address == |
| 3810 isolate->builtins()->OnStackReplacement()->entry()); | 3802 isolate->builtins()->OnStackReplacement()->entry()); |
| 3811 return ON_STACK_REPLACEMENT; | 3803 return ON_STACK_REPLACEMENT; |
| 3812 } | 3804 } |
| 3813 | 3805 |
| 3814 | 3806 |
| 3815 } // namespace internal | 3807 } // namespace internal |
| 3816 } // namespace v8 | 3808 } // namespace v8 |
| 3817 | 3809 |
| 3818 #endif // V8_TARGET_ARCH_ARM | 3810 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |