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

Unified Diff: runtime/vm/simulator_dbc.cc

Issue 2891713002: Cleanup: Make CheckClassId instruction more general so it (Closed)
Patch Set: Feedback from Martin Created 3 years, 7 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/intermediate_language_x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/simulator_dbc.cc
diff --git a/runtime/vm/simulator_dbc.cc b/runtime/vm/simulator_dbc.cc
index a85f26d7cf5f3f0078645e224c7cf2c80d91cec7..ad18d4e1356d2abfc89f06aa93f2544a3a1b9018 100644
--- a/runtime/vm/simulator_dbc.cc
+++ b/runtime/vm/simulator_dbc.cc
@@ -3254,6 +3254,18 @@ RawObject* Simulator::Call(const Code& code,
}
{
+ BYTECODE(CheckClassIdRange, A_D);
+ const intptr_t actual_cid =
+ reinterpret_cast<intptr_t>(FP[rA]) >> kSmiTagSize;
+ const uintptr_t cid_start = rD;
+ const uintptr_t cid_range = Bytecode::DecodeD(*pc);
+ // Unsigned comparison. Skip either just the nop or both the nop and the
+ // following instruction.
+ pc += (actual_cid - cid_start <= cid_range) ? 2 : 1;
+ DISPATCH();
+ }
+
+ {
BYTECODE(CheckBitTest, A_D);
const intptr_t raw_value = reinterpret_cast<intptr_t>(FP[rA]);
const bool is_smi = ((raw_value & kSmiTagMask) == kSmiTag);
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698