Skip to content
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

VM Refactor, new runtime, and the ability to have multiple compilers. #80

Merged
merged 206 commits into from
Jan 22, 2019

Conversation

lachlansneff
Copy link
Contributor

@lachlansneff lachlansneff commented Dec 26, 2018

This pr rewrites the wasm runtime used by wasmer. It also provides the necessary abstractions to provide multiple compiler backends that feed into the runtime frontend.

I'd like to merge this in the next few days. It can continue to progress while upstream.

Progress:

  • Separate code into different libs
    • Cranelift integration
    • Runtime
    • Emscripten (and emtests)
  • Compilation successful in CircleCI (mac)
  • Mmap working on windows
  • Tests passing
    • Spectests
    • Emtests (they will be handled in a separate PR)
  • Cleanup the old code

src/recovery.rs Outdated Show resolved Hide resolved
GlobalInit::Val(Val::I64(x)) => x as u64,
GlobalInit::Val(Val::F32(x)) => x as u64,
GlobalInit::Val(Val::F64(x)) => x,
GlobalInit::GetGlobal(index) => (imports.globals[index.index()].global).data,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I like having a verb (Get) into the struct name.
What you think about using GlobalInit::ImportedGlobal instead ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, sounds fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That struct is just exposing instantiation-time initialization, which can either be a const.* or a get_global.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe *FromGlobal or sth. But that's the name Cranelift used as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just copying the name in the webassembly reference.

lib/clif-backend/src/codegen.rs Outdated Show resolved Hide resolved
lib/clif-backend/src/codegen.rs Outdated Show resolved Hide resolved
lib/clif-backend/src/codegen.rs Outdated Show resolved Hide resolved
lib/clif-backend/src/resolver.rs Outdated Show resolved Hide resolved
src/bin/wasmer.rs Outdated Show resolved Hide resolved
@lachlansneff lachlansneff merged commit 62b8e7c into master Jan 22, 2019
@syrusakbary syrusakbary deleted the feature/vm_refactor branch January 22, 2019 23:01
nlewycky pushed a commit that referenced this pull request Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants