summaryrefslogtreecommitdiff
path: root/ops/optimizer_tests
diff options
context:
space:
mode:
Diffstat (limited to 'ops/optimizer_tests')
-rw-r--r--ops/optimizer_tests/async_nop.out30
-rw-r--r--ops/optimizer_tests/async_result.out35
-rw-r--r--ops/optimizer_tests/issue16934.out29
-rw-r--r--ops/optimizer_tests/issue16934_fast.out29
4 files changed, 30 insertions, 93 deletions
diff --git a/ops/optimizer_tests/async_nop.out b/ops/optimizer_tests/async_nop.out
index 7782b5970..d26733825 100644
--- a/ops/optimizer_tests/async_nop.out
+++ b/ops/optimizer_tests/async_nop.out
@@ -56,8 +56,6 @@ impl op_void_async {
&*(deno_core::v8::Local::<deno_core::v8::External>::cast(args.data()).value()
as *const deno_core::_ops::OpCtx)
};
- let op_id = ctx.id;
- let realm_idx = ctx.realm_idx;
let promise_id = args.get(0);
let promise_id = deno_core::v8::Local::<
deno_core::v8::Integer,
@@ -74,25 +72,13 @@ impl op_void_async {
return;
}
};
- let get_class = {
- let state = ::std::cell::RefCell::borrow(&ctx.state);
- state.tracker.track_async(op_id);
- state.get_error_class_fn
- };
+ let fut = deno_core::_ops::map_async_op2(ctx, Self::call());
let maybe_response = deno_core::_ops::queue_async_op(
ctx,
scope,
false,
- async move {
- let result = Self::call().await;
- let result = Ok(result);
- (
- realm_idx,
- promise_id,
- op_id,
- deno_core::_ops::to_op_result(get_class, result),
- )
- },
+ promise_id,
+ fut,
);
if let Some(response) = maybe_response {
rv.set(response);
@@ -116,16 +102,10 @@ fn op_void_async_fast_fn<'scope>(
};
let op_state = __ctx.state.clone();
let result = op_void_async::call();
- let __op_id = __ctx.id;
- let __state = ::std::cell::RefCell::borrow(&__ctx.state);
- __state.tracker.track_async(__op_id);
- let realm_idx = __ctx.realm_idx;
let result = _ops::queue_fast_async_op(
__ctx,
- async move {
- let result = result.await;
- (realm_idx, __promise_id, __op_id, _ops::OpResult::Ok(result.into()))
- },
+ __promise_id,
+ async move { Ok(result.await) },
);
result
}
diff --git a/ops/optimizer_tests/async_result.out b/ops/optimizer_tests/async_result.out
index c3bb433f1..4494bf22a 100644
--- a/ops/optimizer_tests/async_result.out
+++ b/ops/optimizer_tests/async_result.out
@@ -56,8 +56,6 @@ impl op_async_result {
&*(deno_core::v8::Local::<deno_core::v8::External>::cast(args.data()).value()
as *const deno_core::_ops::OpCtx)
};
- let op_id = ctx.id;
- let realm_idx = ctx.realm_idx;
let promise_id = args.get(0);
let promise_id = deno_core::v8::Local::<
deno_core::v8::Integer,
@@ -85,24 +83,16 @@ impl op_async_result {
return deno_core::_ops::throw_type_error(scope, msg);
}
};
- let get_class = {
- let state = ::std::cell::RefCell::borrow(&ctx.state);
- state.tracker.track_async(op_id);
- state.get_error_class_fn
- };
+ let fut = deno_core::_ops::map_async_op1(
+ ctx,
+ Self::call(ctx.state.clone(), arg_0),
+ );
let maybe_response = deno_core::_ops::queue_async_op(
ctx,
scope,
false,
- async move {
- let result = Self::call(ctx.state.clone(), arg_0).await;
- (
- realm_idx,
- promise_id,
- op_id,
- deno_core::_ops::to_op_result(get_class, result),
- )
- },
+ promise_id,
+ fut,
);
if let Some(response) = maybe_response {
rv.set(response);
@@ -127,16 +117,5 @@ fn op_async_result_fast_fn<'scope>(
};
let state = __ctx.state.clone();
let result = op_async_result::call(state, rid);
- let __op_id = __ctx.id;
- let __state = ::std::cell::RefCell::borrow(&__ctx.state);
- __state.tracker.track_async(__op_id);
- let realm_idx = __ctx.realm_idx;
- let __get_class = __state.get_error_class_fn;
- let result = _ops::queue_fast_async_op(
- __ctx,
- async move {
- let result = result.await;
- (realm_idx, __promise_id, __op_id, _ops::to_op_result(__get_class, result))
- },
- );
+ let result = _ops::queue_fast_async_op(__ctx, __promise_id, result);
}
diff --git a/ops/optimizer_tests/issue16934.out b/ops/optimizer_tests/issue16934.out
index 68f59ef43..e92510038 100644
--- a/ops/optimizer_tests/issue16934.out
+++ b/ops/optimizer_tests/issue16934.out
@@ -50,8 +50,6 @@ impl send_stdin {
&*(deno_core::v8::Local::<deno_core::v8::External>::cast(args.data()).value()
as *const deno_core::_ops::OpCtx)
};
- let op_id = ctx.id;
- let realm_idx = ctx.realm_idx;
let promise_id = args.get(0);
let promise_id = deno_core::v8::Local::<
deno_core::v8::Integer,
@@ -79,28 +77,19 @@ impl send_stdin {
);
}
};
- let get_class = {
- let state = ::std::cell::RefCell::borrow(&ctx.state);
- state.tracker.track_async(op_id);
- state.get_error_class_fn
- };
+ let fut = deno_core::_ops::map_async_op1(
+ ctx,
+ Self::call(
+ compile_error!("mutable opstate is not supported in async ops"),
+ arg_0,
+ ),
+ );
let maybe_response = deno_core::_ops::queue_async_op(
ctx,
scope,
false,
- async move {
- let result = Self::call(
- compile_error!("mutable opstate is not supported in async ops"),
- arg_0,
- )
- .await;
- (
- realm_idx,
- promise_id,
- op_id,
- deno_core::_ops::to_op_result(get_class, result),
- )
- },
+ promise_id,
+ fut,
);
if let Some(response) = maybe_response {
rv.set(response);
diff --git a/ops/optimizer_tests/issue16934_fast.out b/ops/optimizer_tests/issue16934_fast.out
index 7a4a39f34..2a16d1b62 100644
--- a/ops/optimizer_tests/issue16934_fast.out
+++ b/ops/optimizer_tests/issue16934_fast.out
@@ -48,8 +48,6 @@ impl send_stdin {
&*(deno_core::v8::Local::<deno_core::v8::External>::cast(args.data()).value()
as *const deno_core::_ops::OpCtx)
};
- let op_id = ctx.id;
- let realm_idx = ctx.realm_idx;
let promise_id = args.get(0);
let promise_id = deno_core::v8::Local::<
deno_core::v8::Integer,
@@ -77,28 +75,19 @@ impl send_stdin {
return deno_core::_ops::throw_type_error(scope, msg);
}
};
- let get_class = {
- let state = ::std::cell::RefCell::borrow(&ctx.state);
- state.tracker.track_async(op_id);
- state.get_error_class_fn
- };
+ let fut = deno_core::_ops::map_async_op1(
+ ctx,
+ Self::call(
+ compile_error!("mutable opstate is not supported in async ops"),
+ arg_0,
+ ),
+ );
let maybe_response = deno_core::_ops::queue_async_op(
ctx,
scope,
false,
- async move {
- let result = Self::call(
- compile_error!("mutable opstate is not supported in async ops"),
- arg_0,
- )
- .await;
- (
- realm_idx,
- promise_id,
- op_id,
- deno_core::_ops::to_op_result(get_class, result),
- )
- },
+ promise_id,
+ fut,
);
if let Some(response) = maybe_response {
rv.set(response);