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

Unified Diff: runtime/vm/code_generator.cc

Issue 17554003: Change static calls in unoptimized code to always call via a stub. Using ICData, the call count of … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 | « no previous file | runtime/vm/code_patcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator.cc
===================================================================
--- runtime/vm/code_generator.cc (revision 24306)
+++ runtime/vm/code_generator.cc (working copy)
@@ -729,8 +729,8 @@
}
-// Patches static call with the target's entry point. Compiles target if
-// necessary.
+// Patches static call in optimized code with the target's entry point.
+// Compiles target if necessary.
DEFINE_RUNTIME_ENTRY(PatchStaticCall, 0) {
ASSERT(arguments.ArgCount() == kPatchStaticCallRuntimeEntry.argument_count());
DartFrameIterator iterator;
@@ -738,6 +738,7 @@
ASSERT(caller_frame != NULL);
const Code& caller_code = Code::Handle(caller_frame->LookupDartCode());
ASSERT(!caller_code.IsNull());
+ ASSERT(caller_code.is_optimized());
const Function& target_function = Function::Handle(
caller_code.GetStaticCallTargetFunctionAt(caller_frame->pc()));
if (!target_function.HasCode()) {
@@ -835,8 +836,10 @@
StackFrame* caller_frame = iterator.NextFrame();
ASSERT(caller_frame != NULL);
const Code& code = Code::Handle(caller_frame->LookupDartCode());
+ ASSERT(!code.is_optimized());
const Function& function =
- Function::Handle(code.GetStaticCallTargetFunctionAt(caller_frame->pc()));
+ Function::Handle(CodePatcher::GetUnoptimizedStaticCallTargetAt(
+ caller_frame->pc(), code));
if (!function.HasCode()) {
const Error& error = Error::Handle(Compiler::CompileFunction(function));
@@ -1403,6 +1406,7 @@
}
ASSERT(frame->IsDartFrame());
const Code& caller_code = Code::Handle(frame->LookupDartCode());
+ ASSERT(caller_code.is_optimized());
const Function& target_function = Function::Handle(
caller_code.GetStaticCallTargetFunctionAt(frame->pc()));
const Code& target_code = Code::Handle(target_function.CurrentCode());
« no previous file with comments | « no previous file | runtime/vm/code_patcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698