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

Unified Diff: runtime/vm/instructions_mips.cc

Issue 2382953004: Revert "Lazy deopt without code patching." (Closed)
Patch Set: Created 4 years, 3 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/instructions_mips.h ('k') | runtime/vm/instructions_x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/instructions_mips.cc
diff --git a/runtime/vm/instructions_mips.cc b/runtime/vm/instructions_mips.cc
index 737094e69cc6b014e3a45b1692f5de957e52ae36..70fff9d0a4cae0429d46fa4b3c474f23de8b61e3 100644
--- a/runtime/vm/instructions_mips.cc
+++ b/runtime/vm/instructions_mips.cc
@@ -217,6 +217,24 @@ void NativeCallPattern::set_native_function(NativeFunction func) const {
}
+void CallPattern::InsertDeoptCallAt(uword pc, uword target_address) {
+ Instr* lui = Instr::At(pc + (0 * Instr::kInstrSize));
+ Instr* ori = Instr::At(pc + (1 * Instr::kInstrSize));
+ Instr* jr = Instr::At(pc + (2 * Instr::kInstrSize));
+ Instr* nop = Instr::At(pc + (3 * Instr::kInstrSize));
+ uint16_t target_lo = target_address & 0xffff;
+ uint16_t target_hi = target_address >> 16;
+
+ lui->SetImmInstrBits(LUI, ZR, T9, target_hi);
+ ori->SetImmInstrBits(ORI, T9, T9, target_lo);
+ jr->SetSpecialInstrBits(JALR, T9, ZR, RA);
+ nop->SetInstructionBits(Instr::kNopInstruction);
+
+ ASSERT(kDeoptCallLengthInBytes == 4 * Instr::kInstrSize);
+ CPU::FlushICache(pc, kDeoptCallLengthInBytes);
+}
+
+
SwitchableCallPattern::SwitchableCallPattern(uword pc, const Code& code)
: object_pool_(ObjectPool::Handle(code.GetObjectPool())),
data_pool_index_(-1),
« no previous file with comments | « runtime/vm/instructions_mips.h ('k') | runtime/vm/instructions_x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698