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

Unified Diff: runtime/vm/code_generator.cc

Issue 19774007: Collect both arguments for math's min/max static functions. Later that information will be used to … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
Index: runtime/vm/code_generator.cc
===================================================================
--- runtime/vm/code_generator.cc (revision 25162)
+++ runtime/vm/code_generator.cc (working copy)
@@ -1024,6 +1024,42 @@
}
+// Handles a static call in unoptimized code that has two arguments types not
regis 2013/07/18 21:30:18 arguments -> argument
srdjan 2013/07/18 22:17:06 Done.
+// seen before. Compile the target if necessary and update the ICData.
+// Arg0: argument 0.
+// Arg1: argument 1.
+// Arg2: IC data object.
+DEFINE_RUNTIME_ENTRY(StaticCallMissHandlerTwoArgs, 3) {
+ ASSERT(arguments.ArgCount() ==
+ kStaticCallMissHandlerTwoArgsRuntimeEntry.argument_count());
+ const Instance& arg0 = Instance::CheckedHandle(arguments.ArgAt(0));
+ const Instance& arg1 = Instance::CheckedHandle(arguments.ArgAt(1));
+ const ICData& ic_data = ICData::CheckedHandle(arguments.ArgAt(2));
+ // IC data for static call is prepopulated with the statically known target.
+ ASSERT(ic_data.NumberOfChecks() > 0);
+ const Function& target = Function::Handle(ic_data.GetTargetAt(0));
+ if (!target.HasCode()) {
+ const Error& error = Error::Handle(Compiler::CompileFunction(target));
+ if (!error.IsNull()) {
+ Exceptions::PropagateError(error);
+ }
+ }
+ ASSERT(!target.IsNull() && target.HasCode());
+ GrowableArray<intptr_t> cids(2);
+ cids.Add(arg0.GetClassId());
+ cids.Add(arg1.GetClassId());
+ ic_data.AddCheck(cids, target);
+ if (FLAG_trace_ic) {
+ DartFrameIterator iterator;
+ StackFrame* caller_frame = iterator.NextFrame();
+ ASSERT(caller_frame != NULL);
+ OS::PrintErr("StaticCallMissHandler at %#"Px" target %s (%"Pd", %"Pd")\n",
+ caller_frame->pc(), target.ToCString(), cids[0], cids[1]);
+ }
+ arguments.SetReturn(target);
+}
+
+
// Handle a miss of a megamorphic cache.
// Arg0: Receiver.
// Arg1: ICData object.

Powered by Google App Engine
This is Rietveld 408576698