| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
| 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 1575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1586 | 1586 |
| 1587 if (!result_saved) { | 1587 if (!result_saved) { |
| 1588 PushOperand(x0); | 1588 PushOperand(x0); |
| 1589 result_saved = true; | 1589 result_saved = true; |
| 1590 } | 1590 } |
| 1591 VisitForAccumulatorValue(subexpr); | 1591 VisitForAccumulatorValue(subexpr); |
| 1592 | 1592 |
| 1593 __ Mov(StoreDescriptor::NameRegister(), Smi::FromInt(array_index)); | 1593 __ Mov(StoreDescriptor::NameRegister(), Smi::FromInt(array_index)); |
| 1594 __ Peek(StoreDescriptor::ReceiverRegister(), 0); | 1594 __ Peek(StoreDescriptor::ReceiverRegister(), 0); |
| 1595 EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); | 1595 EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); |
| 1596 Handle<Code> ic = | 1596 CallKeyedStoreIC(); |
| 1597 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | |
| 1598 CallIC(ic); | |
| 1599 | 1597 |
| 1600 PrepareForBailoutForId(expr->GetIdForElement(array_index), | 1598 PrepareForBailoutForId(expr->GetIdForElement(array_index), |
| 1601 BailoutState::NO_REGISTERS); | 1599 BailoutState::NO_REGISTERS); |
| 1602 } | 1600 } |
| 1603 | 1601 |
| 1604 // In case the array literal contains spread expressions it has two parts. The | 1602 // In case the array literal contains spread expressions it has two parts. The |
| 1605 // first part is the "static" array which has a literal index is handled | 1603 // first part is the "static" array which has a literal index is handled |
| 1606 // above. The second part is the part after the first spread expression | 1604 // above. The second part is the part after the first spread expression |
| 1607 // (inclusive) and these elements gets appended to the array. Note that the | 1605 // (inclusive) and these elements gets appended to the array. Note that the |
| 1608 // number elements an iterable produces is unknown ahead of time. | 1606 // number elements an iterable produces is unknown ahead of time. |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2005 break; | 2003 break; |
| 2006 } | 2004 } |
| 2007 case KEYED_PROPERTY: { | 2005 case KEYED_PROPERTY: { |
| 2008 PushOperand(x0); // Preserve value. | 2006 PushOperand(x0); // Preserve value. |
| 2009 VisitForStackValue(prop->obj()); | 2007 VisitForStackValue(prop->obj()); |
| 2010 VisitForAccumulatorValue(prop->key()); | 2008 VisitForAccumulatorValue(prop->key()); |
| 2011 __ Mov(StoreDescriptor::NameRegister(), x0); | 2009 __ Mov(StoreDescriptor::NameRegister(), x0); |
| 2012 PopOperands(StoreDescriptor::ReceiverRegister(), | 2010 PopOperands(StoreDescriptor::ReceiverRegister(), |
| 2013 StoreDescriptor::ValueRegister()); | 2011 StoreDescriptor::ValueRegister()); |
| 2014 EmitLoadStoreICSlot(slot); | 2012 EmitLoadStoreICSlot(slot); |
| 2015 Handle<Code> ic = | 2013 CallKeyedStoreIC(); |
| 2016 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | |
| 2017 CallIC(ic); | |
| 2018 break; | 2014 break; |
| 2019 } | 2015 } |
| 2020 } | 2016 } |
| 2021 context()->Plug(x0); | 2017 context()->Plug(x0); |
| 2022 } | 2018 } |
| 2023 | 2019 |
| 2024 | 2020 |
| 2025 void FullCodeGenerator::EmitStoreToStackLocalOrContextSlot( | 2021 void FullCodeGenerator::EmitStoreToStackLocalOrContextSlot( |
| 2026 Variable* var, MemOperand location) { | 2022 Variable* var, MemOperand location) { |
| 2027 __ Str(result_register(), location); | 2023 __ Str(result_register(), location); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2151 | 2147 |
| 2152 void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { | 2148 void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { |
| 2153 ASM_LOCATION("FullCodeGenerator::EmitKeyedPropertyAssignment"); | 2149 ASM_LOCATION("FullCodeGenerator::EmitKeyedPropertyAssignment"); |
| 2154 // Assignment to a property, using a keyed store IC. | 2150 // Assignment to a property, using a keyed store IC. |
| 2155 | 2151 |
| 2156 // TODO(all): Could we pass this in registers rather than on the stack? | 2152 // TODO(all): Could we pass this in registers rather than on the stack? |
| 2157 PopOperands(StoreDescriptor::NameRegister(), | 2153 PopOperands(StoreDescriptor::NameRegister(), |
| 2158 StoreDescriptor::ReceiverRegister()); | 2154 StoreDescriptor::ReceiverRegister()); |
| 2159 DCHECK(StoreDescriptor::ValueRegister().is(x0)); | 2155 DCHECK(StoreDescriptor::ValueRegister().is(x0)); |
| 2160 | 2156 |
| 2161 Handle<Code> ic = | |
| 2162 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | |
| 2163 EmitLoadStoreICSlot(expr->AssignmentSlot()); | 2157 EmitLoadStoreICSlot(expr->AssignmentSlot()); |
| 2164 CallIC(ic); | 2158 CallKeyedStoreIC(); |
| 2165 | 2159 |
| 2166 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); | 2160 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); |
| 2167 context()->Plug(x0); | 2161 context()->Plug(x0); |
| 2168 } | 2162 } |
| 2169 | 2163 |
| 2170 | 2164 |
| 2171 void FullCodeGenerator::CallIC(Handle<Code> code, | 2165 void FullCodeGenerator::CallIC(Handle<Code> code, |
| 2172 TypeFeedbackId ast_id) { | 2166 TypeFeedbackId ast_id) { |
| 2173 ic_total_count_++; | 2167 ic_total_count_++; |
| 2174 // All calls must have a predictable size in full-codegen code to ensure that | 2168 // All calls must have a predictable size in full-codegen code to ensure that |
| (...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3277 context()->PlugTOS(); | 3271 context()->PlugTOS(); |
| 3278 } | 3272 } |
| 3279 } else { | 3273 } else { |
| 3280 context()->Plug(x0); | 3274 context()->Plug(x0); |
| 3281 } | 3275 } |
| 3282 break; | 3276 break; |
| 3283 } | 3277 } |
| 3284 case KEYED_PROPERTY: { | 3278 case KEYED_PROPERTY: { |
| 3285 PopOperand(StoreDescriptor::NameRegister()); | 3279 PopOperand(StoreDescriptor::NameRegister()); |
| 3286 PopOperand(StoreDescriptor::ReceiverRegister()); | 3280 PopOperand(StoreDescriptor::ReceiverRegister()); |
| 3287 Handle<Code> ic = | |
| 3288 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | |
| 3289 EmitLoadStoreICSlot(expr->CountSlot()); | 3281 EmitLoadStoreICSlot(expr->CountSlot()); |
| 3290 CallIC(ic); | 3282 CallKeyedStoreIC(); |
| 3291 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); | 3283 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); |
| 3292 if (expr->is_postfix()) { | 3284 if (expr->is_postfix()) { |
| 3293 if (!context()->IsEffect()) { | 3285 if (!context()->IsEffect()) { |
| 3294 context()->PlugTOS(); | 3286 context()->PlugTOS(); |
| 3295 } | 3287 } |
| 3296 } else { | 3288 } else { |
| 3297 context()->Plug(x0); | 3289 context()->Plug(x0); |
| 3298 } | 3290 } |
| 3299 break; | 3291 break; |
| 3300 } | 3292 } |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3819 } | 3811 } |
| 3820 | 3812 |
| 3821 return INTERRUPT; | 3813 return INTERRUPT; |
| 3822 } | 3814 } |
| 3823 | 3815 |
| 3824 | 3816 |
| 3825 } // namespace internal | 3817 } // namespace internal |
| 3826 } // namespace v8 | 3818 } // namespace v8 |
| 3827 | 3819 |
| 3828 #endif // V8_TARGET_ARCH_ARM64 | 3820 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |