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/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 3074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3085 DCHECK(expr->AllocationSiteFeedbackSlot().ToInt() == | 3085 DCHECK(expr->AllocationSiteFeedbackSlot().ToInt() == |
3086 expr->CallNewFeedbackSlot().ToInt() + 1); | 3086 expr->CallNewFeedbackSlot().ToInt() + 1); |
3087 } | 3087 } |
3088 | 3088 |
3089 __ LoadHeapObject(ebx, FeedbackVector()); | 3089 __ LoadHeapObject(ebx, FeedbackVector()); |
3090 __ mov(edx, Immediate(SmiFromSlot(expr->CallNewFeedbackSlot()))); | 3090 __ mov(edx, Immediate(SmiFromSlot(expr->CallNewFeedbackSlot()))); |
3091 | 3091 |
3092 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); | 3092 CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET); |
3093 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 3093 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
3094 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); | 3094 PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
| 3095 // Restore context register. |
| 3096 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
3095 context()->Plug(eax); | 3097 context()->Plug(eax); |
3096 } | 3098 } |
3097 | 3099 |
3098 | 3100 |
3099 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { | 3101 void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) { |
3100 SuperCallReference* super_call_ref = | 3102 SuperCallReference* super_call_ref = |
3101 expr->expression()->AsSuperCallReference(); | 3103 expr->expression()->AsSuperCallReference(); |
3102 DCHECK_NOT_NULL(super_call_ref); | 3104 DCHECK_NOT_NULL(super_call_ref); |
3103 | 3105 |
3104 EmitLoadSuperConstructor(super_call_ref); | 3106 EmitLoadSuperConstructor(super_call_ref); |
(...skipping 29 matching lines...) Expand all Loading... |
3134 } | 3136 } |
3135 | 3137 |
3136 __ LoadHeapObject(ebx, FeedbackVector()); | 3138 __ LoadHeapObject(ebx, FeedbackVector()); |
3137 __ mov(edx, Immediate(SmiFromSlot(expr->CallFeedbackSlot()))); | 3139 __ mov(edx, Immediate(SmiFromSlot(expr->CallFeedbackSlot()))); |
3138 | 3140 |
3139 CallConstructStub stub(isolate(), SUPER_CALL_RECORD_TARGET); | 3141 CallConstructStub stub(isolate(), SUPER_CALL_RECORD_TARGET); |
3140 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 3142 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
3141 | 3143 |
3142 RecordJSReturnSite(expr); | 3144 RecordJSReturnSite(expr); |
3143 | 3145 |
| 3146 // Restore context register. |
| 3147 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
3144 context()->Plug(eax); | 3148 context()->Plug(eax); |
3145 } | 3149 } |
3146 | 3150 |
3147 | 3151 |
3148 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { | 3152 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { |
3149 ZoneList<Expression*>* args = expr->arguments(); | 3153 ZoneList<Expression*>* args = expr->arguments(); |
3150 DCHECK(args->length() == 1); | 3154 DCHECK(args->length() == 1); |
3151 | 3155 |
3152 VisitForAccumulatorValue(args->at(0)); | 3156 VisitForAccumulatorValue(args->at(0)); |
3153 | 3157 |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4048 __ j(not_zero, &loop); | 4052 __ j(not_zero, &loop); |
4049 } | 4053 } |
4050 | 4054 |
4051 __ bind(&args_set_up); | 4055 __ bind(&args_set_up); |
4052 | 4056 |
4053 __ mov(edi, Operand(esp, eax, times_pointer_size, 0)); | 4057 __ mov(edi, Operand(esp, eax, times_pointer_size, 0)); |
4054 __ mov(ebx, Immediate(isolate()->factory()->undefined_value())); | 4058 __ mov(ebx, Immediate(isolate()->factory()->undefined_value())); |
4055 CallConstructStub stub(isolate(), SUPER_CONSTRUCTOR_CALL); | 4059 CallConstructStub stub(isolate(), SUPER_CONSTRUCTOR_CALL); |
4056 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); | 4060 __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL); |
4057 | 4061 |
4058 __ Drop(1); | 4062 // Restore context register. |
| 4063 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
4059 | 4064 |
4060 context()->Plug(eax); | 4065 context()->DropAndPlug(1, eax); |
4061 } | 4066 } |
4062 | 4067 |
4063 | 4068 |
4064 void FullCodeGenerator::EmitRegExpConstructResult(CallRuntime* expr) { | 4069 void FullCodeGenerator::EmitRegExpConstructResult(CallRuntime* expr) { |
4065 // Load the arguments on the stack and call the stub. | 4070 // Load the arguments on the stack and call the stub. |
4066 RegExpConstructResultStub stub(isolate()); | 4071 RegExpConstructResultStub stub(isolate()); |
4067 ZoneList<Expression*>* args = expr->arguments(); | 4072 ZoneList<Expression*>* args = expr->arguments(); |
4068 DCHECK(args->length() == 3); | 4073 DCHECK(args->length() == 3); |
4069 VisitForStackValue(args->at(0)); | 4074 VisitForStackValue(args->at(0)); |
4070 VisitForStackValue(args->at(1)); | 4075 VisitForStackValue(args->at(1)); |
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5237 Assembler::target_address_at(call_target_address, | 5242 Assembler::target_address_at(call_target_address, |
5238 unoptimized_code)); | 5243 unoptimized_code)); |
5239 return OSR_AFTER_STACK_CHECK; | 5244 return OSR_AFTER_STACK_CHECK; |
5240 } | 5245 } |
5241 | 5246 |
5242 | 5247 |
5243 } // namespace internal | 5248 } // namespace internal |
5244 } // namespace v8 | 5249 } // namespace v8 |
5245 | 5250 |
5246 #endif // V8_TARGET_ARCH_IA32 | 5251 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |