-
Notifications
You must be signed in to change notification settings - Fork 491
Typed arrays + flags for the FuncTable #6323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,6 +43,7 @@ import type { | |
| MarkerIndex, | ||
| SelectedMarkersPerThread, | ||
| } from 'firefox-profiler/types'; | ||
| import { FuncFlag } from 'firefox-profiler/types'; | ||
| import { | ||
| decodeUintArrayFromUrlComponent, | ||
| encodeUintArrayForUrlComponent, | ||
|
|
@@ -1719,7 +1720,7 @@ function getStackIndexFromVersion3JSCallNodePath( | |
| const prefix = offset === 0 ? null : stackIndex - offset; | ||
| const frameIndex = stackTable.frame[stackIndex]; | ||
| const funcIndex = frameTable.func[frameIndex]; | ||
| const isJS = funcTable.isJS[funcIndex]; | ||
| const isJS = (funcTable.flags[funcIndex] & FuncFlag.IsJS) !== 0; | ||
| // We know that at this point stack table is sorted and the following | ||
| // condition holds: | ||
| // assert(prefix === null || prefix < stackIndex); | ||
|
|
@@ -1762,7 +1763,11 @@ function getVersion4JSCallNodePathFromStackIndex( | |
| while (nextStackIndex !== null) { | ||
| const frameIndex: IndexIntoFrameTable = stackTable.frame[nextStackIndex]; | ||
| const funcIndex = frameTable.func[frameIndex]; | ||
| if (funcTable.isJS[funcIndex] || funcTable.relevantForJS[funcIndex]) { | ||
| if ( | ||
| (funcTable.flags[funcIndex] & | ||
| (FuncFlag.IsJS | FuncFlag.RelevantForJS)) !== | ||
|
Comment on lines
+1767
to
+1768
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not for this PR, but now that we are having more bit flags and tests like this, I wonder if it makes sense to create a generic function for testing these flags to make things easier to read. Especially it's a footgun to forget the parenthesis before But I'm also not sure about the perf overhead of it in hot loops in general. So I think this is perfectly fine. |
||
| 0 | ||
| ) { | ||
| callNodePath.unshift(funcIndex); | ||
| } | ||
| const offset: number = stackTable.prefixOffset[nextStackIndex]; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!