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

Unified Diff: runtime/vm/simulator_dbc.cc

Issue 2122363002: DBC: Implement TestCids instruction. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync, review Created 4 years, 5 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_dbc.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 b1c648dc96d9e61026a30e3c64623a54b7d7c0e8..329db38f9fbee04befadf4dc48a7ee116e9e6848 100644
--- a/runtime/vm/simulator_dbc.cc
+++ b/runtime/vm/simulator_dbc.cc
@@ -2058,6 +2058,27 @@ RawObject* Simulator::Call(const Code& code,
}
{
+ BYTECODE(TestCids, A_D);
+ const intptr_t cid = SimulatorHelpers::GetClassId(FP[rA]);
+ const intptr_t num_cases = rD;
+ for (intptr_t i = 0; i < num_cases; i++) {
+ ASSERT(Bytecode::DecodeOpcode(pc[i]) == Bytecode::kNop);
+ intptr_t test_target = Bytecode::DecodeA(pc[i]);
+ intptr_t test_cid = Bytecode::DecodeD(pc[i]);
+ if (cid == test_cid) {
+ if (test_target != 0) {
+ pc += 1; // Match true.
+ } else {
+ pc += 2; // Match false.
+ }
+ break;
+ }
+ }
+ pc += num_cases;
+ DISPATCH();
+ }
+
+ {
BYTECODE(CheckSmi, 0);
intptr_t obj = reinterpret_cast<intptr_t>(FP[rA]);
if ((obj & kSmiTagMask) == kSmiTag) {
« no previous file with comments | « runtime/vm/intermediate_language_dbc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698