forked from google/starlark-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/compile: record column information for each PC offset (googl…
…e#204) * internal/compile: record column information for each PC offset Prior to this CL, the line-number table in the compiled code recorded only the line number for each program counter value. This change causes it to record columns too. By stealing bits from the PC and line fields, we can encode the additional information in the same 16 bits of space, again using the same delta encoding approach for columns. The field widths (uint4 for Δpc, int5 for Δline, and int6 for Δcol) were chosen after analysis of a large set of files to minimize the frequency of overflows, which are more common now but still account for only about 2.5% of all rows. Also, the encoder and decoder now implicitly initialize line to fn.pos.line (which we already record) instead of zero, which avoids a bunch of overflow entries at the start of any function declared far from the start of the file. This optimization could have been applied independently, but it helped pay for the new feature. The decompressed LNTs are 50% bigger, but only a minority of functions' LNTs are materialized in a typical program due to calls to Funcode.Position via Thread.CallStack. Fixes google#176 Change-Id: I07c1621a1718844e5098b15a034dffdc27eb09c7 * internal/compile: record column information for each PC offset Prior to this CL, the line-number table in the compiled code recorded only the line number for each program counter value. This change causes it to record columns too. By stealing bits from the PC and line fields, we can encode the additional information in the same 16 bits of space, again using the same delta encoding approach for columns. The field widths (uint4 for Δpc, int5 for Δline, and int6 for Δcol) were chosen after analysis of a large set of files to minimize the frequency of overflows, which are more common now but still account for only about 2.5% of all rows. Also, the encoder and decoder now implicitly initialize line to fn.pos.line (which we already record) instead of zero, which avoids a bunch of overflow entries at the start of any function declared far from the start of the file. This optimization could have been applied independently, but it helped pay for the new feature. The decompressed LNTs are 50% bigger, but only a minority of functions' LNTs are materialized in a typical program due to calls to Funcode.Position via Thread.CallStack. Fixes google#176
- Loading branch information
Showing
3 changed files
with
89 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters