Skip to content

Baldrdash integration#4

Merged
bnjbvr merged 9 commits intocfallin:arm64from
bnjbvr:new-isa-ben
Apr 8, 2020
Merged

Baldrdash integration#4
bnjbvr merged 9 commits intocfallin:arm64from
bnjbvr:new-isa-ben

Conversation

@bnjbvr
Copy link
Copy Markdown
Collaborator

@bnjbvr bnjbvr commented Apr 2, 2020

First two commits are extracted from bytecodealliance#1460.

There's a spurious Cargo.lock update that was reappearing all the time, so eventually I committed it.

Two following commits (add support for add_call_site in testing + new-isel support for passing sourceloc) fill in the pieces to support the machinery introduced by the two first commits.

Last commit passes the special VMContext register (called WasmTlsReg in Spidermonkey, on arm64 it's x23) value to callees when it sees it.

@bnjbvr bnjbvr requested a review from cfallin April 2, 2020 17:14
Copy link
Copy Markdown
Owner

@cfallin cfallin left a comment

Choose a reason for hiding this comment

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

Thanks for this! If I understand everything correctly, it looks like this mainly consists of (i) plumbing SourceLocs through everywhere to add_call_site on the CodeSink, and (ii) using udf instead of brk. The latter is perfectly fine. For the former: it's a somewhat intrusive API change, so I want to at least ask: what's the need that drives this, and what are the alternative options? Is this just enabling sensible stack-traces now, or does SpiderMonkey require the info for correctness? And in either case, would a full implementation of debug info provide the same benefit? (If so, given that we'll eventually do this, perhaps we could avoid changing the CodeSink API for now?)

cfallin pushed a commit that referenced this pull request Apr 3, 2020
* Add some basic sanity tests for Region

This commit adds some basic sanity tests for `overlap` method
of `Region`.

* Refactor overlaps method of Region struct

This commit refactors `Region::overlaps` method.

* Add some docs

* Assert Region's len is nonzero
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2020

Subscribe to Label Action

This issue or pull request has been labeled: "cranelift", "cranelift:meta", "cranelift:module", "wasi"

Users Subscribed to "cranelift"
Users Subscribed to "wasi"

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@bnjbvr
Copy link
Copy Markdown
Collaborator Author

bnjbvr commented Apr 3, 2020

(Uh, we should disable the github actions on this fork, or empty the subscribe* JSON file.)

Yeah, the sink change is actually an adaptation to make Spidermonkey integration easier in general: see also upstream PR and accompanying Spidermonkey patch (removes around 150 LOC and does things more smoothly!).

No worries about rebasing, and I'll address your comments. Thanks for the quick look!

@bnjbvr
Copy link
Copy Markdown
Collaborator Author

bnjbvr commented Apr 3, 2020

One supplementary note: SourceLoc are needed for stack traces indeed, but add_call_site is strongly required for stack frame iteration (Spidermonkey uses the return address as a key for a mapping to function metadata, and indirect calls would be invisible without add_call_site -- full explanation here).

@bnjbvr
Copy link
Copy Markdown
Collaborator Author

bnjbvr commented Apr 3, 2020

(Sorry, this is not meant to be merged anymore; this is basically my WIP branch for all the changes.)

@bnjbvr bnjbvr force-pushed the new-isa-ben branch 6 times, most recently from 1523230 to 13c0164 Compare April 7, 2020 16:03
@bnjbvr
Copy link
Copy Markdown
Collaborator Author

bnjbvr commented Apr 7, 2020

cc @cfallin it's now ready again! Note it has a few breaking changes, in particular it now uses the direct instruction bl and Arm64Call relocations for calls when the callee is statically known. Current tests run by arm64-tests.sh all pass on this branch too.

@bnjbvr
Copy link
Copy Markdown
Collaborator Author

bnjbvr commented Apr 8, 2020

Will rebase and merge, before any other merge conflicts show up.

bnjbvr added 8 commits April 8, 2020 09:51
- properly pass WasmTlsReg and WasmTableCallSigReg in the new backend.
- optionally pass source locations and record trap locations of
  loads/stores so out-of-bounds can be properly caught and pretty-printed.
  No source location means the load/store can't trap (because it's not a
  user memory access, or it's known to be aligned, etc.).
- pass the opcode to ARM64ABICall so we can pass it to the RelocSink,
  and record calls with add_call_site (so indirect calls work).
@bnjbvr bnjbvr merged commit f55c154 into cfallin:arm64 Apr 8, 2020
jgouly added a commit to jgouly/wasmtime that referenced this pull request Nov 11, 2020
This changes the following:
  mov x0, cfallin#4
  ldr x0, [x1, cfallin#4]

Into:
  ldr x0, [x1]

I noticed this pattern (but with #0), in a benchmark.

Copyright (c) 2020, Arm Limited.
cfallin pushed a commit that referenced this pull request Nov 12, 2021
cfallin pushed a commit that referenced this pull request Apr 6, 2023
* Integrate experimental HTTP into wasmtime.

* Reset Cargo.lock

* Switch to bail!, plumb options partially.

* Implement timeouts.

* Remove generated files & wasm, add Makefile

* Remove generated code textfile

* Update crates/wasi-http/Cargo.toml

Co-authored-by: Eduardo de Moura Rodrigues <16357187+eduardomourar@users.noreply.github.com>

* Update crates/wasi-http/Cargo.toml

Co-authored-by: Eduardo de Moura Rodrigues <16357187+eduardomourar@users.noreply.github.com>

* Extract streams from request/response.

* Fix read for len < buffer length.

* Formatting.

* types impl: swap todos for traps

* streams_impl: idioms, and swap todos for traps

* component impl: idioms, swap all unwraps for traps, swap all todos for traps

* http impl: idiom

* Remove an unnecessary mut.

* Remove an unsupported function.

* Switch to the tokio runtime for the HTTP request.

* Add a rust example.

* Update to latest wit definition

* Remove example code.

* wip: start writing a http test...

* finish writing the outbound request example

havent executed it yet

* better debug output

* wasi-http: some stubs required for rust rewrite of the example

* add wasi_http tests to test-programs

* CI: run the http tests

* Fix some warnings.

* bump new deps to latest releases (#3)

* Add tests for wasi-http to test-programs (#2)

* wip: start writing a http test...

* finish writing the outbound request example

havent executed it yet

* better debug output

* wasi-http: some stubs required for rust rewrite of the example

* add wasi_http tests to test-programs

* CI: run the http tests

* bump new deps to latest releases

h2 0.3.16
http 0.2.9
mio 0.8.6
openssl 0.10.48
openssl-sys 0.9.83
tokio 1.26.0

---------

Co-authored-by: Brendan Burns <bburns@microsoft.com>

* Update crates/test-programs/tests/http_tests/runtime/wasi_http_tests.rs

* Update crates/test-programs/tests/http_tests/runtime/wasi_http_tests.rs

* Update crates/test-programs/tests/http_tests/runtime/wasi_http_tests.rs

* wasi-http: fix cargo.toml file and publish script to work together (#4)

unfortunately, the publish script doesn't use a proper toml parser (in
order to not have any dependencies), so the whitespace has to be the
trivial expected case.

then, add wasi-http to the list of crates to publish.

* Update crates/test-programs/build.rs

* Switch to rustls

* Cleanups.

* Merge switch to rustls.

* Formatting

* Remove libssl install

* Fix tests.

* Rename wasi-http -> wasmtime-wasi-http

* prtest:full

Conditionalize TLS on riscv64gc.

* prtest:full

Fix formatting, also disable tls on s390x

* prtest:full

Add a path parameter to wit-bindgen, remove symlink.

* prtest:full

Fix tests for places where SSL isn't supported.

* Update crates/wasi-http/Cargo.toml

---------

Co-authored-by: Eduardo de Moura Rodrigues <16357187+eduardomourar@users.noreply.github.com>
Co-authored-by: Pat Hickey <phickey@fastly.com>
Co-authored-by: Pat Hickey <pat@moreproductive.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants