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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
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 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1601 PushOperand(v0); // array literal | 1601 PushOperand(v0); // array literal |
1602 result_saved = true; | 1602 result_saved = true; |
1603 } | 1603 } |
1604 | 1604 |
1605 VisitForAccumulatorValue(subexpr); | 1605 VisitForAccumulatorValue(subexpr); |
1606 | 1606 |
1607 __ li(StoreDescriptor::NameRegister(), Operand(Smi::FromInt(array_index))); | 1607 __ li(StoreDescriptor::NameRegister(), Operand(Smi::FromInt(array_index))); |
1608 __ ld(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); | 1608 __ ld(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); |
1609 __ mov(StoreDescriptor::ValueRegister(), result_register()); | 1609 __ mov(StoreDescriptor::ValueRegister(), result_register()); |
1610 EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); | 1610 EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); |
1611 Handle<Code> ic = | 1611 CallKeyedStoreIC(); |
1612 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | |
1613 CallIC(ic); | |
1614 | 1612 |
1615 PrepareForBailoutForId(expr->GetIdForElement(array_index), | 1613 PrepareForBailoutForId(expr->GetIdForElement(array_index), |
1616 BailoutState::NO_REGISTERS); | 1614 BailoutState::NO_REGISTERS); |
1617 } | 1615 } |
1618 | 1616 |
1619 // In case the array literal contains spread expressions it has two parts. The | 1617 // In case the array literal contains spread expressions it has two parts. The |
1620 // first part is the "static" array which has a literal index is handled | 1618 // first part is the "static" array which has a literal index is handled |
1621 // above. The second part is the part after the first spread expression | 1619 // above. The second part is the part after the first spread expression |
1622 // (inclusive) and these elements gets appended to the array. Note that the | 1620 // (inclusive) and these elements gets appended to the array. Note that the |
1623 // number elements an iterable produces is unknown ahead of time. | 1621 // number elements an iterable produces is unknown ahead of time. |
(...skipping 492 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 __ Move(StoreDescriptor::NameRegister(), result_register()); | 2120 __ Move(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 __ sd(result_register(), location); | 2134 __ sd(result_register(), location); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2267 // Call keyed store IC. | 2263 // Call keyed store IC. |
2268 // The arguments are: | 2264 // The arguments are: |
2269 // - a0 is the value, | 2265 // - a0 is the value, |
2270 // - a1 is the key, | 2266 // - a1 is the key, |
2271 // - a2 is the receiver. | 2267 // - a2 is the receiver. |
2272 __ mov(StoreDescriptor::ValueRegister(), result_register()); | 2268 __ mov(StoreDescriptor::ValueRegister(), result_register()); |
2273 PopOperands(StoreDescriptor::ReceiverRegister(), | 2269 PopOperands(StoreDescriptor::ReceiverRegister(), |
2274 StoreDescriptor::NameRegister()); | 2270 StoreDescriptor::NameRegister()); |
2275 DCHECK(StoreDescriptor::ValueRegister().is(a0)); | 2271 DCHECK(StoreDescriptor::ValueRegister().is(a0)); |
2276 | 2272 |
2277 Handle<Code> ic = | |
2278 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | |
2279 EmitLoadStoreICSlot(expr->AssignmentSlot()); | 2273 EmitLoadStoreICSlot(expr->AssignmentSlot()); |
2280 CallIC(ic); | 2274 CallKeyedStoreIC(); |
2281 | 2275 |
2282 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); | 2276 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); |
2283 context()->Plug(v0); | 2277 context()->Plug(v0); |
2284 } | 2278 } |
2285 | 2279 |
2286 | 2280 |
2287 void FullCodeGenerator::CallIC(Handle<Code> code, | 2281 void FullCodeGenerator::CallIC(Handle<Code> code, |
2288 TypeFeedbackId id) { | 2282 TypeFeedbackId id) { |
2289 ic_total_count_++; | 2283 ic_total_count_++; |
2290 __ Call(code, RelocInfo::CODE_TARGET, id); | 2284 __ Call(code, RelocInfo::CODE_TARGET, id); |
(...skipping 1071 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3757 reinterpret_cast<uint64_t>( | 3749 reinterpret_cast<uint64_t>( |
3758 isolate->builtins()->OnStackReplacement()->entry())); | 3750 isolate->builtins()->OnStackReplacement()->entry())); |
3759 return ON_STACK_REPLACEMENT; | 3751 return ON_STACK_REPLACEMENT; |
3760 } | 3752 } |
3761 | 3753 |
3762 | 3754 |
3763 } // namespace internal | 3755 } // namespace internal |
3764 } // namespace v8 | 3756 } // namespace v8 |
3765 | 3757 |
3766 #endif // V8_TARGET_ARCH_MIPS64 | 3758 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |