Comments (6)
That's a validation error.
from function-references.
How can an validation error occur if there are no runtime checks?
from function-references.
I'm afraid I don't understand the question. Validation happens before compilation and execution.
from function-references.
How should validation occur before compilation? Can be that I does not have understand the concept.
My understand is:
- I can pass a variable of
func.ref
to any location. - At runtime there can be in a
func.ref
variable a pointer to any function. - The
call_ref
instruction hat no type information likecall_indrect
. - At compile time, there is no knowledge of the number and type of function parameters.
- At compile time, there is no knowledge of the number and type of return values.
Of course, the Wasm file compiler has the necessary knowledge about the parameter types. But this not help the Wasm engine.
from function-references.
Please see the Summary and following sections in the Overview doc. The central novelty in this proposal is the introduction of typed references (ref $ty)
, which provide the validator with the necessary type information. The func.ref
instruction creates such a typed function reference and the call_ref
instruction can only be applied to such references (thus the name of the proposal).
from function-references.
Ok, thank you. This important point I have oversee. Now all is clearer.
from function-references.
Related Issues (20)
- Issues with the JavaScript spec tests HOT 4
- `Illegal macro parameter reference` in the spec HOT 1
- Binary encoding out of sync with GC proposal
- Merge in latest spec repo HOT 2
- Function reference from JavaScript functions? HOT 4
- Validation rule for call_ref with polymorphic stack HOT 5
- Fix table-elem desugaring
- `func.bind` and iso-recursion HOT 2
- Validating local.get in nested blocks with unreachable HOT 5
- br_on_non_null.wast needs unreachable test HOT 1
- slowness of test/core/skip-stack-guard-page.wast HOT 3
- Drop null casts? HOT 4
- Tweak binary format for table declarations HOT 2
- JS-API is missing value conversions HOT 3
- Extend `TableType` to support non-nullable references in JS-API HOT 1
- Progress toward phase 4 HOT 2
- Malformed br_on_null and br_on_non_null in tests HOT 1
- Default/init values in JS-API for globals and table. HOT 3
- Clarification request: initializers for tables with non-nullable type and initial_size == 0 HOT 3
- Should non-nullable locals be initialized by unreachable code? HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from function-references.