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

Unified Diff: runtime/vm/stub_code_ia32.cc

Issue 496483002: Moves SingleStepHandler runtime calls (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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 39379)
+++ runtime/vm/stub_code_ia32.cc (working copy)
@@ -1509,19 +1509,13 @@
}
#endif // DEBUG
// Check single stepping.
- Label not_stepping;
+ Label stepping, done_stepping;
__ movl(EAX, FieldAddress(CTX, Context::isolate_offset()));
__ movzxb(EAX, Address(EAX, Isolate::single_step_offset()));
__ cmpl(EAX, Immediate(0));
- __ j(EQUAL, &not_stepping, Assembler::kNearJump);
+ __ j(NOT_EQUAL, &stepping, Assembler::kNearJump);
+ __ Bind(&done_stepping);
- __ EnterStubFrame();
- __ pushl(ECX);
- __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
- __ popl(ECX);
- __ LeaveFrame();
- __ Bind(&not_stepping);
-
// ECX: IC data object (preserved).
__ movl(EBX, FieldAddress(ECX, ICData::ic_data_offset()));
// EBX: ic_data_array with entries: target functions and count.
@@ -1531,11 +1525,11 @@
const intptr_t count_offset = ICData::CountIndexFor(0) * kWordSize;
// Increment count for this call.
- Label increment_done;
- __ addl(Address(EBX, count_offset), Immediate(Smi::RawValue(1)));
- __ j(NO_OVERFLOW, &increment_done, Assembler::kNearJump);
- __ movl(Address(EBX, count_offset), Immediate(Smi::RawValue(Smi::kMaxValue)));
- __ Bind(&increment_done);
+ __ movl(EAX, Address(EBX, count_offset));
+ __ addl(EAX, Immediate(Smi::RawValue(1)));
+ __ movl(EDI, Immediate(Smi::RawValue(Smi::kMaxValue)));
+ __ cmovno(EDI, EAX);
+ __ movl(Address(EBX, count_offset), EDI);
// Load arguments descriptor into EDX.
__ movl(EDX, FieldAddress(ECX, ICData::arguments_descriptor_offset()));
@@ -1547,6 +1541,14 @@
// EBX: Target instructions.
__ addl(EBX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
__ jmp(EBX);
+
+ __ Bind(&stepping);
+ __ EnterStubFrame();
+ __ pushl(ECX);
+ __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
+ __ popl(ECX);
+ __ LeaveFrame();
+ __ jmp(&done_stepping, Assembler::kNearJump);
}
@@ -1635,18 +1637,19 @@
// Called only from unoptimized code.
void StubCode::GenerateDebugStepCheckStub(Assembler* assembler) {
// Check single stepping.
- Label not_stepping;
+ Label stepping, done_stepping;
__ movl(EAX, FieldAddress(CTX, Context::isolate_offset()));
__ movzxb(EAX, Address(EAX, Isolate::single_step_offset()));
__ cmpl(EAX, Immediate(0));
- __ j(EQUAL, &not_stepping, Assembler::kNearJump);
+ __ j(NOT_EQUAL, &stepping, Assembler::kNearJump);
+ __ Bind(&done_stepping);
+ __ ret();
+ __ Bind(&stepping);
__ EnterStubFrame();
__ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
__ LeaveFrame();
- __ Bind(&not_stepping);
-
- __ ret();
+ __ jmp(&done_stepping, Assembler::kNearJump);
}
@@ -1896,17 +1899,13 @@
void StubCode::GenerateUnoptimizedIdenticalWithNumberCheckStub(
Assembler* assembler) {
// Check single stepping.
- Label not_stepping;
+ Label stepping, done_stepping;
__ movl(EAX, FieldAddress(CTX, Context::isolate_offset()));
__ movzxb(EAX, Address(EAX, Isolate::single_step_offset()));
__ cmpl(EAX, Immediate(0));
- __ j(EQUAL, &not_stepping, Assembler::kNearJump);
+ __ j(NOT_EQUAL, &stepping);
+ __ Bind(&done_stepping);
- __ EnterStubFrame();
- __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
- __ LeaveFrame();
- __ Bind(&not_stepping);
-
const Register left = EAX;
const Register right = EDX;
const Register temp = ECX;
@@ -1914,6 +1913,12 @@
__ movl(right, Address(ESP, 1 * kWordSize));
GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
__ ret();
+
+ __ 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