Skip to content

Commit

Permalink
Wasm compiler: remove unused operators Extern{In,Ex}ternalize
Browse files Browse the repository at this point in the history
  • Loading branch information
vouillon committed Jul 19, 2024
1 parent 7cc2831 commit b9a93a3
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 15 deletions.
4 changes: 1 addition & 3 deletions compiler/lib/wasm/wa_asm_output.ml
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,7 @@ module Output () = struct
| RefEq _
| RefNull _
| Br_on_cast _
| Br_on_cast_fail _
| ExternExternalize _
| ExternInternalize _ -> assert false (* Not supported *)
| Br_on_cast_fail _ -> assert false (* Not supported *)

and instruction m i =
match i with
Expand Down
2 changes: 0 additions & 2 deletions compiler/lib/wasm/wa_ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ type expression =
| RefTest of ref_type * expression
| RefEq of expression * expression
| RefNull of heap_type
| ExternInternalize of expression
| ExternExternalize of expression
| Br_on_cast of int * ref_type * ref_type * expression
| Br_on_cast_fail of int * ref_type * ref_type * expression
| IfExpr of value_type * expression * expression * expression
Expand Down
2 changes: 0 additions & 2 deletions compiler/lib/wasm/wa_code_generation.ml
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,6 @@ let rec is_smi e =
| StructGet _
| RefCast _
| RefNull _
| ExternInternalize _
| ExternExternalize _
| Br_on_cast _
| Br_on_cast_fail _ -> false
| BinOp ((F32 _ | F64 _), _, _) | RefTest _ | RefEq _ -> true
Expand Down
4 changes: 1 addition & 3 deletions compiler/lib/wasm/wa_gc_target.ml
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,7 @@ module Value = struct
| ArrayLen e'
| StructGet (_, _, _, e')
| RefCast (_, e')
| RefTest (_, e')
| ExternInternalize e'
| ExternExternalize e' -> effect_free e'
| RefTest (_, e') -> effect_free e'
| BinOp (_, e1, e2)
| ArrayNew (_, e1, e2)
| ArrayNewData (_, _, e1, e2)
Expand Down
4 changes: 1 addition & 3 deletions compiler/lib/wasm/wa_initialize_locals.ml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ let rec scan_expression ctx e =
| RefCast (_, e')
| RefTest (_, e')
| Br_on_cast (_, _, _, e')
| Br_on_cast_fail (_, _, _, e')
| ExternInternalize e'
| ExternExternalize e' -> scan_expression ctx e'
| Br_on_cast_fail (_, _, _, e') -> scan_expression ctx e'
| BinOp (_, e', e'')
| ArrayNew (_, e', e'')
| ArrayNewData (_, _, e', e'')
Expand Down
2 changes: 0 additions & 2 deletions compiler/lib/wasm/wa_wat_output.ml
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,6 @@ let expression_or_instructions ctx st in_function =
:: ref_type st ty'
:: expression e)
]
| ExternInternalize e -> [ List (Atom "extern.internalize" :: expression e) ]
| ExternExternalize e -> [ List (Atom "extern.externalize" :: expression e) ]
| IfExpr (ty, cond, ift, iff) ->
[ List
((Atom "if" :: block_type st { params = []; result = [ ty ] })
Expand Down

0 comments on commit b9a93a3

Please sign in to comment.