Skip to content

Commit 37f814d

Browse files
committed
Web Inspector: should not include implementation details of the injected script in stack traces
https://bugs.webkit.org/show_bug.cgi?id=242954 Reviewed by Yusuke Suzuki. * Source/JavaScriptCore/runtime/ImplementationVisibility.h: Add a new `PrivateRecursive` that tells JSC to also propagate it to any nested functions. * Source/JavaScriptCore/Scripts/wkbuiltins/builtins_generator.py: (BuiltinsGenerator.generate_embedded_code_data_for_function): * Source/JavaScriptCore/Scripts/wkbuiltins/builtins_model.py: (BuiltinFunction.__init__): (BuiltinFunction.fromString): Allow builtins to define a custom `@visibility=...`. If not defined, `@linkTimeConstant` is `Private` and everything else is `Public`. * Source/JavaScriptCore/inspector/InjectedScriptSource.js: Annotate `createInspectorInjectedScript` with `@visibility=PrivateRecursive`. * Source/JavaScriptCore/parser/Nodes.h: * Source/JavaScriptCore/parser/Nodes.cpp: (JSC::FunctionMetadataNode::FunctionMetadataNode): (JSC::FunctionMetadataNode::operator== const): (JSC::FunctionMetadataNode::dump const): * Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h: (JSC::UnlinkedFunctionExecutable::create): * Source/JavaScriptCore/builtins/BuiltinExecutables.cpp: (JSC::BuiltinExecutables::createExecutable): * Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp: (JSC::generateUnlinkedFunctionCodeBlock): (JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable): * Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h: (JSC::BytecodeGenerator::makeFunction): * Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitNewClassFieldInitializerFunction): Have the `FunctionMetadataNode` hold the `ImplementationVisibility` instead of directly giving it to the `UnlinkedFunctionExecutable`, as the `FunctionMetadataNode` has more widespread usage. * Source/JavaScriptCore/parser/ASTBuilder.h: (JSC::ASTBuilder::createFunctionMetadata): * Source/JavaScriptCore/parser/Parser.h: (JSC::Scope::Scope): (JSC::Scope::implementationVisibility const): Added. (JSC::Parser::pushScope): (JSC::Parser::resetImplementationVisibilityIfNeeded): Added. (JSC::Parser::implementationVisibility): Added. (JSC::parse): (JSC::parseFunctionForFunctionConstructor): * Source/JavaScriptCore/parser/Parser.cpp: (JSC::Parser<LexerType>::Parser): (JSC::Parser<LexerType>::isArrowFunctionParameters): (JSC::Parser<LexerType>::parseGeneratorFunctionSourceElements): (JSC::Parser<LexerType>::parseAsyncFunctionSourceElements): (JSC::Parser<LexerType>::parseAsyncGeneratorFunctionSourceElements): (JSC::Parser<LexerType>::parseFunctionBody): (JSC::Parser<LexerType>::parseFunctionInfo): * Source/JavaScriptCore/parser/SyntaxChecker.h: (JSC::SyntaxChecker::createFunctionMetadata): Pass along the `ImplementationVisibility` to the creation of the `FunctionMetadataNode` when parsing. Make sure the `ImplementationVisibility` is properly propagated when new `Scope` are created. * Source/JavaScriptCore/debugger/DebuggerParseData.cpp: (JSC::gatherDebuggerParseData): * Source/JavaScriptCore/runtime/CodeCache.cpp: (JSC::generateUnlinkedCodeBlockImpl): (JSC::CodeCache::getUnlinkedGlobalFunctionExecutable): * Source/JavaScriptCore/runtime/Completion.cpp: (JSC::checkSyntaxInternal): (JSC::checkModuleSyntax): * Source/JavaScriptCore/API/JSScriptRef.cpp: (parseScript): * Source/JavaScriptCore/API/glib/JSCContext.cpp: (jsc_context_check_syntax): * Source/JavaScriptCore/runtime/JSModuleLoader.cpp: (JSC::moduleLoaderParseModule): Non-builtins should be `ImplementationVisibility::Public`. * Source/JavaScriptCore/parser/ParserModes.h: Decrease the width of `LexicalScopeFeatures` to make room for the wider `ImplementationVisibility`. * Source/JavaScriptCore/runtime/FunctionPrototype.cpp: (JSC::isAllowedReceiverFunctionForCallerAndArguments): (JSC::RetrieveCallerFunctionFunctor::operator() const): Ignore anything that isn't `ImplementationVisibility::Public`. * LayoutTests/inspector/animation/lifecycle-web-animation-expected.txt: * LayoutTests/inspector/canvas/create-context-2d-expected.txt: * LayoutTests/inspector/canvas/create-context-bitmaprenderer-expected.txt: * LayoutTests/inspector/canvas/create-context-webgl-expected.txt: * LayoutTests/inspector/canvas/create-context-webgl2-expected.txt: * LayoutTests/inspector/canvas/recording-2d-frameCount-expected.txt: * LayoutTests/inspector/canvas/recording-2d-full-expected.txt: * LayoutTests/inspector/canvas/recording-2d-memoryLimit-expected.txt: * LayoutTests/inspector/canvas/recording-webgl-frameCount-expected.txt: * LayoutTests/inspector/canvas/recording-webgl-full-expected.txt: * LayoutTests/inspector/canvas/recording-webgl-memoryLimit-expected.txt: * LayoutTests/inspector/canvas/recording-webgl-snapshots-expected.txt: * LayoutTests/inspector/canvas/recording-webgl2-frameCount-expected.txt: * LayoutTests/inspector/canvas/recording-webgl2-full-expected.txt: * LayoutTests/inspector/canvas/recording-webgl2-memoryLimit-expected.txt: * LayoutTests/inspector/canvas/recording-webgl2-snapshots-expected.txt: * LayoutTests/inspector/model/remote-object/error-expected.txt: * LayoutTests/inspector/model/stack-trace-expected.txt: * LayoutTests/inspector/timeline/line-column-expected.txt: * LayoutTests/platform/gtk/inspector/timeline/line-column-expected.txt: * LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl-frameCount-expected.txt: * LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl-full-expected.txt: * LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl-memoryLimit-expected.txt: * LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl-snapshots-expected.txt: * LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl2-frameCount-expected.txt: * LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl2-full-expected.txt: * LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl2-memoryLimit-expected.txt: * LayoutTests/platform/mac-wk1/inspector/canvas/recording-webgl2-snapshots-expected.txt: Canonical link: https://commits.webkit.org/252914@main
1 parent abdef04 commit 37f814d

File tree

51 files changed

+140
-273
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+140
-273
lines changed

LayoutTests/inspector/animation/lifecycle-web-animation-expected.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ PASS: Animation created 'web-animation-test'.
1414
1: createAnimation - inspector/animation/resources/lifecycle-utilities.js:3:15
1515
2: Global Code - [program code]
1616
3: evaluateWithScopeExtension - [native code]
17-
4: (anonymous function) - [native code]
18-
5: _wrapCall - [native code]
1917
PASS: Animation type should be Web Animation.
2018
startDelay: 100
2119
endDelay: 200

LayoutTests/inspector/canvas/create-context-2d-expected.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ PASS: Canvas context should be 2D.
1111
1: createAttachedCanvas - inspector/canvas/resources/create-context-utilities.js:4:36
1212
2: Global Code - [program code]
1313
3: evaluateWithScopeExtension - [native code]
14-
4: (anonymous function) - [native code]
15-
5: _wrapCall - [native code]
1614

1715
PASS: Removed canvas has expected ID.
1816

@@ -22,8 +20,6 @@ PASS: Canvas context should be 2D.
2220
1: createDetachedCanvas - inspector/canvas/resources/create-context-utilities.js:11:62
2321
2: Global Code - [program code]
2422
3: evaluateWithScopeExtension - [native code]
25-
4: (anonymous function) - [native code]
26-
5: _wrapCall - [native code]
2723

2824
PASS: Removed canvas has expected ID.
2925

@@ -34,8 +30,6 @@ PASS: Canvas context should be 2D.
3430
1: createCSSCanvas - inspector/canvas/resources/create-context-utilities.js:18:47
3531
2: Global Code - [program code]
3632
3: evaluateWithScopeExtension - [native code]
37-
4: (anonymous function) - [native code]
38-
5: _wrapCall - [native code]
3933

4034
PASS: Canvas name should equal the identifier passed to -webkit-canvas.
4135

LayoutTests/inspector/canvas/create-context-bitmaprenderer-expected.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ PASS: Canvas context should be Bitmap Renderer.
1111
1: createAttachedCanvas - inspector/canvas/resources/create-context-utilities.js:4:36
1212
2: Global Code - [program code]
1313
3: evaluateWithScopeExtension - [native code]
14-
4: (anonymous function) - [native code]
15-
5: _wrapCall - [native code]
1614

1715
PASS: Removed canvas has expected ID.
1816

@@ -22,8 +20,6 @@ PASS: Canvas context should be Bitmap Renderer.
2220
1: createDetachedCanvas - inspector/canvas/resources/create-context-utilities.js:11:62
2321
2: Global Code - [program code]
2422
3: evaluateWithScopeExtension - [native code]
25-
4: (anonymous function) - [native code]
26-
5: _wrapCall - [native code]
2723

2824
PASS: Removed canvas has expected ID.
2925

LayoutTests/inspector/canvas/create-context-webgl-expected.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ PASS: Canvas context should be WebGL.
1111
1: createAttachedCanvas - inspector/canvas/resources/create-context-utilities.js:4:36
1212
2: Global Code - [program code]
1313
3: evaluateWithScopeExtension - [native code]
14-
4: (anonymous function) - [native code]
15-
5: _wrapCall - [native code]
1614

1715
PASS: Removed canvas has expected ID.
1816

@@ -22,8 +20,6 @@ PASS: Canvas context should be WebGL.
2220
1: createDetachedCanvas - inspector/canvas/resources/create-context-utilities.js:11:62
2321
2: Global Code - [program code]
2422
3: evaluateWithScopeExtension - [native code]
25-
4: (anonymous function) - [native code]
26-
5: _wrapCall - [native code]
2723

2824
PASS: Removed canvas has expected ID.
2925

@@ -34,8 +30,6 @@ PASS: Canvas context should be WebGL.
3430
1: createCSSCanvas - inspector/canvas/resources/create-context-utilities.js:18:47
3531
2: Global Code - [program code]
3632
3: evaluateWithScopeExtension - [native code]
37-
4: (anonymous function) - [native code]
38-
5: _wrapCall - [native code]
3933

4034
PASS: Canvas name should equal the identifier passed to -webkit-canvas.
4135

LayoutTests/inspector/canvas/create-context-webgl2-expected.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ PASS: Canvas context should be WebGL2.
1111
1: createAttachedCanvas - inspector/canvas/resources/create-context-utilities.js:4:36
1212
2: Global Code - [program code]
1313
3: evaluateWithScopeExtension - [native code]
14-
4: (anonymous function) - [native code]
15-
5: _wrapCall - [native code]
1614

1715
PASS: Removed canvas has expected ID.
1816

@@ -22,8 +20,6 @@ PASS: Canvas context should be WebGL2.
2220
1: createDetachedCanvas - inspector/canvas/resources/create-context-utilities.js:11:62
2321
2: Global Code - [program code]
2422
3: evaluateWithScopeExtension - [native code]
25-
4: (anonymous function) - [native code]
26-
5: _wrapCall - [native code]
2723

2824
PASS: Removed canvas has expected ID.
2925

@@ -34,8 +30,6 @@ PASS: Canvas context should be WebGL2.
3430
1: createCSSCanvas - inspector/canvas/resources/create-context-utilities.js:18:47
3531
2: Global Code - [program code]
3632
3: evaluateWithScopeExtension - [native code]
37-
4: (anonymous function) - [native code]
38-
5: _wrapCall - [native code]
3933

4034
PASS: Canvas name should equal the identifier passed to -webkit-canvas.
4135

LayoutTests/inspector/canvas/recording-2d-frameCount-expected.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ frames:
4646
5: performActions
4747
6: Global Code
4848
7: evaluateWithScopeExtension
49-
8: (anonymous function)
50-
9: _wrapCall
5149
1: arc(6, 7, 8, 9, 10, true)
5250
swizzleTypes: [Number, Number, Number, Number, Number, Boolean]
5351
trace:
@@ -59,6 +57,4 @@ frames:
5957
5: performActions
6058
6: Global Code
6159
7: evaluateWithScopeExtension
62-
8: (anonymous function)
63-
9: _wrapCall
6460

LayoutTests/inspector/canvas/recording-2d-full-expected.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ frames:
4646
5: performActions
4747
6: Global Code
4848
7: evaluateWithScopeExtension
49-
8: (anonymous function)
50-
9: _wrapCall
5149
1: arc(6, 7, 8, 9, 10, true)
5250
swizzleTypes: [Number, Number, Number, Number, Number, Boolean]
5351
trace:
@@ -59,8 +57,6 @@ frames:
5957
5: performActions
6058
6: Global Code
6159
7: evaluateWithScopeExtension
62-
8: (anonymous function)
63-
9: _wrapCall
6460
1: (duration)
6561
0: arcTo(1, 2, 3, 4, 5)
6662
swizzleTypes: [Number, Number, Number, Number, Number]

LayoutTests/inspector/canvas/recording-2d-memoryLimit-expected.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,4 @@ frames:
4646
5: performActions
4747
6: Global Code
4848
7: evaluateWithScopeExtension
49-
8: (anonymous function)
50-
9: _wrapCall
5149

LayoutTests/inspector/canvas/recording-webgl-frameCount-expected.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,4 @@ frames:
2121
3: performActions
2222
4: Global Code
2323
5: evaluateWithScopeExtension
24-
6: (anonymous function)
25-
7: _wrapCall
2624

LayoutTests/inspector/canvas/recording-webgl-full-expected.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ frames:
2121
3: performActions
2222
4: Global Code
2323
5: evaluateWithScopeExtension
24-
6: (anonymous function)
25-
7: _wrapCall
2624
1: (duration)
2725
0: attachShader(0, 0)
2826
swizzleTypes: [WebGLProgram, WebGLShader]

LayoutTests/inspector/canvas/recording-webgl-memoryLimit-expected.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,4 @@ frames:
2121
3: performActions
2222
4: Global Code
2323
5: evaluateWithScopeExtension
24-
6: (anonymous function)
25-
7: _wrapCall
2624

LayoutTests/inspector/canvas/recording-webgl-snapshots-expected.txt

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ frames:
1919
1: performActions
2020
2: Global Code
2121
3: evaluateWithScopeExtension
22-
4: (anonymous function)
23-
5: _wrapCall
2422
1: clearColor(0, 0, 0, 1)
2523
swizzleTypes: [Number, Number, Number, Number]
2624
trace:
@@ -29,8 +27,6 @@ frames:
2927
2: performActions
3028
3: Global Code
3129
4: evaluateWithScopeExtension
32-
5: (anonymous function)
33-
6: _wrapCall
3430
2: clear(16384)
3531
swizzleTypes: [Number]
3632
trace:
@@ -39,8 +35,6 @@ frames:
3935
2: performActions
4036
3: Global Code
4137
4: evaluateWithScopeExtension
42-
5: (anonymous function)
43-
6: _wrapCall
4438
snapshot: <PASS: content changed>
4539
3: bufferData(34962, 0, 35044)
4640
swizzleTypes: [Number, TypedArray, Number]
@@ -50,8 +44,6 @@ frames:
5044
2: performActions
5145
3: Global Code
5246
4: evaluateWithScopeExtension
53-
5: (anonymous function)
54-
6: _wrapCall
5547
4: drawArrays(4, 0, 3)
5648
swizzleTypes: [Number, Number, Number]
5749
trace:
@@ -60,8 +52,6 @@ frames:
6052
2: performActions
6153
3: Global Code
6254
4: evaluateWithScopeExtension
63-
5: (anonymous function)
64-
6: _wrapCall
6555
snapshot: <PASS: content changed>
6656
5: clearColor(0, 0, 0, 1)
6757
swizzleTypes: [Number, Number, Number, Number]
@@ -71,8 +61,6 @@ frames:
7161
2: performActions
7262
3: Global Code
7363
4: evaluateWithScopeExtension
74-
5: (anonymous function)
75-
6: _wrapCall
7664
6: clear(16384)
7765
swizzleTypes: [Number]
7866
trace:
@@ -81,8 +69,6 @@ frames:
8169
2: performActions
8270
3: Global Code
8371
4: evaluateWithScopeExtension
84-
5: (anonymous function)
85-
6: _wrapCall
8672
snapshot: <PASS: content changed>
8773
7: bufferData(34962, 0, 35044)
8874
swizzleTypes: [Number, TypedArray, Number]
@@ -92,8 +78,6 @@ frames:
9278
2: performActions
9379
3: Global Code
9480
4: evaluateWithScopeExtension
95-
5: (anonymous function)
96-
6: _wrapCall
9781
8: bufferData(34963, 0, 35044)
9882
swizzleTypes: [Number, TypedArray, Number]
9983
trace:
@@ -102,8 +86,6 @@ frames:
10286
2: performActions
10387
3: Global Code
10488
4: evaluateWithScopeExtension
105-
5: (anonymous function)
106-
6: _wrapCall
10789
9: drawElements(4, 3, 5123, 0)
10890
swizzleTypes: [Number, Number, Number, Number]
10991
trace:
@@ -112,8 +94,6 @@ frames:
11294
2: performActions
11395
3: Global Code
11496
4: evaluateWithScopeExtension
115-
5: (anonymous function)
116-
6: _wrapCall
11797
snapshot: <PASS: content changed>
11898
10: clearColor(0, 0, 0, 1)
11999
swizzleTypes: [Number, Number, Number, Number]
@@ -123,8 +103,6 @@ frames:
123103
2: performActions
124104
3: Global Code
125105
4: evaluateWithScopeExtension
126-
5: (anonymous function)
127-
6: _wrapCall
128106
11: clear(16384)
129107
swizzleTypes: [Number]
130108
trace:
@@ -133,7 +111,5 @@ frames:
133111
2: performActions
134112
3: Global Code
135113
4: evaluateWithScopeExtension
136-
5: (anonymous function)
137-
6: _wrapCall
138114
snapshot: <PASS: content changed>
139115

LayoutTests/inspector/canvas/recording-webgl2-frameCount-expected.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,4 @@ frames:
2121
3: performActions
2222
4: Global Code
2323
5: evaluateWithScopeExtension
24-
6: (anonymous function)
25-
7: _wrapCall
2624

LayoutTests/inspector/canvas/recording-webgl2-full-expected.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ frames:
2121
3: performActions
2222
4: Global Code
2323
5: evaluateWithScopeExtension
24-
6: (anonymous function)
25-
7: _wrapCall
2624
1: (duration)
2725
0: attachShader(0, 0)
2826
swizzleTypes: [WebGLProgram, WebGLShader]

LayoutTests/inspector/canvas/recording-webgl2-memoryLimit-expected.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,4 @@ frames:
2121
3: performActions
2222
4: Global Code
2323
5: evaluateWithScopeExtension
24-
6: (anonymous function)
25-
7: _wrapCall
2624

0 commit comments

Comments
 (0)