Skip to content

Commit 91a3149

Browse files
committed
Rename except_ref type to exnref
In WebAssembly/exception-handling#79 we agreed to rename `except_ref` type to `exnref`.
1 parent 8d13b5a commit 91a3149

34 files changed

+101
-101
lines changed

build-js.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export_function "_BinaryenTypeInt64"
184184
export_function "_BinaryenTypeFloat32"
185185
export_function "_BinaryenTypeFloat64"
186186
export_function "_BinaryenTypeVec128"
187-
export_function "_BinaryenTypeExceptRef"
187+
export_function "_BinaryenTypeExnref"
188188
export_function "_BinaryenTypeUnreachable"
189189
export_function "_BinaryenTypeAuto"
190190

src/asmjs/asm_v_wasm.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ AsmType wasmToAsmType(Type type) {
5353
return ASM_INT64;
5454
case v128:
5555
assert(false && "v128 not implemented yet");
56-
case except_ref:
57-
assert(false && "except_ref is not in asm2wasm");
56+
case exnref:
57+
assert(false && "exnref is not in asm2wasm");
5858
case none:
5959
return ASM_NONE;
6060
case unreachable:
@@ -75,7 +75,7 @@ char getSig(Type type) {
7575
return 'd';
7676
case v128:
7777
return 'V';
78-
case except_ref:
78+
case exnref:
7979
return 'e';
8080
case none:
8181
return 'v';
@@ -106,7 +106,7 @@ Type sigToType(char sig) {
106106
case 'V':
107107
return v128;
108108
case 'e':
109-
return except_ref;
109+
return exnref;
110110
case 'v':
111111
return none;
112112
default:

src/binaryen-c.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ BinaryenLiteral toBinaryenLiteral(Literal x) {
7070
break;
7171
}
7272

73-
case Type::except_ref: // there's no except_ref literals
73+
case Type::exnref: // there's no exnref literals
7474
case Type::none:
7575
case Type::unreachable:
7676
WASM_UNREACHABLE();
@@ -90,7 +90,7 @@ Literal fromBinaryenLiteral(BinaryenLiteral x) {
9090
return Literal(x.i64).castToF64();
9191
case Type::v128:
9292
return Literal(x.v128);
93-
case Type::except_ref: // there's no except_ref literals
93+
case Type::exnref: // there's no exnref literals
9494
case Type::none:
9595
case Type::unreachable:
9696
WASM_UNREACHABLE();
@@ -210,7 +210,7 @@ void printArg(std::ostream& setup, std::ostream& out, BinaryenLiteral arg) {
210210
out << "BinaryenLiteralVec128(" << array << ")";
211211
break;
212212
}
213-
case Type::except_ref: // there's no except_ref literals
213+
case Type::exnref: // there's no exnref literals
214214
case Type::none:
215215
case Type::unreachable:
216216
WASM_UNREACHABLE();
@@ -265,7 +265,7 @@ BinaryenType BinaryenTypeInt64(void) { return i64; }
265265
BinaryenType BinaryenTypeFloat32(void) { return f32; }
266266
BinaryenType BinaryenTypeFloat64(void) { return f64; }
267267
BinaryenType BinaryenTypeVec128(void) { return v128; }
268-
BinaryenType BinaryenTypeExceptRef(void) { return except_ref; }
268+
BinaryenType BinaryenTypeExnref(void) { return exnref; }
269269
BinaryenType BinaryenTypeUnreachable(void) { return unreachable; }
270270
BinaryenType BinaryenTypeAuto(void) { return uint32_t(-1); }
271271

src/binaryen-c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ BinaryenType BinaryenTypeInt64(void);
7474
BinaryenType BinaryenTypeFloat32(void);
7575
BinaryenType BinaryenTypeFloat64(void);
7676
BinaryenType BinaryenTypeVec128(void);
77-
BinaryenType BinaryenTypeExceptRef(void);
77+
BinaryenType BinaryenTypeExnref(void);
7878
BinaryenType BinaryenTypeUnreachable(void);
7979
// Not a real type. Used as the last parameter to BinaryenBlock to let
8080
// the API figure out the type instead of providing one.

src/ir/abstract.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ inline UnaryOp getUnary(Type type, Op op) {
8181
assert(false && "v128 not implemented yet");
8282
WASM_UNREACHABLE();
8383
}
84-
case except_ref: // there's no unary instructions for except_ref
84+
case exnref: // there's no unary instructions for exnref
8585
case none:
8686
case unreachable: {
8787
return InvalidUnary;
@@ -212,7 +212,7 @@ inline BinaryOp getBinary(Type type, Op op) {
212212
assert(false && "v128 not implemented yet");
213213
WASM_UNREACHABLE();
214214
}
215-
case except_ref: // there's no binary instructions for except_ref
215+
case exnref: // there's no binary instructions for exnref
216216
case none:
217217
case unreachable: {
218218
return InvalidBinary;

src/js/binaryen.js-post.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Module['i64'] = Module['_BinaryenTypeInt64']();
3737
Module['f32'] = Module['_BinaryenTypeFloat32']();
3838
Module['f64'] = Module['_BinaryenTypeFloat64']();
3939
Module['v128'] = Module['_BinaryenTypeVec128']();
40-
Module['except_ref'] = Module['_BinaryenTypeExceptRef']();
40+
Module['exnref'] = Module['_BinaryenTypeExnref']();
4141
Module['unreachable'] = Module['_BinaryenTypeUnreachable']();
4242
Module['auto'] = /* deprecated */ Module['undefined'] = Module['_BinaryenTypeAuto']();
4343

src/literal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class Literal {
8080
Literal(int32_t(0)),
8181
Literal(int32_t(0)),
8282
Literal(int32_t(0))}});
83-
case Type::except_ref: // there's no except_ref literals
83+
case Type::exnref: // there's no exnref literals
8484
case none:
8585
case unreachable:
8686
WASM_UNREACHABLE();
@@ -430,7 +430,7 @@ template<> struct less<wasm::Literal> {
430430
return a.reinterpreti64() < b.reinterpreti64();
431431
case wasm::Type::v128:
432432
return memcmp(a.getv128Ptr(), b.getv128Ptr(), 16) < 0;
433-
case wasm::Type::except_ref: // except_ref is an opaque value
433+
case wasm::Type::exnref: // exnref is an opaque value
434434
case wasm::Type::none:
435435
case wasm::Type::unreachable:
436436
return false;

src/parsing.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ parseConst(cashew::IString s, Type type, MixedArena& allocator) {
263263
break;
264264
}
265265
case v128:
266-
case except_ref: // there's no except_ref.const
266+
case exnref: // there's no exnref.const
267267
WASM_UNREACHABLE();
268268
case none:
269269
case unreachable: {

src/passes/ConstHoisting.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ struct ConstHoisting : public WalkerPass<PostWalker<ConstHoisting>> {
9595
// v128 not implemented yet
9696
return false;
9797
}
98-
case except_ref: {
99-
// except_ref cannot have literals
98+
case exnref: {
99+
// exnref cannot have literals
100100
return false;
101101
}
102102
case none:

src/passes/FuncCastEmulation.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ static Expression* toABI(Expression* value, Module* module) {
6666
assert(false && "v128 not implemented yet");
6767
WASM_UNREACHABLE();
6868
}
69-
case except_ref: {
70-
assert(false && "except_ref cannot be converted to i64");
69+
case exnref: {
70+
assert(false && "exnref cannot be converted to i64");
7171
WASM_UNREACHABLE();
7272
}
7373
case none: {
@@ -108,8 +108,8 @@ static Expression* fromABI(Expression* value, Type type, Module* module) {
108108
assert(false && "v128 not implemented yet");
109109
WASM_UNREACHABLE();
110110
}
111-
case except_ref: {
112-
assert(false && "except_ref cannot be converted from i64");
111+
case exnref: {
112+
assert(false && "exnref cannot be converted from i64");
113113
WASM_UNREACHABLE();
114114
}
115115
case none: {

src/passes/InstrumentLocals.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ struct InstrumentLocals : public WalkerPass<PostWalker<InstrumentLocals>> {
8181
break;
8282
case v128:
8383
assert(false && "v128 not implemented yet");
84-
case except_ref:
84+
case exnref:
8585
assert(false && "not implemented yet");
8686
case none:
8787
WASM_UNREACHABLE();
@@ -113,8 +113,8 @@ struct InstrumentLocals : public WalkerPass<PostWalker<InstrumentLocals>> {
113113
break;
114114
case v128:
115115
assert(false && "v128 not implemented yet");
116-
case except_ref:
117-
assert(false && "except_ref not implemented yet");
116+
case exnref:
117+
assert(false && "exnref not implemented yet");
118118
case unreachable:
119119
return; // nothing to do here
120120
case none:

src/shell-interface.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ struct ShellExternalInterface : ModuleInstance::ExternalInterface {
114114
break;
115115
case v128:
116116
assert(false && "v128 not implemented yet");
117-
case except_ref:
118-
assert(false && "except_ref not implemented yet");
117+
case exnref:
118+
assert(false && "exnref not implemented yet");
119119
case none:
120120
case unreachable:
121121
WASM_UNREACHABLE();

src/tools/fuzzing.h

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ high chance for set at start of loop
2525
high chance of a tee in that case => loop var
2626
*/
2727

28-
// TODO Complete except_ref type support. Its support is partialy implemented
28+
// TODO Complete exnref type support. Its support is partialy implemented
2929
// and the type is currently not generated in fuzzed programs yet.
3030

3131
#include "ir/memory-utils.h"
@@ -851,7 +851,7 @@ class TranslateToFuzzReader {
851851
case f32:
852852
case f64:
853853
case v128:
854-
case except_ref:
854+
case exnref:
855855
ret = _makeConcrete(type);
856856
break;
857857
case none:
@@ -1363,7 +1363,7 @@ class TranslateToFuzzReader {
13631363
return builder.makeLoad(
13641364
16, false, offset, pick(1, 2, 4, 8, 16), ptr, type);
13651365
}
1366-
case except_ref: // except_ref cannot be loaded from memory
1366+
case exnref: // exnref cannot be loaded from memory
13671367
case none:
13681368
case unreachable:
13691369
WASM_UNREACHABLE();
@@ -1372,8 +1372,8 @@ class TranslateToFuzzReader {
13721372
}
13731373

13741374
Expression* makeLoad(Type type) {
1375-
// except_ref type cannot be stored in memory
1376-
if (!allowMemory || type == except_ref) {
1375+
// exnref type cannot be stored in memory
1376+
if (!allowMemory || type == exnref) {
13771377
return makeTrivial(type);
13781378
}
13791379
auto* ret = makeNonAtomicLoad(type);
@@ -1464,7 +1464,7 @@ class TranslateToFuzzReader {
14641464
return builder.makeStore(
14651465
16, offset, pick(1, 2, 4, 8, 16), ptr, value, type);
14661466
}
1467-
case except_ref: // except_ref cannot be stored in memory
1467+
case exnref: // exnref cannot be stored in memory
14681468
case none:
14691469
case unreachable:
14701470
WASM_UNREACHABLE();
@@ -1473,8 +1473,8 @@ class TranslateToFuzzReader {
14731473
}
14741474

14751475
Expression* makeStore(Type type) {
1476-
// except_ref type cannot be stored in memory
1477-
if (!allowMemory || type == except_ref) {
1476+
// exnref type cannot be stored in memory
1477+
if (!allowMemory || type == exnref) {
14781478
return makeTrivial(type);
14791479
}
14801480
auto* ret = makeNonAtomicStore(type);
@@ -1559,7 +1559,7 @@ class TranslateToFuzzReader {
15591559
case f64:
15601560
return Literal(getDouble());
15611561
case v128:
1562-
case except_ref: // except_ref cannot have literals
1562+
case exnref: // exnref cannot have literals
15631563
case none:
15641564
case unreachable:
15651565
WASM_UNREACHABLE();
@@ -1601,7 +1601,7 @@ class TranslateToFuzzReader {
16011601
case f64:
16021602
return Literal(double(small));
16031603
case v128:
1604-
case except_ref: // except_ref cannot have literals
1604+
case exnref: // exnref cannot have literals
16051605
case none:
16061606
case unreachable:
16071607
WASM_UNREACHABLE();
@@ -1666,7 +1666,7 @@ class TranslateToFuzzReader {
16661666
std::numeric_limits<uint64_t>::max()));
16671667
break;
16681668
case v128:
1669-
case except_ref: // except_ref cannot have literals
1669+
case exnref: // exnref cannot have literals
16701670
case none:
16711671
case unreachable:
16721672
WASM_UNREACHABLE();
@@ -1697,7 +1697,7 @@ class TranslateToFuzzReader {
16971697
value = Literal(double(int64_t(1) << upTo(64)));
16981698
break;
16991699
case v128:
1700-
case except_ref: // except_ref cannot have literals
1700+
case exnref: // exnref cannot have literals
17011701
case none:
17021702
case unreachable:
17031703
WASM_UNREACHABLE();
@@ -1721,11 +1721,11 @@ class TranslateToFuzzReader {
17211721
}
17221722

17231723
Expression* makeConst(Type type) {
1724-
if (type == except_ref) {
1725-
// There's no except_ref.const.
1724+
if (type == exnref) {
1725+
// There's no exnref.const.
17261726
// TODO We should return a nullref once we implement instructions for
17271727
// reference types proposal.
1728-
assert(false && "except_ref const is not implemented yet");
1728+
assert(false && "exnref const is not implemented yet");
17291729
}
17301730
auto* ret = wasm.allocator.alloc<Const>();
17311731
ret->value = makeLiteral(type);
@@ -1745,8 +1745,8 @@ class TranslateToFuzzReader {
17451745
// give up
17461746
return makeTrivial(type);
17471747
}
1748-
// There's no binary ops for except_ref
1749-
if (type == except_ref) {
1748+
// There's no binary ops for exnref
1749+
if (type == exnref) {
17501750
makeTrivial(type);
17511751
}
17521752

@@ -1795,7 +1795,7 @@ class TranslateToFuzzReader {
17951795
AllTrueVecI64x2),
17961796
make(v128)});
17971797
}
1798-
case except_ref: // there's no unary ops for except_ref
1798+
case exnref: // there's no unary ops for exnref
17991799
case none:
18001800
case unreachable:
18011801
WASM_UNREACHABLE();
@@ -1926,7 +1926,7 @@ class TranslateToFuzzReader {
19261926
}
19271927
WASM_UNREACHABLE();
19281928
}
1929-
case except_ref: // there's no unary ops for except_ref
1929+
case exnref: // there's no unary ops for exnref
19301930
case none:
19311931
case unreachable:
19321932
WASM_UNREACHABLE();
@@ -1947,8 +1947,8 @@ class TranslateToFuzzReader {
19471947
// give up
19481948
return makeTrivial(type);
19491949
}
1950-
// There's no binary ops for except_ref
1951-
if (type == except_ref) {
1950+
// There's no binary ops for exnref
1951+
if (type == exnref) {
19521952
makeTrivial(type);
19531953
}
19541954

@@ -2139,7 +2139,7 @@ class TranslateToFuzzReader {
21392139
make(v128),
21402140
make(v128)});
21412141
}
2142-
case except_ref: // there's no binary ops for except_ref
2142+
case exnref: // there's no binary ops for exnref
21432143
case none:
21442144
case unreachable:
21452145
WASM_UNREACHABLE();
@@ -2333,7 +2333,7 @@ class TranslateToFuzzReader {
23332333
op = ExtractLaneVecF64x2;
23342334
break;
23352335
case v128:
2336-
case except_ref:
2336+
case exnref:
23372337
case none:
23382338
case unreachable:
23392339
WASM_UNREACHABLE();

src/tools/spec-wrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static std::string generateSpecWrapper(Module& wasm) {
4848
case v128:
4949
ret += "(v128.const i32x4 0 0 0 0)";
5050
break;
51-
case except_ref: // there's no except_ref.const
51+
case exnref: // there's no exnref.const
5252
case none:
5353
case unreachable:
5454
WASM_UNREACHABLE();

0 commit comments

Comments
 (0)