Skip to content

Commit

Permalink
Spilt Tagged<T> into a utility crate
Browse files Browse the repository at this point in the history
  • Loading branch information
HalidOdat committed May 13, 2024
1 parent ced222f commit 12de194
Show file tree
Hide file tree
Showing 26 changed files with 128 additions and 131 deletions.
2 changes: 2 additions & 0 deletions ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Try out the most recent release with Boa's live demo
- [**`boa_icu_provider`**][icu] - Boa's ICU4X data provider.
- [**`boa_runtime`**][runtime] - Boa's WebAPI features.
- [**`boa_string`**][string] - Boa's ECMAScript string implementation.
- [**`boa_utils`**][utils] - Boa's utility crate.

[boa-conformance]: https://boajs.dev/conformance
[boa-web]: https://boajs.dev/
Expand All @@ -32,3 +33,4 @@ Try out the most recent release with Boa's live demo
[icu]: https://docs.rs/boa_icu_provider/latest/boa_icu_provider/index.html
[runtime]: https://docs.rs/boa_runtime/latest/boa_runtime/index.html
[string]: https://docs.rs/boa_string/latest/boa_string/index.html
[utils]: https://docs.rs/boa_utils/latest/boa_utils/index.html
10 changes: 9 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ boa_parser = { version = "~0.18.0", path = "core/parser" }
boa_profiler = { version = "~0.18.0", path = "core/profiler" }
boa_runtime = { version = "~0.18.0", path = "core/runtime" }
boa_string = { version = "~0.18.0", path = "core/string" }
boa_utils = { version = "~0.18.0", path = "core/utils" }

# Shared deps
arbitrary = "1"
Expand Down
2 changes: 2 additions & 0 deletions cli/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Try out the most recent release with Boa's live demo
- [**`boa_icu_provider`**][icu] - Boa's ICU4X data provider.
- [**`boa_runtime`**][runtime] - Boa's WebAPI features.
- [**`boa_string`**][string] - Boa's ECMAScript string implementation.
- [**`boa_utils`**][utils] - Boa's utility crate.

[boa-conformance]: https://boajs.dev/conformance
[boa-web]: https://boajs.dev/
Expand All @@ -32,3 +33,4 @@ Try out the most recent release with Boa's live demo
[icu]: https://docs.rs/boa_icu_provider/latest/boa_icu_provider/index.html
[runtime]: https://docs.rs/boa_runtime/latest/boa_runtime/index.html
[string]: https://docs.rs/boa_string/latest/boa_string/index.html
[utils]: https://docs.rs/boa_utils/latest/boa_utils/index.html
2 changes: 2 additions & 0 deletions core/ast/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Try out the most recent release with Boa's live demo
- [**`boa_icu_provider`**][icu] - Boa's ICU4X data provider.
- [**`boa_runtime`**][runtime] - Boa's WebAPI features.
- [**`boa_string`**][string] - Boa's ECMAScript string implementation.
- [**`boa_utils`**][utils] - Boa's utility crate.

[boa-conformance]: https://boajs.dev/conformance
[boa-web]: https://boajs.dev/
Expand All @@ -32,3 +33,4 @@ Try out the most recent release with Boa's live demo
[icu]: https://docs.rs/boa_icu_provider/latest/boa_icu_provider/index.html
[runtime]: https://docs.rs/boa_runtime/latest/boa_runtime/index.html
[string]: https://docs.rs/boa_string/latest/boa_string/index.html
[utils]: https://docs.rs/boa_utils/latest/boa_utils/index.html
2 changes: 2 additions & 0 deletions core/engine/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Try out the most recent release with Boa's live demo
- [**`boa_icu_provider`**][icu] - Boa's ICU4X data provider.
- [**`boa_runtime`**][runtime] - Boa's WebAPI features.
- [**`boa_string`**][string] - Boa's ECMAScript string implementation.
- [**`boa_utils`**][utils] - Boa's utility crate.

[boa-conformance]: https://boajs.dev/conformance
[boa-web]: https://boajs.dev/
Expand All @@ -32,3 +33,4 @@ Try out the most recent release with Boa's live demo
[icu]: https://docs.rs/boa_icu_provider/latest/boa_icu_provider/index.html
[runtime]: https://docs.rs/boa_runtime/latest/boa_runtime/index.html
[string]: https://docs.rs/boa_string/latest/boa_string/index.html
[utils]: https://docs.rs/boa_utils/latest/boa_utils/index.html
1 change: 1 addition & 0 deletions core/engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ boa_macros.workspace = true
boa_ast.workspace = true
boa_parser.workspace = true
boa_string.workspace = true
boa_utils.workspace = true
serde = { workspace = true, features = ["derive", "rc"] }
serde_json.workspace = true
rand = "0.8.5"
Expand Down
2 changes: 0 additions & 2 deletions core/engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ pub mod symbol;
pub mod value;
pub mod vm;

pub(crate) mod tagged;

mod host_defined;
mod small_map;
mod sys;
Expand Down
3 changes: 1 addition & 2 deletions core/engine/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@
use crate::{
js_string,
string::{JsString, StaticJsStrings},
tagged::{Tagged, UnwrappedTagged},
};
use boa_gc::{Finalize, Trace};

use boa_macros::{js_str, JsData};
use boa_utils::tagged::{Tagged, UnwrappedTagged};
use num_enum::{IntoPrimitive, TryFromPrimitive};

use std::{
Expand Down
2 changes: 2 additions & 0 deletions core/gc/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Try out the most recent release with Boa's live demo
- [**`boa_icu_provider`**][icu] - Boa's ICU4X data provider.
- [**`boa_runtime`**][runtime] - Boa's WebAPI features.
- [**`boa_string`**][string] - Boa's ECMAScript string implementation.
- [**`boa_utils`**][utils] - Boa's utility crate.

[boa-conformance]: https://boajs.dev/conformance
[boa-web]: https://boajs.dev/
Expand All @@ -32,3 +33,4 @@ Try out the most recent release with Boa's live demo
[icu]: https://docs.rs/boa_icu_provider/latest/boa_icu_provider/index.html
[runtime]: https://docs.rs/boa_runtime/latest/boa_runtime/index.html
[string]: https://docs.rs/boa_string/latest/boa_string/index.html
[utils]: https://docs.rs/boa_utils/latest/boa_utils/index.html
2 changes: 2 additions & 0 deletions core/icu_provider/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Try out the most recent release with Boa's live demo
- [**`boa_icu_provider`**][icu] - Boa's ICU4X data provider.
- [**`boa_runtime`**][runtime] - Boa's WebAPI features.
- [**`boa_string`**][string] - Boa's ECMAScript string implementation.
- [**`boa_utils`**][utils] - Boa's utility crate.

[boa-conformance]: https://boajs.dev/conformance
[boa-web]: https://boajs.dev/
Expand All @@ -32,3 +33,4 @@ Try out the most recent release with Boa's live demo
[icu]: https://docs.rs/boa_icu_provider/latest/boa_icu_provider/index.html
[runtime]: https://docs.rs/boa_runtime/latest/boa_runtime/index.html
[string]: https://docs.rs/boa_string/latest/boa_string/index.html
[utils]: https://docs.rs/boa_utils/latest/boa_utils/index.html
2 changes: 2 additions & 0 deletions core/interner/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Try out the most recent release with Boa's live demo
- [**`boa_icu_provider`**][icu] - Boa's ICU4X data provider.
- [**`boa_runtime`**][runtime] - Boa's WebAPI features.
- [**`boa_string`**][string] - Boa's ECMAScript string implementation.
- [**`boa_utils`**][utils] - Boa's utility crate.

[boa-conformance]: https://boajs.dev/conformance
[boa-web]: https://boajs.dev/
Expand All @@ -32,3 +33,4 @@ Try out the most recent release with Boa's live demo
[icu]: https://docs.rs/boa_icu_provider/latest/boa_icu_provider/index.html
[runtime]: https://docs.rs/boa_runtime/latest/boa_runtime/index.html
[string]: https://docs.rs/boa_string/latest/boa_string/index.html
[utils]: https://docs.rs/boa_utils/latest/boa_utils/index.html
2 changes: 2 additions & 0 deletions core/interop/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Try out the most recent release with Boa's live demo
- [**`boa_icu_provider`**][icu] - Boa's ICU4X data provider.
- [**`boa_runtime`**][runtime] - Boa's WebAPI features.
- [**`boa_string`**][string] - Boa's ECMAScript string implementation.
- [**`boa_utils`**][utils] - Boa's utility crate.

[boa-conformance]: https://boajs.dev/conformance
[boa-web]: https://boajs.dev/
Expand All @@ -32,3 +33,4 @@ Try out the most recent release with Boa's live demo
[icu]: https://docs.rs/boa_icu_provider/latest/boa_icu_provider/index.html
[runtime]: https://docs.rs/boa_runtime/latest/boa_runtime/index.html
[string]: https://docs.rs/boa_string/latest/boa_string/index.html
[utils]: https://docs.rs/boa_utils/latest/boa_utils/index.html
2 changes: 2 additions & 0 deletions core/macros/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Try out the most recent release with Boa's live demo
- [**`boa_icu_provider`**][icu] - Boa's ICU4X data provider.
- [**`boa_runtime`**][runtime] - Boa's WebAPI features.
- [**`boa_string`**][string] - Boa's ECMAScript string implementation.
- [**`boa_utils`**][utils] - Boa's utility crate.

[boa-conformance]: https://boajs.dev/conformance
[boa-web]: https://boajs.dev/
Expand All @@ -32,3 +33,4 @@ Try out the most recent release with Boa's live demo
[icu]: https://docs.rs/boa_icu_provider/latest/boa_icu_provider/index.html
[runtime]: https://docs.rs/boa_runtime/latest/boa_runtime/index.html
[string]: https://docs.rs/boa_string/latest/boa_string/index.html
[utils]: https://docs.rs/boa_utils/latest/boa_utils/index.html
2 changes: 2 additions & 0 deletions core/parser/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Try out the most recent release with Boa's live demo
- [**`boa_icu_provider`**][icu] - Boa's ICU4X data provider.
- [**`boa_runtime`**][runtime] - Boa's WebAPI features.
- [**`boa_string`**][string] - Boa's ECMAScript string implementation.
- [**`boa_utils`**][utils] - Boa's utility crate.

[boa-conformance]: https://boajs.dev/conformance
[boa-web]: https://boajs.dev/
Expand All @@ -32,3 +33,4 @@ Try out the most recent release with Boa's live demo
[icu]: https://docs.rs/boa_icu_provider/latest/boa_icu_provider/index.html
[runtime]: https://docs.rs/boa_runtime/latest/boa_runtime/index.html
[string]: https://docs.rs/boa_string/latest/boa_string/index.html
[utils]: https://docs.rs/boa_utils/latest/boa_utils/index.html
2 changes: 2 additions & 0 deletions core/profiler/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Try out the most recent release with Boa's live demo
- [**`boa_icu_provider`**][icu] - Boa's ICU4X data provider.
- [**`boa_runtime`**][runtime] - Boa's WebAPI features.
- [**`boa_string`**][string] - Boa's ECMAScript string implementation.
- [**`boa_utils`**][utils] - Boa's utility crate.

[boa-conformance]: https://boajs.dev/conformance
[boa-web]: https://boajs.dev/
Expand All @@ -32,3 +33,4 @@ Try out the most recent release with Boa's live demo
[icu]: https://docs.rs/boa_icu_provider/latest/boa_icu_provider/index.html
[runtime]: https://docs.rs/boa_runtime/latest/boa_runtime/index.html
[string]: https://docs.rs/boa_string/latest/boa_string/index.html
[utils]: https://docs.rs/boa_utils/latest/boa_utils/index.html
2 changes: 2 additions & 0 deletions core/runtime/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Try out the most recent release with Boa's live demo
- [**`boa_icu_provider`**][icu] - Boa's ICU4X data provider.
- [**`boa_runtime`**][runtime] - Boa's WebAPI features.
- [**`boa_string`**][string] - Boa's ECMAScript string implementation.
- [**`boa_utils`**][utils] - Boa's utility crate.

[boa-conformance]: https://boajs.dev/conformance
[boa-web]: https://boajs.dev/
Expand All @@ -32,3 +33,4 @@ Try out the most recent release with Boa's live demo
[icu]: https://docs.rs/boa_icu_provider/latest/boa_icu_provider/index.html
[runtime]: https://docs.rs/boa_runtime/latest/boa_runtime/index.html
[string]: https://docs.rs/boa_string/latest/boa_string/index.html
[utils]: https://docs.rs/boa_utils/latest/boa_utils/index.html
2 changes: 2 additions & 0 deletions core/string/ABOUT.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Try out the most recent release with Boa's live demo
- [**`boa_icu_provider`**][icu] - Boa's ICU4X data provider.
- [**`boa_runtime`**][runtime] - Boa's WebAPI features.
- [**`boa_string`**][string] - Boa's ECMAScript string implementation.
- [**`boa_utils`**][utils] - Boa's utility crate.

[boa-conformance]: https://boajs.dev/conformance
[boa-web]: https://boajs.dev/
Expand All @@ -32,3 +33,4 @@ Try out the most recent release with Boa's live demo
[icu]: https://docs.rs/boa_icu_provider/latest/boa_icu_provider/index.html
[runtime]: https://docs.rs/boa_runtime/latest/boa_runtime/index.html
[string]: https://docs.rs/boa_string/latest/boa_string/index.html
[utils]: https://docs.rs/boa_utils/latest/boa_utils/index.html
2 changes: 1 addition & 1 deletion core/string/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ repository.workspace = true
rust-version.workspace = true

[dependencies]
boa_utils.workspace = true
rustc-hash = { workspace = true, features = ["std"] }
sptr = "0.3.2"
static_assertions.workspace = true
paste = "1.0"
fast-float.workspace = true
Expand Down
5 changes: 2 additions & 3 deletions core/string/src/common.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//! List of commonly used strings in Javascript code.

use crate::{tagged::Tagged, JsStr};

use super::JsString;
use super::{JsStr, JsString};
use boa_utils::tagged::Tagged;
use paste::paste;
use rustc_hash::{FxHashMap, FxHasher};
use std::hash::BuildHasherDefault;
Expand Down
3 changes: 1 addition & 2 deletions core/string/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,18 @@
mod common;
mod iter;
mod str;
mod tagged;

#[cfg(test)]
mod tests;

use self::{iter::Windows, str::JsSliceIndex};
use crate::tagged::{Tagged, UnwrappedTagged};
#[doc(inline)]
pub use crate::{
common::StaticJsStrings,
iter::Iter,
str::{JsStr, JsStrVariant},
};
use boa_utils::tagged::{Tagged, UnwrappedTagged};
use std::{
alloc::{alloc, dealloc, Layout},
cell::Cell,
Expand Down
109 changes: 0 additions & 109 deletions core/string/src/tagged.rs

This file was deleted.

Loading

0 comments on commit 12de194

Please sign in to comment.