Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Bundle an unpublished `rquickjs` compatibility facade for dependencies such as LLRT to share the quickjs-jit types and VM.

- Add pre-generated bindings for `riscv64gc-unknown-linux-gnu` and `riscv64a23-unknown-linux-gnu`
- JIT M2: Tier 1 and Tier 2 now support the remaining comparison, bitwise, shift, `%`, unary
numeric, constant, stack-shuffle, tail-call, `null`, and empty-string opcodes; the JIT ABI
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
edition = "2021"
rust-version = "1.87"
license = "MIT"
readme = "README.md"

Check warning on line 8 in Cargo.toml

View workflow job for this annotation

GitHub Actions / doc

explicit `package.readme` can be inferred

Check warning on line 8 in Cargo.toml

View workflow job for this annotation

GitHub Actions / check

explicit `package.readme` can be inferred

Check warning on line 8 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (bindings, ubuntu-24.04, nightly, loongarch64-unknown-linux-musl, full-async)

explicit `package.readme` can be inferred

Check warning on line 8 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (bindings, ubuntu-24.04, nightly, loongarch64-unknown-linux-musl, full-async)

explicit `package.readme` can be inferred

Check warning on line 8 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (bindings, ubuntu-24.04, nightly, loongarch64-unknown-linux-musl, full-async)

explicit `package.readme` can be inferred

Check warning on line 8 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (bindings, ubuntu-24.04, nightly, loongarch64-unknown-linux-gnu, full-async)

explicit `package.readme` can be inferred

Check warning on line 8 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (bindings, ubuntu-24.04, nightly, loongarch64-unknown-linux-gnu, full-async)

explicit `package.readme` can be inferred

Check warning on line 8 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (bindings, ubuntu-24.04, nightly, loongarch64-unknown-linux-gnu, full-async)

explicit `package.readme` can be inferred

Check warning on line 8 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (bindings, ubuntu-latest, nightly, wasm32-wasip2, full-async-wasi)

explicit `package.readme` can be inferred

Check warning on line 8 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (bindings, ubuntu-latest, nightly, wasm32-wasip2, full-async-wasi)

explicit `package.readme` can be inferred

Check warning on line 8 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (bindings, ubuntu-latest, nightly, wasm32-wasip2, full-async-wasi)

explicit `package.readme` can be inferred

Check warning on line 8 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (channels, ubuntu-latest, nightly, x86_64-unknown-linux-gnu, full-async)

explicit `package.readme` can be inferred

Check warning on line 8 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (channels, ubuntu-latest, nightly, x86_64-unknown-linux-gnu, full-async)

explicit `package.readme` can be inferred

Check warning on line 8 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (channels, ubuntu-latest, nightly, x86_64-unknown-linux-gnu, full-async)

explicit `package.readme` can be inferred

Check warning on line 8 in Cargo.toml

View workflow job for this annotation

GitHub Actions / ubuntu / nightly / sanitizer

explicit `package.readme` can be inferred

Check warning on line 8 in Cargo.toml

View workflow job for this annotation

GitHub Actions / ubuntu / nightly / sanitizer

explicit `package.readme` can be inferred

Check warning on line 8 in Cargo.toml

View workflow job for this annotation

GitHub Actions / ubuntu / nightly / sanitizer

explicit `package.readme` can be inferred

Check warning on line 8 in Cargo.toml

View workflow job for this annotation

GitHub Actions / ubuntu / nightly / sanitizer

explicit `package.readme` can be inferred

Check warning on line 8 in Cargo.toml

View workflow job for this annotation

GitHub Actions / ubuntu / nightly / sanitizer

explicit `package.readme` can be inferred

Check warning on line 8 in Cargo.toml

View workflow job for this annotation

GitHub Actions / ubuntu / nightly / sanitizer

explicit `package.readme` can be inferred
description = "JIT-enabled high level bindings to the QuickJS JavaScript engine"
keywords = ["quickjs", "ecmascript", "javascript", "es6", "es2020"]
categories = ["api-bindings"]
Expand All @@ -22,6 +22,7 @@
"jit",
"benchmarks",
"macro",
"compat/rquickjs",
"examples/native-module",
"examples/module-loader",
"examples/import-attributes",
Expand All @@ -34,7 +35,7 @@
rquickjs-core = { package = "quickjs-jit-core", version = "0.12.7", path = "core", default-features = false }
rquickjs-macro = { package = "quickjs-jit-macro", version = "0.12.7", path = "macro", default-features = false }
rquickjs-sys = { package = "quickjs-jit-sys", version = "0.12.7", path = "sys", default-features = false }
rquickjs = { package = "quickjs-jit", version = "0.12.7", path = "./", default-features = false }

Check warning on line 38 in Cargo.toml

View workflow job for this annotation

GitHub Actions / doc

unused workspace dependency `rquickjs`

Check warning on line 38 in Cargo.toml

View workflow job for this annotation

GitHub Actions / check

unused workspace dependency `rquickjs`

Check warning on line 38 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (bindings, ubuntu-24.04, nightly, loongarch64-unknown-linux-musl, full-async)

unused workspace dependency `rquickjs`

Check warning on line 38 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (bindings, ubuntu-24.04, nightly, loongarch64-unknown-linux-musl, full-async)

unused workspace dependency `rquickjs`

Check warning on line 38 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (bindings, ubuntu-24.04, nightly, loongarch64-unknown-linux-musl, full-async)

unused workspace dependency `rquickjs`

Check warning on line 38 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (bindings, ubuntu-24.04, nightly, loongarch64-unknown-linux-gnu, full-async)

unused workspace dependency `rquickjs`

Check warning on line 38 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (bindings, ubuntu-24.04, nightly, loongarch64-unknown-linux-gnu, full-async)

unused workspace dependency `rquickjs`

Check warning on line 38 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (bindings, ubuntu-24.04, nightly, loongarch64-unknown-linux-gnu, full-async)

unused workspace dependency `rquickjs`

Check warning on line 38 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (bindings, ubuntu-latest, nightly, wasm32-wasip2, full-async-wasi)

unused workspace dependency `rquickjs`

Check warning on line 38 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (bindings, ubuntu-latest, nightly, wasm32-wasip2, full-async-wasi)

unused workspace dependency `rquickjs`

Check warning on line 38 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (bindings, ubuntu-latest, nightly, wasm32-wasip2, full-async-wasi)

unused workspace dependency `rquickjs`

Check warning on line 38 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (channels, ubuntu-latest, nightly, x86_64-unknown-linux-gnu, full-async)

unused workspace dependency `rquickjs`

Check warning on line 38 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (channels, ubuntu-latest, nightly, x86_64-unknown-linux-gnu, full-async)

unused workspace dependency `rquickjs`

Check warning on line 38 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (channels, ubuntu-latest, nightly, x86_64-unknown-linux-gnu, full-async)

unused workspace dependency `rquickjs`

Check warning on line 38 in Cargo.toml

View workflow job for this annotation

GitHub Actions / ubuntu / nightly / sanitizer

unused workspace dependency `rquickjs`

Check warning on line 38 in Cargo.toml

View workflow job for this annotation

GitHub Actions / ubuntu / nightly / sanitizer

unused workspace dependency `rquickjs`

Check warning on line 38 in Cargo.toml

View workflow job for this annotation

GitHub Actions / ubuntu / nightly / sanitizer

unused workspace dependency `rquickjs`

[dependencies]
indexmap-rs = { package = "indexmap", version = "2", optional = true }
Expand Down Expand Up @@ -97,7 +98,7 @@

# Enable native module loading support
dyn-load = ["rquickjs-core/dyn-load"]

Check warning on line 101 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (bindings, ubuntu-24.04, nightly, loongarch64-unknown-linux-musl, full-async)

unused workspace dependency `rquickjs`

Check warning on line 101 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (bindings, ubuntu-24.04, nightly, loongarch64-unknown-linux-gnu, full-async)

unused workspace dependency `rquickjs`

Check warning on line 101 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (channels, ubuntu-latest, nightly, x86_64-unknown-linux-gnu, full-async)

unused workspace dependency `rquickjs`

Check warning on line 101 in Cargo.toml

View workflow job for this annotation

GitHub Actions / ubuntu / nightly / sanitizer

unused workspace dependency `rquickjs`

Check warning on line 101 in Cargo.toml

View workflow job for this annotation

GitHub Actions / ubuntu / nightly / sanitizer

unused workspace dependency `rquickjs`

Check warning on line 101 in Cargo.toml

View workflow job for this annotation

GitHub Actions / ubuntu / nightly / sanitizer

unused workspace dependency `rquickjs`
# Use Rust global allocator by default
# otherwise libc allocator will be used
rust-alloc = ["rquickjs-core/rust-alloc"]
Expand All @@ -115,7 +116,7 @@

# Enable `ArrayBufferSource` impl for `bytes::Bytes`
bytes = ["rquickjs-core/bytes"]

Check warning on line 119 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (bindings, ubuntu-24.04, nightly, loongarch64-unknown-linux-musl, full-async)

unused workspace dependency `rquickjs-sys`

Check warning on line 119 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (bindings, ubuntu-24.04, nightly, loongarch64-unknown-linux-gnu, full-async)

unused workspace dependency `rquickjs-sys`

Check warning on line 119 in Cargo.toml

View workflow job for this annotation

GitHub Actions / test (channels, ubuntu-latest, nightly, x86_64-unknown-linux-gnu, full-async)

unused workspace dependency `rquickjs-sys`

Check warning on line 119 in Cargo.toml

View workflow job for this annotation

GitHub Actions / ubuntu / nightly / sanitizer

unused workspace dependency `rquickjs-sys`

Check warning on line 119 in Cargo.toml

View workflow job for this annotation

GitHub Actions / ubuntu / nightly / sanitizer

unused workspace dependency `rquickjs-sys`

Check warning on line 119 in Cargo.toml

View workflow job for this annotation

GitHub Actions / ubuntu / nightly / sanitizer

unused workspace dependency `rquickjs-sys`
# Enable interop between Rust futures and JS Promises
futures = ["rquickjs-core/futures"]

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ and use Cargo source patches from that revision for both `quickjs-jit-core` and
`quickjs-jit-sys`. Do not combine the published 0.12.2 runtime with 0.12.3
core or sys crates.

Dependencies that still name the `rquickjs` package, including LLRT, can use
the bundled [compatibility facade](compat/rquickjs/README.md). The consuming
workspace must select it with a root-level `[patch.crates-io]` entry.

[![github](https://img.shields.io/badge/github-longbridge/rquickjs-8da0cb.svg?style=for-the-badge&logo=github)](https://github.com/longbridge/rquickjs)
[![crates](https://img.shields.io/crates/v/quickjs-jit.svg?style=for-the-badge&color=fc8d62&logo=rust)](https://crates.io/crates/quickjs-jit)
[![docs](https://img.shields.io/badge/docs.rs-quickjs--jit-66c2a5?style=for-the-badge&logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K)](https://docs.rs/quickjs-jit)
Expand Down
35 changes: 35 additions & 0 deletions compat/rquickjs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[package]
name = "rquickjs"
version = "0.12.7"
edition = "2021"
rust-version = "1.87"
license = "MIT"
description = "Compatibility facade routing rquickjs dependencies to quickjs-jit"
publish = false

[lib]
path = "src/lib.rs"

[dependencies]
upstream = { package = "quickjs-jit", version = "0.12.7", path = "../..", default-features = false }

[features]
default = ["std"]
std = ["upstream/std"]
chrono = ["upstream/chrono"]
either = ["upstream/either"]
indexmap = ["upstream/indexmap"]
phf = ["upstream/phf"]
bindgen = ["upstream/bindgen"]
parallel = ["upstream/parallel"]
loader = ["upstream/loader"]
dyn-load = ["upstream/dyn-load"]
rust-alloc = ["upstream/rust-alloc"]
macro = ["upstream/macro"]
half = ["upstream/half"]
bytes = ["upstream/bytes"]
futures = ["upstream/futures"]
classes = ["upstream/classes"]
array-buffer = ["upstream/array-buffer"]
allocator = ["upstream/allocator"]
properties = ["upstream/properties"]
30 changes: 30 additions & 0 deletions compat/rquickjs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# rquickjs compatibility facade

This unpublished package reexports `quickjs-jit` under the package name
`rquickjs`. Dependencies such as LLRT can keep their existing `rquickjs`
dependency while sharing the application's QuickJS types and VM. The facade
forwards features and performs no runtime conversion.

For an application next to a local quickjs-jit checkout, configure its workspace
root as follows:

```toml
[dependencies]
rquickjs = { package = "quickjs-jit", path = "../quickjs-jit" }
rquickjs-jit = { package = "quickjs-jit-runtime", path = "../quickjs-jit/jit", features = ["compiler"] }

[patch.crates-io]
rquickjs = { path = "../quickjs-jit/compat/rquickjs" }
```

Cargo only applies patches declared by the consuming workspace root; declaring
this patch inside a library dependency does not redirect that library's consumers.
The facade satisfies compatible `rquickjs` 0.12 requirements, not older binding
versions.

For a Git dependency, point all three entries to the same repository URL and
full commit revision containing this package. Cargo locates the named packages
within the repository. Keep the bindings, runtime, and facade on that same
source so they resolve to one `quickjs-jit-core` and `quickjs-jit-sys` instance.
The `rquickjs` package name belongs to upstream on crates.io, so this facade has
`publish = false` and is consumed through Git or a local path.
3 changes: 3 additions & 0 deletions compat/rquickjs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//! Compatibility facade for dependencies that still name the upstream package.

pub use upstream::*;
Loading