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

Unified Diff: runtime/vm/simulator_dbc.cc

Issue 2149993006: DBC: Make unoptimized static calls call through ICData (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments 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/isolate_reload.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 4102e8f1c71ec4182193bbafa51e30ba6e9e47df..757e54b1756934d703cee642f929052b8234b053 100644
--- a/runtime/vm/simulator_dbc.cc
+++ b/runtime/vm/simulator_dbc.cc
@@ -1374,7 +1374,7 @@ RawObject* Simulator::Call(const Code& code,
}
{
- BYTECODE(StaticCall, A_D);
+ BYTECODE(IndirectStaticCall, A_D);
// Check if single stepping.
if (thread->isolate()->single_step()) {
@@ -1386,6 +1386,12 @@ RawObject* Simulator::Call(const Code& code,
// Invoke target function.
{
const uint16_t argc = rA;
+ // Lookup the funciton in the ICData.
+ RawObject* ic_data_obj = SP[0];
+ RawICData* ic_data = RAW_CAST(ICData, ic_data_obj);
+ RawArray* cache = ic_data->ptr()->ic_data_->ptr();
+ SP[0] = cache->data()[ICData::TargetIndexFor(
+ ic_data->ptr()->state_bits_ & 0x3)];
RawObject** call_base = SP - argc;
RawObject** call_top = SP; // *SP contains function
argdesc = static_cast<RawArray*>(LOAD_CONSTANT(rD));
@@ -1396,6 +1402,16 @@ RawObject* Simulator::Call(const Code& code,
}
{
+ BYTECODE(StaticCall, A_D);
+ const uint16_t argc = rA;
+ RawObject** call_base = SP - argc;
+ RawObject** call_top = SP; // *SP contains function
+ argdesc = static_cast<RawArray*>(LOAD_CONSTANT(rD));
+ Invoke(thread, call_base, call_top, &pp, &pc, &FP, &SP);
+ DISPATCH();
+ }
+
+ {
BYTECODE(InstanceCall1, A_D);
// Check if single stepping.
« no previous file with comments | « runtime/vm/isolate_reload.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698