| 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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 } | 457 } |
| 458 EmitProfilingCounterDecrement(weight); | 458 EmitProfilingCounterDecrement(weight); |
| 459 Label ok; | 459 Label ok; |
| 460 __ j(positive, &ok, Label::kNear); | 460 __ j(positive, &ok, Label::kNear); |
| 461 __ push(eax); | 461 __ push(eax); |
| 462 __ call(isolate()->builtins()->InterruptCheck(), | 462 __ call(isolate()->builtins()->InterruptCheck(), |
| 463 RelocInfo::CODE_TARGET); | 463 RelocInfo::CODE_TARGET); |
| 464 __ pop(eax); | 464 __ pop(eax); |
| 465 EmitProfilingCounterReset(); | 465 EmitProfilingCounterReset(); |
| 466 __ bind(&ok); | 466 __ bind(&ok); |
| 467 #ifdef DEBUG | 467 |
| 468 // Add a label for checking the size of the code used for returning. | |
| 469 Label check_exit_codesize; | |
| 470 masm_->bind(&check_exit_codesize); | |
| 471 #endif | |
| 472 SetReturnPosition(function()); | 468 SetReturnPosition(function()); |
| 473 __ RecordJSReturn(); | |
| 474 // Do not use the leave instruction here because it is too short to | |
| 475 // patch with the code required by the debugger. | |
| 476 __ mov(esp, ebp); | |
| 477 int no_frame_start = masm_->pc_offset(); | 469 int no_frame_start = masm_->pc_offset(); |
| 478 __ pop(ebp); | 470 __ leave(); |
| 479 | 471 |
| 480 int arg_count = info_->scope()->num_parameters() + 1; | 472 int arg_count = info_->scope()->num_parameters() + 1; |
| 481 int arguments_bytes = arg_count * kPointerSize; | 473 int arguments_bytes = arg_count * kPointerSize; |
| 482 __ Ret(arguments_bytes, ecx); | 474 __ Ret(arguments_bytes, ecx); |
| 483 // Check that the size of the code used for returning is large enough | |
| 484 // for the debugger's requirements. | |
| 485 DCHECK(Assembler::kJSReturnSequenceLength <= | |
| 486 masm_->SizeOfCodeGeneratedSince(&check_exit_codesize)); | |
| 487 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); | 475 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); |
| 488 } | 476 } |
| 489 } | 477 } |
| 490 | 478 |
| 491 | 479 |
| 492 void FullCodeGenerator::EffectContext::Plug(Variable* var) const { | 480 void FullCodeGenerator::EffectContext::Plug(Variable* var) const { |
| 493 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 481 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
| 494 } | 482 } |
| 495 | 483 |
| 496 | 484 |
| (...skipping 4997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5494 Assembler::target_address_at(call_target_address, | 5482 Assembler::target_address_at(call_target_address, |
| 5495 unoptimized_code)); | 5483 unoptimized_code)); |
| 5496 return OSR_AFTER_STACK_CHECK; | 5484 return OSR_AFTER_STACK_CHECK; |
| 5497 } | 5485 } |
| 5498 | 5486 |
| 5499 | 5487 |
| 5500 } // namespace internal | 5488 } // namespace internal |
| 5501 } // namespace v8 | 5489 } // namespace v8 |
| 5502 | 5490 |
| 5503 #endif // V8_TARGET_ARCH_IA32 | 5491 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |