Closed Bug 1178840 Opened 9 years ago Closed 9 years ago

Odin: Retrieve basic block position and source offset from the bytecode position

Categories

(Core :: JavaScript Engine: JIT, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: bbouvier, Unassigned)

References

Details

For perf (the linux tool) support, we have a debug-only way to annotate basic blocks with the source code position (line and column). This will be broken by bug 1157624, so it will need fixing.

Two things need to be fixed:
- we need a way to retrieve the source code offset from the bytecode position. I thought about having debug information, at the function or module level (with a map from bytecode-position to source-offset; and we'd iterate backwards from the given bytecode to the closest one which is in the map, if the exact value isn't found). But after a discussion with luke, we want to ensure debug information is implemented The Right Way (c), so that's been postponed.
- for control flow structures, we sometimes even don't have the bytecode position. For instance, when creating an if/else, we know the position of the 'if' block as we're decoding it, but the next block (join block or else block) has an unknown (bytecode) position. One way to do it would be to have a block with a temporary unknown position, and patch it later when we get to the actual next block. I think the issue would be trivial to deal with, if we had postorder serialization (as we'd have to create the blocks as they show up in the bytecode, before actually creating the control flow).
Perf block annotations will be removed in bug 1186424.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.