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

Unified Diff: runtime/vm/object.cc

Issue 22425006: Fix equality of implicit closures in the Dart VM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: added missing file Created 7 years, 4 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
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 26064)
+++ runtime/vm/object.cc (working copy)
@@ -979,6 +979,14 @@
RegisterPrivateClass(cls, Symbols::_Double(), core_lib);
pending_classes.Add(cls, Heap::kOld);
+ // Abstract super class for all signature classes.
+ cls = Class::New<Instance>(kIllegalCid);
+ cls.set_is_prefinalized();
+ RegisterPrivateClass(cls, Symbols::DartFunctionImpl(), core_lib);
+ pending_classes.Add(cls, Heap::kOld);
+ type = Type::NewNonParameterizedType(cls);
+ object_store->set_dart_function_impl_type(type);
+
cls = Class::New<WeakProperty>();
object_store->set_weak_property_class(cls);
RegisterPrivateClass(cls, Symbols::_WeakProperty(), core_lib);
@@ -1110,7 +1118,6 @@
name = Symbols::New("String");
cls = Class::New<Instance>(kIllegalCid);
- cls.set_is_prefinalized();
RegisterClass(cls, name, core_lib);
cls.set_is_prefinalized();
pending_classes.Add(cls, Heap::kOld);
@@ -1881,9 +1888,9 @@
invocation.SetNumOptionalParameters(desc.NamedCount(),
false); // Not positional.
invocation.set_parameter_types(Array::Handle(Array::New(desc.Count(),
- Heap::kOld)));
+ Heap::kOld)));
invocation.set_parameter_names(Array::Handle(Array::New(desc.Count(),
- Heap::kOld)));
+ Heap::kOld)));
// Receiver.
invocation.SetParameterTypeAt(0, Type::Handle(Type::DynamicType()));
invocation.SetParameterNameAt(0, Symbols::This());
@@ -2129,12 +2136,12 @@
const Script& script,
intptr_t token_pos) {
const Class& result = Class::Handle(New(name, script, token_pos));
- const Type& super_type = Type::Handle(Type::ObjectType());
- ASSERT(!super_type.IsNull());
// Instances of a signature class can only be closures.
result.set_instance_size(Closure::InstanceSize());
result.set_next_field_offset(Closure::InstanceSize());
- result.set_super_type(super_type);
+ // Signature classes extend the _FunctionImpl class.
+ result.set_super_type(Type::Handle(
+ Isolate::Current()->object_store()->dart_function_impl_type()));
result.set_is_synthesized_class();
result.set_type_arguments_field_offset(Closure::type_arguments_offset());
// Implements interface "Function".

Powered by Google App Engine
This is Rietveld 408576698