Skip to content

Commit ffc6151

Browse files
Jeffrey Tanfacebook-github-bot
authored andcommitted
Fix FinalizableNativeFunction for Loom
Reviewed By: dulinriley Differential Revision: D18330211 fbshipit-source-id: bb58b7c71cfeca71d2c61fe4eeaa39207b1e2d3c
1 parent 24a5df2 commit ffc6151

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/VM/Profiler/SamplingProfilerPosix.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ uint32_t SamplingProfiler::walkRuntimeStack(
288288
// 1. Most significant bit of 64bits address is set for native frame.
289289
// 2. JS frame: module id in high 32 bits, address virtual offset in lower
290290
// 32 bits, with MSB unset.
291-
// 3. Native frame: address returned with MSB set.
291+
// 3. Native/Finalizable frame: address returned with MSB set.
292292
// TODO: enhance this when supporting more frame types.
293293
sampledStackDepth = std::min(sampledStackDepth, (uint32_t)max_depth);
294294
for (uint32_t i = 0; i < sampledStackDepth; ++i) {
@@ -308,8 +308,12 @@ uint32_t SamplingProfiler::walkRuntimeStack(
308308
frames[i] = frameAddress;
309309
} else if (stackFrame.kind == StackFrame::FrameKind::NativeFunction) {
310310
frames[i] = ((uint64_t)stackFrame.nativeFrame | kNativeFrameMask);
311+
} else if (
312+
stackFrame.kind == StackFrame::FrameKind::FinalizableNativeFunction) {
313+
frames[i] =
314+
((uint64_t)stackFrame.finalizableNativeFrame | kNativeFrameMask);
311315
} else {
312-
llvm_unreachable("Unknown frame kind");
316+
llvm_unreachable("Loom: unknown frame kind");
313317
}
314318
}
315319
*depth = sampledStackDepth;

0 commit comments

Comments
 (0)