| 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 2429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2440 __ LoadSmiLiteral(r5, SmiFromSlot(expr->CallNewFeedbackSlot())); | 2440 __ LoadSmiLiteral(r5, SmiFromSlot(expr->CallNewFeedbackSlot())); |
| 2441 | 2441 |
| 2442 CallConstructStub stub(isolate()); | 2442 CallConstructStub stub(isolate()); |
| 2443 CallIC(stub.GetCode()); | 2443 CallIC(stub.GetCode()); |
| 2444 OperandStackDepthDecrement(arg_count + 1); | 2444 OperandStackDepthDecrement(arg_count + 1); |
| 2445 PrepareForBailoutForId(expr->ReturnId(), BailoutState::TOS_REGISTER); | 2445 PrepareForBailoutForId(expr->ReturnId(), BailoutState::TOS_REGISTER); |
| 2446 RestoreContext(); | 2446 RestoreContext(); |
| 2447 context()->Plug(r2); | 2447 context()->Plug(r2); |
| 2448 } | 2448 } |
| 2449 | 2449 |
| 2450 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { | |
| 2451 SuperCallReference* super_call_ref = | |
| 2452 expr->expression()->AsSuperCallReference(); | |
| 2453 DCHECK_NOT_NULL(super_call_ref); | |
| 2454 | |
| 2455 // Push the super constructor target on the stack (may be null, | |
| 2456 // but the Construct builtin can deal with that properly). | |
| 2457 VisitForAccumulatorValue(super_call_ref->this_function_var()); | |
| 2458 __ AssertFunction(result_register()); | |
| 2459 __ LoadP(result_register(), | |
| 2460 FieldMemOperand(result_register(), HeapObject::kMapOffset)); | |
| 2461 __ LoadP(result_register(), | |
| 2462 FieldMemOperand(result_register(), Map::kPrototypeOffset)); | |
| 2463 PushOperand(result_register()); | |
| 2464 | |
| 2465 // Push the arguments ("left-to-right") on the stack. | |
| 2466 ZoneList<Expression*>* args = expr->arguments(); | |
| 2467 int arg_count = args->length(); | |
| 2468 for (int i = 0; i < arg_count; i++) { | |
| 2469 VisitForStackValue(args->at(i)); | |
| 2470 } | |
| 2471 | |
| 2472 // Call the construct call builtin that handles allocation and | |
| 2473 // constructor invocation. | |
| 2474 SetConstructCallPosition(expr); | |
| 2475 | |
| 2476 // Load new target into r5. | |
| 2477 VisitForAccumulatorValue(super_call_ref->new_target_var()); | |
| 2478 __ LoadRR(r5, result_register()); | |
| 2479 | |
| 2480 // Load function and argument count into r1 and r0. | |
| 2481 __ mov(r2, Operand(arg_count)); | |
| 2482 __ LoadP(r3, MemOperand(sp, arg_count * kPointerSize)); | |
| 2483 | |
| 2484 __ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | |
| 2485 OperandStackDepthDecrement(arg_count + 1); | |
| 2486 | |
| 2487 RecordJSReturnSite(expr); | |
| 2488 RestoreContext(); | |
| 2489 context()->Plug(r2); | |
| 2490 } | |
| 2491 | |
| 2492 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { | 2450 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { |
| 2493 ZoneList<Expression*>* args = expr->arguments(); | 2451 ZoneList<Expression*>* args = expr->arguments(); |
| 2494 DCHECK(args->length() == 1); | 2452 DCHECK(args->length() == 1); |
| 2495 | 2453 |
| 2496 VisitForAccumulatorValue(args->at(0)); | 2454 VisitForAccumulatorValue(args->at(0)); |
| 2497 | 2455 |
| 2498 Label materialize_true, materialize_false, skip_lookup; | 2456 Label materialize_true, materialize_false, skip_lookup; |
| 2499 Label* if_true = NULL; | 2457 Label* if_true = NULL; |
| 2500 Label* if_false = NULL; | 2458 Label* if_false = NULL; |
| 2501 Label* fall_through = NULL; | 2459 Label* fall_through = NULL; |
| (...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3498 DCHECK(kOSRBranchInstruction == br_instr); | 3456 DCHECK(kOSRBranchInstruction == br_instr); |
| 3499 | 3457 |
| 3500 DCHECK(interrupt_address == | 3458 DCHECK(interrupt_address == |
| 3501 isolate->builtins()->OnStackReplacement()->entry()); | 3459 isolate->builtins()->OnStackReplacement()->entry()); |
| 3502 return ON_STACK_REPLACEMENT; | 3460 return ON_STACK_REPLACEMENT; |
| 3503 } | 3461 } |
| 3504 | 3462 |
| 3505 } // namespace internal | 3463 } // namespace internal |
| 3506 } // namespace v8 | 3464 } // namespace v8 |
| 3507 #endif // V8_TARGET_ARCH_S390 | 3465 #endif // V8_TARGET_ARCH_S390 |
| OLD | NEW |