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

Unified Diff: runtime/vm/code_generator.cc

Issue 11642003: Create and cache method extraction stub in the ICData. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: ready for review. Created 8 years 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/flow_graph.h » ('j') | runtime/vm/flow_graph_optimizer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator.cc
diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc
index 87b2a89ce36376f5c4f5177f71085f7ce9f022c5..37e00ad5626b6774fee919ece5c26fef2f5d478f 100644
--- a/runtime/vm/code_generator.cc
+++ b/runtime/vm/code_generator.cc
@@ -1097,7 +1097,8 @@ DEFINE_RUNTIME_ENTRY(UpdateICDataTwoArgs, 4) {
// Otherwise return null.
static RawInstance* ResolveImplicitClosure(const Instance& receiver,
const Class& receiver_class,
- const String& target_name) {
+ const String& target_name,
+ const ICData& ic_data) {
// 1. Check if was a getter call.
if (!Field::IsGetterName(target_name)) return Instance::null();
@@ -1120,6 +1121,11 @@ static RawInstance* ResolveImplicitClosure(const Instance& receiver,
AbstractTypeArguments::Handle(receiver.GetTypeArguments());
closure.SetTypeArguments(type_arguments);
}
+
+ ASSERT(ic_data.num_args_tested() == 1);
+ ic_data.AddReceiverCheck(
+ receiver_class.id(),
+ Function::Handle(StubCode::GetMethodExtractor(closure_function)));
return closure.raw();
}
@@ -1404,7 +1410,8 @@ DEFINE_RUNTIME_ENTRY(InstanceFunctionLookup, 4) {
Instance& closure = Instance::Handle(ResolveImplicitClosure(receiver,
receiver_class,
- target_name));
+ target_name,
+ ic_data));
if (!closure.IsNull()) {
arguments.SetReturn(closure);
return;
« no previous file with comments | « no previous file | runtime/vm/flow_graph.h » ('j') | runtime/vm/flow_graph_optimizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698