| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
| 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 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1524 if (!result_saved) { | 1524 if (!result_saved) { |
| 1525 PushOperand(r2); | 1525 PushOperand(r2); |
| 1526 result_saved = true; | 1526 result_saved = true; |
| 1527 } | 1527 } |
| 1528 VisitForAccumulatorValue(subexpr); | 1528 VisitForAccumulatorValue(subexpr); |
| 1529 | 1529 |
| 1530 __ LoadSmiLiteral(StoreDescriptor::NameRegister(), | 1530 __ LoadSmiLiteral(StoreDescriptor::NameRegister(), |
| 1531 Smi::FromInt(array_index)); | 1531 Smi::FromInt(array_index)); |
| 1532 __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); | 1532 __ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0)); |
| 1533 EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); | 1533 EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); |
| 1534 Handle<Code> ic = | 1534 CallKeyedStoreIC(); |
| 1535 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | |
| 1536 CallIC(ic); | |
| 1537 | 1535 |
| 1538 PrepareForBailoutForId(expr->GetIdForElement(array_index), | 1536 PrepareForBailoutForId(expr->GetIdForElement(array_index), |
| 1539 BailoutState::NO_REGISTERS); | 1537 BailoutState::NO_REGISTERS); |
| 1540 } | 1538 } |
| 1541 | 1539 |
| 1542 // In case the array literal contains spread expressions it has two parts. The | 1540 // In case the array literal contains spread expressions it has two parts. The |
| 1543 // first part is the "static" array which has a literal index is handled | 1541 // first part is the "static" array which has a literal index is handled |
| 1544 // above. The second part is the part after the first spread expression | 1542 // above. The second part is the part after the first spread expression |
| 1545 // (inclusive) and these elements gets appended to the array. Note that the | 1543 // (inclusive) and these elements gets appended to the array. Note that the |
| 1546 // number elements an iterable produces is unknown ahead of time. | 1544 // number elements an iterable produces is unknown ahead of time. |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2073 break; | 2071 break; |
| 2074 } | 2072 } |
| 2075 case KEYED_PROPERTY: { | 2073 case KEYED_PROPERTY: { |
| 2076 PushOperand(r2); // Preserve value. | 2074 PushOperand(r2); // Preserve value. |
| 2077 VisitForStackValue(prop->obj()); | 2075 VisitForStackValue(prop->obj()); |
| 2078 VisitForAccumulatorValue(prop->key()); | 2076 VisitForAccumulatorValue(prop->key()); |
| 2079 __ Move(StoreDescriptor::NameRegister(), r2); | 2077 __ Move(StoreDescriptor::NameRegister(), r2); |
| 2080 PopOperands(StoreDescriptor::ValueRegister(), | 2078 PopOperands(StoreDescriptor::ValueRegister(), |
| 2081 StoreDescriptor::ReceiverRegister()); | 2079 StoreDescriptor::ReceiverRegister()); |
| 2082 EmitLoadStoreICSlot(slot); | 2080 EmitLoadStoreICSlot(slot); |
| 2083 Handle<Code> ic = | 2081 CallKeyedStoreIC(); |
| 2084 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | |
| 2085 CallIC(ic); | |
| 2086 break; | 2082 break; |
| 2087 } | 2083 } |
| 2088 } | 2084 } |
| 2089 context()->Plug(r2); | 2085 context()->Plug(r2); |
| 2090 } | 2086 } |
| 2091 | 2087 |
| 2092 void FullCodeGenerator::EmitStoreToStackLocalOrContextSlot( | 2088 void FullCodeGenerator::EmitStoreToStackLocalOrContextSlot( |
| 2093 Variable* var, MemOperand location) { | 2089 Variable* var, MemOperand location) { |
| 2094 __ StoreP(result_register(), location); | 2090 __ StoreP(result_register(), location); |
| 2095 if (var->IsContextSlot()) { | 2091 if (var->IsContextSlot()) { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2211 ? Runtime::kStoreKeyedToSuper_Strict | 2207 ? Runtime::kStoreKeyedToSuper_Strict |
| 2212 : Runtime::kStoreKeyedToSuper_Sloppy)); | 2208 : Runtime::kStoreKeyedToSuper_Sloppy)); |
| 2213 } | 2209 } |
| 2214 | 2210 |
| 2215 void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { | 2211 void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { |
| 2216 // Assignment to a property, using a keyed store IC. | 2212 // Assignment to a property, using a keyed store IC. |
| 2217 PopOperands(StoreDescriptor::ReceiverRegister(), | 2213 PopOperands(StoreDescriptor::ReceiverRegister(), |
| 2218 StoreDescriptor::NameRegister()); | 2214 StoreDescriptor::NameRegister()); |
| 2219 DCHECK(StoreDescriptor::ValueRegister().is(r2)); | 2215 DCHECK(StoreDescriptor::ValueRegister().is(r2)); |
| 2220 | 2216 |
| 2221 Handle<Code> ic = | |
| 2222 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | |
| 2223 EmitLoadStoreICSlot(expr->AssignmentSlot()); | 2217 EmitLoadStoreICSlot(expr->AssignmentSlot()); |
| 2224 CallIC(ic); | 2218 CallKeyedStoreIC(); |
| 2225 | 2219 |
| 2226 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); | 2220 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); |
| 2227 context()->Plug(r2); | 2221 context()->Plug(r2); |
| 2228 } | 2222 } |
| 2229 | 2223 |
| 2230 void FullCodeGenerator::CallIC(Handle<Code> code, TypeFeedbackId ast_id) { | 2224 void FullCodeGenerator::CallIC(Handle<Code> code, TypeFeedbackId ast_id) { |
| 2231 ic_total_count_++; | 2225 ic_total_count_++; |
| 2232 __ Call(code, RelocInfo::CODE_TARGET, ast_id); | 2226 __ Call(code, RelocInfo::CODE_TARGET, ast_id); |
| 2233 } | 2227 } |
| 2234 | 2228 |
| (...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3269 context()->PlugTOS(); | 3263 context()->PlugTOS(); |
| 3270 } | 3264 } |
| 3271 } else { | 3265 } else { |
| 3272 context()->Plug(r2); | 3266 context()->Plug(r2); |
| 3273 } | 3267 } |
| 3274 break; | 3268 break; |
| 3275 } | 3269 } |
| 3276 case KEYED_PROPERTY: { | 3270 case KEYED_PROPERTY: { |
| 3277 PopOperands(StoreDescriptor::ReceiverRegister(), | 3271 PopOperands(StoreDescriptor::ReceiverRegister(), |
| 3278 StoreDescriptor::NameRegister()); | 3272 StoreDescriptor::NameRegister()); |
| 3279 Handle<Code> ic = | |
| 3280 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); | |
| 3281 EmitLoadStoreICSlot(expr->CountSlot()); | 3273 EmitLoadStoreICSlot(expr->CountSlot()); |
| 3282 CallIC(ic); | 3274 CallKeyedStoreIC(); |
| 3283 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); | 3275 PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); |
| 3284 if (expr->is_postfix()) { | 3276 if (expr->is_postfix()) { |
| 3285 if (!context()->IsEffect()) { | 3277 if (!context()->IsEffect()) { |
| 3286 context()->PlugTOS(); | 3278 context()->PlugTOS(); |
| 3287 } | 3279 } |
| 3288 } else { | 3280 } else { |
| 3289 context()->Plug(r2); | 3281 context()->Plug(r2); |
| 3290 } | 3282 } |
| 3291 break; | 3283 break; |
| 3292 } | 3284 } |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3643 DCHECK(kOSRBranchInstruction == br_instr); | 3635 DCHECK(kOSRBranchInstruction == br_instr); |
| 3644 | 3636 |
| 3645 DCHECK(interrupt_address == | 3637 DCHECK(interrupt_address == |
| 3646 isolate->builtins()->OnStackReplacement()->entry()); | 3638 isolate->builtins()->OnStackReplacement()->entry()); |
| 3647 return ON_STACK_REPLACEMENT; | 3639 return ON_STACK_REPLACEMENT; |
| 3648 } | 3640 } |
| 3649 | 3641 |
| 3650 } // namespace internal | 3642 } // namespace internal |
| 3651 } // namespace v8 | 3643 } // namespace v8 |
| 3652 #endif // V8_TARGET_ARCH_S390 | 3644 #endif // V8_TARGET_ARCH_S390 |
| OLD | NEW |