Skip to content

Commit a90f390

Browse files
sstricklCommit Queue
authored andcommitted
[vm,dyn_modules] Add bytecode closures to the ClosureFunctionCache.
This allows Debugger::FindNextFit to locate source positions within inner closures. TEST=pkg/vm_service/test Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try,vm-aot-dyn-linux-debug-x64-try,vm-aot-dyn-linux-product-x64-try,vm-dyn-mac-debug-arm64-try Change-Id: I57cf3073e2013c1e395f3897fd73d1f3073922ac Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/449541 Reviewed-by: Alexander Markov <[email protected]> Commit-Queue: Tess Strickland <[email protected]>
1 parent 9bee017 commit a90f390

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

runtime/vm/bytecode_reader.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,8 @@ void BytecodeReaderHelper::ReadCode(const Function& function,
317317
KernelBytecodeDisassembler::Disassemble(closure);
318318
}
319319
}
320+
321+
ClosureFunctionsCache::AddClosureFunctionLocked(closure);
320322
}
321323
}
322324
}

runtime/vm/closure_functions_cache.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ using FunctionHashMap = UnorderedHashMap<FunctionHashMapTraits>;
2626
FunctionPtr ClosureFunctionsCache::LookupClosureFunction(
2727
const Function& member_function,
2828
intptr_t kernel_offset) {
29+
ASSERT(!member_function.HasBytecode());
2930
auto thread = Thread::Current();
3031
SafepointReadRwLocker ml(thread, thread->isolate_group()->program_lock());
3132
return LookupClosureFunctionLocked(member_function, kernel_offset);
@@ -34,6 +35,7 @@ FunctionPtr ClosureFunctionsCache::LookupClosureFunction(
3435
FunctionPtr ClosureFunctionsCache::LookupClosureFunctionLocked(
3536
const Function& member_function,
3637
intptr_t kernel_offset) {
38+
ASSERT(!member_function.HasBytecode());
3739
auto thread = Thread::Current();
3840
auto zone = thread->zone();
3941
auto object_store = thread->isolate_group()->object_store();
@@ -86,7 +88,7 @@ void ClosureFunctionsCache::AddClosureFunctionLocked(
8688
function.IsNonImplicitClosureFunction());
8789
closures.Add(function, Heap::kOld);
8890

89-
if (allow_implicit_closure_functions) {
91+
if (allow_implicit_closure_functions || function.HasBytecode()) {
9092
return;
9193
}
9294

0 commit comments

Comments
 (0)