| 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 Label ok; | 539 Label ok; |
| 540 __ LoadRoot(a4, Heap::kStackLimitRootIndex); | 540 __ LoadRoot(a4, Heap::kStackLimitRootIndex); |
| 541 __ Branch(&ok, hs, sp, Operand(a4)); | 541 __ Branch(&ok, hs, sp, Operand(a4)); |
| 542 | 542 |
| 543 GenerateTailCallToReturnedCode(masm, Runtime::kTryInstallOptimizedCode); | 543 GenerateTailCallToReturnedCode(masm, Runtime::kTryInstallOptimizedCode); |
| 544 | 544 |
| 545 __ bind(&ok); | 545 __ bind(&ok); |
| 546 GenerateTailCallToSharedCode(masm); | 546 GenerateTailCallToSharedCode(masm); |
| 547 } | 547 } |
| 548 | 548 |
| 549 static void Generate_JSConstructStubHelper(MacroAssembler* masm, | 549 namespace { |
| 550 bool is_api_function, | 550 |
| 551 bool create_implicit_receiver, | 551 void Generate_JSConstructStubHelper(MacroAssembler* masm, bool is_api_function, |
| 552 bool check_derived_construct) { | 552 bool create_implicit_receiver, |
| 553 bool check_derived_construct) { |
| 553 // ----------- S t a t e ------------- | 554 // ----------- S t a t e ------------- |
| 554 // -- a0 : number of arguments | 555 // -- a0 : number of arguments |
| 555 // -- a1 : constructor function | 556 // -- a1 : constructor function |
| 556 // -- a2 : allocation site or undefined | |
| 557 // -- a3 : new target | 557 // -- a3 : new target |
| 558 // -- cp : context | 558 // -- cp : context |
| 559 // -- ra : return address | 559 // -- ra : return address |
| 560 // -- sp[...]: constructor arguments | 560 // -- sp[...]: constructor arguments |
| 561 // ----------------------------------- | 561 // ----------------------------------- |
| 562 | 562 |
| 563 Isolate* isolate = masm->isolate(); | 563 Isolate* isolate = masm->isolate(); |
| 564 | 564 |
| 565 // Enter a construct frame. | 565 // Enter a construct frame. |
| 566 { | 566 { |
| 567 FrameScope scope(masm, StackFrame::CONSTRUCT); | 567 FrameScope scope(masm, StackFrame::CONSTRUCT); |
| 568 | 568 |
| 569 // Preserve the incoming parameters on the stack. | 569 // Preserve the incoming parameters on the stack. |
| 570 __ AssertUndefinedOrAllocationSite(a2, t0); | |
| 571 __ SmiTag(a0); | 570 __ SmiTag(a0); |
| 572 __ Push(cp, a2, a0); | 571 __ Push(cp, a0); |
| 573 | 572 |
| 574 if (create_implicit_receiver) { | 573 if (create_implicit_receiver) { |
| 575 __ Push(a1, a3); | 574 __ Push(a1, a3); |
| 576 FastNewObjectStub stub(masm->isolate()); | 575 FastNewObjectStub stub(masm->isolate()); |
| 577 __ CallStub(&stub); | 576 __ CallStub(&stub); |
| 578 __ mov(t0, v0); | 577 __ mov(t0, v0); |
| 579 __ Pop(a1, a3); | 578 __ Pop(a1, a3); |
| 580 | 579 |
| 581 // ----------- S t a t e ------------- | 580 // ----------- S t a t e ------------- |
| 582 // -- a1: constructor function | 581 // -- a1: constructor function |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 | 685 |
| 687 __ SmiScale(a4, a1, kPointerSizeLog2); | 686 __ SmiScale(a4, a1, kPointerSizeLog2); |
| 688 __ Daddu(sp, sp, a4); | 687 __ Daddu(sp, sp, a4); |
| 689 __ Daddu(sp, sp, kPointerSize); | 688 __ Daddu(sp, sp, kPointerSize); |
| 690 if (create_implicit_receiver) { | 689 if (create_implicit_receiver) { |
| 691 __ IncrementCounter(isolate->counters()->constructed_objects(), 1, a1, a2); | 690 __ IncrementCounter(isolate->counters()->constructed_objects(), 1, a1, a2); |
| 692 } | 691 } |
| 693 __ Ret(); | 692 __ Ret(); |
| 694 } | 693 } |
| 695 | 694 |
| 695 } // namespace |
| 696 |
| 696 void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) { | 697 void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) { |
| 697 Generate_JSConstructStubHelper(masm, false, true, false); | 698 Generate_JSConstructStubHelper(masm, false, true, false); |
| 698 } | 699 } |
| 699 | 700 |
| 700 void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) { | 701 void Builtins::Generate_JSConstructStubApi(MacroAssembler* masm) { |
| 701 Generate_JSConstructStubHelper(masm, true, false, false); | 702 Generate_JSConstructStubHelper(masm, true, false, false); |
| 702 } | 703 } |
| 703 | 704 |
| 704 void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) { | 705 void Builtins::Generate_JSBuiltinsConstructStub(MacroAssembler* masm) { |
| 705 Generate_JSConstructStubHelper(masm, false, false, false); | 706 Generate_JSConstructStubHelper(masm, false, false, false); |
| (...skipping 2270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2976 __ break_(0xCC); | 2977 __ break_(0xCC); |
| 2977 } | 2978 } |
| 2978 } | 2979 } |
| 2979 | 2980 |
| 2980 #undef __ | 2981 #undef __ |
| 2981 | 2982 |
| 2982 } // namespace internal | 2983 } // namespace internal |
| 2983 } // namespace v8 | 2984 } // namespace v8 |
| 2984 | 2985 |
| 2985 #endif // V8_TARGET_ARCH_MIPS64 | 2986 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |