Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/build/deps/webkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* for local mode. Override via `--webkit-version=<hash>` to test a branch.
* From https://github.com/oven-sh/WebKit releases.
*/
export const WEBKIT_VERSION = "autobuild-preview-pr-972-cf0e99d2";
export const WEBKIT_VERSION = "autobuild-preview-pr-977-e16b7a5e";
Comment thread
robobun marked this conversation as resolved.
Resolved

/**
* WebKit (JavaScriptCore) — the JS engine, with WTF and bmalloc.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5256,8 +5256,8 @@ runtimefunction id=ProcessObjectInternalsInitializeNextTickQueue function=f83
# CHECK-NEXT: Return v6
# CHECK-NEXT: }
# CHECK-LABEL: function f15 module=
# CHECK: m0 position=3288 kind=Arrow flags=[IsChecked] length=1 thisType={type=anything} parameters=[{type=undefined|null|function flags=[IsExpected]}] results=[{type=undefined}] functionTypes=[f54] capabilities=[MayChangeSignature, MayBeCloned, MayBeInlined, HasOrdinaryFrame, IsNeverCalledByHost, ClosuresAreReadWithoutCode] {
# CHECK-NEXT: b0(v0: anything ~ undefined|null|function):
# CHECK: m0 position=3288 kind=Arrow flags=[IsChecked] length=1 thisType={type=anything} parameters=[{type=undefined|function}] results=[{type=undefined}] functionTypes=[f54] capabilities=[MayChangeSignature, MayBeCloned, MayBeInlined, HasOrdinaryFrame, IsNeverCalledByHost, ClosuresAreReadWithoutCode] {
# CHECK-NEXT: b0(v0: undefined|function):
# CHECK-NEXT: PutModuleVariable v0 variable=g8
# CHECK-NEXT: v2: undefined = Undefined
# CHECK-NEXT: Return v2
Expand Down Expand Up @@ -5288,7 +5288,7 @@ runtimefunction id=ProcessObjectInternalsInitializeNextTickQueue function=f83
# CHECK-LABEL: function f18 module=
# CHECK: m0 position=3549 kind=Arrow flags=[IsChecked] thisType={type=anything} results=[{type=undefined}] functionTypes=[f58] capabilities=[MayChangeSignature, MayBeCloned, MayBeInlined, HasOrdinaryFrame, IsNeverCalledByHost, ClosuresAreReadWithoutCode] {
# CHECK-NEXT: b0():
# CHECK-NEXT: v0: anything ~ undefined|null|function = GetModuleVariable variable=g8
# CHECK-NEXT: v0: undefined|function = GetModuleVariable variable=g8
# CHECK-NEXT: v1: "x" = String string="x"
# CHECK-NEXT: v2: anything = Call v0, -, v1 calleeName="settle" accessSite=151
# CHECK-NEXT: ReturnCall v2 casts=[{declared={type=undefined} resolution=Assume}]
Expand Down Expand Up @@ -5355,8 +5355,8 @@ runtimefunction id=ProcessObjectInternalsInitializeNextTickQueue function=f83
# CHECK-NEXT: ReturnCall v4
# CHECK-NEXT: }
# CHECK-LABEL: function f25 module=
# CHECK: m0 position=1955 kind=Arrow role=EntryChecks flags=[IsChecked] length=1 captures=[{type=undefined|null|string site=w18 flags=[IsExpected, OmitsNull, OmitsUndefined] variableName="name"}] thisType={type=anything} parameters=[{type=undefined|null|function flags=[IsExpected]}] results=[{type=undefined}] functionTypes=[f47] capabilities=[MayBeInlined, HasOrdinaryFrame, IsNeverCalledByHost, ClosuresAreReadWithoutCode] creator=EntryChecks{body=f303 fallback=f312} {
# CHECK-NEXT: b0(v0: anything ~ undefined|null|string, v1: anything ~ undefined|null|function):
# CHECK: m0 position=1955 kind=Arrow role=EntryChecks flags=[IsChecked] length=1 captures=[{type=undefined|null|string site=w18 flags=[IsExpected, OmitsNull, OmitsUndefined] variableName="name"}] thisType={type=anything} parameters=[{type=undefined|function}] results=[{type=undefined}] functionTypes=[f47] capabilities=[MayBeInlined, HasOrdinaryFrame, IsNeverCalledByHost, ClosuresAreReadWithoutCode] creator=EntryChecks{body=f303 fallback=f312} {
# CHECK-NEXT: b0(v0: anything ~ undefined|null|string, v1: undefined|function):
# CHECK-NEXT: v2: boolean ~ true = TypeTest v0 testedType=undefined|null|string
# CHECK-NEXT: Branch v2 -> taken b1(| 0), notTaken b2()
# CHECK-NEXT: b1(v3: undefined|null|string):
Expand Down Expand Up @@ -5542,8 +5542,8 @@ runtimefunction id=ProcessObjectInternalsInitializeNextTickQueue function=f83
# CHECK-NEXT: Jump -> next b4() @426:2 tail
# CHECK-NEXT: }
# CHECK-LABEL: function f34 module=
# CHECK: m0 position=1981 kind=Arrow role=EntryChecks flags=[IsChecked] captures=[{type=undefined|null|string site=w18 flags=[IsExpected, OmitsNull, OmitsUndefined] variableName="name"}, {type=undefined|null|function flags=[IsExpected] variableName="resolve"}] thisType={type=anything} results=[{type=undefined}] functionTypes=[f46] capabilities=[MayBeInlined, HasOrdinaryFrame, IsNeverCalledByHost, ClosuresAreReadWithoutCode] creator=EntryChecks{body=f306 fallback=f315} {
# CHECK-NEXT: b0(v0: anything ~ undefined|null|string, v1: anything ~ undefined|null|function):
# CHECK: m0 position=1981 kind=Arrow role=EntryChecks flags=[IsChecked] captures=[{type=undefined|null|string site=w18 flags=[IsExpected, OmitsNull, OmitsUndefined] variableName="name"}, {type=undefined|function variableName="resolve"}] thisType={type=anything} results=[{type=undefined}] functionTypes=[f46] capabilities=[MayBeInlined, HasOrdinaryFrame, IsNeverCalledByHost, ClosuresAreReadWithoutCode] creator=EntryChecks{body=f306 fallback=f315} {
# CHECK-NEXT: b0(v0: anything ~ undefined|null|string, v1: undefined|function):
# CHECK-NEXT: v2: boolean ~ true = TypeTest v0 testedType=undefined|null|string
# CHECK-NEXT: Branch v2 -> taken b1(| 0), notTaken b2()
# CHECK-NEXT: b1(v3: undefined|null|string):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2760,8 +2760,8 @@ runtimefunction id=ProcessObjectInternalsInitializeNextTickQueue function=f36
# CHECK-NEXT: Return v3
# CHECK-NEXT: }
# CHECK-LABEL: function f16 module=
# CHECK: m0 position=147 kind=Arrow captures=[{type=undefined|null|function flags=[IsExpected] variableName="resolve"}] thisType={type=anything} results=[{type=undefined}] functionTypes=[f17] capabilities=[MayChangeSignature, MayBeCloned, MayBeInlined, HasOrdinaryFrame, IsNeverCalledByHost, ClosuresAreReadWithoutCode] {
# CHECK-NEXT: b0(v0: anything ~ undefined|null|function):
# CHECK: m0 position=147 kind=Arrow captures=[{type=undefined|function variableName="resolve"}] thisType={type=anything} results=[{type=undefined}] functionTypes=[f17] capabilities=[MayChangeSignature, MayBeCloned, MayBeInlined, HasOrdinaryFrame, IsNeverCalledByHost, ClosuresAreReadWithoutCode] {
# CHECK-NEXT: b0(v0: undefined|function):
# CHECK-NEXT: v1: 1 = Integer integer=1
# CHECK-NEXT: v2: anything = Call v0, -, v1 calleeName="resolve" accessSite=58
# CHECK-NEXT: ReturnCall v2 casts=[{declared={type=undefined} resolution=Assume}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4449,7 +4449,7 @@ runtimefunction id=ArrayTraversalTraverseArray function=f136 visibility=Private
# CHECK-NEXT: v3: Array<WeakRef<pristine[Storage, Names]>, proven, Contiguous, pristine[Storage, Names, Dense]> = AssumeType v2 provenType=Array<WeakRef<pristine[Storage, Names]>, proven, Contiguous, pristine[Storage, Names, Dense]>
# CHECK-NEXT: v4: 0 = Integer
# CHECK-NEXT: v5: Array<Promise<int|whole, proven, pristine[Storage, Names]>, proven, pristine[Storage, Names]> = GetModuleVariable variable=g3
# CHECK-NEXT: v6: unspecified|Array<undefined|object, proven, Contiguous, pristine[Storage, Names, Dense]> = GetModuleVariable variable=g4 [mayPrecedeItsStore]
# CHECK-NEXT: v6: unspecified|Array<undefined|function, proven, Contiguous, pristine[Storage, Names, Dense]> = GetModuleVariable variable=g4 [mayPrecedeItsStore]
# CHECK-NEXT: Jump -> next b1(v4)
# CHECK-NEXT: b1(v7: int[0, 40]):
# CHECK-NEXT: LoopHint
Expand All @@ -4463,7 +4463,7 @@ runtimefunction id=ArrayTraversalTraverseArray function=f136 visibility=Private
# CHECK-NEXT: b3() handler=b4():
# CHECK-NEXT: v14: f82 = NewClosure v13 function=f82 allocationSite=54
# CHECK-NEXT: v15: fact = Entered function=f11
# CHECK-NEXT: v16: Array<undefined|object, proven, Contiguous, pristine[Storage, Names, Dense]> = AssumeType v6, v15 provenType=Array<undefined|object, proven, Contiguous, pristine[Storage, Names, Dense]>
# CHECK-NEXT: v16: Array<undefined|function, proven, Contiguous, pristine[Storage, Names, Dense]> = AssumeType v6, v15 provenType=Array<undefined|function, proven, Contiguous, pristine[Storage, Names, Dense]>
# CHECK-NEXT: v17: int[0, 4294967295] = CallBuiltin v16, v14 overload=ArrayPrototypePush/0 accessSite=58 @1473:4 tail
# CHECK-NEXT: Jump -> next b5()
# CHECK-NEXT: b4() role=CatchHandler:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,8 @@ runtimefunction id=IteratorOperationsIteratorGenericClose function=f51 visibilit
# CHECK-NEXT: Return v7
# CHECK-NEXT: }
# CHECK-LABEL: function f4 module=
# CHECK: m2 position=380 kind=Arrow flags=[IsChecked] length=2 captures=[{type=undefined|null|object flags=[IsExpected]}, {type="b" site=w1 flags=[OmitsNull, OmitsUndefined]}] thisType={type=anything} parameters=[{type=undefined|null|function flags=[IsExpected]}, {type=undefined|null|function flags=[IsExpected]}] results=[{type=undefined}] functionTypes=[f9] capabilities=[MayChangeSignature, MayBeCloned, MayBeInlined, HasOrdinaryFrame, IsNeverCalledByHost, ClosuresAreReadWithoutCode] {
# CHECK-NEXT: b0(v0: anything ~ undefined|null|object, v1: "b", v2: anything ~ undefined|null|function, v3: anything ~ undefined|null|function):
# CHECK: m2 position=380 kind=Arrow flags=[IsChecked] length=2 captures=[{type=undefined|null|object flags=[IsExpected]}, {type="b" site=w1 flags=[OmitsNull, OmitsUndefined]}] thisType={type=anything} parameters=[{type=undefined|function}, {type=undefined|function}] results=[{type=undefined}] functionTypes=[f9] capabilities=[MayChangeSignature, MayBeCloned, MayBeInlined, HasOrdinaryFrame, IsNeverCalledByHost, ClosuresAreReadWithoutCode] {
# CHECK-NEXT: b0(v0: anything ~ undefined|null|object, v1: "b", v2: undefined|function, v3: undefined|function):
# CHECK-NEXT: v9: "b" = AssumeType v1 provenType=undefined|null|string
# CHECK-NEXT: v10: "b" = AssumeType v9 provenType="b"
# CHECK-NEXT: v4: f6 = NewClosure v3 function=f6 allocationSite=4
Expand All @@ -655,8 +655,8 @@ runtimefunction id=IteratorOperationsIteratorGenericClose function=f51 visibilit
# CHECK-NEXT: Return v8
# CHECK-NEXT: }
# CHECK-LABEL: function f6 module=
# CHECK: m2 position=503 kind=Arrow flags=[IsChecked] length=1 captures=[{type=undefined|null|function flags=[IsExpected]}] thisType={type=anything} parameters=[{type=undefined|null|object flags=[IsExpected]}] results=[{type=undefined}] functionTypes=[f8] capabilities=[MayChangeSignature, MayBeCloned, MayBeInlined, HasOrdinaryFrame, IsNeverCalledByHost] {
# CHECK-NEXT: b0(v0: anything ~ undefined|null|function, v1: anything ~ undefined|null|object):
# CHECK: m2 position=503 kind=Arrow flags=[IsChecked] length=1 captures=[{type=undefined|function}] thisType={type=anything} parameters=[{type=undefined|null|object flags=[IsExpected]}] results=[{type=undefined}] functionTypes=[f8] capabilities=[MayChangeSignature, MayBeCloned, MayBeInlined, HasOrdinaryFrame, IsNeverCalledByHost] {
# CHECK-NEXT: b0(v0: undefined|function, v1: anything ~ undefined|null|object):
# CHECK-NEXT: v2: builtin(GlobalThis) = Builtin builtin=GlobalThis
# CHECK-NEXT: v3: anything = PropGet v2 key="Error" accessSite=13 [isFreeName]
# CHECK-NEXT: v13: builtin(Error) = AssumeType v3 provenType=builtin(Error)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// The reject function that `new Promise` hands its executor, stored into a field typed as a function: the field holds its declared type from birth, and a read of it is one load.
// The loop reads the field 160,000 times. Without the fact each read tests the object first: 160,000 branches more.
// COUNT: branches <= 420000
class Call {
reject!: (reason: Error) => void;
promise: Promise<number>;
constructor() {
this.promise = new Promise<number>((_resolve, reject) => {
this.reject = reject;
});
}
}
export function fail(list: Call[], reason: Error): void {
for (let j = 0; j < list.length; j++) list[j]!.reject(reason);
}
const list: Call[] = [];
for (let i = 0; i < 16; i++) list.push(new Call());
const reason = new Error("batch failed");
for (let turn = 0; turn < 10000; turn++) fail(list, reason);
let failures = 0;
for (const result of await Promise.allSettled(list.map(c => c.promise))) {
if (result.status === "rejected" && result.reason.message === "batch failed") failures++;
}
console.log(failures);
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// The same field without the `!`: declared as the function or undefined, and undefined until the executor runs. What the executor stores is a function, so the slot keeps its declared type.
// The loop reads the field 160,000 times. Without the fact each read tests the object first: 160,000 branches more.
// COUNT: branches <= 750000
class Call {
resolve: ((v: number) => void) | undefined = undefined;
promise: Promise<number>;
constructor() {
this.promise = new Promise<number>(r => {
this.resolve = r;
});
}
}
export function settle(list: Call[], values: number[]): void {
for (let j = 0; j < list.length; j++) list[j]!.resolve!(values[j]!);
}
const list: Call[] = [];
const values: number[] = [];
for (let i = 0; i < 16; i++) {
list.push(new Call());
values.push(i);
}
for (let turn = 0; turn < 10000; turn++) settle(list, values);
let sum = 0;
for (const v of await Promise.all(list.map(c => c.promise))) sum += v;
console.log(sum);
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// The resolve function that `new Promise` hands its executor is stored into a field typed as a function. Flow knows it is a function, so the field holds its declared type
// from birth: a read of it is one load, with no test of the object in front. The batching pattern: each pending call keeps its resolve, and one settle loop calls them all.
// The loop reads the field 160,000 times. Without the fact each read tests the object first: 160,000 branches more.
// COUNT: branches <= 750000
class Call {
resolve!: (v: number) => void;
promise: Promise<number>;
constructor() {
this.promise = new Promise<number>(r => {
this.resolve = r;
});
}
}
export function settle(list: Call[], values: number[]): void {
for (let j = 0; j < list.length; j++) list[j]!.resolve(values[j]!);
}
const list: Call[] = [];
const values: number[] = [];
for (let i = 0; i < 16; i++) {
list.push(new Call());
values.push(i);
}
for (let turn = 0; turn < 10000; turn++) settle(list, values);
let sum = 0;
for (const v of await Promise.all(list.map(c => c.promise))) sum += v;
console.log(sum);
Loading