Skip to content

Commit d698d0e

Browse files
Liedtkev8-internal-scoped@luci-project-accounts.iam.gserviceaccount.com
authored andcommitted
Partial revert for "[wasm] Implement ref.as_non_null"
This reverts unreviewed changes that were accidentally added to commit 8fbbfdc. Original change's description: > [wasm] Implement ref.as_non_null > > Bug: 474940922 > Change-Id: I20f142ba41d3efa88872ae0dfa308170a8c0ff11 > Reviewed-on: https://chrome-internal-review.googlesource.com/c/v8/fuzzilli/+/8956716 > Commit-Queue: Matthias Liedtke <mliedtke@google.com> > Auto-Submit: Matthias Liedtke <mliedtke@google.com> > Reviewed-by: Leon Bettscheider <bettscheider@google.com> Bug: 474940922 Change-Id: I5a8d7cc465384c304908502d0447cc3b6c9be6ef Reviewed-on: https://chrome-internal-review.googlesource.com/c/v8/fuzzilli/+/9347522 Reviewed-by: Leon Bettscheider <bettscheider@google.com> Commit-Queue: Leon Bettscheider <bettscheider@google.com> Auto-Submit: Matthias Liedtke <mliedtke@google.com>
1 parent 77806f1 commit d698d0e

2 files changed

Lines changed: 3 additions & 23 deletions

File tree

Sources/Fuzzilli/Base/ProgramBuilder.swift

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5549,15 +5549,6 @@ public class ProgramBuilder {
55495549
}
55505550
}
55515551
),
5552-
(
5553-
.wasmRefExtern(),
5554-
{
5555-
let i31 = self.wasmRefI31(
5556-
self.consti32(
5557-
Int32(truncatingIfNeeded: self.b.randomInt())))
5558-
return self.wasmExternConvertAny(i31)
5559-
}
5560-
),
55615552
]
55625553
// Note that for a type like eqref there are multiple valid options.
55635554
let options = allOptions.filter { $0.0.Is(type) }.map { $0.1 }
@@ -5587,15 +5578,6 @@ public class ProgramBuilder {
55875578
return wasmStructNewDefault(
55885579
structType: b.jsTyper.getWasmTypeDef(for: type))
55895580
}
5590-
if abstractSuper == .WasmFunc {
5591-
let signatureType = b.type(of: b.jsTyper.getWasmTypeDef(for: type))
5592-
if let f = b.findVariable(satisfying: {
5593-
b.type(of: $0).wasmFunctionDef?.signatureType
5594-
== signatureType
5595-
}) {
5596-
return wasmRefFunc(f)
5597-
}
5598-
}
55995581
}
56005582
if nullable {
56015583
return wasmRefNull(typeDef: b.jsTyper.getWasmTypeDef(for: type))

Tests/FuzzilliTests/WasmTests.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,9 @@ class WasmFoundationTests: XCTestCase {
281281
nullable
282282
|| (
283283
// Non-nullable heap types unsupported for these types.
284-
// TODO(mliedtke): Extend for ref func, extend for exnref once we can generate them.
285-
heapType != .WasmFunc && heapType != .WasmExn
284+
// TODO(mliedtke): Extend for ref extern, extend for ref func once we
285+
// have ref.func.
286+
heapType != .WasmFunc && heapType != .WasmExtern && heapType != .WasmExn
286287
// Bottom null-types must be nullable.
287288
&& !heapType.isBottom())
288289
}.map { ILType.wasmRef($0.0, nullability: $0.1) }
@@ -293,9 +294,6 @@ class WasmFoundationTests: XCTestCase {
293294
}.map { b.type(of: $0.0).wasmTypeDefinition!.getReferenceTypeTo(nullability: $0.1) }
294295

295296
b.buildWasmModule { wasmModule in
296-
// Add a dummy function so that ref.func has something to pick.
297-
wasmModule.addWasmFunction(with: [] => []) { _, _, _ in [] }
298-
299297
// Test multiple times. Note that this will lead to a huge test case (but will be
300298
// significantly faster than invoking the JS engine many times).
301299
for _ in 0..<10 {

0 commit comments

Comments
 (0)