| 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, ¬_stepping, Assembler::kNearJump);
|
| + __ j(NOT_EQUAL, &stepping, Assembler::kNearJump);
|
| + __ Bind(&done_stepping);
|
|
|
| - __ EnterStubFrame();
|
| - __ pushl(ECX);
|
| - __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
|
| - __ popl(ECX);
|
| - __ LeaveFrame();
|
| - __ Bind(¬_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, ¬_stepping, Assembler::kNearJump);
|
| + __ j(NOT_EQUAL, &stepping, Assembler::kNearJump);
|
| + __ Bind(&done_stepping);
|
| + __ ret();
|
|
|
| + __ Bind(&stepping);
|
| __ EnterStubFrame();
|
| __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
|
| __ LeaveFrame();
|
| - __ Bind(¬_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, ¬_stepping, Assembler::kNearJump);
|
| + __ j(NOT_EQUAL, &stepping);
|
| + __ Bind(&done_stepping);
|
|
|
| - __ EnterStubFrame();
|
| - __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
|
| - __ LeaveFrame();
|
| - __ Bind(¬_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);
|
| }
|
|
|
|
|
|
|