Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1264)

Unified Diff: runtime/vm/stub_code_ia32.cc

Issue 1127523004: Add flag --support_debugger, controls emitting single stepping checks. Disable in --noopt, 6% gain. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/stub_code_arm64.cc ('k') | runtime/vm/stub_code_mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_ia32.cc
===================================================================
--- runtime/vm/stub_code_ia32.cc (revision 45631)
+++ runtime/vm/stub_code_ia32.cc (working copy)
@@ -28,6 +28,7 @@
"Set to true for debugging & verifying the slow paths.");
DECLARE_FLAG(bool, trace_optimized_ic_calls);
DECLARE_FLAG(int, optimization_counter_threshold);
+DECLARE_FLAG(bool, support_debugger);
#define INT32_SIZEOF(x) static_cast<int32_t>(sizeof(x))
@@ -1304,14 +1305,15 @@
}
#endif // DEBUG
- __ Comment("Check single stepping");
Label stepping, done_stepping;
- uword single_step_address = reinterpret_cast<uword>(Isolate::Current()) +
- Isolate::single_step_offset();
- __ cmpb(Address::Absolute(single_step_address), Immediate(0));
- __ j(NOT_EQUAL, &stepping);
- __ Bind(&done_stepping);
-
+ if (FLAG_support_debugger) {
+ __ Comment("Check single stepping");
+ uword single_step_address = reinterpret_cast<uword>(Isolate::Current()) +
+ Isolate::single_step_offset();
+ __ cmpb(Address::Absolute(single_step_address), Immediate(0));
+ __ j(NOT_EQUAL, &stepping);
+ __ Bind(&done_stepping);
+ }
__ Comment("Range feedback collection");
Label not_smi_or_overflow;
if (range_collection_mode == kCollectRanges) {
@@ -1463,13 +1465,15 @@
__ jmp(EBX);
}
- __ Bind(&stepping);
- __ EnterStubFrame();
- __ pushl(ECX);
- __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
- __ popl(ECX);
- __ LeaveFrame();
- __ jmp(&done_stepping);
+ if (FLAG_support_debugger) {
+ __ Bind(&stepping);
+ __ EnterStubFrame();
+ __ pushl(ECX);
+ __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
+ __ popl(ECX);
+ __ LeaveFrame();
+ __ jmp(&done_stepping);
+ }
}
@@ -1619,11 +1623,13 @@
#endif // DEBUG
// Check single stepping.
Label stepping, done_stepping;
- uword single_step_address = reinterpret_cast<uword>(Isolate::Current()) +
- Isolate::single_step_offset();
- __ cmpb(Address::Absolute(single_step_address), Immediate(0));
- __ j(NOT_EQUAL, &stepping, Assembler::kNearJump);
- __ Bind(&done_stepping);
+ if (FLAG_support_debugger) {
+ uword single_step_address = reinterpret_cast<uword>(Isolate::Current()) +
+ Isolate::single_step_offset();
+ __ cmpb(Address::Absolute(single_step_address), Immediate(0));
+ __ j(NOT_EQUAL, &stepping, Assembler::kNearJump);
+ __ Bind(&done_stepping);
+ }
// ECX: IC data object (preserved).
__ movl(EBX, FieldAddress(ECX, ICData::ic_data_offset()));
@@ -1653,13 +1659,15 @@
__ addl(EBX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
__ jmp(EBX);
- __ Bind(&stepping);
- __ EnterStubFrame();
- __ pushl(ECX);
- __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
- __ popl(ECX);
- __ LeaveFrame();
- __ jmp(&done_stepping, Assembler::kNearJump);
+ if (FLAG_support_debugger) {
+ __ Bind(&stepping);
+ __ EnterStubFrame();
+ __ pushl(ECX);
+ __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
+ __ popl(ECX);
+ __ LeaveFrame();
+ __ jmp(&done_stepping, Assembler::kNearJump);
+ }
}
@@ -2022,11 +2030,13 @@
Assembler* assembler) {
// Check single stepping.
Label stepping, done_stepping;
- __ LoadIsolate(EAX);
- __ movzxb(EAX, Address(EAX, Isolate::single_step_offset()));
- __ cmpl(EAX, Immediate(0));
- __ j(NOT_EQUAL, &stepping);
- __ Bind(&done_stepping);
+ if (FLAG_support_debugger) {
+ __ LoadIsolate(EAX);
+ __ movzxb(EAX, Address(EAX, Isolate::single_step_offset()));
+ __ cmpl(EAX, Immediate(0));
+ __ j(NOT_EQUAL, &stepping);
+ __ Bind(&done_stepping);
+ }
const Register left = EAX;
const Register right = EDX;
@@ -2036,11 +2046,13 @@
GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
__ ret();
- __ Bind(&stepping);
- __ EnterStubFrame();
- __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
- __ LeaveFrame();
- __ jmp(&done_stepping);
+ if (FLAG_support_debugger) {
+ __ Bind(&stepping);
+ __ EnterStubFrame();
+ __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
+ __ LeaveFrame();
+ __ jmp(&done_stepping);
+ }
}
« no previous file with comments | « runtime/vm/stub_code_arm64.cc ('k') | runtime/vm/stub_code_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698