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_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.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 1786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1797 __ Push(rdi); | 1797 __ Push(rdi); |
1798 __ CallRuntime(Runtime::kThrowCalledNonCallable, 1); | 1798 __ CallRuntime(Runtime::kThrowCalledNonCallable, 1); |
1799 } | 1799 } |
1800 } | 1800 } |
1801 | 1801 |
1802 | 1802 |
1803 // static | 1803 // static |
1804 void Builtins::Generate_ConstructFunction(MacroAssembler* masm) { | 1804 void Builtins::Generate_ConstructFunction(MacroAssembler* masm) { |
1805 // ----------- S t a t e ------------- | 1805 // ----------- S t a t e ------------- |
1806 // -- rax : the number of arguments (not including the receiver) | 1806 // -- rax : the number of arguments (not including the receiver) |
1807 // -- rdx : the new target (checked to be a JSFunction) | 1807 // -- rdx : the new target (checked to be a constructor) |
1808 // -- rdi : the constructor to call (checked to be a JSFunction) | 1808 // -- rdi : the constructor to call (checked to be a JSFunction) |
1809 // ----------------------------------- | 1809 // ----------------------------------- |
1810 __ AssertFunction(rdx); | |
1811 __ AssertFunction(rdi); | 1810 __ AssertFunction(rdi); |
1812 | 1811 |
1813 // Calling convention for function specific ConstructStubs require | 1812 // Calling convention for function specific ConstructStubs require |
1814 // rbx to contain either an AllocationSite or undefined. | 1813 // rbx to contain either an AllocationSite or undefined. |
1815 __ LoadRoot(rbx, Heap::kUndefinedValueRootIndex); | 1814 __ LoadRoot(rbx, Heap::kUndefinedValueRootIndex); |
1816 | 1815 |
1817 // Tail call to the function-specific construct stub (still in the caller | 1816 // Tail call to the function-specific construct stub (still in the caller |
1818 // context at this point). | 1817 // context at this point). |
1819 __ movp(rcx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); | 1818 __ movp(rcx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); |
1820 __ movp(rcx, FieldOperand(rcx, SharedFunctionInfo::kConstructStubOffset)); | 1819 __ movp(rcx, FieldOperand(rcx, SharedFunctionInfo::kConstructStubOffset)); |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2063 __ ret(0); | 2062 __ ret(0); |
2064 } | 2063 } |
2065 | 2064 |
2066 | 2065 |
2067 #undef __ | 2066 #undef __ |
2068 | 2067 |
2069 } // namespace internal | 2068 } // namespace internal |
2070 } // namespace v8 | 2069 } // namespace v8 |
2071 | 2070 |
2072 #endif // V8_TARGET_ARCH_X64 | 2071 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |