Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 6 | 6 |
| 7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
| 8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
| 9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
| 10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 548 __ LoadRoot(ip, Heap::kStackLimitRootIndex); | 548 __ LoadRoot(ip, Heap::kStackLimitRootIndex); |
| 549 __ cmpl(sp, ip); | 549 __ cmpl(sp, ip); |
| 550 __ bge(&ok); | 550 __ bge(&ok); |
| 551 | 551 |
| 552 GenerateTailCallToReturnedCode(masm, Runtime::kTryInstallOptimizedCode); | 552 GenerateTailCallToReturnedCode(masm, Runtime::kTryInstallOptimizedCode); |
| 553 | 553 |
| 554 __ bind(&ok); | 554 __ bind(&ok); |
| 555 GenerateTailCallToSharedCode(masm); | 555 GenerateTailCallToSharedCode(masm); |
| 556 } | 556 } |
| 557 | 557 |
| 558 static void Generate_JSConstructStubHelper(MacroAssembler* masm, | 558 namespace { |
| 559 bool is_api_function, | 559 |
| 560 bool create_implicit_receiver, | 560 void Generate_JSConstructStubHelper(MacroAssembler* masm, bool is_api_function, |
| 561 bool check_derived_construct) { | 561 bool create_implicit_receiver, |
| 562 bool check_derived_construct) { | |
| 562 // ----------- S t a t e ------------- | 563 // ----------- S t a t e ------------- |
| 563 // -- r3 : number of arguments | 564 // -- r3 : number of arguments |
| 564 // -- r4 : constructor function | 565 // -- r4 : constructor function |
| 565 // -- r5 : allocation site or undefined | |
| 566 // -- r6 : new target | 566 // -- r6 : new target |
| 567 // -- cp : context | 567 // -- cp : context |
| 568 // -- lr : return address | 568 // -- lr : return address |
| 569 // -- sp[...]: constructor arguments | 569 // -- sp[...]: constructor arguments |
| 570 // ----------------------------------- | 570 // ----------------------------------- |
| 571 | 571 |
| 572 Isolate* isolate = masm->isolate(); | 572 Isolate* isolate = masm->isolate(); |
| 573 | 573 |
| 574 // Enter a construct frame. | 574 // Enter a construct frame. |
| 575 { | 575 { |
| 576 FrameAndConstantPoolScope scope(masm, StackFrame::CONSTRUCT); | 576 FrameAndConstantPoolScope scope(masm, StackFrame::CONSTRUCT); |
| 577 | 577 |
| 578 // Preserve the incoming parameters on the stack. | 578 // Preserve the incoming parameters on the stack. |
| 579 __ AssertUndefinedOrAllocationSite(r5, r7); | 579 __ Push(cp); |
|
JaideepBajwa
2016/10/18 22:26:59
as discussed, this Push can be removed. Otherwise
| |
| 580 | 580 |
| 581 if (!create_implicit_receiver) { | 581 if (!create_implicit_receiver) { |
| 582 __ SmiTag(r7, r3, SetRC); | 582 __ SmiTag(r7, r3, SetRC); |
| 583 __ Push(cp, r5, r7); | 583 __ Push(cp, r7); |
| 584 __ PushRoot(Heap::kTheHoleValueRootIndex); | 584 __ PushRoot(Heap::kTheHoleValueRootIndex); |
| 585 } else { | 585 } else { |
| 586 __ SmiTag(r3); | 586 __ SmiTag(r3); |
| 587 __ Push(cp, r5, r3); | 587 __ Push(cp, r3); |
| 588 | 588 |
| 589 // Allocate the new receiver object. | 589 // Allocate the new receiver object. |
| 590 __ Push(r4, r6); | 590 __ Push(r4, r6); |
| 591 FastNewObjectStub stub(masm->isolate()); | 591 FastNewObjectStub stub(masm->isolate()); |
| 592 __ CallStub(&stub); | 592 __ CallStub(&stub); |
| 593 __ mr(r7, r3); | 593 __ mr(r7, r3); |
| 594 __ Pop(r4, r6); | 594 __ Pop(r4, r6); |
| 595 | 595 |
| 596 // ----------- S t a t e ------------- | 596 // ----------- S t a t e ------------- |
| 597 // -- r4: constructor function | 597 // -- r4: constructor function |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 704 | 704 |
| 705 __ SmiToPtrArrayOffset(r4, r4); | 705 __ SmiToPtrArrayOffset(r4, r4); |
| 706 __ add(sp, sp, r4); | 706 __ add(sp, sp, r4); |
| 707 __ addi(sp, sp, Operand(kPointerSize)); | 707 __ addi(sp, sp, Operand(kPointerSize)); |
| 708 if (create_implicit_receiver) { | 708 if (create_implicit_receiver) { |
| 709 __ IncrementCounter(isolate->counters()->constructed_objects(), 1, r4, r5); | 709 __ IncrementCounter(isolate->counters()->constructed_objects(), 1, r4, r5); |
| 710 } | 710 } |
| 711 __ blr(); | 711 __ blr(); |
| 712 } | 712 } |
| 713 | 713 |
| 714 } // namespace | |
| 715 | |
| 714 void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) { | 716 void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) { |
| 715 Generate_JSConstructStubHelper(masm, false, true, false); | 717 Generate_JSConstructStubHelper(masm, false, true, false); |
| 716 } | 718 } |
| 717 | 719 |
| 718 void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) { | 720 void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) { |
| 719 Generate_JSConstructStubHelper(masm, true, false, false); | 721 Generate_JSConstructStubHelper(masm, true, false, false); |
| 720 } | 722 } |
| 721 | 723 |
| 722 void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) { | 724 void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) { |
| 723 Generate_JSConstructStubHelper(masm, false, false, false); | 725 Generate_JSConstructStubHelper(masm, false, false, false); |
| (...skipping 2271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2995 __ CallRuntime(Runtime::kThrowStackOverflow); | 2997 __ CallRuntime(Runtime::kThrowStackOverflow); |
| 2996 __ bkpt(0); | 2998 __ bkpt(0); |
| 2997 } | 2999 } |
| 2998 } | 3000 } |
| 2999 | 3001 |
| 3000 #undef __ | 3002 #undef __ |
| 3001 } // namespace internal | 3003 } // namespace internal |
| 3002 } // namespace v8 | 3004 } // namespace v8 |
| 3003 | 3005 |
| 3004 #endif // V8_TARGET_ARCH_PPC | 3006 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |