| 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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 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 2014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2025 __ bind(¬_array_function); | 2025 __ bind(¬_array_function); |
| 2026 CreateWeakCellStub weak_cell_stub(isolate); | 2026 CreateWeakCellStub weak_cell_stub(isolate); |
| 2027 CallStubInRecordCallTarget(masm, &weak_cell_stub, is_super); | 2027 CallStubInRecordCallTarget(masm, &weak_cell_stub, is_super); |
| 2028 __ bind(&done); | 2028 __ bind(&done); |
| 2029 } | 2029 } |
| 2030 | 2030 |
| 2031 | 2031 |
| 2032 void CallConstructStub::Generate(MacroAssembler* masm) { | 2032 void CallConstructStub::Generate(MacroAssembler* masm) { |
| 2033 // eax : number of arguments | 2033 // eax : number of arguments |
| 2034 // ebx : feedback vector | 2034 // ebx : feedback vector |
| 2035 // ecx : original constructor (for IsSuperConstructorCall) | 2035 // ecx : new target (for IsSuperConstructorCall) |
| 2036 // edx : slot in feedback vector (Smi, for RecordCallTarget) | 2036 // edx : slot in feedback vector (Smi, for RecordCallTarget) |
| 2037 // edi : constructor function | 2037 // edi : constructor function |
| 2038 | 2038 |
| 2039 if (IsSuperConstructorCall()) { | 2039 if (IsSuperConstructorCall()) { |
| 2040 __ push(ecx); | 2040 __ push(ecx); |
| 2041 } | 2041 } |
| 2042 | 2042 |
| 2043 Label non_function; | 2043 Label non_function; |
| 2044 // Check that function is not a smi. | 2044 // Check that function is not a smi. |
| 2045 __ JumpIfSmi(edi, &non_function); | 2045 __ JumpIfSmi(edi, &non_function); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 2060 __ j(equal, &feedback_register_initialized); | 2060 __ j(equal, &feedback_register_initialized); |
| 2061 __ mov(ebx, isolate()->factory()->undefined_value()); | 2061 __ mov(ebx, isolate()->factory()->undefined_value()); |
| 2062 __ bind(&feedback_register_initialized); | 2062 __ bind(&feedback_register_initialized); |
| 2063 | 2063 |
| 2064 __ AssertUndefinedOrAllocationSite(ebx); | 2064 __ AssertUndefinedOrAllocationSite(ebx); |
| 2065 } | 2065 } |
| 2066 | 2066 |
| 2067 if (IsSuperConstructorCall()) { | 2067 if (IsSuperConstructorCall()) { |
| 2068 __ pop(edx); | 2068 __ pop(edx); |
| 2069 } else { | 2069 } else { |
| 2070 // Pass original constructor to construct stub. | 2070 // Pass new target to construct stub. |
| 2071 __ mov(edx, edi); | 2071 __ mov(edx, edi); |
| 2072 } | 2072 } |
| 2073 | 2073 |
| 2074 // Tail call to the function-specific construct stub (still in the caller | 2074 // Tail call to the function-specific construct stub (still in the caller |
| 2075 // context at this point). | 2075 // context at this point). |
| 2076 __ mov(ecx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); | 2076 __ mov(ecx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
| 2077 __ mov(ecx, FieldOperand(ecx, SharedFunctionInfo::kConstructStubOffset)); | 2077 __ mov(ecx, FieldOperand(ecx, SharedFunctionInfo::kConstructStubOffset)); |
| 2078 __ lea(ecx, FieldOperand(ecx, Code::kHeaderSize)); | 2078 __ lea(ecx, FieldOperand(ecx, Code::kHeaderSize)); |
| 2079 __ jmp(ecx); | 2079 __ jmp(ecx); |
| 2080 | 2080 |
| (...skipping 3671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5752 Operand(ebp, 7 * kPointerSize), NULL); | 5752 Operand(ebp, 7 * kPointerSize), NULL); |
| 5753 } | 5753 } |
| 5754 | 5754 |
| 5755 | 5755 |
| 5756 #undef __ | 5756 #undef __ |
| 5757 | 5757 |
| 5758 } // namespace internal | 5758 } // namespace internal |
| 5759 } // namespace v8 | 5759 } // namespace v8 |
| 5760 | 5760 |
| 5761 #endif // V8_TARGET_ARCH_IA32 | 5761 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |