| Index: runtime/vm/debugger_mips.cc
|
| diff --git a/runtime/vm/debugger_mips.cc b/runtime/vm/debugger_mips.cc
|
| index e3918e6760c5b9a2bba950a3eb2cae27169f516a..96d463250b58de68910b4dd746ec431eea637be5 100644
|
| --- a/runtime/vm/debugger_mips.cc
|
| +++ b/runtime/vm/debugger_mips.cc
|
| @@ -20,35 +20,25 @@ uword CodeBreakpoint::OrigStubAddress() const {
|
|
|
| void CodeBreakpoint::PatchCode() {
|
| ASSERT(!is_enabled_);
|
| - const Code& code = Code::Handle(code_);
|
| - const Instructions& instrs = Instructions::Handle(code.instructions());
|
| - Isolate* isolate = Isolate::Current();
|
| - {
|
| - WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size());
|
| - switch (breakpoint_kind_) {
|
| - case RawPcDescriptors::kIcCall:
|
| - case RawPcDescriptors::kUnoptStaticCall: {
|
| - saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code);
|
| - CodePatcher::PatchStaticCallAt(
|
| - pc_, code, isolate->stub_code()->ICCallBreakpointEntryPoint());
|
| - break;
|
| - }
|
| - case RawPcDescriptors::kClosureCall: {
|
| - saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code);
|
| - CodePatcher::PatchStaticCallAt(
|
| - pc_, code, isolate->stub_code()->ClosureCallBreakpointEntryPoint());
|
| - break;
|
| - }
|
| - case RawPcDescriptors::kRuntimeCall: {
|
| - saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code);
|
| - CodePatcher::PatchStaticCallAt(
|
| - pc_, code, isolate->stub_code()->RuntimeCallBreakpointEntryPoint());
|
| - break;
|
| - }
|
| - default:
|
| - UNREACHABLE();
|
| - }
|
| + StubCode* stub_code = Isolate::Current()->stub_code();
|
| + uword stub_target = 0;
|
| + switch (breakpoint_kind_) {
|
| + case RawPcDescriptors::kIcCall:
|
| + case RawPcDescriptors::kUnoptStaticCall:
|
| + stub_target = stub_code->ICCallBreakpointEntryPoint();
|
| + break;
|
| + case RawPcDescriptors::kClosureCall:
|
| + stub_target = stub_code->ClosureCallBreakpointEntryPoint();
|
| + break;
|
| + case RawPcDescriptors::kRuntimeCall:
|
| + stub_target = stub_code->RuntimeCallBreakpointEntryPoint();
|
| + break;
|
| + default:
|
| + UNREACHABLE();
|
| }
|
| + const Code& code = Code::Handle(code_);
|
| + saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code);
|
| + CodePatcher::PatchStaticCallAt(pc_, code, stub_target);
|
| is_enabled_ = true;
|
| }
|
|
|
| @@ -56,20 +46,16 @@ void CodeBreakpoint::PatchCode() {
|
| void CodeBreakpoint::RestoreCode() {
|
| ASSERT(is_enabled_);
|
| const Code& code = Code::Handle(code_);
|
| - const Instructions& instrs = Instructions::Handle(code.instructions());
|
| - {
|
| - WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size());
|
| - switch (breakpoint_kind_) {
|
| - case RawPcDescriptors::kIcCall:
|
| - case RawPcDescriptors::kUnoptStaticCall:
|
| - case RawPcDescriptors::kClosureCall:
|
| - case RawPcDescriptors::kRuntimeCall: {
|
| - CodePatcher::PatchStaticCallAt(pc_, code, saved_value_);
|
| - break;
|
| - }
|
| - default:
|
| - UNREACHABLE();
|
| + switch (breakpoint_kind_) {
|
| + case RawPcDescriptors::kIcCall:
|
| + case RawPcDescriptors::kUnoptStaticCall:
|
| + case RawPcDescriptors::kClosureCall:
|
| + case RawPcDescriptors::kRuntimeCall: {
|
| + CodePatcher::PatchStaticCallAt(pc_, code, saved_value_);
|
| + break;
|
| }
|
| + default:
|
| + UNREACHABLE();
|
| }
|
| is_enabled_ = false;
|
| }
|
|
|