Closed Bug 1847469 Opened 2 years ago Closed 2 years ago

Introduce column number type that represents origin and wasm bit

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: arai, Assigned: arai)

References

(Blocks 1 open bug)

Details

Attachments

(26 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

SpiderMonkey uses both 0-origin column number and 1-origin column number (see a graph in bug 1846913 comment #3 for details), and also the column number can have the wasm flag bit in some place:

https://searchfox.org/mozilla-central/rev/fb43eb3bdf5b51000bc7dfe3474cbe56ca2ab63c/js/src/wasm/WasmFrameIter.cpp#294-308

// As a terrible hack to avoid changing the tons of places that pass around
// (url, line, column) tuples to instead passing around a Variant that
// stores a (url, func-index, bytecode-offset) tuple for wasm frames,
// wasm stuffs its tuple into the existing (url, line, column) tuple,
// tagging the high bit of the column to indicate "this is a wasm frame".
// When knowing clients see this bit, they shall render the tuple
// (url, line, column|bit) as "url:wasm-function[column]:0xline" according
// to the WebAssembly Web API's Developer-Facing Display Conventions.
//   https://webassembly.github.io/spec/web-api/index.html#conventions
// The wasm bytecode offset continues to be passed as the JS line to avoid
// breaking existing devtools code written when this used to be the case.

MOZ_ASSERT(!(codeRange_->funcIndex() & ColumnBit));
if (column) {
  *column = codeRange_->funcIndex() | ColumnBit;

It's unclear which field, parameter or return value uses which origin and whether it can have the wasm flag bit.
Introducing a dedicate type for each case should help figuring out the current situation and also will help migrating to 1-origin column number in bug 1144340.

Blocks: 1848467
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/f26a10289316 Part 1: Add JS::ColumnNumberZeroOrigin, JS::ColumnNumberOneOrigin, JS::WasmFunctionIndex, JS::ColumnNumberOffset and compound types. r=iain https://hg.mozilla.org/integration/autoland/rev/b4521e546d7e Part 2: Use column number types in parser and bytecode compiler. r=iain https://hg.mozilla.org/integration/autoland/rev/c19b81f48055 Part 3: Use column number types in module internal. r=iain https://hg.mozilla.org/integration/autoland/rev/a0f789621bc8 Part 4: Use column number types in irregexp. r=iain https://hg.mozilla.org/integration/autoland/rev/9b4d5b435020 Part 5: Use column number types in ErrorMetadata. r=iain https://hg.mozilla.org/integration/autoland/rev/236ff135701e Part 6: Use column number types in Module API. r=iain https://hg.mozilla.org/integration/autoland/rev/6757db4575d7 Part 7: Use column number types in FrameIter and SavedFrame internal. r=iain https://hg.mozilla.org/integration/autoland/rev/aa14337bf5c6 Part 8: Use column number types in ubi. r=iain https://hg.mozilla.org/integration/autoland/rev/f5f78944df81 Part 9: Use column number types in SavedFrame API. r=iain https://hg.mozilla.org/integration/autoland/rev/1fa5ab59814b Part 10: Use column number types in SourceExtent. r=iain https://hg.mozilla.org/integration/autoland/rev/cf84fb98c5e1 Part 11: Use column number types in JSScript. r=iain https://hg.mozilla.org/integration/autoland/rev/782499fbedf2 Part 12: Use column number types in JitCodeSourceInfo. r=iain https://hg.mozilla.org/integration/autoland/rev/a0993f2a2195 Part 13: Use column number types in PCToLineNumber. r=iain https://hg.mozilla.org/integration/autoland/rev/cb57923f6532 Part 14: Use column number types in ScriptSource. r=iain https://hg.mozilla.org/integration/autoland/rev/5df4f43ac0bf Part 15: Use uint32_t for line and column in debugger as a preparation to use column number types. r=iain https://hg.mozilla.org/integration/autoland/rev/056eed7abc97 Part 16: Use column number types in debugger. r=iain https://hg.mozilla.org/integration/autoland/rev/b2ddddec8818 Part 17: Use uint32_t for line and column in JSErrorBase as a preparation to use column number types. r=iain https://hg.mozilla.org/integration/autoland/rev/69f32cf1862a Part 18: Remove unused line and column from MIR. r=iain https://hg.mozilla.org/integration/autoland/rev/df9f925f9837 Part 19: Remove unused conversion functions. r=iain https://hg.mozilla.org/integration/autoland/rev/1320f83fb8c7 Part 20: Use column number types in JSErrorBase. r=iain https://hg.mozilla.org/integration/autoland/rev/8292a38bd99f Part 21: Use column number types in ErrorObject. r=iain https://hg.mozilla.org/integration/autoland/rev/aed75776cfff Part 22: Use column number types in SrcNote::ColSpan. r=iain https://hg.mozilla.org/integration/autoland/rev/f3e2207fdeec Part 23: Use uint32_t for line and column in DescribeScriptedCaller* functions as a preparation to use column number types. r=iain https://hg.mozilla.org/integration/autoland/rev/46833087f8ac Part 24: Use column number types in JS::DescribeScriptedCaller. r=iain https://hg.mozilla.org/integration/autoland/rev/86abf5cf0a22 Part 25: Use uint32_t for line and column in JS::CompileOptions as a preparation to use column number types. r=iain https://hg.mozilla.org/integration/autoland/rev/9b72d668efd2 Part 26: Use column number types in JS::CompileOptions. r=iain https://hg.mozilla.org/integration/autoland/rev/9d6e2651a013 apply code formatting via Lando

Backed out for causing spidermonkey bustages

Flags: needinfo?(arai.unmht)
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/e496e8ae0294 Part 1: Add JS::ColumnNumberZeroOrigin, JS::ColumnNumberOneOrigin, JS::WasmFunctionIndex, JS::ColumnNumberOffset and compound types. r=iain https://hg.mozilla.org/integration/autoland/rev/f3bd9d7686c1 Part 2: Use column number types in parser and bytecode compiler. r=iain https://hg.mozilla.org/integration/autoland/rev/1cee58fb35ca Part 3: Use column number types in module internal. r=iain https://hg.mozilla.org/integration/autoland/rev/e9f19ef7fa03 Part 4: Use column number types in irregexp. r=iain https://hg.mozilla.org/integration/autoland/rev/0dcca111ea50 Part 5: Use column number types in ErrorMetadata. r=iain https://hg.mozilla.org/integration/autoland/rev/3c1671cdc76c Part 6: Use column number types in Module API. r=iain https://hg.mozilla.org/integration/autoland/rev/f1817bc330b7 Part 7: Use column number types in FrameIter and SavedFrame internal. r=iain https://hg.mozilla.org/integration/autoland/rev/e760d2228607 Part 8: Use column number types in ubi. r=iain https://hg.mozilla.org/integration/autoland/rev/43af4e4c0eb6 Part 9: Use column number types in SavedFrame API. r=iain https://hg.mozilla.org/integration/autoland/rev/7d89a3d4f78e Part 10: Use column number types in SourceExtent. r=iain https://hg.mozilla.org/integration/autoland/rev/16ead9106590 Part 11: Use column number types in JSScript. r=iain https://hg.mozilla.org/integration/autoland/rev/23152821fdff Part 12: Use column number types in JitCodeSourceInfo. r=iain https://hg.mozilla.org/integration/autoland/rev/c902ce08d170 Part 13: Use column number types in PCToLineNumber. r=iain https://hg.mozilla.org/integration/autoland/rev/fc1ca17609c2 Part 14: Use column number types in ScriptSource. r=iain https://hg.mozilla.org/integration/autoland/rev/64a80f31ee5e Part 15: Use uint32_t for line and column in debugger as a preparation to use column number types. r=iain https://hg.mozilla.org/integration/autoland/rev/e710b987f162 Part 16: Use column number types in debugger. r=iain https://hg.mozilla.org/integration/autoland/rev/517b02ba0418 Part 17: Use uint32_t for line and column in JSErrorBase as a preparation to use column number types. r=iain https://hg.mozilla.org/integration/autoland/rev/b7407f6a8f97 Part 18: Remove unused line and column from MIR. r=iain https://hg.mozilla.org/integration/autoland/rev/361253f95a3c Part 19: Remove unused conversion functions. r=iain https://hg.mozilla.org/integration/autoland/rev/adf33e49f1db Part 20: Use column number types in JSErrorBase. r=iain https://hg.mozilla.org/integration/autoland/rev/92c56890a465 Part 21: Use column number types in ErrorObject. r=iain https://hg.mozilla.org/integration/autoland/rev/72a25c44626a Part 22: Use column number types in SrcNote::ColSpan. r=iain https://hg.mozilla.org/integration/autoland/rev/b472e6999fc6 Part 23: Use uint32_t for line and column in DescribeScriptedCaller* functions as a preparation to use column number types. r=iain https://hg.mozilla.org/integration/autoland/rev/d48ed29ea766 Part 24: Use column number types in JS::DescribeScriptedCaller. r=iain https://hg.mozilla.org/integration/autoland/rev/2d87cadd4c4e Part 25: Use uint32_t for line and column in JS::CompileOptions as a preparation to use column number types. r=iain https://hg.mozilla.org/integration/autoland/rev/c90a50e57b5e Part 26: Use column number types in JS::CompileOptions. r=iain https://hg.mozilla.org/integration/autoland/rev/52f816cfe298 apply code formatting via Lando

https://hg.mozilla.org/mozilla-central/rev/e496e8ae0294
https://hg.mozilla.org/mozilla-central/rev/f3bd9d7686c1
https://hg.mozilla.org/mozilla-central/rev/1cee58fb35ca
https://hg.mozilla.org/mozilla-central/rev/e9f19ef7fa03
https://hg.mozilla.org/mozilla-central/rev/0dcca111ea50
https://hg.mozilla.org/mozilla-central/rev/3c1671cdc76c
https://hg.mozilla.org/mozilla-central/rev/f1817bc330b7
https://hg.mozilla.org/mozilla-central/rev/e760d2228607
https://hg.mozilla.org/mozilla-central/rev/43af4e4c0eb6
https://hg.mozilla.org/mozilla-central/rev/7d89a3d4f78e
https://hg.mozilla.org/mozilla-central/rev/16ead9106590
https://hg.mozilla.org/mozilla-central/rev/23152821fdff
https://hg.mozilla.org/mozilla-central/rev/c902ce08d170
https://hg.mozilla.org/mozilla-central/rev/fc1ca17609c2
https://hg.mozilla.org/mozilla-central/rev/64a80f31ee5e
https://hg.mozilla.org/mozilla-central/rev/e710b987f162
https://hg.mozilla.org/mozilla-central/rev/517b02ba0418
https://hg.mozilla.org/mozilla-central/rev/b7407f6a8f97
https://hg.mozilla.org/mozilla-central/rev/361253f95a3c
https://hg.mozilla.org/mozilla-central/rev/adf33e49f1db
https://hg.mozilla.org/mozilla-central/rev/92c56890a465
https://hg.mozilla.org/mozilla-central/rev/72a25c44626a
https://hg.mozilla.org/mozilla-central/rev/b472e6999fc6
https://hg.mozilla.org/mozilla-central/rev/d48ed29ea766
https://hg.mozilla.org/mozilla-central/rev/2d87cadd4c4e
https://hg.mozilla.org/mozilla-central/rev/c90a50e57b5e
https://hg.mozilla.org/mozilla-central/rev/52f816cfe298

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
Flags: needinfo?(arai.unmht)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: