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

Unified Diff: runtime/vm/object.cc

Issue 1195573006: Handle field-invocation and method-extraction in the runtime when --lazy_dispatchers=false. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 88802f36c21615825e4f9633767472c81503d68a..c0bbe1197a26a5b31519d0faa7bdfb6fea3a643a 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -6487,6 +6487,21 @@ RawInstance* Function::ImplicitStaticClosure() const {
}
+RawInstance* Function::ImplicitInstanceClosure(const Instance& receiver) const {
+ ASSERT(IsImplicitClosureFunction());
+ const Class& cls = Class::Handle(signature_class());
+ const Context& context = Context::Handle(Context::New(1));
+ context.SetAt(0, receiver);
+ const Instance& result = Instance::Handle(Closure::New(*this, context));
+ if (cls.NumTypeArguments() > 0) {
+ const TypeArguments& type_arguments =
+ TypeArguments::Handle(receiver.GetTypeArguments());
+ result.SetTypeArguments(type_arguments);
+ }
+ return result.raw();
+}
+
+
RawString* Function::BuildSignature(bool instantiate,
NameVisibility name_visibility,
const TypeArguments& instantiator) const {

Powered by Google App Engine
This is Rietveld 408576698