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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
6 | 6 |
7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
8 // | 8 // |
9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
(...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1600 PushOperand(v0); // array literal | 1600 PushOperand(v0); // array literal |
1601 result_saved = true; | 1601 result_saved = true; |
1602 } | 1602 } |
1603 | 1603 |
1604 VisitForAccumulatorValue(subexpr); | 1604 VisitForAccumulatorValue(subexpr); |
1605 | 1605 |
1606 __ li(StoreDescriptor::NameRegister(), Operand(Smi::FromInt(array_index))); | 1606 __ li(StoreDescriptor::NameRegister(), Operand(Smi::FromInt(array_index))); |
1607 __ lw(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); | 1607 __ lw(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); |
1608 __ mov(StoreDescriptor::ValueRegister(), result_register()); | 1608 __ mov(StoreDescriptor::ValueRegister(), result_register()); |
1609 EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); | 1609 EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); |
1610 Handle<Code> ic = | 1610 CallKeyedStoreIC(); |
1611 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | |
1612 CallIC(ic); | |
1613 | 1611 |
1614 PrepareForBailoutForId(expr->GetIdForElement(array_index), | 1612 PrepareForBailoutForId(expr->GetIdForElement(array_index), |
1615 BailoutState::NO_REGISTERS); | 1613 BailoutState::NO_REGISTERS); |
1616 } | 1614 } |
1617 | 1615 |
1618 // In case the array literal contains spread expressions it has two parts. The | 1616 // In case the array literal contains spread expressions it has two parts. The |
1619 // first part is the "static" array which has a literal index is handled | 1617 // first part is the "static" array which has a literal index is handled |
1620 // above. The second part is the part after the first spread expression | 1618 // above. The second part is the part after the first spread expression |
1621 // (inclusive) and these elements gets appended to the array. Note that the | 1619 // (inclusive) and these elements gets appended to the array. Note that the |
1622 // number elements an iterable produces is unknown ahead of time. | 1620 // number elements an iterable produces is unknown ahead of time. |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2116 break; | 2114 break; |
2117 } | 2115 } |
2118 case KEYED_PROPERTY: { | 2116 case KEYED_PROPERTY: { |
2119 PushOperand(result_register()); // Preserve value. | 2117 PushOperand(result_register()); // Preserve value. |
2120 VisitForStackValue(prop->obj()); | 2118 VisitForStackValue(prop->obj()); |
2121 VisitForAccumulatorValue(prop->key()); | 2119 VisitForAccumulatorValue(prop->key()); |
2122 __ mov(StoreDescriptor::NameRegister(), result_register()); | 2120 __ mov(StoreDescriptor::NameRegister(), result_register()); |
2123 PopOperands(StoreDescriptor::ValueRegister(), | 2121 PopOperands(StoreDescriptor::ValueRegister(), |
2124 StoreDescriptor::ReceiverRegister()); | 2122 StoreDescriptor::ReceiverRegister()); |
2125 EmitLoadStoreICSlot(slot); | 2123 EmitLoadStoreICSlot(slot); |
2126 Handle<Code> ic = | 2124 CallKeyedStoreIC(); |
2127 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | |
2128 CallIC(ic); | |
2129 break; | 2125 break; |
2130 } | 2126 } |
2131 } | 2127 } |
2132 context()->Plug(v0); | 2128 context()->Plug(v0); |
2133 } | 2129 } |
2134 | 2130 |
2135 | 2131 |
2136 void FullCodeGenerator::EmitStoreToStackLocalOrContextSlot( | 2132 void FullCodeGenerator::EmitStoreToStackLocalOrContextSlot( |
2137 Variable* var, MemOperand location) { | 2133 Variable* var, MemOperand location) { |
2138 __ sw(result_register(), location); | 2134 __ sw(result_register(), location); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2268 // Call keyed store IC. | 2264 // Call keyed store IC. |
2269 // The arguments are: | 2265 // The arguments are: |
2270 // - a0 is the value, | 2266 // - a0 is the value, |
2271 // - a1 is the key, | 2267 // - a1 is the key, |
2272 // - a2 is the receiver. | 2268 // - a2 is the receiver. |
2273 __ mov(StoreDescriptor::ValueRegister(), result_register()); | 2269 __ mov(StoreDescriptor::ValueRegister(), result_register()); |
2274 PopOperands(StoreDescriptor::ReceiverRegister(), | 2270 PopOperands(StoreDescriptor::ReceiverRegister(), |
2275 StoreDescriptor::NameRegister()); | 2271 StoreDescriptor::NameRegister()); |
2276 DCHECK(StoreDescriptor::ValueRegister().is(a0)); | 2272 DCHECK(StoreDescriptor::ValueRegister().is(a0)); |
2277 | 2273 |
2278 Handle<Code> ic = | |
2279 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | |
2280 EmitLoadStoreICSlot(expr->AssignmentSlot()); | 2274 EmitLoadStoreICSlot(expr->AssignmentSlot()); |
2281 CallIC(ic); | 2275 CallKeyedStoreIC(); |
2282 | 2276 |
2283 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); | 2277 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); |
2284 context()->Plug(v0); | 2278 context()->Plug(v0); |
2285 } | 2279 } |
2286 | 2280 |
2287 | 2281 |
2288 void FullCodeGenerator::CallIC(Handle<Code> code, | 2282 void FullCodeGenerator::CallIC(Handle<Code> code, |
2289 TypeFeedbackId id) { | 2283 TypeFeedbackId id) { |
2290 ic_total_count_++; | 2284 ic_total_count_++; |
2291 __ Call(code, RelocInfo::CODE_TARGET, id); | 2285 __ Call(code, RelocInfo::CODE_TARGET, id); |
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3362 } | 3356 } |
3363 } else { | 3357 } else { |
3364 context()->Plug(v0); | 3358 context()->Plug(v0); |
3365 } | 3359 } |
3366 break; | 3360 break; |
3367 } | 3361 } |
3368 case KEYED_PROPERTY: { | 3362 case KEYED_PROPERTY: { |
3369 __ mov(StoreDescriptor::ValueRegister(), result_register()); | 3363 __ mov(StoreDescriptor::ValueRegister(), result_register()); |
3370 PopOperands(StoreDescriptor::ReceiverRegister(), | 3364 PopOperands(StoreDescriptor::ReceiverRegister(), |
3371 StoreDescriptor::NameRegister()); | 3365 StoreDescriptor::NameRegister()); |
3372 Handle<Code> ic = | |
3373 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | |
3374 EmitLoadStoreICSlot(expr->CountSlot()); | 3366 EmitLoadStoreICSlot(expr->CountSlot()); |
3375 CallIC(ic); | 3367 CallKeyedStoreIC(); |
3376 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); | 3368 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); |
3377 if (expr->is_postfix()) { | 3369 if (expr->is_postfix()) { |
3378 if (!context()->IsEffect()) { | 3370 if (!context()->IsEffect()) { |
3379 context()->PlugTOS(); | 3371 context()->PlugTOS(); |
3380 } | 3372 } |
3381 } else { | 3373 } else { |
3382 context()->Plug(v0); | 3374 context()->Plug(v0); |
3383 } | 3375 } |
3384 break; | 3376 break; |
3385 } | 3377 } |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3750 reinterpret_cast<uint32_t>( | 3742 reinterpret_cast<uint32_t>( |
3751 isolate->builtins()->OnStackReplacement()->entry())); | 3743 isolate->builtins()->OnStackReplacement()->entry())); |
3752 return ON_STACK_REPLACEMENT; | 3744 return ON_STACK_REPLACEMENT; |
3753 } | 3745 } |
3754 | 3746 |
3755 | 3747 |
3756 } // namespace internal | 3748 } // namespace internal |
3757 } // namespace v8 | 3749 } // namespace v8 |
3758 | 3750 |
3759 #endif // V8_TARGET_ARCH_MIPS | 3751 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |