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

Unified Diff: runtime/vm/bootstrap_nocore.cc

Issue 2719603002: Rename Closure instance field type_arguments_ to instantiator_. (Closed)
Patch Set: work in progress Created 3 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/bootstrap.cc ('k') | runtime/vm/code_generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/bootstrap_nocore.cc
diff --git a/runtime/vm/bootstrap_nocore.cc b/runtime/vm/bootstrap_nocore.cc
index 74367a1d6406facda5d50df1dbd4b2e7c009d9bf..a188ae5ddbf086389443676e5cbed01b23da2ebf 100644
--- a/runtime/vm/bootstrap_nocore.cc
+++ b/runtime/vm/bootstrap_nocore.cc
@@ -47,8 +47,23 @@ void Finish(Thread* thread, bool from_kernel) {
// instances. This allows us to just finalize function types without going
// through the hoops of trying to compile their scope class.
ObjectStore* object_store = thread->isolate()->object_store();
- Class& cls = Class::Handle(thread->zone(), object_store->closure_class());
+ Zone* zone = thread->zone();
+ Class& cls = Class::Handle(zone, object_store->closure_class());
Compiler::CompileClass(cls);
+
+#if defined(DEBUG)
+ // Verify that closure field offsets are identical in Dart and C++.
+ const Array& fields = Array::Handle(zone, cls.fields());
+ ASSERT(fields.Length() == 3);
+ Field& field = Field::Handle(zone);
+ field ^= fields.At(0);
+ ASSERT(field.Offset() == Closure::instantiator_offset());
+ field ^= fields.At(1);
+ ASSERT(field.Offset() == Closure::function_offset());
+ field ^= fields.At(2);
+ ASSERT(field.Offset() == Closure::context_offset());
+#endif // defined(DEBUG)
+
// Eagerly compile Bool class, bool constants are used from within compiler.
cls = object_store->bool_class();
Compiler::CompileClass(cls);
« no previous file with comments | « runtime/vm/bootstrap.cc ('k') | runtime/vm/code_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698