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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 3124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3135 __ mov(edx, Immediate(SmiFromSlot(expr->CallNewFeedbackSlot()))); | 3135 __ mov(edx, Immediate(SmiFromSlot(expr->CallNewFeedbackSlot()))); |
3136 | 3136 |
3137 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); | 3137 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); |
3138 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 3138 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
3139 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); | 3139 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
3140 context()->Plug(eax); | 3140 context()->Plug(eax); |
3141 } | 3141 } |
3142 | 3142 |
3143 | 3143 |
3144 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { | 3144 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { |
| 3145 if (!ValidateSuperCall(expr)) return; |
| 3146 |
3145 Variable* new_target_var = scope()->DeclarationScope()->new_target_var(); | 3147 Variable* new_target_var = scope()->DeclarationScope()->new_target_var(); |
3146 GetVar(eax, new_target_var); | 3148 GetVar(eax, new_target_var); |
3147 __ push(eax); | 3149 __ push(eax); |
3148 | 3150 |
3149 EmitLoadSuperConstructor(); | 3151 EmitLoadSuperConstructor(); |
3150 __ push(result_register()); | 3152 __ push(result_register()); |
3151 | 3153 |
3152 // Push the arguments ("left-to-right") on the stack. | 3154 // Push the arguments ("left-to-right") on the stack. |
3153 ZoneList<Expression*>* args = expr->arguments(); | 3155 ZoneList<Expression*>* args = expr->arguments(); |
3154 int arg_count = args->length(); | 3156 int arg_count = args->length(); |
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4101 StandardFrameConstants::kCallerSPOffset)); | 4103 StandardFrameConstants::kCallerSPOffset)); |
4102 Label loop; | 4104 Label loop; |
4103 __ bind(&loop); | 4105 __ bind(&loop); |
4104 __ push(Operand(edx, -1 * kPointerSize)); | 4106 __ push(Operand(edx, -1 * kPointerSize)); |
4105 __ sub(edx, Immediate(kPointerSize)); | 4107 __ sub(edx, Immediate(kPointerSize)); |
4106 __ dec(ecx); | 4108 __ dec(ecx); |
4107 __ j(not_zero, &loop); | 4109 __ j(not_zero, &loop); |
4108 } | 4110 } |
4109 | 4111 |
4110 __ bind(&args_set_up); | 4112 __ bind(&args_set_up); |
| 4113 |
4111 __ mov(edi, Operand(esp, eax, times_pointer_size, 0)); | 4114 __ mov(edi, Operand(esp, eax, times_pointer_size, 0)); |
4112 | 4115 |
4113 CallConstructStub stub(isolate(), SUPER_CONSTRUCTOR_CALL); | 4116 CallConstructStub stub(isolate(), SUPER_CONSTRUCTOR_CALL); |
4114 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 4117 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
4115 | 4118 |
4116 __ Drop(1); | 4119 __ Drop(1); |
4117 | 4120 |
4118 context()->Plug(eax); | 4121 context()->Plug(eax); |
4119 } | 4122 } |
4120 | 4123 |
(...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5351 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 5354 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
5352 Assembler::target_address_at(call_target_address, | 5355 Assembler::target_address_at(call_target_address, |
5353 unoptimized_code)); | 5356 unoptimized_code)); |
5354 return OSR_AFTER_STACK_CHECK; | 5357 return OSR_AFTER_STACK_CHECK; |
5355 } | 5358 } |
5356 | 5359 |
5357 | 5360 |
5358 } } // namespace v8::internal | 5361 } } // namespace v8::internal |
5359 | 5362 |
5360 #endif // V8_TARGET_ARCH_IA32 | 5363 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |