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

Unified Diff: runtime/vm/code_generator.cc

Issue 178233003: Allocate instance closures similarly to regular closures, i.e. without a (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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/code_generator.h ('k') | runtime/vm/flow_graph_builder.cc » ('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 33072)
+++ runtime/vm/code_generator.cc (working copy)
@@ -206,53 +206,6 @@
}
-// TODO(regis): Not used anymore. Delete.
-
-// Allocate a new closure.
-// The type argument vector of a closure is always the vector of type parameters
-// of its signature class, i.e. an uninstantiated identity vector. Therefore,
-// the instantiator type arguments can be used as the instantiated closure type
-// arguments and is passed here as the type arguments.
-// Arg0: local function.
-// Arg1: type arguments of the closure (i.e. instantiator).
-// Return value: newly allocated closure.
-DEFINE_RUNTIME_ENTRY(AllocateClosure, 2) {
- const Function& function = Function::CheckedHandle(arguments.ArgAt(0));
- ASSERT(function.IsClosureFunction() && !function.IsImplicitClosureFunction());
- const TypeArguments& type_arguments =
- TypeArguments::CheckedHandle(arguments.ArgAt(1));
- ASSERT(type_arguments.IsNull() || type_arguments.IsInstantiated());
- // The current context was saved in the Isolate structure when entering the
- // runtime.
- const Context& context = Context::Handle(isolate->top_context());
- ASSERT(!context.IsNull());
- const Instance& closure = Instance::Handle(Closure::New(function, context));
- Closure::SetTypeArguments(closure, type_arguments);
- arguments.SetReturn(closure);
-}
-
-
-// Allocate a new implicit instance closure.
-// Arg0: local function.
-// Arg1: receiver object.
-// Arg2: type arguments of the closure.
-// Return value: newly allocated closure.
-DEFINE_RUNTIME_ENTRY(AllocateImplicitInstanceClosure, 3) {
- const Function& function = Function::CheckedHandle(arguments.ArgAt(0));
- ASSERT(function.IsImplicitInstanceClosureFunction());
- const Instance& receiver = Instance::CheckedHandle(arguments.ArgAt(1));
- const TypeArguments& type_arguments =
- TypeArguments::CheckedHandle(arguments.ArgAt(2));
- ASSERT(type_arguments.IsNull() || type_arguments.IsInstantiated());
- Context& context = Context::Handle();
- context = Context::New(1);
- context.SetAt(0, receiver);
- const Instance& closure = Instance::Handle(Closure::New(function, context));
- Closure::SetTypeArguments(closure, type_arguments);
- arguments.SetReturn(closure);
-}
-
-
// Allocate a new context large enough to hold the given number of variables.
// Arg0: number of variables.
// Return value: newly allocated context.
« no previous file with comments | « runtime/vm/code_generator.h ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698