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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 2477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2488 | 2488 |
2489 CallConstructStub stub(isolate()); | 2489 CallConstructStub stub(isolate()); |
2490 CallIC(stub.GetCode()); | 2490 CallIC(stub.GetCode()); |
2491 OperandStackDepthDecrement(arg_count + 1); | 2491 OperandStackDepthDecrement(arg_count + 1); |
2492 PrepareForBailoutForId(expr->ReturnId(), BailoutState::TOS_REGISTER); | 2492 PrepareForBailoutForId(expr->ReturnId(), BailoutState::TOS_REGISTER); |
2493 RestoreContext(); | 2493 RestoreContext(); |
2494 context()->Plug(r0); | 2494 context()->Plug(r0); |
2495 } | 2495 } |
2496 | 2496 |
2497 | 2497 |
2498 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { | |
2499 SuperCallReference* super_call_ref = | |
2500 expr->expression()->AsSuperCallReference(); | |
2501 DCHECK_NOT_NULL(super_call_ref); | |
2502 | |
2503 // Push the super constructor target on the stack (may be null, | |
2504 // but the Construct builtin can deal with that properly). | |
2505 VisitForAccumulatorValue(super_call_ref->this_function_var()); | |
2506 __ AssertFunction(result_register()); | |
2507 __ ldr(result_register(), | |
2508 FieldMemOperand(result_register(), HeapObject::kMapOffset)); | |
2509 __ ldr(result_register(), | |
2510 FieldMemOperand(result_register(), Map::kPrototypeOffset)); | |
2511 PushOperand(result_register()); | |
2512 | |
2513 // Push the arguments ("left-to-right") on the stack. | |
2514 ZoneList<Expression*>* args = expr->arguments(); | |
2515 int arg_count = args->length(); | |
2516 for (int i = 0; i < arg_count; i++) { | |
2517 VisitForStackValue(args->at(i)); | |
2518 } | |
2519 | |
2520 // Call the construct call builtin that handles allocation and | |
2521 // constructor invocation. | |
2522 SetConstructCallPosition(expr); | |
2523 | |
2524 // Load new target into r3. | |
2525 VisitForAccumulatorValue(super_call_ref->new_target_var()); | |
2526 __ mov(r3, result_register()); | |
2527 | |
2528 // Load function and argument count into r1 and r0. | |
2529 __ mov(r0, Operand(arg_count)); | |
2530 __ ldr(r1, MemOperand(sp, arg_count * kPointerSize)); | |
2531 | |
2532 __ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); | |
2533 OperandStackDepthDecrement(arg_count + 1); | |
2534 | |
2535 RecordJSReturnSite(expr); | |
2536 RestoreContext(); | |
2537 context()->Plug(r0); | |
2538 } | |
2539 | |
2540 | |
2541 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { | 2498 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { |
2542 ZoneList<Expression*>* args = expr->arguments(); | 2499 ZoneList<Expression*>* args = expr->arguments(); |
2543 DCHECK(args->length() == 1); | 2500 DCHECK(args->length() == 1); |
2544 | 2501 |
2545 VisitForAccumulatorValue(args->at(0)); | 2502 VisitForAccumulatorValue(args->at(0)); |
2546 | 2503 |
2547 Label materialize_true, materialize_false; | 2504 Label materialize_true, materialize_false; |
2548 Label* if_true = NULL; | 2505 Label* if_true = NULL; |
2549 Label* if_false = NULL; | 2506 Label* if_false = NULL; |
2550 Label* fall_through = NULL; | 2507 Label* fall_through = NULL; |
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3645 DCHECK(interrupt_address == | 3602 DCHECK(interrupt_address == |
3646 isolate->builtins()->OnStackReplacement()->entry()); | 3603 isolate->builtins()->OnStackReplacement()->entry()); |
3647 return ON_STACK_REPLACEMENT; | 3604 return ON_STACK_REPLACEMENT; |
3648 } | 3605 } |
3649 | 3606 |
3650 | 3607 |
3651 } // namespace internal | 3608 } // namespace internal |
3652 } // namespace v8 | 3609 } // namespace v8 |
3653 | 3610 |
3654 #endif // V8_TARGET_ARCH_ARM | 3611 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |