summaryrefslogtreecommitdiff
path: root/core/benches/op_baseline.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2021-04-28 18:28:46 +0200
committerGitHub <noreply@github.com>2021-04-28 18:28:46 +0200
commitb28f9445aae85dbf86033300cfcb55e404529a23 (patch)
tree65b89f43a2af1984b3e1c49f281bd8aba8138089 /core/benches/op_baseline.rs
parent6a33d2073f1a99d0943a986418a376386fdc30b3 (diff)
refactor(core): simplify module loading code (#10385)
General cleanup of module loading code, tried to reduce indentation in various methods on "JsRuntime" to improve readability. Added "JsRuntime::handle_scope" helper function, which returns a "v8::HandleScope". This was done to reduce a code pattern that happens all over the "deno_core". Additionally if event loop hangs during loading of dynamic modules a list of currently pending dynamic imports is printed.
Diffstat (limited to 'core/benches/op_baseline.rs')
-rw-r--r--core/benches/op_baseline.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/core/benches/op_baseline.rs b/core/benches/op_baseline.rs
index c0c988eb6..268b3b04e 100644
--- a/core/benches/op_baseline.rs
+++ b/core/benches/op_baseline.rs
@@ -36,8 +36,7 @@ async fn op_pi_async(
pub fn bench_runtime_js(b: &mut Bencher, src: &str) {
let mut runtime = create_js_runtime();
- let context = runtime.global_context();
- let scope = &mut v8::HandleScope::with_context(runtime.v8_isolate(), context);
+ let scope = &mut runtime.handle_scope();
let code = v8::String::new(scope, src).unwrap();
let script = v8::Script::compile(scope, code, None).unwrap();
b.iter(|| {