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

Unified Diff: runtime/vm/simulator_dbc.cc

Issue 2891713002: Cleanup: Make CheckClassId instruction more general so it (Closed)
Patch Set: 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
Index: runtime/vm/simulator_dbc.cc
diff --git a/runtime/vm/simulator_dbc.cc b/runtime/vm/simulator_dbc.cc
index a85f26d7cf5f3f0078645e224c7cf2c80d91cec7..8c7bfcc2a947edb5c11502ffaddc93a2121f2422 100644
--- a/runtime/vm/simulator_dbc.cc
+++ b/runtime/vm/simulator_dbc.cc
@@ -3254,6 +3254,17 @@ RawObject* Simulator::Call(const Code& code,
}
{
+ BYTECODE(CheckClassIdRange, A_B_C);
+ const intptr_t actual_cid =
+ reinterpret_cast<intptr_t>(FP[rA]) >> kSmiTagSize;
+ const uintptr_t cid_start = rB;
+ const uintptr_t cid_end = rC;
+ // Unsigned comparison.
+ pc += (actual_cid - cid_start <= cid_end + 1u - cid_start) ? 1 : 0;
kustermann 2017/05/18 09:59:45 If [cid_start, cid_end] = [0, 1] actual_cid =
erikcorry 2017/05/18 14:25:30 Oops, fixed.
+ DISPATCH();
+ }
+
+ {
BYTECODE(CheckBitTest, A_D);
const intptr_t raw_value = reinterpret_cast<intptr_t>(FP[rA]);
const bool is_smi = ((raw_value & kSmiTagMask) == kSmiTag);
« runtime/vm/intermediate_language_dbc.cc ('K') | « runtime/vm/intermediate_language_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698