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

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
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 150be3ed8b4df78464ebf9ee893868e3a62f4803..b178ae0145a3c10ddcd0fd75b2185d46a20a435f 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -6511,6 +6511,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 {
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698