Skip to content

Commit e979895

Browse files
rmacnak-googlecommit-bot@chromium.org
authored andcommitted
Revert "[vm] Repair the resolver abstraction."
This reverts commit 3fd124d. Reason for revert: Provokes existing bug in hot reload call site reset Original change's description: > [vm] Repair the resolver abstraction. > > - Move resolution logic that accumulated in the runtime entries into Resolver. > - Improve NoSuchMethodError for closures when --no-lazy-dispatchers > - Fix concurrent modification of Null class by nullability propagation. > > Change-Id: Id979459bea43d318a4bb8fd904ef7f23e2711342 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97846 > Commit-Queue: Ryan Macnak <[email protected]> > Reviewed-by: Régis Crelier <[email protected]> [email protected],[email protected],[email protected],[email protected] Change-Id: Ife28f28fff7394dca3fc27e2745370030572720e No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98427 Reviewed-by: Ryan Macnak <[email protected]> Commit-Queue: Ryan Macnak <[email protected]>
1 parent dd7a632 commit e979895

10 files changed

+247
-278
lines changed

runtime/vm/compilation_trace.cc

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,22 @@ RawObject* CompilationTraceLoader::CompileTriple(const char* uri_cstr,
241241
field_ = cls_.LookupFieldAllowPrivate(function_name2_);
242242
if (!function_.IsNull() && !function_.is_static()) {
243243
// Maybe this was a method extractor.
244-
// TODO(rmacnak)
244+
function2_ =
245+
Resolver::ResolveDynamicAnyArgs(zone_, cls_, function_name_);
246+
if (!function2_.IsNull()) {
247+
error_ = CompileFunction(function2_);
248+
if (error_.IsError()) {
249+
if (FLAG_trace_compilation_trace) {
250+
THR_Print(
251+
"Compilation trace: error compiling extractor %s for "
252+
"%s,%s,%s (%s)\n",
253+
function2_.ToCString(), uri_.ToCString(),
254+
class_name_.ToCString(), function_name_.ToCString(),
255+
Error::Cast(error_).ToErrorCString());
256+
}
257+
return error_.raw();
258+
}
259+
}
245260
}
246261
}
247262
if (field_.IsNull() && is_getter) {

runtime/vm/compiler/backend/flow_graph.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,10 @@ FlowGraph::ToCheck FlowGraph::CheckForInstanceCall(
503503
#else
504504
const Class& null_class =
505505
Class::Handle(zone(), isolate()->object_store()->null_class());
506-
if (Resolver::HasDefinition(zone(), null_class, method_name)) {
506+
const Function& target = Function::Handle(
507+
zone(),
508+
Resolver::ResolveDynamicAnyArgs(zone(), null_class, method_name));
509+
if (!target.IsNull()) {
507510
return ToCheck::kCheckCid;
508511
}
509512
#endif

runtime/vm/compiler/backend/type_propagator.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -310,12 +310,11 @@ void FlowGraphTypePropagator::CheckNonNullSelector(
310310
// Nothing to do if type is already non-nullable.
311311
return;
312312
}
313-
314-
Thread* thread = Thread::Current();
315-
Zone* zone = thread->zone();
316313
const Class& null_class =
317-
Class::Handle(zone, thread->isolate()->object_store()->null_class());
318-
if (!Resolver::HasDefinition(zone, null_class, function_name)) {
314+
Class::Handle(Isolate::Current()->object_store()->null_class());
315+
const Function& target = Function::Handle(Resolver::ResolveDynamicAnyArgs(
316+
Thread::Current()->zone(), null_class, function_name));
317+
if (target.IsNull()) {
319318
// If the selector is not defined on Null, we can propagate non-nullness.
320319
CompileType* type = TypeOf(receiver);
321320
if (type->is_nullable()) {

runtime/vm/dart_entry.cc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,7 @@ RawObject* DartEntry::InvokeClosure(const Array& arguments,
267267
}
268268

269269
// No compatible method or getter so invoke noSuchMethod.
270-
String& function_name = String::Handle(zone);
271-
if (instance.IsClosure()) {
272-
function_name = Function::Handle(zone, Closure::Cast(instance).function())
273-
.QualifiedUserVisibleName();
274-
} else {
275-
function_name = Symbols::Call().raw();
276-
}
277-
return InvokeNoSuchMethod(instance, function_name, arguments,
270+
return InvokeNoSuchMethod(instance, Symbols::Call(), arguments,
278271
arguments_descriptor);
279272
}
280273

runtime/vm/dart_entry.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ class ArgumentsDescriptor : public ValueObject {
4747
bool MatchesNameAt(intptr_t i, const String& other) const;
4848
// Returns array of argument names in the arguments order.
4949
RawArray* GetArgumentNames() const;
50-
const Array& array() const { return array_; }
5150

5251
// Generated code support.
5352
static intptr_t type_args_len_offset();

0 commit comments

Comments
 (0)