@@ -83,11 +83,11 @@ class BinaryReaderIR : public BinaryReaderNop {
83
83
Index global_index,
84
84
Type type,
85
85
bool mutable_) override ;
86
- Result OnImportEvent (Index import_index,
87
- string_view module_name,
88
- string_view field_name,
89
- Index event_index ,
90
- Index sig_index) override ;
86
+ Result OnImportTag (Index import_index,
87
+ string_view module_name,
88
+ string_view field_name,
89
+ Index tag_index ,
90
+ Index sig_index) override ;
91
91
92
92
Result OnFunctionCount (Index count) override ;
93
93
Result OnFunction (Index index, Index sig_index) override ;
@@ -144,7 +144,7 @@ class BinaryReaderIR : public BinaryReaderNop {
144
144
Index* target_depths,
145
145
Index default_target_depth) override ;
146
146
Result OnCallExpr (Index func_index) override ;
147
- Result OnCatchExpr (Index event_index ) override ;
147
+ Result OnCatchExpr (Index tag_index ) override ;
148
148
Result OnCatchAllExpr () override ;
149
149
Result OnCallIndirectExpr (Index sig_index, Index table_index) override ;
150
150
Result OnReturnCallExpr (Index func_index) override ;
@@ -194,7 +194,7 @@ class BinaryReaderIR : public BinaryReaderNop {
194
194
Result OnStoreExpr (Opcode opcode,
195
195
Address alignment_log2,
196
196
Address offset) override ;
197
- Result OnThrowExpr (Index event_index ) override ;
197
+ Result OnThrowExpr (Index tag_index ) override ;
198
198
Result OnTryExpr (Type sig_type) override ;
199
199
Result OnUnaryExpr (Opcode opcode) override ;
200
200
Result OnTernaryExpr (Opcode opcode) override ;
@@ -252,10 +252,10 @@ class BinaryReaderIR : public BinaryReaderNop {
252
252
Index index,
253
253
string_view name) override ;
254
254
255
- Result BeginEventSection (Offset size) override { return Result::Ok; }
256
- Result OnEventCount (Index count) override { return Result::Ok; }
257
- Result OnEventType (Index index, Index sig_index) override ;
258
- Result EndEventSection () override { return Result::Ok; }
255
+ Result BeginTagSection (Offset size) override { return Result::Ok; }
256
+ Result OnTagCount (Index count) override { return Result::Ok; }
257
+ Result OnTagType (Index index, Index sig_index) override ;
258
+ Result EndTagSection () override { return Result::Ok; }
259
259
260
260
Result OnInitExprF32ConstExpr (Index index, uint32_t value) override ;
261
261
Result OnInitExprF64ConstExpr (Index index, uint64_t value) override ;
@@ -274,8 +274,10 @@ class BinaryReaderIR : public BinaryReaderNop {
274
274
Index global_index) override ;
275
275
Result OnSectionSymbol (Index index, uint32_t flags,
276
276
Index section_index) override ;
277
- Result OnEventSymbol (Index index, uint32_t flags, string_view name,
278
- Index event_index) override ;
277
+ Result OnTagSymbol (Index index,
278
+ uint32_t flags,
279
+ string_view name,
280
+ Index tag_index) override ;
279
281
Result OnTableSymbol (Index index, uint32_t flags, string_view name,
280
282
Index table_index) override ;
281
283
@@ -525,15 +527,15 @@ Result BinaryReaderIR::OnImportGlobal(Index import_index,
525
527
return Result::Ok;
526
528
}
527
529
528
- Result BinaryReaderIR::OnImportEvent (Index import_index,
529
- string_view module_name,
530
- string_view field_name,
531
- Index event_index ,
532
- Index sig_index) {
533
- auto import = MakeUnique<EventImport >();
530
+ Result BinaryReaderIR::OnImportTag (Index import_index,
531
+ string_view module_name,
532
+ string_view field_name,
533
+ Index tag_index ,
534
+ Index sig_index) {
535
+ auto import = MakeUnique<TagImport >();
534
536
import->module_name = module_name.to_string ();
535
537
import->field_name = field_name.to_string ();
536
- SetFuncDeclaration (&import->event .decl , Var (sig_index, GetLocation ()));
538
+ SetFuncDeclaration (&import->tag .decl , Var (sig_index, GetLocation ()));
537
539
module_->AppendField (
538
540
MakeUnique<ImportModuleField>(std::move (import), GetLocation ()));
539
541
return Result::Ok;
@@ -975,8 +977,8 @@ Result BinaryReaderIR::OnStoreExpr(Opcode opcode,
975
977
return AppendExpr (MakeUnique<StoreExpr>(opcode, 1 << alignment_log2, offset));
976
978
}
977
979
978
- Result BinaryReaderIR::OnThrowExpr (Index event_index ) {
979
- return AppendExpr (MakeUnique<ThrowExpr>(Var (event_index , GetLocation ())));
980
+ Result BinaryReaderIR::OnThrowExpr (Index tag_index ) {
981
+ return AppendExpr (MakeUnique<ThrowExpr>(Var (tag_index , GetLocation ())));
980
982
}
981
983
982
984
Result BinaryReaderIR::OnLocalTeeExpr (Index local_index) {
@@ -1482,10 +1484,10 @@ Result BinaryReaderIR::OnLocalName(Index func_index,
1482
1484
return Result::Ok;
1483
1485
}
1484
1486
1485
- Result BinaryReaderIR::OnEventType (Index index, Index sig_index) {
1486
- auto field = MakeUnique<EventModuleField >(GetLocation ());
1487
- Event& event = field->event ;
1488
- SetFuncDeclaration (&event .decl , Var (sig_index, GetLocation ()));
1487
+ Result BinaryReaderIR::OnTagType (Index index, Index sig_index) {
1488
+ auto field = MakeUnique<TagModuleField >(GetLocation ());
1489
+ Tag& tag = field->tag ;
1490
+ SetFuncDeclaration (&tag .decl , Var (sig_index, GetLocation ()));
1489
1491
module_->AppendField (std::move (field));
1490
1492
return Result::Ok;
1491
1493
}
@@ -1548,20 +1550,22 @@ Result BinaryReaderIR::OnSectionSymbol(Index index, uint32_t flags,
1548
1550
return Result::Ok;
1549
1551
}
1550
1552
1551
- Result BinaryReaderIR::OnEventSymbol (Index index, uint32_t flags,
1552
- string_view name, Index event_index) {
1553
+ Result BinaryReaderIR::OnTagSymbol (Index index,
1554
+ uint32_t flags,
1555
+ string_view name,
1556
+ Index tag_index) {
1553
1557
if (name.empty ()) {
1554
1558
return Result::Ok;
1555
1559
}
1556
- if (event_index >= module_->events .size ()) {
1557
- PrintError (" invalid event index: %" PRIindex, event_index );
1560
+ if (tag_index >= module_->tags .size ()) {
1561
+ PrintError (" invalid tag index: %" PRIindex, tag_index );
1558
1562
return Result::Error;
1559
1563
}
1560
- Event* event = module_->events [event_index ];
1564
+ Tag* tag = module_->tags [tag_index ];
1561
1565
std::string dollar_name =
1562
- GetUniqueName (&module_->event_bindings , MakeDollarName (name));
1563
- event ->name = dollar_name;
1564
- module_->event_bindings .emplace (dollar_name, Binding (event_index ));
1566
+ GetUniqueName (&module_->tag_bindings , MakeDollarName (name));
1567
+ tag ->name = dollar_name;
1568
+ module_->tag_bindings .emplace (dollar_name, Binding (tag_index ));
1565
1569
return Result::Ok;
1566
1570
}
1567
1571
0 commit comments