| 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/codegen.h" | 8 #include "src/codegen.h" |
| 9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
| 10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 // Store resume mode into generator object. | 385 // Store resume mode into generator object. |
| 386 __ mov(FieldOperand(ebx, JSGeneratorObject::kResumeModeOffset), edx); | 386 __ mov(FieldOperand(ebx, JSGeneratorObject::kResumeModeOffset), edx); |
| 387 | 387 |
| 388 // Load suspended function and context. | 388 // Load suspended function and context. |
| 389 __ mov(esi, FieldOperand(ebx, JSGeneratorObject::kContextOffset)); | 389 __ mov(esi, FieldOperand(ebx, JSGeneratorObject::kContextOffset)); |
| 390 __ mov(edi, FieldOperand(ebx, JSGeneratorObject::kFunctionOffset)); | 390 __ mov(edi, FieldOperand(ebx, JSGeneratorObject::kFunctionOffset)); |
| 391 | 391 |
| 392 // Flood function if we are stepping. | 392 // Flood function if we are stepping. |
| 393 Label prepare_step_in_if_stepping, prepare_step_in_suspended_generator; | 393 Label prepare_step_in_if_stepping, prepare_step_in_suspended_generator; |
| 394 Label stepping_prepared; | 394 Label stepping_prepared; |
| 395 ExternalReference last_step_action = | 395 ExternalReference debug_hook = |
| 396 ExternalReference::debug_last_step_action_address(masm->isolate()); | 396 ExternalReference::debug_hook_on_function_call_address(masm->isolate()); |
| 397 STATIC_ASSERT(StepFrame > StepIn); | 397 __ cmpb(Operand::StaticVariable(debug_hook), Immediate(0)); |
| 398 __ cmpb(Operand::StaticVariable(last_step_action), Immediate(StepIn)); | 398 __ j(not_equal, &prepare_step_in_if_stepping); |
| 399 __ j(greater_equal, &prepare_step_in_if_stepping); | |
| 400 | 399 |
| 401 // Flood function if we need to continue stepping in the suspended generator. | 400 // Flood function if we need to continue stepping in the suspended generator. |
| 402 ExternalReference debug_suspended_generator = | 401 ExternalReference debug_suspended_generator = |
| 403 ExternalReference::debug_suspended_generator_address(masm->isolate()); | 402 ExternalReference::debug_suspended_generator_address(masm->isolate()); |
| 404 __ cmp(ebx, Operand::StaticVariable(debug_suspended_generator)); | 403 __ cmp(ebx, Operand::StaticVariable(debug_suspended_generator)); |
| 405 __ j(equal, &prepare_step_in_suspended_generator); | 404 __ j(equal, &prepare_step_in_suspended_generator); |
| 406 __ bind(&stepping_prepared); | 405 __ bind(&stepping_prepared); |
| 407 | 406 |
| 408 // Pop return address. | 407 // Pop return address. |
| 409 __ PopReturnAddressTo(eax); | 408 __ PopReturnAddressTo(eax); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 __ mov(edx, ebx); | 456 __ mov(edx, ebx); |
| 458 __ jmp(FieldOperand(edi, JSFunction::kCodeEntryOffset)); | 457 __ jmp(FieldOperand(edi, JSFunction::kCodeEntryOffset)); |
| 459 } | 458 } |
| 460 | 459 |
| 461 __ bind(&prepare_step_in_if_stepping); | 460 __ bind(&prepare_step_in_if_stepping); |
| 462 { | 461 { |
| 463 FrameScope scope(masm, StackFrame::INTERNAL); | 462 FrameScope scope(masm, StackFrame::INTERNAL); |
| 464 __ Push(ebx); | 463 __ Push(ebx); |
| 465 __ Push(edx); | 464 __ Push(edx); |
| 466 __ Push(edi); | 465 __ Push(edi); |
| 467 __ CallRuntime(Runtime::kDebugPrepareStepInIfStepping); | 466 __ CallRuntime(Runtime::kDebugOnFunctionCall); |
| 468 __ Pop(edx); | 467 __ Pop(edx); |
| 469 __ Pop(ebx); | 468 __ Pop(ebx); |
| 470 __ mov(edi, FieldOperand(ebx, JSGeneratorObject::kFunctionOffset)); | 469 __ mov(edi, FieldOperand(ebx, JSGeneratorObject::kFunctionOffset)); |
| 471 } | 470 } |
| 472 __ jmp(&stepping_prepared); | 471 __ jmp(&stepping_prepared); |
| 473 | 472 |
| 474 __ bind(&prepare_step_in_suspended_generator); | 473 __ bind(&prepare_step_in_suspended_generator); |
| 475 { | 474 { |
| 476 FrameScope scope(masm, StackFrame::INTERNAL); | 475 FrameScope scope(masm, StackFrame::INTERNAL); |
| 477 __ Push(ebx); | 476 __ Push(ebx); |
| (...skipping 2631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3109 | 3108 |
| 3110 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { | 3109 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { |
| 3111 Generate_OnStackReplacementHelper(masm, true); | 3110 Generate_OnStackReplacementHelper(masm, true); |
| 3112 } | 3111 } |
| 3113 | 3112 |
| 3114 #undef __ | 3113 #undef __ |
| 3115 } // namespace internal | 3114 } // namespace internal |
| 3116 } // namespace v8 | 3115 } // namespace v8 |
| 3117 | 3116 |
| 3118 #endif // V8_TARGET_ARCH_IA32 | 3117 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |