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

Unified Diff: runtime/vm/code_patcher_dbc.cc

Issue 2226893002: Optimize AOT's switchable calls for the monomorphic case. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync 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/code_patcher_arm_test.cc ('k') | runtime/vm/code_patcher_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_patcher_dbc.cc
diff --git a/runtime/vm/code_patcher_dbc.cc b/runtime/vm/code_patcher_dbc.cc
index 6a273ac1c921703cac17a36444cb05bcdad37ce5..327b27f3a1e2fdbb2c8b3af0cc33148bbdb64d1e 100644
--- a/runtime/vm/code_patcher_dbc.cc
+++ b/runtime/vm/code_patcher_dbc.cc
@@ -68,15 +68,29 @@ RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(
void CodePatcher::PatchSwitchableCallAt(uword return_address,
- const Code& code,
- const ICData& ic_data,
- const MegamorphicCache& cache,
- const Code& lookup_stub) {
- ASSERT(code.ContainsInstructionAt(return_address));
- SwitchableCallPattern call(return_address, code);
- ASSERT(call.cache() == ic_data.raw());
- call.SetLookupStub(lookup_stub);
- call.SetCache(cache);
+ const Code& caller_code,
+ const Object& data,
+ const Code& target) {
+ ASSERT(caller_code.ContainsInstructionAt(return_address));
+ SwitchableCallPattern call(return_address, caller_code);
+ call.SetData(data);
+ call.SetTarget(target);
+}
+
+
+RawCode* CodePatcher::GetSwitchableCallTargetAt(uword return_address,
+ const Code& caller_code) {
+ ASSERT(caller_code.ContainsInstructionAt(return_address));
+ SwitchableCallPattern call(return_address, caller_code);
+ return call.target();
+}
+
+
+RawObject* CodePatcher::GetSwitchableCallDataAt(uword return_address,
+ const Code& caller_code) {
+ ASSERT(caller_code.ContainsInstructionAt(return_address));
+ SwitchableCallPattern call(return_address, caller_code);
+ return call.data();
}
« no previous file with comments | « runtime/vm/code_patcher_arm_test.cc ('k') | runtime/vm/code_patcher_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698