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_X87 | 7 #if V8_TARGET_ARCH_X87 |
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 3102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3113 __ mov(edx, Immediate(SmiFromSlot(expr->CallNewFeedbackSlot()))); | 3113 __ mov(edx, Immediate(SmiFromSlot(expr->CallNewFeedbackSlot()))); |
3114 | 3114 |
3115 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); | 3115 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); |
3116 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 3116 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
3117 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); | 3117 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
3118 context()->Plug(eax); | 3118 context()->Plug(eax); |
3119 } | 3119 } |
3120 | 3120 |
3121 | 3121 |
3122 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { | 3122 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { |
| 3123 if (!ValidateSuperCall(expr)) return; |
| 3124 |
3123 Variable* new_target_var = scope()->DeclarationScope()->new_target_var(); | 3125 Variable* new_target_var = scope()->DeclarationScope()->new_target_var(); |
3124 GetVar(eax, new_target_var); | 3126 GetVar(eax, new_target_var); |
3125 __ push(eax); | 3127 __ push(eax); |
3126 | 3128 |
3127 EmitLoadSuperConstructor(); | 3129 EmitLoadSuperConstructor(); |
3128 __ push(result_register()); | 3130 __ push(result_register()); |
3129 | 3131 |
3130 // Push the arguments ("left-to-right") on the stack. | 3132 // Push the arguments ("left-to-right") on the stack. |
3131 ZoneList<Expression*>* args = expr->arguments(); | 3133 ZoneList<Expression*>* args = expr->arguments(); |
3132 int arg_count = args->length(); | 3134 int arg_count = args->length(); |
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4078 StandardFrameConstants::kCallerSPOffset)); | 4080 StandardFrameConstants::kCallerSPOffset)); |
4079 Label loop; | 4081 Label loop; |
4080 __ bind(&loop); | 4082 __ bind(&loop); |
4081 __ push(Operand(edx, -1 * kPointerSize)); | 4083 __ push(Operand(edx, -1 * kPointerSize)); |
4082 __ sub(edx, Immediate(kPointerSize)); | 4084 __ sub(edx, Immediate(kPointerSize)); |
4083 __ dec(ecx); | 4085 __ dec(ecx); |
4084 __ j(not_zero, &loop); | 4086 __ j(not_zero, &loop); |
4085 } | 4087 } |
4086 | 4088 |
4087 __ bind(&args_set_up); | 4089 __ bind(&args_set_up); |
| 4090 |
4088 __ mov(edi, Operand(esp, eax, times_pointer_size, 0)); | 4091 __ mov(edi, Operand(esp, eax, times_pointer_size, 0)); |
4089 | 4092 |
4090 CallConstructStub stub(isolate(), SUPER_CONSTRUCTOR_CALL); | 4093 CallConstructStub stub(isolate(), SUPER_CONSTRUCTOR_CALL); |
4091 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 4094 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
4092 | 4095 |
4093 __ Drop(1); | 4096 __ Drop(1); |
4094 | 4097 |
4095 context()->Plug(eax); | 4098 context()->Plug(eax); |
4096 } | 4099 } |
4097 | 4100 |
(...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5328 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 5331 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
5329 Assembler::target_address_at(call_target_address, | 5332 Assembler::target_address_at(call_target_address, |
5330 unoptimized_code)); | 5333 unoptimized_code)); |
5331 return OSR_AFTER_STACK_CHECK; | 5334 return OSR_AFTER_STACK_CHECK; |
5332 } | 5335 } |
5333 | 5336 |
5334 | 5337 |
5335 } } // namespace v8::internal | 5338 } } // namespace v8::internal |
5336 | 5339 |
5337 #endif // V8_TARGET_ARCH_X87 | 5340 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |