Skip to content

Commit

Permalink
Merge 02cfe9e into 0274858
Browse files Browse the repository at this point in the history
  • Loading branch information
Razican committed Apr 13, 2020
2 parents 0274858 + 02cfe9e commit 1a9db43
Show file tree
Hide file tree
Showing 8 changed files with 133 additions and 59 deletions.
75 changes: 55 additions & 20 deletions Cargo.lock

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

9 changes: 6 additions & 3 deletions boa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,20 @@ default = ["wasm-bindgen"]
[dependencies]
gc = "0.3.3"
gc_derive = "0.3.2"
serde_json = "1.0.48"
serde_json = "1.0.51"
rand = "0.7.3"
regex = "1.3.6"

# Optional Dependencies
wasm-bindgen = { version = "0.2.59", optional = true }
serde = { version = "1.0.105", features = ["derive"], optional = true }
wasm-bindgen = { version = "0.2.60", optional = true }
serde = { version = "1.0.106", features = ["derive"], optional = true }

[dev-dependencies]
criterion = "0.3.1"

[target.x86_64-unknown-linux-gnu.dev-dependencies]
jemallocator = "0.3.2"

[lib]
crate-type = ["cdylib", "lib"]
name = "boa"
Expand Down
10 changes: 5 additions & 5 deletions boa/benches/exec.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#[macro_use]
extern crate criterion;
use boa::{exec, realm::Realm};
use criterion::{black_box, criterion_group, criterion_main, Criterion};

use boa::exec;
use boa::realm::Realm;
use criterion::{black_box, Criterion};
#[cfg_attr(target = "x86_64-unknown-linux-gnu", global_allocator)]
#[cfg(target = "x86_64-unknown-linux-gnu")]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

static SRC: &str = r#"
let a = Symbol();
Expand Down
10 changes: 5 additions & 5 deletions boa/benches/fib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#[macro_use]
extern crate criterion;

use boa::exec;
use criterion::black_box;
use criterion::Criterion;
use criterion::{black_box, criterion_group, criterion_main, Criterion};

#[cfg_attr(target = "x86_64-unknown-linux-gnu", global_allocator)]
#[cfg(target = "x86_64-unknown-linux-gnu")]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

static SRC: &str = r#"
let num = 12;
Expand Down
11 changes: 5 additions & 6 deletions boa/benches/parser.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#[macro_use]
extern crate criterion;
use boa::syntax::{lexer::Lexer, parser::Parser};
use criterion::{black_box, criterion_group, criterion_main, Criterion};

use boa::syntax::lexer::Lexer;
use boa::syntax::parser::Parser;
use criterion::black_box;
use criterion::Criterion;
#[cfg_attr(target = "x86_64-unknown-linux-gnu", global_allocator)]
#[cfg(target = "x86_64-unknown-linux-gnu")]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

static EXPRESSION: &str = r#"
1 + 1 + 1 + 1 + 1 + 1 / 1 + 1 + 1 * 1 + 1 + 1 + 1;
Expand Down
15 changes: 8 additions & 7 deletions boa/benches/string.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#[macro_use]
extern crate criterion;
use boa::{
exec,
syntax::{lexer::Lexer, parser::Parser},
};
use criterion::{black_box, criterion_group, criterion_main, Criterion};

use boa::exec;
use boa::syntax::lexer::Lexer;
use boa::syntax::parser::Parser;
use criterion::black_box;
use criterion::Criterion;
#[cfg_attr(target = "x86_64-unknown-linux-gnu", global_allocator)]
#[cfg(target = "x86_64-unknown-linux-gnu")]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

static SRC: &str = "let foo = 'hello world!'; foo;";

Expand Down
5 changes: 4 additions & 1 deletion boa_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ edition = "2018"

[dependencies]
Boa = { path = "../boa", features = ["serde-ast"], default-features = false }
structopt = "0.3.12"
structopt = "0.3.13"

[target.x86_64-unknown-linux-gnu.dependencies]
jemallocator = "0.3.2"
57 changes: 45 additions & 12 deletions boa_cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,48 @@
#![deny(unused_qualifications, clippy::correctness, clippy::style)]
#![warn(clippy::perf)]
#![allow(clippy::cognitive_complexity)]

use boa::builtins::console::log;
use boa::serde_json;
use boa::syntax::ast::{node::Node, token::Token};
use boa::{exec::Executor, forward_val, realm::Realm};
use std::io::{self, Write};
use std::{fs::read_to_string, path::PathBuf};
use structopt::clap::arg_enum;
use structopt::StructOpt;
#![deny(
unused_qualifications,
clippy::all,
unused_qualifications,
unused_import_braces,
unused_lifetimes,
unreachable_pub,
trivial_numeric_casts,
rustdoc,
missing_debug_implementations,
missing_copy_implementations,
deprecated_in_future,
non_ascii_idents,
rust_2018_compatibility,
rust_2018_idioms,
future_incompatible,
nonstandard_style
)]
#![warn(clippy::perf, clippy::single_match_else, clippy::dbg_macro)]
#![allow(
clippy::missing_inline_in_public_items,
clippy::cognitive_complexity,
clippy::must_use_candidate,
clippy::missing_errors_doc,
clippy::as_conversions
)]

use boa::{
builtins::console::log,
exec::Executor,
forward_val,
realm::Realm,
serde_json,
syntax::ast::{node::Node, token::Token},
};
use std::{
fs::read_to_string,
io::{self, Write},
path::PathBuf,
};
use structopt::{clap::arg_enum, StructOpt};

#[cfg_attr(target = "x86_64-unknown-linux-gnu", global_allocator)]
#[cfg(target = "x86_64-unknown-linux-gnu")]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

/// CLI configuration for Boa.
//
Expand Down

0 comments on commit 1a9db43

Please sign in to comment.