-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is an initial, mechanical step to support the [exception handling proposal](https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-handling/Exceptions.md). Not much, but it's self-contained and tested.
- Loading branch information
Showing
15 changed files
with
380 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
runtime/src/main/java/com/dylibso/chicory/runtime/ImportTag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.dylibso.chicory.runtime; | ||
|
||
public class ImportTag implements ImportValue { | ||
private final String module; | ||
private final String name; | ||
private final TagInstance tag; | ||
|
||
public ImportTag(String module, String name, TagInstance tag) { | ||
this.module = module; | ||
this.name = name; | ||
this.tag = tag; | ||
} | ||
|
||
@Override | ||
public String module() { | ||
return module; | ||
} | ||
|
||
@Override | ||
public String name() { | ||
return name; | ||
} | ||
|
||
@Override | ||
public Type type() { | ||
return Type.TAG; | ||
} | ||
|
||
public TagInstance tag() { | ||
return tag; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,8 @@ enum Type { | |
FUNCTION, | ||
GLOBAL, | ||
MEMORY, | ||
TABLE | ||
TABLE, | ||
TAG | ||
} | ||
|
||
String module(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
runtime/src/main/java/com/dylibso/chicory/runtime/TagInstance.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.dylibso.chicory.runtime; | ||
|
||
import com.dylibso.chicory.wasm.types.TagType; | ||
|
||
public class TagInstance { | ||
|
||
private final TagType tag; | ||
private final Instance instance; | ||
|
||
public TagInstance(TagType tag, Instance instance) { | ||
this.tag = tag; | ||
this.instance = instance; | ||
} | ||
|
||
public TagType tagType() { | ||
return tag; | ||
} | ||
|
||
public Instance instance() { | ||
return instance; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.