|
10 | 10 |
|
11 | 11 | namespace dart {
|
12 | 12 |
|
13 |
| -FunctionPtr ClosureFunctionsCache::LookupClosureFunction( |
14 |
| - const Class& owner, |
15 |
| - TokenPosition token_pos) { |
16 |
| - auto thread = Thread::Current(); |
17 |
| - SafepointReadRwLocker ml(thread, thread->isolate_group()->program_lock()); |
18 |
| - return LookupClosureFunctionLocked(owner, token_pos); |
19 |
| -} |
20 |
| - |
21 |
| -FunctionPtr ClosureFunctionsCache::LookupClosureFunctionLocked( |
22 |
| - const Class& owner, |
23 |
| - TokenPosition token_pos) { |
24 |
| - auto thread = Thread::Current(); |
25 |
| - auto zone = thread->zone(); |
26 |
| - auto object_store = thread->isolate_group()->object_store(); |
27 |
| - |
28 |
| - DEBUG_ASSERT( |
29 |
| - thread->isolate_group()->program_lock()->IsCurrentThreadReader()); |
30 |
| - |
31 |
| - const auto& closures = |
32 |
| - GrowableObjectArray::Handle(zone, object_store->closure_functions()); |
33 |
| - auto& closure = Function::Handle(zone); |
34 |
| - intptr_t num_closures = closures.Length(); |
35 |
| - for (intptr_t i = 0; i < num_closures; i++) { |
36 |
| - closure ^= closures.At(i); |
37 |
| - if (closure.token_pos() == token_pos && closure.Owner() == owner.ptr()) { |
38 |
| - return closure.ptr(); |
39 |
| - } |
40 |
| - } |
41 |
| - return Function::null(); |
42 |
| -} |
43 |
| - |
44 | 13 | FunctionPtr ClosureFunctionsCache::LookupClosureFunction(
|
45 | 14 | const Function& parent,
|
46 | 15 | TokenPosition token_pos) {
|
@@ -126,33 +95,6 @@ FunctionPtr ClosureFunctionsCache::ClosureFunctionFromIndex(intptr_t idx) {
|
126 | 95 | return Function::RawCast(closures_array.At(idx));
|
127 | 96 | }
|
128 | 97 |
|
129 |
| -FunctionPtr ClosureFunctionsCache::GetUniqueInnerClosure( |
130 |
| - const Function& outer) { |
131 |
| - auto thread = Thread::Current(); |
132 |
| - auto zone = thread->zone(); |
133 |
| - auto object_store = thread->isolate_group()->object_store(); |
134 |
| - |
135 |
| - SafepointReadRwLocker ml(thread, thread->isolate_group()->program_lock()); |
136 |
| - |
137 |
| - const auto& closures = |
138 |
| - GrowableObjectArray::Handle(zone, object_store->closure_functions()); |
139 |
| - auto& entry = Function::Handle(zone); |
140 |
| - for (intptr_t i = (closures.Length() - 1); i >= 0; i--) { |
141 |
| - entry ^= closures.At(i); |
142 |
| - if (entry.parent_function() == outer.ptr()) { |
143 |
| -#if defined(DEBUG) |
144 |
| - auto& other = Function::Handle(zone); |
145 |
| - for (intptr_t j = i - 1; j >= 0; j--) { |
146 |
| - other ^= closures.At(j); |
147 |
| - ASSERT(other.parent_function() != outer.ptr()); |
148 |
| - } |
149 |
| -#endif |
150 |
| - return entry.ptr(); |
151 |
| - } |
152 |
| - } |
153 |
| - return Function::null(); |
154 |
| -} |
155 |
| - |
156 | 98 | void ClosureFunctionsCache::ForAllClosureFunctions(
|
157 | 99 | std::function<bool(const Function&)> callback) {
|
158 | 100 | auto thread = Thread::Current();
|
|
0 commit comments