Skip to content

Commit b75b5dc

Browse files
alexmarkovCommit Queue
authored andcommitted
[vm] Cleanup unused Library::GetFunctionClosure
TEST=ci Change-Id: I303ea1fc07c9a682f8c3b2800c9baebd78fc567f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428302 Reviewed-by: Ryan Macnak <[email protected]> Commit-Queue: Alexander Markov <[email protected]>
1 parent a2f785c commit b75b5dc

File tree

2 files changed

+0
-30
lines changed

2 files changed

+0
-30
lines changed

runtime/vm/object.cc

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16019,31 +16019,6 @@ FunctionPtr Library::GetFunction(const Library& lib,
1601916019
return func.ptr();
1602016020
}
1602116021

16022-
ObjectPtr Library::GetFunctionClosure(const String& name) const {
16023-
Thread* thread = Thread::Current();
16024-
Zone* zone = thread->zone();
16025-
Function& func = Function::Handle(zone, LookupFunctionAllowPrivate(name));
16026-
if (func.IsNull()) {
16027-
// Check whether the function is reexported into the library.
16028-
const Object& obj = Object::Handle(zone, LookupReExport(name));
16029-
if (obj.IsFunction()) {
16030-
func ^= obj.ptr();
16031-
} else {
16032-
// Check if there is a getter of 'name', in which case invoke it
16033-
// and return the result.
16034-
const String& getter_name = String::Handle(zone, Field::GetterName(name));
16035-
func = LookupFunctionAllowPrivate(getter_name);
16036-
if (func.IsNull()) {
16037-
return Closure::null();
16038-
}
16039-
// Invoke the getter and return the result.
16040-
return DartEntry::InvokeFunction(func, Object::empty_array());
16041-
}
16042-
}
16043-
func = func.ImplicitClosureFunction();
16044-
return func.ImplicitStaticClosure();
16045-
}
16046-
1604716022
#if defined(DEBUG) && !defined(DART_PRECOMPILED_RUNTIME)
1604816023
void Library::CheckFunctionFingerprints() {
1604916024
Library& lib = Library::Handle();

runtime/vm/object.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5443,11 +5443,6 @@ class Library : public Object {
54435443
void CheckReload(const Library& replacement,
54445444
ProgramReloadContext* context) const;
54455445

5446-
// Returns a closure of top level function 'name' in the exported namespace
5447-
// of this library. If a top level function 'name' does not exist we look
5448-
// for a top level getter 'name' that returns a closure.
5449-
ObjectPtr GetFunctionClosure(const String& name) const;
5450-
54515446
// Ensures that all top-level functions and variables (fields) are loaded.
54525447
void EnsureTopLevelClassIsFinalized() const;
54535448

0 commit comments

Comments
 (0)