-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade WABT to 1.0.19 #443
Conversation
Codecov Report
@@ Coverage Diff @@
## master #443 +/- ##
==========================================
+ Coverage 98.61% 98.64% +0.02%
==========================================
Files 59 59
Lines 8912 8932 +20
==========================================
+ Hits 8789 8811 +22
+ Misses 123 121 -2 |
77dc7c8
to
ec64b3b
Compare
|
||
// Run start function (this will return ok if no start function is present) | ||
const wabt::interp::ExecResult r = m_executor.RunStartFunction(m_module); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this now executed properly by instantiate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, looks like so, our unit test for this passes.
} | ||
|
||
WasmEngine::Result WabtEngine::execute( | ||
WasmEngine::FuncRef func_ref, const std::vector<uint64_t>& args) | ||
{ | ||
const auto* e = reinterpret_cast<const wabt::interp::Export*>(func_ref); | ||
assert(m_instance); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why assert here and not in init_memory/get_memory? I think we have the "rules" described in wasm_engine.h
, I can't remember myself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wasm_engine.hpp
says for all threeRequires instantiate().
, though it seems ambiguous whether it means "assumes instantiate was called" or "fails when instantiate was not called".
But I see that here it's inconsitent now, I guess I'll change it to asserts in all three, fizzy_engine
also assumes m_instance
is non-null there.
feb9550
to
e7e2b09
Compare
a03c67b
to
7ce690a
Compare
Can you also squash the commits? I think this is ready now, isn't it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, we should have a benchmarking comparing this to 1.0.12 though.
@chfast waiting for your review |
This does not look very impressive. |
wabt::interp::DefinedModule* m_module{nullptr}; | ||
|
||
// WABT Executor/Thread with default options. | ||
wabt::interp::Executor m_executor{&m_env}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously the stack space was allocated here. Not allocating stack for every call had big impact on performance.
})()}; | ||
wabt::interp::Module::Ptr m_module; | ||
wabt::interp::Instance::Ptr m_instance; | ||
wabt::interp::Thread::Ptr m_thread{wabt::interp::Thread::New(m_store, {})}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are the options for Thread
https://github.com/WebAssembly/wabt/blob/21350996d5bbcd9cafbaa3a5687e6fb503da060c/src/interp/interp.h#L1025-L1032
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default values are fine provided we create it once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So m_store
does not need to be mutable anymore, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So
m_store
does not need to be mutable anymore, right?
It still needs it for get_memory
where it gets the (smart) pointer to memory, which can be only non-const.
I benchmarked the version with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved.
Make sure to squash the last commit :) |
I've got similar or worse results
|
I propose to merge it as is, and report upstream. Depending on the feedback we may adjust to code in following PRs. |
f966f6c
to
33f5554
Compare
Updated benchmarks, now without
|
For reference, here's PR intoducing new API: WebAssembly/wabt#1330