| 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 #endif | 411 #endif |
| 412 SetSourcePosition(function()->end_position() - 1); | 412 SetSourcePosition(function()->end_position() - 1); |
| 413 __ RecordJSReturn(); | 413 __ RecordJSReturn(); |
| 414 // Do not use the leave instruction here because it is too short to | 414 // Do not use the leave instruction here because it is too short to |
| 415 // patch with the code required by the debugger. | 415 // patch with the code required by the debugger. |
| 416 __ mov(esp, ebp); | 416 __ mov(esp, ebp); |
| 417 int no_frame_start = masm_->pc_offset(); | 417 int no_frame_start = masm_->pc_offset(); |
| 418 __ pop(ebp); | 418 __ pop(ebp); |
| 419 | 419 |
| 420 int arg_count = info_->scope()->num_parameters() + 1; | 420 int arg_count = info_->scope()->num_parameters() + 1; |
| 421 if (FLAG_experimental_classes && | 421 if (IsSubclassConstructor(info_->function()->kind())) { |
| 422 IsSubclassConstructor(info_->function()->kind())) { | |
| 423 arg_count++; | 422 arg_count++; |
| 424 } | 423 } |
| 425 int arguments_bytes = arg_count * kPointerSize; | 424 int arguments_bytes = arg_count * kPointerSize; |
| 426 __ Ret(arguments_bytes, ecx); | 425 __ Ret(arguments_bytes, ecx); |
| 427 // Check that the size of the code used for returning is large enough | 426 // Check that the size of the code used for returning is large enough |
| 428 // for the debugger's requirements. | 427 // for the debugger's requirements. |
| 429 DCHECK(Assembler::kJSReturnSequenceLength <= | 428 DCHECK(Assembler::kJSReturnSequenceLength <= |
| 430 masm_->SizeOfCodeGeneratedSince(&check_exit_codesize)); | 429 masm_->SizeOfCodeGeneratedSince(&check_exit_codesize)); |
| 431 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); | 430 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); |
| 432 } | 431 } |
| (...skipping 2630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3063 PreservePositionScope scope(masm()->positions_recorder()); | 3062 PreservePositionScope scope(masm()->positions_recorder()); |
| 3064 VisitForStackValue(property->obj()); | 3063 VisitForStackValue(property->obj()); |
| 3065 } | 3064 } |
| 3066 if (is_named_call) { | 3065 if (is_named_call) { |
| 3067 EmitCallWithLoadIC(expr); | 3066 EmitCallWithLoadIC(expr); |
| 3068 } else { | 3067 } else { |
| 3069 EmitKeyedCallWithLoadIC(expr, property->key()); | 3068 EmitKeyedCallWithLoadIC(expr, property->key()); |
| 3070 } | 3069 } |
| 3071 } | 3070 } |
| 3072 } else if (call_type == Call::SUPER_CALL) { | 3071 } else if (call_type == Call::SUPER_CALL) { |
| 3073 if (FLAG_experimental_classes) { | 3072 EmitSuperConstructorCall(expr); |
| 3074 EmitSuperConstructorCall(expr); | |
| 3075 } else { | |
| 3076 SuperReference* super_ref = callee->AsSuperReference(); | |
| 3077 EmitLoadSuperConstructor(); | |
| 3078 __ push(result_register()); | |
| 3079 VisitForStackValue(super_ref->this_var()); | |
| 3080 EmitCall(expr, CallICState::METHOD); | |
| 3081 } | |
| 3082 } else { | 3073 } else { |
| 3083 DCHECK(call_type == Call::OTHER_CALL); | 3074 DCHECK(call_type == Call::OTHER_CALL); |
| 3084 // Call to an arbitrary expression not handled specially above. | 3075 // Call to an arbitrary expression not handled specially above. |
| 3085 { PreservePositionScope scope(masm()->positions_recorder()); | 3076 { PreservePositionScope scope(masm()->positions_recorder()); |
| 3086 VisitForStackValue(callee); | 3077 VisitForStackValue(callee); |
| 3087 } | 3078 } |
| 3088 __ push(Immediate(isolate()->factory()->undefined_value())); | 3079 __ push(Immediate(isolate()->factory()->undefined_value())); |
| 3089 // Emit function call. | 3080 // Emit function call. |
| 3090 EmitCall(expr); | 3081 EmitCall(expr); |
| 3091 } | 3082 } |
| (...skipping 2262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5354 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 5345 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
| 5355 Assembler::target_address_at(call_target_address, | 5346 Assembler::target_address_at(call_target_address, |
| 5356 unoptimized_code)); | 5347 unoptimized_code)); |
| 5357 return OSR_AFTER_STACK_CHECK; | 5348 return OSR_AFTER_STACK_CHECK; |
| 5358 } | 5349 } |
| 5359 | 5350 |
| 5360 | 5351 |
| 5361 } } // namespace v8::internal | 5352 } } // namespace v8::internal |
| 5362 | 5353 |
| 5363 #endif // V8_TARGET_ARCH_IA32 | 5354 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |