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

Unified Diff: src/debug/arm/debug-arm.cc

Issue 2732273003: Disentangle assembler from isolate. (Closed)
Patch Set: Address feedback. Created 3 years, 9 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 | « src/crankshaft/lithium-codegen.cc ('k') | src/debug/arm64/debug-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/arm/debug-arm.cc
diff --git a/src/debug/arm/debug-arm.cc b/src/debug/arm/debug-arm.cc
index 16fdc8f456e00b77dd34b03332991f7be57a38b7..2f3fe03fd8b6bd67549d6b4b1a343659638f0014 100644
--- a/src/debug/arm/debug-arm.cc
+++ b/src/debug/arm/debug-arm.cc
@@ -16,17 +16,17 @@ namespace internal {
#define __ ACCESS_MASM(masm)
-
-void EmitDebugBreakSlot(MacroAssembler* masm) {
+namespace {
+void EmitDebugBreakSlot(Assembler* assembler) {
Label check_size;
- __ bind(&check_size);
+ assembler->bind(&check_size);
for (int i = 0; i < Assembler::kDebugBreakSlotInstructions; i++) {
- __ nop(MacroAssembler::DEBUG_BREAK_NOP);
+ assembler->nop(MacroAssembler::DEBUG_BREAK_NOP);
}
DCHECK_EQ(Assembler::kDebugBreakSlotInstructions,
- masm->InstructionsGeneratedSince(&check_size));
+ assembler->InstructionsGeneratedSince(&check_size));
}
-
+} // anonymous namespace
void DebugCodegen::GenerateSlot(MacroAssembler* masm, RelocInfo::Mode mode) {
// Generate enough nop's to make space for a call instruction. Avoid emitting
@@ -38,15 +38,18 @@ void DebugCodegen::GenerateSlot(MacroAssembler* masm, RelocInfo::Mode mode) {
void DebugCodegen::ClearDebugBreakSlot(Isolate* isolate, Address pc) {
- CodePatcher patcher(isolate, pc, Assembler::kDebugBreakSlotInstructions);
- EmitDebugBreakSlot(patcher.masm());
+ PatchingAssembler patcher(Assembler::IsolateData(isolate), pc,
+ Assembler::kDebugBreakSlotInstructions);
+ EmitDebugBreakSlot(&patcher);
+ patcher.FlushICache(isolate);
}
void DebugCodegen::PatchDebugBreakSlot(Isolate* isolate, Address pc,
Handle<Code> code) {
DCHECK(code->is_debug_stub());
- CodePatcher patcher(isolate, pc, Assembler::kDebugBreakSlotInstructions);
+ PatchingAssembler patcher(Assembler::IsolateData(isolate), pc,
+ Assembler::kDebugBreakSlotInstructions);
// Patch the code changing the debug break slot code from
// mov r2, r2
// mov r2, r2
@@ -59,11 +62,12 @@ void DebugCodegen::PatchDebugBreakSlot(Isolate* isolate, Address pc,
// skip:
// blx ip
Label skip_constant;
- patcher.masm()->ldr(ip, MemOperand(v8::internal::pc, 0));
- patcher.masm()->b(&skip_constant);
+ patcher.ldr(ip, MemOperand(v8::internal::pc, 0));
+ patcher.b(&skip_constant);
patcher.Emit(code->entry());
- patcher.masm()->bind(&skip_constant);
- patcher.masm()->blx(ip);
+ patcher.bind(&skip_constant);
+ patcher.blx(ip);
+ patcher.FlushICache(isolate);
}
bool DebugCodegen::DebugBreakSlotIsPatched(Address pc) {
« no previous file with comments | « src/crankshaft/lithium-codegen.cc ('k') | src/debug/arm64/debug-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698