| 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/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
| (...skipping 3053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3064 | 3064 |
| 3065 // Call the construct call builtin that handles allocation and | 3065 // Call the construct call builtin that handles allocation and |
| 3066 // constructor invocation. | 3066 // constructor invocation. |
| 3067 SetConstructCallPosition(expr); | 3067 SetConstructCallPosition(expr); |
| 3068 | 3068 |
| 3069 // Load function and argument count into edi and eax. | 3069 // Load function and argument count into edi and eax. |
| 3070 __ Move(eax, Immediate(arg_count)); | 3070 __ Move(eax, Immediate(arg_count)); |
| 3071 __ mov(edi, Operand(esp, arg_count * kPointerSize)); | 3071 __ mov(edi, Operand(esp, arg_count * kPointerSize)); |
| 3072 | 3072 |
| 3073 // Record call targets in unoptimized code. | 3073 // Record call targets in unoptimized code. |
| 3074 if (FLAG_pretenuring_call_new) { | |
| 3075 EnsureSlotContainsAllocationSite(expr->AllocationSiteFeedbackSlot()); | |
| 3076 DCHECK(expr->AllocationSiteFeedbackSlot().ToInt() == | |
| 3077 expr->CallNewFeedbackSlot().ToInt() + 1); | |
| 3078 } | |
| 3079 | |
| 3080 __ LoadHeapObject(ebx, FeedbackVector()); | 3074 __ LoadHeapObject(ebx, FeedbackVector()); |
| 3081 __ mov(edx, Immediate(SmiFromSlot(expr->CallNewFeedbackSlot()))); | 3075 __ mov(edx, Immediate(SmiFromSlot(expr->CallNewFeedbackSlot()))); |
| 3082 | 3076 |
| 3083 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); | 3077 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); |
| 3084 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 3078 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
| 3085 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); | 3079 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
| 3086 // Restore context register. | 3080 // Restore context register. |
| 3087 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 3081 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
| 3088 context()->Plug(eax); | 3082 context()->Plug(eax); |
| 3089 } | 3083 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 3110 | 3104 |
| 3111 // Load original constructor into ecx. | 3105 // Load original constructor into ecx. |
| 3112 VisitForAccumulatorValue(super_call_ref->new_target_var()); | 3106 VisitForAccumulatorValue(super_call_ref->new_target_var()); |
| 3113 __ mov(ecx, result_register()); | 3107 __ mov(ecx, result_register()); |
| 3114 | 3108 |
| 3115 // Load function and argument count into edi and eax. | 3109 // Load function and argument count into edi and eax. |
| 3116 __ Move(eax, Immediate(arg_count)); | 3110 __ Move(eax, Immediate(arg_count)); |
| 3117 __ mov(edi, Operand(esp, arg_count * kPointerSize)); | 3111 __ mov(edi, Operand(esp, arg_count * kPointerSize)); |
| 3118 | 3112 |
| 3119 // Record call targets in unoptimized code. | 3113 // Record call targets in unoptimized code. |
| 3120 if (FLAG_pretenuring_call_new) { | |
| 3121 UNREACHABLE(); | |
| 3122 /* TODO(dslomov): support pretenuring. | |
| 3123 EnsureSlotContainsAllocationSite(expr->AllocationSiteFeedbackSlot()); | |
| 3124 DCHECK(expr->AllocationSiteFeedbackSlot().ToInt() == | |
| 3125 expr->CallNewFeedbackSlot().ToInt() + 1); | |
| 3126 */ | |
| 3127 } | |
| 3128 | |
| 3129 __ LoadHeapObject(ebx, FeedbackVector()); | 3114 __ LoadHeapObject(ebx, FeedbackVector()); |
| 3130 __ mov(edx, Immediate(SmiFromSlot(expr->CallFeedbackSlot()))); | 3115 __ mov(edx, Immediate(SmiFromSlot(expr->CallFeedbackSlot()))); |
| 3131 | 3116 |
| 3132 CallConstructStub stub(isolate(), SUPER_CALL_RECORD_TARGET); | 3117 CallConstructStub stub(isolate(), SUPER_CALL_RECORD_TARGET); |
| 3133 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 3118 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
| 3134 | 3119 |
| 3135 RecordJSReturnSite(expr); | 3120 RecordJSReturnSite(expr); |
| 3136 | 3121 |
| 3137 // Restore context register. | 3122 // Restore context register. |
| 3138 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 3123 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
| (...skipping 2003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5142 Assembler::target_address_at(call_target_address, | 5127 Assembler::target_address_at(call_target_address, |
| 5143 unoptimized_code)); | 5128 unoptimized_code)); |
| 5144 return OSR_AFTER_STACK_CHECK; | 5129 return OSR_AFTER_STACK_CHECK; |
| 5145 } | 5130 } |
| 5146 | 5131 |
| 5147 | 5132 |
| 5148 } // namespace internal | 5133 } // namespace internal |
| 5149 } // namespace v8 | 5134 } // namespace v8 |
| 5150 | 5135 |
| 5151 #endif // V8_TARGET_ARCH_X87 | 5136 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |