Index: runtime/vm/stub_code_mips.cc |
=================================================================== |
--- runtime/vm/stub_code_mips.cc (revision 36530) |
+++ runtime/vm/stub_code_mips.cc (working copy) |
@@ -26,6 +26,7 @@ |
"Set to true for debugging & verifying the slow paths."); |
DECLARE_FLAG(bool, trace_optimized_ic_calls); |
+DECLARE_FLAG(bool, enable_debugger); |
// Input parameters: |
// RA : return address. |
@@ -1424,22 +1425,24 @@ |
#endif // DEBUG |
- // Check single stepping. |
- Label not_stepping; |
- __ lw(T0, FieldAddress(CTX, Context::isolate_offset())); |
- __ lbu(T0, Address(T0, Isolate::single_step_offset())); |
- __ BranchEqual(T0, 0, ¬_stepping); |
- // Call single step callback in debugger. |
- __ EnterStubFrame(); |
- __ addiu(SP, SP, Immediate(-2 * kWordSize)); |
- __ sw(S5, Address(SP, 1 * kWordSize)); // Preserve IC data. |
- __ sw(RA, Address(SP, 0 * kWordSize)); // Return address. |
- __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); |
- __ lw(RA, Address(SP, 0 * kWordSize)); |
- __ lw(S5, Address(SP, 1 * kWordSize)); |
- __ addiu(SP, SP, Immediate(2 * kWordSize)); |
- __ LeaveStubFrame(); |
- __ Bind(¬_stepping); |
+ if (FLAG_enable_debugger) { |
+ // Check single stepping. |
+ Label not_stepping; |
+ __ lw(T0, FieldAddress(CTX, Context::isolate_offset())); |
+ __ lbu(T0, Address(T0, Isolate::single_step_offset())); |
+ __ BranchEqual(T0, 0, ¬_stepping); |
+ // Call single step callback in debugger. |
+ __ EnterStubFrame(); |
+ __ addiu(SP, SP, Immediate(-2 * kWordSize)); |
+ __ sw(S5, Address(SP, 1 * kWordSize)); // Preserve IC data. |
+ __ sw(RA, Address(SP, 0 * kWordSize)); // Return address. |
+ __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); |
+ __ lw(RA, Address(SP, 0 * kWordSize)); |
+ __ lw(S5, Address(SP, 1 * kWordSize)); |
+ __ addiu(SP, SP, Immediate(2 * kWordSize)); |
+ __ LeaveStubFrame(); |
+ __ Bind(¬_stepping); |
+ } |
// Load argument descriptor into S4. |
__ lw(S4, FieldAddress(S5, ICData::arguments_descriptor_offset())); |
@@ -1671,24 +1674,25 @@ |
} |
#endif // DEBUG |
- // Check single stepping. |
- Label not_stepping; |
- __ lw(T0, FieldAddress(CTX, Context::isolate_offset())); |
- __ lbu(T0, Address(T0, Isolate::single_step_offset())); |
- __ BranchEqual(T0, 0, ¬_stepping); |
- // Call single step callback in debugger. |
- __ EnterStubFrame(); |
- __ addiu(SP, SP, Immediate(-2 * kWordSize)); |
- __ sw(S5, Address(SP, 1 * kWordSize)); // Preserve IC data. |
- __ sw(RA, Address(SP, 0 * kWordSize)); // Return address. |
- __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); |
- __ lw(RA, Address(SP, 0 * kWordSize)); |
- __ lw(S5, Address(SP, 1 * kWordSize)); |
- __ addiu(SP, SP, Immediate(2 * kWordSize)); |
- __ LeaveStubFrame(); |
- __ Bind(¬_stepping); |
+ if (FLAG_enable_debugger) { |
+ // Check single stepping. |
+ Label not_stepping; |
+ __ lw(T0, FieldAddress(CTX, Context::isolate_offset())); |
+ __ lbu(T0, Address(T0, Isolate::single_step_offset())); |
+ __ BranchEqual(T0, 0, ¬_stepping); |
+ // Call single step callback in debugger. |
+ __ EnterStubFrame(); |
+ __ addiu(SP, SP, Immediate(-2 * kWordSize)); |
+ __ sw(S5, Address(SP, 1 * kWordSize)); // Preserve IC data. |
+ __ sw(RA, Address(SP, 0 * kWordSize)); // Return address. |
+ __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); |
+ __ lw(RA, Address(SP, 0 * kWordSize)); |
+ __ lw(S5, Address(SP, 1 * kWordSize)); |
+ __ addiu(SP, SP, Immediate(2 * kWordSize)); |
+ __ LeaveStubFrame(); |
+ __ Bind(¬_stepping); |
+ } |
- |
// S5: IC data object (preserved). |
__ lw(T0, FieldAddress(S5, ICData::ic_data_offset())); |
// T0: ic_data_array with entries: target functions and count. |
@@ -1777,20 +1781,22 @@ |
// Called only from unoptimized code. All relevant registers have been saved. |
// RA: return address. |
void StubCode::GenerateDebugStepCheckStub(Assembler* assembler) { |
- // Check single stepping. |
- Label not_stepping; |
- __ lw(T0, FieldAddress(CTX, Context::isolate_offset())); |
- __ lbu(T0, Address(T0, Isolate::single_step_offset())); |
- __ BranchEqual(T0, 0, ¬_stepping); |
- // Call single step callback in debugger. |
- __ EnterStubFrame(); |
- __ addiu(SP, SP, Immediate(-1 * kWordSize)); |
- __ sw(RA, Address(SP, 0 * kWordSize)); // Return address. |
- __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); |
- __ lw(RA, Address(SP, 0 * kWordSize)); |
- __ addiu(SP, SP, Immediate(1 * kWordSize)); |
- __ LeaveStubFrame(); |
- __ Bind(¬_stepping); |
+ if (FLAG_enable_debugger) { |
+ // Check single stepping. |
+ Label not_stepping; |
+ __ lw(T0, FieldAddress(CTX, Context::isolate_offset())); |
+ __ lbu(T0, Address(T0, Isolate::single_step_offset())); |
+ __ BranchEqual(T0, 0, ¬_stepping); |
+ // Call single step callback in debugger. |
+ __ EnterStubFrame(); |
+ __ addiu(SP, SP, Immediate(-1 * kWordSize)); |
+ __ sw(RA, Address(SP, 0 * kWordSize)); // Return address. |
+ __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); |
+ __ lw(RA, Address(SP, 0 * kWordSize)); |
+ __ addiu(SP, SP, Immediate(1 * kWordSize)); |
+ __ LeaveStubFrame(); |
+ __ Bind(¬_stepping); |
+ } |
__ Ret(); |
} |
@@ -2053,20 +2059,22 @@ |
// Returns: CMPRES1 is zero if equal, non-zero otherwise. |
void StubCode::GenerateUnoptimizedIdenticalWithNumberCheckStub( |
Assembler* assembler) { |
- // Check single stepping. |
- Label not_stepping; |
- __ lw(T0, FieldAddress(CTX, Context::isolate_offset())); |
- __ lbu(T0, Address(T0, Isolate::single_step_offset())); |
- __ BranchEqual(T0, 0, ¬_stepping); |
- // Call single step callback in debugger. |
- __ EnterStubFrame(); |
- __ addiu(SP, SP, Immediate(-1 * kWordSize)); |
- __ sw(RA, Address(SP, 0 * kWordSize)); // Return address. |
- __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); |
- __ lw(RA, Address(SP, 0 * kWordSize)); |
- __ addiu(SP, SP, Immediate(1 * kWordSize)); |
- __ LeaveStubFrame(); |
- __ Bind(¬_stepping); |
+ if (FLAG_enable_debugger) { |
+ // Check single stepping. |
+ Label not_stepping; |
+ __ lw(T0, FieldAddress(CTX, Context::isolate_offset())); |
+ __ lbu(T0, Address(T0, Isolate::single_step_offset())); |
+ __ BranchEqual(T0, 0, ¬_stepping); |
+ // Call single step callback in debugger. |
+ __ EnterStubFrame(); |
+ __ addiu(SP, SP, Immediate(-1 * kWordSize)); |
+ __ sw(RA, Address(SP, 0 * kWordSize)); // Return address. |
+ __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0); |
+ __ lw(RA, Address(SP, 0 * kWordSize)); |
+ __ addiu(SP, SP, Immediate(1 * kWordSize)); |
+ __ LeaveStubFrame(); |
+ __ Bind(¬_stepping); |
+ } |
const Register temp1 = T2; |
const Register temp2 = T3; |