Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit 381e333

Browse files
WebAssembly: support name section
JSTests: https://bugs.webkit.org/show_bug.cgi?id=171263 Reviewed by Keith Miller. * wasm/function-tests/nameSection.js: Added. (const.compile): * wasm/function-tests/nameSection.wasm: Added. * wasm/function-tests/stack-trace.js: Update format Source/JavaScriptCore: https://bugs.webkit.org/show_bug.cgi?id=171263 Reviewed by Keith Miller. The name section is an optional custom section in the WebAssembly spec. At least when debugging, developers expect to be able to use this section to obtain intelligible stack traces, otherwise we just number the wasm functions which is somewhat painful. This patch parses this section, dropping its content eagerly on error, and if there is a name section then backtraces use their value instead of numbers. Otherwise we stick to numbers as before. Note that the format of name sections changed in mid-February: WebAssembly/design#984 And binaryen was only updated in early March: WebAssembly/binaryen#933 * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * interpreter/Interpreter.cpp: (JSC::GetStackTraceFunctor::operator()): * interpreter/StackVisitor.cpp: (JSC::StackVisitor::readNonInlinedFrame): (JSC::StackVisitor::Frame::functionName): * interpreter/StackVisitor.h: (JSC::StackVisitor::Frame::wasmFunctionIndexOrName): * runtime/StackFrame.cpp: (JSC::StackFrame::functionName): * runtime/StackFrame.h: (JSC::StackFrame::StackFrame): (JSC::StackFrame::wasm): * wasm/WasmBBQPlanInlines.h: (JSC::Wasm::BBQPlan::initializeCallees): * wasm/WasmCallee.cpp: (JSC::Wasm::Callee::Callee): * wasm/WasmCallee.h: (JSC::Wasm::Callee::create): (JSC::Wasm::Callee::indexOrName): * wasm/WasmFormat.cpp: (JSC::Wasm::makeString): * wasm/WasmFormat.h: (JSC::Wasm::isValidExternalKind): (JSC::Wasm::isValidNameType): (JSC::Wasm::NameSection::get): * wasm/WasmIndexOrName.cpp: Copied from Source/JavaScriptCore/wasm/WasmCallee.cpp. (JSC::Wasm::IndexOrName::IndexOrName): (JSC::Wasm::makeString): * wasm/WasmIndexOrName.h: Copied from Source/JavaScriptCore/wasm/WasmFormat.cpp. * wasm/WasmModuleInformation.h: * wasm/WasmModuleParser.cpp: * wasm/WasmName.h: Copied from Source/JavaScriptCore/wasm/WasmCallee.cpp. * wasm/WasmNameSectionParser.cpp: Added. * wasm/WasmNameSectionParser.h: Copied from Source/JavaScriptCore/wasm/WasmCallee.cpp. (JSC::Wasm::NameSectionParser::NameSectionParser): * wasm/WasmOMGPlan.cpp: (JSC::Wasm::OMGPlan::work): * wasm/WasmParser.h: (JSC::Wasm::Parser<SuccessType>::consumeUTF8String): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@216597 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 5b7d578 commit 381e333

26 files changed

+566
-66
lines changed

JSTests/ChangeLog

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2017-05-10 JF Bastien <[email protected]>
2+
3+
WebAssembly: support name section
4+
https://bugs.webkit.org/show_bug.cgi?id=171263
5+
6+
Reviewed by Keith Miller.
7+
8+
* wasm/function-tests/nameSection.js: Added.
9+
(const.compile):
10+
* wasm/function-tests/nameSection.wasm: Added.
11+
* wasm/function-tests/stack-trace.js: Update format
12+
113
2017-05-10 Filip Pizlo <[email protected]>
214

315
Null pointer dereference in WTF::RefPtr<WTF::StringImpl>::operator!() under slow_path_get_direct_pname
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import * as assert from '../assert.js'
2+
3+
/*
4+
This test loads a WebAssembly file compiled by Emscripten with:
5+
./emsdk-portable/emscripten/incoming/em++ ./nameSection.cc -O2 -g4 -s WASM=1 -o nameSection.js -s EXPORTED_FUNCTIONS="['_parrot']"
6+
7+
From the following C++ source file:
8+
extern "C" {
9+
int silly(int);
10+
__attribute__((noinline)) int eggs(int i) { return silly(i); }
11+
__attribute__((noinline)) int bacon(int i) { return eggs(i); }
12+
__attribute__((noinline)) int spam(int i) { return bacon(i); }
13+
__attribute__((noinline)) int parrot(int i) { return spam(i); }
14+
}
15+
*/
16+
17+
const verbose = false;
18+
const wasmFile = 'nameSection.wasm';
19+
20+
const compile = (location, importObject = {}) => {
21+
if (verbose)
22+
print(`Processing ${location}`);
23+
let buf = typeof readbuffer !== "undefined"? readbuffer(location) : read(location, 'binary');
24+
if (verbose)
25+
print(` Size: ${buf.byteLength}`);
26+
27+
let t0 = Date.now();
28+
let module = new WebAssembly.Module(buf);
29+
let t1 = Date.now();
30+
if (verbose)
31+
print(`new WebAssembly.Module(buf) took ${t1-t0} ms.`);
32+
33+
if (verbose)
34+
print(`Creating fake import object with ${WebAssembly.Module.imports(module).length} imports`);
35+
for (let imp of WebAssembly.Module.imports(module)) {
36+
if (typeof importObject[imp.module] === "undefined")
37+
importObject[imp.module] = {};
38+
if (typeof importObject[imp.module][imp.name] === "undefined") {
39+
switch (imp.kind) {
40+
case "function": importObject[imp.module][imp.name] = () => {}; break;
41+
case "table": importObject[imp.module][imp.name] = new WebAssembly.Table({ initial: 6, maximum: 6, element: "anyfunc" }); break;
42+
case "memory": importObject[imp.module][imp.name] = new WebAssembly.Memory({ initial: 16777216 / (64 * 1024), maximum: 16777216 / (64 * 1024) }); break;
43+
case "global": importObject[imp.module][imp.name] = 0; break;
44+
}
45+
}
46+
47+
}
48+
49+
let t2 = Date.now();
50+
let instance = new WebAssembly.Instance(module, importObject);
51+
let t3 = Date.now();
52+
if (verbose)
53+
print(`new WebAssembly.Module(buf) took ${t3-t2} ms.`);
54+
55+
return instance;
56+
};
57+
58+
let stacktrace;
59+
const importObject = { env: { _silly: i => { stacktrace = (new Error).stack; return i + 42; } } };
60+
const instance = compile(wasmFile, importObject);
61+
const result = instance.exports._parrot(1);
62+
assert.eq(result, 1 + 42);
63+
64+
assert.truthy(stacktrace);
65+
stacktrace = stacktrace.split("\n");
66+
assert.falsy(stacktrace[0].indexOf("_silly") === -1);
67+
assert.eq(stacktrace[1], "wasm function@[wasm code]"); // the wasm->js stub
68+
assert.eq(stacktrace[2], "wasm function: _eggs@[wasm code]");
69+
assert.eq(stacktrace[3], "wasm function: _bacon@[wasm code]");
70+
assert.eq(stacktrace[4], "wasm function: _spam@[wasm code]");
71+
assert.eq(stacktrace[5], "wasm function: _parrot@[wasm code]");
72+
assert.eq(stacktrace[6], "wasm function@[wasm code]"); // wasm entry
13.1 KB
Binary file not shown.

JSTests/wasm/function-tests/stack-trace.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ for (let i = 0; i < 10000; ++i) {
4747
stacktrace = stacktrace.split("\n");
4848
assert(stacktrace[0].indexOf("imp") !== -1); // the arrow function import named "imp".
4949
assert(stacktrace[1] === "wasm function@[wasm code]"); // the wasm->js stub
50-
assert(stacktrace[2] === "wasm function index: 4@[wasm code]");
51-
assert(stacktrace[3] === "wasm function index: 2@[wasm code]");
52-
assert(stacktrace[4] === "wasm function index: 3@[wasm code]");
53-
assert(stacktrace[5] === "wasm function index: 1@[wasm code]");
50+
assert(stacktrace[2] === "wasm function: 4@[wasm code]");
51+
assert(stacktrace[3] === "wasm function: 2@[wasm code]");
52+
assert(stacktrace[4] === "wasm function: 3@[wasm code]");
53+
assert(stacktrace[5] === "wasm function: 1@[wasm code]");
5454
assert(stacktrace[6] === "wasm function@[wasm code]"); // wasm entry
5555

5656
stacktrace = null;

Source/JavaScriptCore/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,12 +951,14 @@ set(JavaScriptCore_SOURCES
951951
wasm/WasmContext.cpp
952952
wasm/WasmFaultSignalHandler.cpp
953953
wasm/WasmFormat.cpp
954+
wasm/WasmIndexOrName.cpp
954955
wasm/WasmMachineThreads.cpp
955956
wasm/WasmMemory.cpp
956957
wasm/WasmMemoryInformation.cpp
957958
wasm/WasmModule.cpp
958959
wasm/WasmModuleInformation.cpp
959960
wasm/WasmModuleParser.cpp
961+
wasm/WasmNameSectionParser.cpp
960962
wasm/WasmOMGPlan.cpp
961963
wasm/WasmOpcodeOrigin.cpp
962964
wasm/WasmPageCount.cpp

Source/JavaScriptCore/ChangeLog

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,67 @@
1+
2017-05-10 JF Bastien <[email protected]>
2+
3+
WebAssembly: support name section
4+
5+
https://bugs.webkit.org/show_bug.cgi?id=171263
6+
7+
Reviewed by Keith Miller.
8+
9+
The name section is an optional custom section in the WebAssembly
10+
spec. At least when debugging, developers expect to be able to use
11+
this section to obtain intelligible stack traces, otherwise we
12+
just number the wasm functions which is somewhat painful.
13+
14+
This patch parses this section, dropping its content eagerly on
15+
error, and if there is a name section then backtraces use their
16+
value instead of numbers. Otherwise we stick to numbers as before.
17+
18+
Note that the format of name sections changed in mid-February:
19+
https://github.com/WebAssembly/design/pull/984
20+
And binaryen was only updated in early March:
21+
https://github.com/WebAssembly/binaryen/pull/933
22+
23+
* CMakeLists.txt:
24+
* JavaScriptCore.xcodeproj/project.pbxproj:
25+
* interpreter/Interpreter.cpp:
26+
(JSC::GetStackTraceFunctor::operator()):
27+
* interpreter/StackVisitor.cpp:
28+
(JSC::StackVisitor::readNonInlinedFrame):
29+
(JSC::StackVisitor::Frame::functionName):
30+
* interpreter/StackVisitor.h:
31+
(JSC::StackVisitor::Frame::wasmFunctionIndexOrName):
32+
* runtime/StackFrame.cpp:
33+
(JSC::StackFrame::functionName):
34+
* runtime/StackFrame.h:
35+
(JSC::StackFrame::StackFrame):
36+
(JSC::StackFrame::wasm):
37+
* wasm/WasmBBQPlanInlines.h:
38+
(JSC::Wasm::BBQPlan::initializeCallees):
39+
* wasm/WasmCallee.cpp:
40+
(JSC::Wasm::Callee::Callee):
41+
* wasm/WasmCallee.h:
42+
(JSC::Wasm::Callee::create):
43+
(JSC::Wasm::Callee::indexOrName):
44+
* wasm/WasmFormat.cpp:
45+
(JSC::Wasm::makeString):
46+
* wasm/WasmFormat.h:
47+
(JSC::Wasm::isValidExternalKind):
48+
(JSC::Wasm::isValidNameType):
49+
(JSC::Wasm::NameSection::get):
50+
* wasm/WasmIndexOrName.cpp: Copied from Source/JavaScriptCore/wasm/WasmCallee.cpp.
51+
(JSC::Wasm::IndexOrName::IndexOrName):
52+
(JSC::Wasm::makeString):
53+
* wasm/WasmIndexOrName.h: Copied from Source/JavaScriptCore/wasm/WasmFormat.cpp.
54+
* wasm/WasmModuleInformation.h:
55+
* wasm/WasmModuleParser.cpp:
56+
* wasm/WasmName.h: Copied from Source/JavaScriptCore/wasm/WasmCallee.cpp.
57+
* wasm/WasmNameSectionParser.cpp: Added.
58+
* wasm/WasmNameSectionParser.h: Copied from Source/JavaScriptCore/wasm/WasmCallee.cpp.
59+
(JSC::Wasm::NameSectionParser::NameSectionParser):
60+
* wasm/WasmOMGPlan.cpp:
61+
(JSC::Wasm::OMGPlan::work):
62+
* wasm/WasmParser.h:
63+
(JSC::Wasm::Parser<SuccessType>::consumeUTF8String):
64+
165
2017-05-10 Filip Pizlo <[email protected]>
266

367
Null pointer dereference in WTF::RefPtr<WTF::StringImpl>::operator!() under slow_path_get_direct_pname

Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,13 +2145,18 @@
21452145
AD4937D41DDD27DE0077C807 /* WebAssemblyFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = AD4937CA1DDD27340077C807 /* WebAssemblyFunction.h */; };
21462146
AD4B1DF91DF244E20071AE32 /* WasmBinding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD4B1DF71DF244D70071AE32 /* WasmBinding.cpp */; };
21472147
AD4B1DFA1DF244E20071AE32 /* WasmBinding.h in Headers */ = {isa = PBXBuildFile; fileRef = AD4B1DF81DF244D70071AE32 /* WasmBinding.h */; };
2148+
AD5B416F1EBAFB77008EFA43 /* WasmName.h in Headers */ = {isa = PBXBuildFile; fileRef = AD5B416E1EBAFB65008EFA43 /* WasmName.h */; settings = {ATTRIBUTES = (Private, ); }; };
21482149
AD7438C01E0457A400FD0C2A /* WasmSignature.h in Headers */ = {isa = PBXBuildFile; fileRef = AD7438BF1E04579200FD0C2A /* WasmSignature.h */; settings = {ATTRIBUTES = (Private, ); }; };
21492150
AD7438C11E0457AA00FD0C2A /* WasmSignature.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD7438BE1E04579200FD0C2A /* WasmSignature.cpp */; };
21502151
AD86A93E1AA4D88D002FE77F /* WeakGCMapInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = AD86A93D1AA4D87C002FE77F /* WeakGCMapInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
2152+
AD8FF3971EB5BDA80087FF82 /* WasmIndexOrName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD8FF3961EB5BD850087FF82 /* WasmIndexOrName.cpp */; };
2153+
AD8FF3981EB5BDB20087FF82 /* WasmIndexOrName.h in Headers */ = {isa = PBXBuildFile; fileRef = AD8FF3951EB5BD850087FF82 /* WasmIndexOrName.h */; settings = {ATTRIBUTES = (Private, ); }; };
21512154
AD9E852F1E8A0C7C008DE39E /* JSWebAssemblyCodeBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = AD9E852E1E8A0C6E008DE39E /* JSWebAssemblyCodeBlock.h */; settings = {ATTRIBUTES = (Private, ); }; };
21522155
ADB6F67D1E15D7600082F384 /* WasmPageCount.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ADB6F67C1E15D7500082F384 /* WasmPageCount.cpp */; };
21532156
ADBC54D41DF8EA2B005BF738 /* WebAssemblyToJSCallee.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ADBC54D21DF8EA00005BF738 /* WebAssemblyToJSCallee.cpp */; };
21542157
ADBC54D51DF8EA2B005BF738 /* WebAssemblyToJSCallee.h in Headers */ = {isa = PBXBuildFile; fileRef = ADBC54D31DF8EA00005BF738 /* WebAssemblyToJSCallee.h */; };
2158+
ADD8FA451EB3078E00DF542F /* WasmNameSectionParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ADD8FA441EB3077100DF542F /* WasmNameSectionParser.cpp */; };
2159+
ADD8FA461EB3079700DF542F /* WasmNameSectionParser.h in Headers */ = {isa = PBXBuildFile; fileRef = ADD8FA431EB3077100DF542F /* WasmNameSectionParser.h */; };
21552160
ADDB1F6318D77DBE009B58A8 /* OpaqueRootSet.h in Headers */ = {isa = PBXBuildFile; fileRef = ADDB1F6218D77DB7009B58A8 /* OpaqueRootSet.h */; settings = {ATTRIBUTES = (Private, ); }; };
21562161
ADE39FFF16DD144B0003CD4A /* PropertyTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD1CF06816DCAB2D00B97123 /* PropertyTable.cpp */; };
21572162
ADE802981E08F1DE0058DE78 /* JSWebAssemblyLinkError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ADE802931E08F1C90058DE78 /* JSWebAssemblyLinkError.cpp */; };
@@ -4773,13 +4778,18 @@
47734778
AD4937CA1DDD27340077C807 /* WebAssemblyFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyFunction.h; path = js/WebAssemblyFunction.h; sourceTree = "<group>"; };
47744779
AD4B1DF71DF244D70071AE32 /* WasmBinding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WasmBinding.cpp; sourceTree = "<group>"; };
47754780
AD4B1DF81DF244D70071AE32 /* WasmBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WasmBinding.h; sourceTree = "<group>"; };
4781+
AD5B416E1EBAFB65008EFA43 /* WasmName.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WasmName.h; sourceTree = "<group>"; };
47764782
AD7438BE1E04579200FD0C2A /* WasmSignature.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WasmSignature.cpp; sourceTree = "<group>"; };
47774783
AD7438BF1E04579200FD0C2A /* WasmSignature.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WasmSignature.h; sourceTree = "<group>"; };
47784784
AD86A93D1AA4D87C002FE77F /* WeakGCMapInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakGCMapInlines.h; sourceTree = "<group>"; };
4785+
AD8FF3951EB5BD850087FF82 /* WasmIndexOrName.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WasmIndexOrName.h; sourceTree = "<group>"; };
4786+
AD8FF3961EB5BD850087FF82 /* WasmIndexOrName.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WasmIndexOrName.cpp; sourceTree = "<group>"; };
47794787
AD9E852E1E8A0C6E008DE39E /* JSWebAssemblyCodeBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSWebAssemblyCodeBlock.h; path = js/JSWebAssemblyCodeBlock.h; sourceTree = "<group>"; };
47804788
ADB6F67C1E15D7500082F384 /* WasmPageCount.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WasmPageCount.cpp; sourceTree = "<group>"; };
47814789
ADBC54D21DF8EA00005BF738 /* WebAssemblyToJSCallee.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyToJSCallee.cpp; path = js/WebAssemblyToJSCallee.cpp; sourceTree = "<group>"; };
47824790
ADBC54D31DF8EA00005BF738 /* WebAssemblyToJSCallee.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyToJSCallee.h; path = js/WebAssemblyToJSCallee.h; sourceTree = "<group>"; };
4791+
ADD8FA431EB3077100DF542F /* WasmNameSectionParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WasmNameSectionParser.h; sourceTree = "<group>"; };
4792+
ADD8FA441EB3077100DF542F /* WasmNameSectionParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WasmNameSectionParser.cpp; sourceTree = "<group>"; };
47834793
ADDB1F6218D77DB7009B58A8 /* OpaqueRootSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpaqueRootSet.h; sourceTree = "<group>"; };
47844794
ADE802931E08F1C90058DE78 /* JSWebAssemblyLinkError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSWebAssemblyLinkError.cpp; path = js/JSWebAssemblyLinkError.cpp; sourceTree = "<group>"; };
47854795
ADE802941E08F1C90058DE78 /* JSWebAssemblyLinkError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSWebAssemblyLinkError.h; path = js/JSWebAssemblyLinkError.h; sourceTree = "<group>"; };
@@ -6409,28 +6419,33 @@
64096419
AD412B311E7B2E8A008AF157 /* WasmContext.cpp */,
64106420
AD412B321E7B2E8A008AF157 /* WasmContext.h */,
64116421
79DAE2791E03C82200B526AA /* WasmExceptionType.h */,
6422+
5381B9361E60E9660090F794 /* WasmFaultSignalHandler.cpp */,
6423+
5381B9381E60E97D0090F794 /* WasmFaultSignalHandler.h */,
64126424
AD2FCC321DC4045300B3E736 /* WasmFormat.cpp */,
64136425
7BC547D21B69599B00959B58 /* WasmFormat.h */,
64146426
53F40E8A1D5901BB0099A1B6 /* WasmFunctionParser.h */,
6427+
AD8FF3961EB5BD850087FF82 /* WasmIndexOrName.cpp */,
6428+
AD8FF3951EB5BD850087FF82 /* WasmIndexOrName.h */,
64156429
53E9E0A91EAE83DE00FEE251 /* WasmMachineThreads.cpp */,
64166430
53E9E0AA1EAE83DE00FEE251 /* WasmMachineThreads.h */,
6417-
790081361E95A8EC0052D7CD /* WasmModule.cpp */,
6418-
790081371E95A8EC0052D7CD /* WasmModule.h */,
64196431
535557151D9DFA32006D583B /* WasmMemory.cpp */,
64206432
535557131D9D9EA5006D583B /* WasmMemory.h */,
64216433
79B759711DFA4C600052174C /* WasmMemoryInformation.cpp */,
64226434
79B759721DFA4C600052174C /* WasmMemoryInformation.h */,
6435+
790081361E95A8EC0052D7CD /* WasmModule.cpp */,
6436+
790081371E95A8EC0052D7CD /* WasmModule.h */,
64236437
53E777E11E92E265007CBEC4 /* WasmModuleInformation.cpp */,
64246438
53E777E21E92E265007CBEC4 /* WasmModuleInformation.h */,
64256439
53F40E961D5A7BEC0099A1B6 /* WasmModuleParser.cpp */,
64266440
53F40E941D5A7AEF0099A1B6 /* WasmModuleParser.h */,
6441+
AD5B416E1EBAFB65008EFA43 /* WasmName.h */,
6442+
ADD8FA441EB3077100DF542F /* WasmNameSectionParser.cpp */,
6443+
ADD8FA431EB3077100DF542F /* WasmNameSectionParser.h */,
64276444
5311BD481EA581E500525281 /* WasmOMGPlan.cpp */,
64286445
5311BD491EA581E500525281 /* WasmOMGPlan.h */,
6429-
ADB6F67C1E15D7500082F384 /* WasmPageCount.cpp */,
6430-
5381B9361E60E9660090F794 /* WasmFaultSignalHandler.cpp */,
6431-
5381B9381E60E97D0090F794 /* WasmFaultSignalHandler.h */,
64326446
53C6FEF01E8AFE0C00B18425 /* WasmOpcodeOrigin.cpp */,
64336447
53C6FEEE1E8ADFA900B18425 /* WasmOpcodeOrigin.h */,
6448+
ADB6F67C1E15D7500082F384 /* WasmPageCount.cpp */,
64346449
79B759731DFA4C600052174C /* WasmPageCount.h */,
64356450
53F40E8C1D5901F20099A1B6 /* WasmParser.h */,
64366451
531374BE1D5CE95000AF7A0B /* WasmPlan.cpp */,
@@ -8217,6 +8232,7 @@
82178232
0F6183311C45BF070072450B /* AirLowerMacros.h in Headers */,
82188233
0F40E4A71C497F7400A577FA /* AirOpcode.h in Headers */,
82198234
0F40E4A81C497F7400A577FA /* AirOpcodeGenerated.h in Headers */,
8235+
AD8FF3981EB5BDB20087FF82 /* WasmIndexOrName.h in Headers */,
82208236
0F40E4A91C497F7400A577FA /* AirOpcodeUtils.h in Headers */,
82218237
0FB387901BFBC44D00E3AB1E /* AirOptimizeBlockOrder.h in Headers */,
82228238
0F9CABC91DB54A7A0008E83B /* AirPadInterference.h in Headers */,
@@ -8335,6 +8351,7 @@
83358351
0FEC85241BDACDAC0080FF74 /* B3Origin.h in Headers */,
83368352
0F4C91661C29F4F2004341A6 /* B3OriginDump.h in Headers */,
83378353
0FEC85261BDACDAC0080FF74 /* B3PatchpointSpecial.h in Headers */,
8354+
ADD8FA461EB3079700DF542F /* WasmNameSectionParser.h in Headers */,
83388355
0FEC85281BDACDAC0080FF74 /* B3PatchpointValue.h in Headers */,
83398356
799EF7C41C56ED96002B0534 /* B3PCToOriginMap.h in Headers */,
83408357
0FEC852A1BDACDAC0080FF74 /* B3PhaseScope.h in Headers */,
@@ -8654,6 +8671,7 @@
86548671
86EC9DD11328DF82002B2AD7 /* DFGRegisterBank.h in Headers */,
86558672
79FC8A081E32E9F000D88F0E /* DFGRegisteredStructure.h in Headers */,
86568673
7980C16D1E3A940E00B71615 /* DFGRegisteredStructureSet.h in Headers */,
8674+
AD5B416F1EBAFB77008EFA43 /* WasmName.h in Headers */,
86578675
0F2FCCFC18A60070001A27F8 /* DFGSafepoint.h in Headers */,
86588676
A77A424317A0BBFD00A8DB81 /* DFGSafeToExecute.h in Headers */,
86598677
A741017F179DAF80002EB8BA /* DFGSaneStringGetByValSlowPathGenerator.h in Headers */,
@@ -10983,6 +11001,7 @@
1098311001
0F6C73501AC9F99F00BE1682 /* VariableWriteFireDetail.cpp in Sources */,
1098411002
0FE0502C1AA9095600D33B33 /* VarOffset.cpp in Sources */,
1098511003
0F20C2591A8013AB00DA3229 /* VirtualRegister.cpp in Sources */,
11004+
AD8FF3971EB5BDA80087FF82 /* WasmIndexOrName.cpp in Sources */,
1098611005
0F952AA21DF7860D00E06FBD /* VisitRaceKey.cpp in Sources */,
1098711006
E18E3A590DF9278C00D90B34 /* VM.cpp in Sources */,
1098811007
FE5932A7183C5A2600A1ECCC /* VMEntryScope.cpp in Sources */,
@@ -11039,6 +11058,7 @@
1103911058
86704B8612DBA33700A9FE7B /* YarrJIT.cpp in Sources */,
1104011059
86704B8912DBA33700A9FE7B /* YarrPattern.cpp in Sources */,
1104111060
86704B4212DB8A8100A9FE7B /* YarrSyntaxChecker.cpp in Sources */,
11061+
ADD8FA451EB3078E00DF542F /* WasmNameSectionParser.cpp in Sources */,
1104211062
321D9E4CFB67423A97F191A7 /* ModuleNamespaceAccessCase.cpp in Sources */,
1104311063
);
1104411064
runOnlyForDeploymentPostprocessing = 0;

Source/JavaScriptCore/interpreter/Interpreter.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,7 @@ class GetStackTraceFunctor {
480480

481481
if (m_remainingCapacityForFrameCapture) {
482482
if (visitor->isWasmFrame()) {
483-
std::optional<unsigned> wasmFunctionIndex = visitor->wasmFunctionIndex();
484-
m_results.append(StackFrame::wasm(wasmFunctionIndex ? *wasmFunctionIndex : StackFrame::invalidWasmIndex));
483+
m_results.append(StackFrame::wasm(visitor->wasmFunctionIndexOrName()));
485484
} else if (!!visitor->codeBlock() && !visitor->codeBlock()->unlinkedCodeBlock()->isBuiltinFunction()) {
486485
m_results.append(
487486
StackFrame(m_vm, visitor->callee().asCell(), visitor->codeBlock(), visitor->bytecodeOffset()));

0 commit comments

Comments
 (0)