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

Unified Diff: runtime/vm/simulator_dbc.cc

Issue 2244313002: DBC: Fleshing out the polymorphic instance call instruction (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Cleanup Created 4 years, 4 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/locations.h ('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 226222ccf711ccd391e3b29fa51acbfabb1d262d..c26cb7500b95f80df22c7961b2314a27a2ceb193 100644
--- a/runtime/vm/simulator_dbc.cc
+++ b/runtime/vm/simulator_dbc.cc
@@ -1528,6 +1528,26 @@ RawObject* Simulator::Call(const Code& code,
}
{
+ BYTECODE(PushPolymorphicInstanceCall, A_D);
+ const uint8_t argc = rA;
+ const intptr_t cids_length = rD;
+ RawObject** args = SP - argc + 1;
+ const intptr_t receiver_cid = SimulatorHelpers::GetClassId(args[0]);
+ for (intptr_t i = 0; i < 2*cids_length; i+=2) {
+ const intptr_t icdata_cid = Bytecode::DecodeD(*(pc + i));
+ if (receiver_cid == icdata_cid) {
+ RawFunction* target =
+ RAW_CAST(Function, LOAD_CONSTANT(Bytecode::DecodeD(*(pc + i + 1))));
+ *++SP = target;
+ pc++;
+ break;
+ }
+ }
+ pc += 2 * cids_length;
+ DISPATCH();
+ }
+
+ {
BYTECODE(NativeBootstrapCall, 0);
RawFunction* function = FrameFunction(FP);
RawObject** incoming_args =
« no previous file with comments | « runtime/vm/locations.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698