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

Unified Diff: runtime/vm/deferred_objects.cc

Issue 1584223006: Remove signature classes from the VM. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync Created 4 years, 11 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/debugger_api_impl.cc ('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/deferred_objects.cc
diff --git a/runtime/vm/deferred_objects.cc b/runtime/vm/deferred_objects.cc
index 71a734acaa610ede45e144bff77701bc52cf5955..d3f89c798bec0d09610beba265784c0caeda76ad 100644
--- a/runtime/vm/deferred_objects.cc
+++ b/runtime/vm/deferred_objects.cc
@@ -304,6 +304,48 @@ void DeferredObject::Fill() {
}
}
}
+ } else if (cls.id() == kClosureCid) {
+ // TODO(regis): It would be better to programmatically add these fields to
+ // the VM Closure class. Declaring them in the Dart class _Closure does not
+ // work, because the class is prefinalized and CalculateFieldOffsets is
+ // therefore not called. Resetting the finalization state may be an option.
+ const Closure& closure = Closure::Cast(*object_);
+
+ Smi& offset = Smi::Handle();
+ Object& value = Object::Handle();
+
+ for (intptr_t i = 0; i < field_count_; i++) {
+ offset ^= GetFieldOffset(i);
+ if (offset.Value() == Closure::type_arguments_offset()) {
+ TypeArguments& arguments = TypeArguments::Handle();
+ arguments ^= GetValue(i);
+ closure.SetTypeArguments(arguments);
+ if (FLAG_trace_deoptimization_verbose) {
+ OS::PrintErr(" closure@type_arguments (offset %" Pd ") <- %s\n",
+ offset.Value(),
+ value.ToCString());
+ }
+ } else if (offset.Value() == Closure::function_offset()) {
+ Function& function = Function::Handle();
+ function ^= GetValue(i);
+ closure.set_function(function);
+ if (FLAG_trace_deoptimization_verbose) {
+ OS::PrintErr(" closure@function (offset %" Pd ") <- %s\n",
+ offset.Value(),
+ value.ToCString());
+ }
+ } else {
+ ASSERT(offset.Value() == Closure::context_offset());
+ Context& context = Context::Handle();
+ context ^= GetValue(i);
+ closure.set_context(context);
+ if (FLAG_trace_deoptimization_verbose) {
+ OS::PrintErr(" closure@context (offset %" Pd ") <- %s\n",
+ offset.Value(),
+ value.ToCString());
+ }
+ }
+ }
} else {
const Instance& obj = Instance::Cast(*object_);
@@ -324,8 +366,7 @@ void DeferredObject::Fill() {
value.ToCString());
}
} else {
- ASSERT(cls.IsSignatureClass() ||
- (offset.Value() == cls.type_arguments_field_offset()));
+ ASSERT(offset.Value() == cls.type_arguments_field_offset());
obj.SetFieldAtOffset(offset.Value(), value);
if (FLAG_trace_deoptimization_verbose) {
OS::PrintErr(" null Field @ offset(%" Pd ") <- %s\n",
« no previous file with comments | « runtime/vm/debugger_api_impl.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698