Index: runtime/vm/simulator_dbc.cc |
diff --git a/runtime/vm/simulator_dbc.cc b/runtime/vm/simulator_dbc.cc |
index b1c648dc96d9e61026a30e3c64623a54b7d7c0e8..fb4929082189002aa42866699d26ead969c1a23e 100644 |
--- a/runtime/vm/simulator_dbc.cc |
+++ b/runtime/vm/simulator_dbc.cc |
@@ -2058,6 +2058,29 @@ RawObject* Simulator::Call(const Code& code, |
} |
{ |
+ BYTECODE(TestCids, A_D); |
+ intptr_t cid = SimulatorHelpers::GetClassId(FP[rA]); |
Vyacheslav Egorov (Google)
2016/07/07 17:08:28
const
rmacnak
2016/07/08 00:54:21
Done.
|
+ intptr_t num_cases = rD; |
Vyacheslav Egorov (Google)
2016/07/07 17:08:28
const
rmacnak
2016/07/08 00:54:21
Done.
|
+ 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 += num_cases + 1; // Match true. |
Vyacheslav Egorov (Google)
2016/07/07 17:08:28
pc += 1
|
+ } else { |
+ pc += num_cases + 2; // Match false. |
Vyacheslav Egorov (Google)
2016/07/07 17:08:28
pc += 2
|
+ } |
+ goto TestCidsOk; |
Vyacheslav Egorov (Google)
2016/07/07 17:08:28
break
then there is no need for goto.
rmacnak
2016/07/08 00:54:21
Yes, I like that better.
|
+ } |
+ } |
+ pc += num_cases; // No match. |
+ |
+ TestCidsOk: |
+ DISPATCH(); |
+ } |
+ |
+ { |
BYTECODE(CheckSmi, 0); |
intptr_t obj = reinterpret_cast<intptr_t>(FP[rA]); |
if ((obj & kSmiTagMask) == kSmiTag) { |