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

Unified Diff: runtime/vm/stub_code_x64.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_mips.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_x64.cc
===================================================================
--- runtime/vm/stub_code_x64.cc (revision 45631)
+++ 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(int, optimization_counter_threshold);
+DECLARE_FLAG(bool, support_debugger);
// Input parameters:
// RSP : points to return address.
@@ -1344,12 +1345,14 @@
}
#endif // DEBUG
- __ Comment("Check single stepping");
Label stepping, done_stepping;
- __ LoadIsolate(RAX);
- __ cmpb(Address(RAX, Isolate::single_step_offset()), Immediate(0));
- __ j(NOT_EQUAL, &stepping);
- __ Bind(&done_stepping);
+ if (FLAG_support_debugger) {
+ __ Comment("Check single stepping");
+ __ LoadIsolate(RAX);
+ __ cmpb(Address(RAX, Isolate::single_step_offset()), Immediate(0));
+ __ j(NOT_EQUAL, &stepping);
+ __ Bind(&done_stepping);
+ }
__ Comment("Range feedback collection");
Label not_smi_or_overflow;
@@ -1503,13 +1506,15 @@
__ jmp(RCX);
}
- __ Bind(&stepping);
- __ EnterStubFrame();
- __ pushq(RBX);
- __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
- __ popq(RBX);
- __ LeaveStubFrame();
- __ jmp(&done_stepping);
+ if (FLAG_support_debugger) {
+ __ Bind(&stepping);
+ __ EnterStubFrame();
+ __ pushq(RBX);
+ __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
+ __ popq(RBX);
+ __ LeaveStubFrame();
+ __ jmp(&done_stepping);
+ }
}
@@ -1659,16 +1664,18 @@
// Check single stepping.
Label stepping, done_stepping;
- __ LoadIsolate(RAX);
- __ movzxb(RAX, Address(RAX, Isolate::single_step_offset()));
- __ cmpq(RAX, Immediate(0));
+ if (FLAG_support_debugger) {
+ __ LoadIsolate(RAX);
+ __ movzxb(RAX, Address(RAX, Isolate::single_step_offset()));
+ __ cmpq(RAX, Immediate(0));
#if defined(DEBUG)
static const bool kJumpLength = Assembler::kFarJump;
#else
static const bool kJumpLength = Assembler::kNearJump;
#endif // DEBUG
- __ j(NOT_EQUAL, &stepping, kJumpLength);
- __ Bind(&done_stepping);
+ __ j(NOT_EQUAL, &stepping, kJumpLength);
+ __ Bind(&done_stepping);
+ }
// RBX: IC data object (preserved).
__ movq(R12, FieldAddress(RBX, ICData::ic_data_offset()));
@@ -1697,13 +1704,15 @@
__ addq(RCX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
__ jmp(RCX);
- __ Bind(&stepping);
- __ EnterStubFrame();
- __ pushq(RBX); // Preserve IC data object.
- __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
- __ popq(RBX);
- __ LeaveStubFrame();
- __ jmp(&done_stepping, Assembler::kNearJump);
+ if (FLAG_support_debugger) {
+ __ Bind(&stepping);
+ __ EnterStubFrame();
+ __ pushq(RBX); // Preserve IC data object.
+ __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
+ __ popq(RBX);
+ __ LeaveStubFrame();
+ __ jmp(&done_stepping, Assembler::kNearJump);
+ }
}
@@ -2074,11 +2083,13 @@
Assembler* assembler) {
// Check single stepping.
Label stepping, done_stepping;
- __ LoadIsolate(RAX);
- __ movzxb(RAX, Address(RAX, Isolate::single_step_offset()));
- __ cmpq(RAX, Immediate(0));
- __ j(NOT_EQUAL, &stepping);
- __ Bind(&done_stepping);
+ if (FLAG_support_debugger) {
+ __ LoadIsolate(RAX);
+ __ movzxb(RAX, Address(RAX, Isolate::single_step_offset()));
+ __ cmpq(RAX, Immediate(0));
+ __ j(NOT_EQUAL, &stepping);
+ __ Bind(&done_stepping);
+ }
const Register left = RAX;
const Register right = RDX;
@@ -2088,11 +2099,13 @@
GenerateIdenticalWithNumberCheckStub(assembler, left, right);
__ ret();
- __ Bind(&stepping);
- __ EnterStubFrame();
- __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
- __ LeaveStubFrame();
- __ jmp(&done_stepping);
+ if (FLAG_support_debugger) {
+ __ Bind(&stepping);
+ __ EnterStubFrame();
+ __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
+ __ LeaveStubFrame();
+ __ jmp(&done_stepping);
+ }
}
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698