| 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 2430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(x0); | 2447 context()->Plug(x0); |
| 2448 } | 2448 } |
| 2449 | 2449 |
| 2450 | 2450 |
| 2451 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { | |
| 2452 ASM_LOCATION("FullCodeGenerator::EmitSuperConstructorCall"); | |
| 2453 SuperCallReference* super_call_ref = | |
| 2454 expr->expression()->AsSuperCallReference(); | |
| 2455 DCHECK_NOT_NULL(super_call_ref); | |
| 2456 | |
| 2457 // Push the super constructor target on the stack (may be null, | |
| 2458 // but the Construct builtin can deal with that properly). | |
| 2459 VisitForAccumulatorValue(super_call_ref->this_function_var()); | |
| 2460 __ AssertFunction(result_register()); | |
| 2461 __ Ldr(result_register(), | |
| 2462 FieldMemOperand(result_register(), HeapObject::kMapOffset)); | |
| 2463 __ Ldr(result_register(), | |
| 2464 FieldMemOperand(result_register(), Map::kPrototypeOffset)); | |
| 2465 PushOperand(result_register()); | |
| 2466 | |
| 2467 // Push the arguments ("left-to-right") on the stack. | |
| 2468 ZoneList<Expression*>* args = expr->arguments(); | |
| 2469 int arg_count = args->length(); | |
| 2470 for (int i = 0; i < arg_count; i++) { | |
| 2471 VisitForStackValue(args->at(i)); | |
| 2472 } | |
| 2473 | |
| 2474 // Call the construct call builtin that handles allocation and | |
| 2475 // constructor invocation. | |
| 2476 SetConstructCallPosition(expr); | |
| 2477 | |
| 2478 // Load new target into x3. | |
| 2479 VisitForAccumulatorValue(super_call_ref->new_target_var()); | |
| 2480 __ Mov(x3, result_register()); | |
| 2481 | |
| 2482 // Load function and argument count into x1 and x0. | |
| 2483 __ Mov(x0, arg_count); | |
| 2484 __ Peek(x1, arg_count * kXRegSize); | |
| 2485 | |
| 2486 __ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | |
| 2487 OperandStackDepthDecrement(arg_count + 1); | |
| 2488 | |
| 2489 RecordJSReturnSite(expr); | |
| 2490 RestoreContext(); | |
| 2491 context()->Plug(x0); | |
| 2492 } | |
| 2493 | |
| 2494 | |
| 2495 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { | 2451 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { |
| 2496 ZoneList<Expression*>* args = expr->arguments(); | 2452 ZoneList<Expression*>* args = expr->arguments(); |
| 2497 DCHECK(args->length() == 1); | 2453 DCHECK(args->length() == 1); |
| 2498 | 2454 |
| 2499 VisitForAccumulatorValue(args->at(0)); | 2455 VisitForAccumulatorValue(args->at(0)); |
| 2500 | 2456 |
| 2501 Label materialize_true, materialize_false; | 2457 Label materialize_true, materialize_false; |
| 2502 Label* if_true = NULL; | 2458 Label* if_true = NULL; |
| 2503 Label* if_false = NULL; | 2459 Label* if_false = NULL; |
| 2504 Label* fall_through = NULL; | 2460 Label* fall_through = NULL; |
| (...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3644 } | 3600 } |
| 3645 | 3601 |
| 3646 return INTERRUPT; | 3602 return INTERRUPT; |
| 3647 } | 3603 } |
| 3648 | 3604 |
| 3649 | 3605 |
| 3650 } // namespace internal | 3606 } // namespace internal |
| 3651 } // namespace v8 | 3607 } // namespace v8 |
| 3652 | 3608 |
| 3653 #endif // V8_TARGET_ARCH_ARM64 | 3609 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |