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_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1732 __ bind(¬_array_function); | 1732 __ bind(¬_array_function); |
1733 CreateWeakCellStub weak_cell_stub(isolate); | 1733 CreateWeakCellStub weak_cell_stub(isolate); |
1734 CallStubInRecordCallTarget(masm, &weak_cell_stub, is_super); | 1734 CallStubInRecordCallTarget(masm, &weak_cell_stub, is_super); |
1735 __ bind(&done); | 1735 __ bind(&done); |
1736 } | 1736 } |
1737 | 1737 |
1738 | 1738 |
1739 void CallConstructStub::Generate(MacroAssembler* masm) { | 1739 void CallConstructStub::Generate(MacroAssembler* masm) { |
1740 // eax : number of arguments | 1740 // eax : number of arguments |
1741 // ebx : feedback vector | 1741 // ebx : feedback vector |
1742 // ecx : original constructor (for IsSuperConstructorCall) | 1742 // ecx : new target (for IsSuperConstructorCall) |
1743 // edx : slot in feedback vector (Smi, for RecordCallTarget) | 1743 // edx : slot in feedback vector (Smi, for RecordCallTarget) |
1744 // edi : constructor function | 1744 // edi : constructor function |
1745 | 1745 |
1746 if (IsSuperConstructorCall()) { | 1746 if (IsSuperConstructorCall()) { |
1747 __ push(ecx); | 1747 __ push(ecx); |
1748 } | 1748 } |
1749 | 1749 |
1750 Label non_function; | 1750 Label non_function; |
1751 // Check that function is not a smi. | 1751 // Check that function is not a smi. |
1752 __ JumpIfSmi(edi, &non_function); | 1752 __ JumpIfSmi(edi, &non_function); |
(...skipping 14 matching lines...) Expand all Loading... |
1767 __ j(equal, &feedback_register_initialized); | 1767 __ j(equal, &feedback_register_initialized); |
1768 __ mov(ebx, isolate()->factory()->undefined_value()); | 1768 __ mov(ebx, isolate()->factory()->undefined_value()); |
1769 __ bind(&feedback_register_initialized); | 1769 __ bind(&feedback_register_initialized); |
1770 | 1770 |
1771 __ AssertUndefinedOrAllocationSite(ebx); | 1771 __ AssertUndefinedOrAllocationSite(ebx); |
1772 } | 1772 } |
1773 | 1773 |
1774 if (IsSuperConstructorCall()) { | 1774 if (IsSuperConstructorCall()) { |
1775 __ pop(edx); | 1775 __ pop(edx); |
1776 } else { | 1776 } else { |
1777 // Pass original constructor to construct stub. | 1777 // Pass new target to construct stub. |
1778 __ mov(edx, edi); | 1778 __ mov(edx, edi); |
1779 } | 1779 } |
1780 | 1780 |
1781 // Tail call to the function-specific construct stub (still in the caller | 1781 // Tail call to the function-specific construct stub (still in the caller |
1782 // context at this point). | 1782 // context at this point). |
1783 __ mov(ecx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); | 1783 __ mov(ecx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
1784 __ mov(ecx, FieldOperand(ecx, SharedFunctionInfo::kConstructStubOffset)); | 1784 __ mov(ecx, FieldOperand(ecx, SharedFunctionInfo::kConstructStubOffset)); |
1785 __ lea(ecx, FieldOperand(ecx, Code::kHeaderSize)); | 1785 __ lea(ecx, FieldOperand(ecx, Code::kHeaderSize)); |
1786 __ jmp(ecx); | 1786 __ jmp(ecx); |
1787 | 1787 |
(...skipping 3644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5432 Operand(ebp, 7 * kPointerSize), NULL); | 5432 Operand(ebp, 7 * kPointerSize), NULL); |
5433 } | 5433 } |
5434 | 5434 |
5435 | 5435 |
5436 #undef __ | 5436 #undef __ |
5437 | 5437 |
5438 } // namespace internal | 5438 } // namespace internal |
5439 } // namespace v8 | 5439 } // namespace v8 |
5440 | 5440 |
5441 #endif // V8_TARGET_ARCH_X87 | 5441 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |