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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 // Store resume mode into generator object. | 386 // Store resume mode into generator object. |
387 __ mov(FieldOperand(ebx, JSGeneratorObject::kResumeModeOffset), edx); | 387 __ mov(FieldOperand(ebx, JSGeneratorObject::kResumeModeOffset), edx); |
388 | 388 |
389 // Load suspended function and context. | 389 // Load suspended function and context. |
390 __ mov(esi, FieldOperand(ebx, JSGeneratorObject::kContextOffset)); | 390 __ mov(esi, FieldOperand(ebx, JSGeneratorObject::kContextOffset)); |
391 __ mov(edi, FieldOperand(ebx, JSGeneratorObject::kFunctionOffset)); | 391 __ mov(edi, FieldOperand(ebx, JSGeneratorObject::kFunctionOffset)); |
392 | 392 |
393 // Flood function if we are stepping. | 393 // Flood function if we are stepping. |
394 Label prepare_step_in_if_stepping, prepare_step_in_suspended_generator; | 394 Label prepare_step_in_if_stepping, prepare_step_in_suspended_generator; |
395 Label stepping_prepared; | 395 Label stepping_prepared; |
396 ExternalReference last_step_action = | 396 ExternalReference debug_hook = |
397 ExternalReference::debug_last_step_action_address(masm->isolate()); | 397 ExternalReference::debug_hook_on_function_call_address(masm->isolate()); |
398 STATIC_ASSERT(StepFrame > StepIn); | 398 __ cmpb(Operand::StaticVariable(debug_hook), Immediate(0)); |
399 __ cmpb(Operand::StaticVariable(last_step_action), Immediate(StepIn)); | 399 __ j(not_equal, &prepare_step_in_if_stepping); |
400 __ j(greater_equal, &prepare_step_in_if_stepping); | |
401 | 400 |
402 // Flood function if we need to continue stepping in the suspended generator. | 401 // Flood function if we need to continue stepping in the suspended generator. |
403 ExternalReference debug_suspended_generator = | 402 ExternalReference debug_suspended_generator = |
404 ExternalReference::debug_suspended_generator_address(masm->isolate()); | 403 ExternalReference::debug_suspended_generator_address(masm->isolate()); |
405 __ cmp(ebx, Operand::StaticVariable(debug_suspended_generator)); | 404 __ cmp(ebx, Operand::StaticVariable(debug_suspended_generator)); |
406 __ j(equal, &prepare_step_in_suspended_generator); | 405 __ j(equal, &prepare_step_in_suspended_generator); |
407 __ bind(&stepping_prepared); | 406 __ bind(&stepping_prepared); |
408 | 407 |
409 // Pop return address. | 408 // Pop return address. |
410 __ PopReturnAddressTo(eax); | 409 __ PopReturnAddressTo(eax); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 __ mov(edx, ebx); | 457 __ mov(edx, ebx); |
459 __ jmp(FieldOperand(edi, JSFunction::kCodeEntryOffset)); | 458 __ jmp(FieldOperand(edi, JSFunction::kCodeEntryOffset)); |
460 } | 459 } |
461 | 460 |
462 __ bind(&prepare_step_in_if_stepping); | 461 __ bind(&prepare_step_in_if_stepping); |
463 { | 462 { |
464 FrameScope scope(masm, StackFrame::INTERNAL); | 463 FrameScope scope(masm, StackFrame::INTERNAL); |
465 __ Push(ebx); | 464 __ Push(ebx); |
466 __ Push(edx); | 465 __ Push(edx); |
467 __ Push(edi); | 466 __ Push(edi); |
468 __ CallRuntime(Runtime::kDebugPrepareStepInIfStepping); | 467 __ CallRuntime(Runtime::kDebugOnFunctionCall); |
469 __ Pop(edx); | 468 __ Pop(edx); |
470 __ Pop(ebx); | 469 __ Pop(ebx); |
471 __ mov(edi, FieldOperand(ebx, JSGeneratorObject::kFunctionOffset)); | 470 __ mov(edi, FieldOperand(ebx, JSGeneratorObject::kFunctionOffset)); |
472 } | 471 } |
473 __ jmp(&stepping_prepared); | 472 __ jmp(&stepping_prepared); |
474 | 473 |
475 __ bind(&prepare_step_in_suspended_generator); | 474 __ bind(&prepare_step_in_suspended_generator); |
476 { | 475 { |
477 FrameScope scope(masm, StackFrame::INTERNAL); | 476 FrameScope scope(masm, StackFrame::INTERNAL); |
478 __ Push(ebx); | 477 __ Push(ebx); |
(...skipping 2658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3137 | 3136 |
3138 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { | 3137 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { |
3139 Generate_OnStackReplacementHelper(masm, true); | 3138 Generate_OnStackReplacementHelper(masm, true); |
3140 } | 3139 } |
3141 | 3140 |
3142 #undef __ | 3141 #undef __ |
3143 } // namespace internal | 3142 } // namespace internal |
3144 } // namespace v8 | 3143 } // namespace v8 |
3145 | 3144 |
3146 #endif // V8_TARGET_ARCH_X87 | 3145 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |