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

Unified Diff: runtime/lib/function.cc

Issue 2818273002: Remove parent_level field of function type parameters. (Closed)
Patch Set: address comments Created 3 years, 8 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 | « no previous file | runtime/lib/function.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/function.cc
diff --git a/runtime/lib/function.cc b/runtime/lib/function.cc
index caf3e1e5aae1a205b1c86087ee8851adf5ec5912..8ba93bafaa59c0c14ee02d4321c58a8c94558f7d 100644
--- a/runtime/lib/function.cc
+++ b/runtime/lib/function.cc
@@ -76,19 +76,22 @@ DEFINE_NATIVE_ENTRY(Closure_hashCode, 1) {
DEFINE_NATIVE_ENTRY(Closure_clone, 1) {
const Closure& receiver =
Closure::CheckedHandle(zone, arguments->NativeArgAt(0));
- const TypeArguments& instantiator =
- TypeArguments::Handle(zone, receiver.instantiator());
- const Function& func = Function::Handle(zone, receiver.function());
- const Context& ctx = Context::Handle(zone, receiver.context());
- Context& cloned_ctx =
- Context::Handle(zone, Context::New(ctx.num_variables()));
- cloned_ctx.set_parent(Context::Handle(zone, ctx.parent()));
- Object& inst = Object::Handle(zone);
- for (int i = 0; i < ctx.num_variables(); i++) {
- inst = ctx.At(i);
- cloned_ctx.SetAt(i, inst);
+ const TypeArguments& instantiator_type_arguments =
+ TypeArguments::Handle(zone, receiver.instantiator_type_arguments());
+ const TypeArguments& function_type_arguments =
+ TypeArguments::Handle(zone, receiver.function_type_arguments());
+ const Function& function = Function::Handle(zone, receiver.function());
+ const Context& context = Context::Handle(zone, receiver.context());
+ Context& cloned_context =
+ Context::Handle(zone, Context::New(context.num_variables()));
+ cloned_context.set_parent(Context::Handle(zone, context.parent()));
+ Object& instance = Object::Handle(zone);
+ for (int i = 0; i < context.num_variables(); i++) {
+ instance = context.At(i);
+ cloned_context.SetAt(i, instance);
}
- return Closure::New(instantiator, func, cloned_ctx);
+ return Closure::New(instantiator_type_arguments, function_type_arguments,
+ function, cloned_context);
}
« no previous file with comments | « no previous file | runtime/lib/function.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698