Index: runtime/vm/stub_code_x64.cc |
=================================================================== |
--- runtime/vm/stub_code_x64.cc (revision 36530) |
+++ runtime/vm/stub_code_x64.cc (working copy) |
@@ -27,6 +27,7 @@ |
"Set to true for debugging & verifying the slow paths."); |
DECLARE_FLAG(bool, trace_optimized_ic_calls); |
+DECLARE_FLAG(bool, enable_debugger); |
// Input parameters: |
// RSP : points to return address. |
@@ -1230,18 +1231,20 @@ |
} |
#endif // DEBUG |
- // Check single stepping. |
- Label not_stepping; |
- __ movq(RAX, FieldAddress(CTX, Context::isolate_offset())); |
- __ movzxb(RAX, Address(RAX, Isolate::single_step_offset())); |
- __ cmpq(RAX, Immediate(0)); |
- __ j(EQUAL, ¬_stepping, Assembler::kNearJump); |
- __ EnterStubFrame(); |
- __ pushq(RBX); |
- __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); |
- __ popq(RBX); |
- __ LeaveStubFrame(); |
- __ Bind(¬_stepping); |
+ if (FLAG_enable_debugger) { |
+ // Check single stepping. |
+ Label not_stepping; |
+ __ movq(RAX, FieldAddress(CTX, Context::isolate_offset())); |
+ __ movzxb(RAX, Address(RAX, Isolate::single_step_offset())); |
+ __ cmpq(RAX, Immediate(0)); |
+ __ j(EQUAL, ¬_stepping, Assembler::kNearJump); |
+ __ EnterStubFrame(); |
+ __ pushq(RBX); |
+ __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); |
+ __ popq(RBX); |
+ __ LeaveStubFrame(); |
+ __ Bind(¬_stepping); |
+ } |
// Load arguments descriptor into R10. |
__ movq(R10, FieldAddress(RBX, ICData::arguments_descriptor_offset())); |
@@ -1449,18 +1452,20 @@ |
} |
#endif // DEBUG |
- // Check single stepping. |
- Label not_stepping; |
- __ movq(RAX, FieldAddress(CTX, Context::isolate_offset())); |
- __ movzxb(RAX, Address(RAX, Isolate::single_step_offset())); |
- __ cmpq(RAX, Immediate(0)); |
- __ j(EQUAL, ¬_stepping, Assembler::kNearJump); |
- __ EnterStubFrame(); |
- __ pushq(RBX); // Preserve IC data object. |
- __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); |
- __ popq(RBX); |
- __ LeaveStubFrame(); |
- __ Bind(¬_stepping); |
+ if (FLAG_enable_debugger) { |
+ // Check single stepping. |
+ Label not_stepping; |
+ __ movq(RAX, FieldAddress(CTX, Context::isolate_offset())); |
+ __ movzxb(RAX, Address(RAX, Isolate::single_step_offset())); |
+ __ cmpq(RAX, Immediate(0)); |
+ __ j(EQUAL, ¬_stepping, Assembler::kNearJump); |
+ __ EnterStubFrame(); |
+ __ pushq(RBX); // Preserve IC data object. |
+ __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); |
+ __ popq(RBX); |
+ __ LeaveStubFrame(); |
+ __ Bind(¬_stepping); |
+ } |
// RBX: IC data object (preserved). |
__ movq(R12, FieldAddress(RBX, ICData::ic_data_offset())); |
@@ -1542,17 +1547,19 @@ |
// Called only from unoptimized code. |
void StubCode::GenerateDebugStepCheckStub(Assembler* assembler) { |
- // Check single stepping. |
- Label not_stepping; |
- __ movq(RAX, FieldAddress(CTX, Context::isolate_offset())); |
- __ movzxb(RAX, Address(RAX, Isolate::single_step_offset())); |
- __ cmpq(RAX, Immediate(0)); |
- __ j(EQUAL, ¬_stepping, Assembler::kNearJump); |
+ if (FLAG_enable_debugger) { |
+ // Check single stepping. |
+ Label not_stepping; |
+ __ movq(RAX, FieldAddress(CTX, Context::isolate_offset())); |
+ __ movzxb(RAX, Address(RAX, Isolate::single_step_offset())); |
+ __ cmpq(RAX, Immediate(0)); |
+ __ j(EQUAL, ¬_stepping, Assembler::kNearJump); |
- __ EnterStubFrame(); |
- __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); |
- __ LeaveStubFrame(); |
- __ Bind(¬_stepping); |
+ __ EnterStubFrame(); |
+ __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); |
+ __ LeaveStubFrame(); |
+ __ Bind(¬_stepping); |
+ } |
__ ret(); |
} |
@@ -1787,16 +1794,18 @@ |
// Returns ZF set. |
void StubCode::GenerateUnoptimizedIdenticalWithNumberCheckStub( |
Assembler* assembler) { |
- // Check single stepping. |
- Label not_stepping; |
- __ movq(RAX, FieldAddress(CTX, Context::isolate_offset())); |
- __ movzxb(RAX, Address(RAX, Isolate::single_step_offset())); |
- __ cmpq(RAX, Immediate(0)); |
- __ j(EQUAL, ¬_stepping, Assembler::kNearJump); |
- __ EnterStubFrame(); |
- __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); |
- __ LeaveStubFrame(); |
- __ Bind(¬_stepping); |
+ if (FLAG_enable_debugger) { |
+ // Check single stepping. |
+ Label not_stepping; |
+ __ movq(RAX, FieldAddress(CTX, Context::isolate_offset())); |
+ __ movzxb(RAX, Address(RAX, Isolate::single_step_offset())); |
+ __ cmpq(RAX, Immediate(0)); |
+ __ j(EQUAL, ¬_stepping, Assembler::kNearJump); |
+ __ EnterStubFrame(); |
+ __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); |
+ __ LeaveStubFrame(); |
+ __ Bind(¬_stepping); |
+ } |
const Register left = RAX; |
const Register right = RDX; |