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

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: new simpler approach 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 25920)
+++ runtime/vm/object.cc (working copy)
@@ -1847,9 +1847,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());
@@ -2082,19 +2082,13 @@
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 DartFunction class.
+ result.set_super_type(Type::Handle(Type::Function()));
result.set_is_synthesized_class();
result.set_type_arguments_field_offset(Closure::type_arguments_offset());
- // Implements interface "Function".
- const Type& function_type = Type::Handle(Type::Function());
- const Array& interfaces = Array::Handle(Array::New(1, Heap::kOld));
- interfaces.SetAt(0, function_type);
- result.set_interfaces(interfaces);
if (!signature_function.IsNull()) {
result.PatchSignatureFunction(signature_function);
}

Powered by Google App Engine
This is Rietveld 408576698