summaryrefslogtreecommitdiff
path: root/ops
diff options
context:
space:
mode:
Diffstat (limited to 'ops')
-rw-r--r--ops/fast_call.rs10
-rw-r--r--ops/lib.rs5
-rw-r--r--ops/optimizer_tests/async_nop.out11
-rw-r--r--ops/optimizer_tests/async_result.out11
-rw-r--r--ops/optimizer_tests/issue16934.out8
-rw-r--r--ops/optimizer_tests/issue16934_fast.out8
6 files changed, 44 insertions, 9 deletions
diff --git a/ops/fast_call.rs b/ops/fast_call.rs
index b8fdf91bf..ce7a28210 100644
--- a/ops/fast_call.rs
+++ b/ops/fast_call.rs
@@ -265,10 +265,12 @@ pub(crate) fn generate(
let queue_future = if optimizer.returns_result {
q!({
+ 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),
@@ -277,9 +279,15 @@ pub(crate) fn generate(
})
} else {
q!({
+ let realm_idx = __ctx.realm_idx;
let result = _ops::queue_fast_async_op(__ctx, async move {
let result = result.await;
- (__promise_id, __op_id, _ops::OpResult::Ok(result.into()))
+ (
+ realm_idx,
+ __promise_id,
+ __op_id,
+ _ops::OpResult::Ok(result.into()),
+ )
});
})
};
diff --git a/ops/lib.rs b/ops/lib.rs
index 7fb377420..c16893366 100644
--- a/ops/lib.rs
+++ b/ops/lib.rs
@@ -221,7 +221,7 @@ fn codegen_v8_async(
quote! {
let result = match result {
Ok(fut) => fut.await,
- Err(e) => return (promise_id, op_id, #core::_ops::to_op_result::<()>(get_class, Err(e))),
+ Err(e) => return (realm_idx, promise_id, op_id, #core::_ops::to_op_result::<()>(get_class, Err(e))),
};
}
} else {
@@ -240,6 +240,7 @@ fn codegen_v8_async(
as *const #core::_ops::OpCtx)
};
let op_id = ctx.id;
+ let realm_idx = ctx.realm_idx;
let promise_id = args.get(0);
let promise_id = #core::v8::Local::<#core::v8::Integer>::try_from(promise_id)
@@ -267,7 +268,7 @@ fn codegen_v8_async(
#core::_ops::queue_async_op(ctx, scope, #deferred, async move {
let result = #result_fut
#result_wrapper
- (promise_id, op_id, #core::_ops::to_op_result(get_class, result))
+ (realm_idx, promise_id, op_id, #core::_ops::to_op_result(get_class, result))
});
},
argc,
diff --git a/ops/optimizer_tests/async_nop.out b/ops/optimizer_tests/async_nop.out
index 08f7a87a2..b59eedf9b 100644
--- a/ops/optimizer_tests/async_nop.out
+++ b/ops/optimizer_tests/async_nop.out
@@ -43,6 +43,7 @@ impl op_void_async {
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,
@@ -71,7 +72,12 @@ impl op_void_async {
async move {
let result = Self::call().await;
let result = Ok(result);
- (promise_id, op_id, deno_core::_ops::to_op_result(get_class, result))
+ (
+ realm_idx,
+ promise_id,
+ op_id,
+ deno_core::_ops::to_op_result(get_class, result),
+ )
},
);
}
@@ -111,11 +117,12 @@ fn op_void_async_fast_fn<'scope>(
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;
- (__promise_id, __op_id, _ops::OpResult::Ok(result.into()))
+ (realm_idx, __promise_id, __op_id, _ops::OpResult::Ok(result.into()))
},
);
result
diff --git a/ops/optimizer_tests/async_result.out b/ops/optimizer_tests/async_result.out
index b9719d22a..3e4f9a49d 100644
--- a/ops/optimizer_tests/async_result.out
+++ b/ops/optimizer_tests/async_result.out
@@ -47,6 +47,7 @@ impl op_read {
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,
@@ -130,7 +131,12 @@ impl op_read {
false,
async move {
let result = Self::call(ctx.state.clone(), arg_0, arg_1).await;
- (promise_id, op_id, deno_core::_ops::to_op_result(get_class, result))
+ (
+ realm_idx,
+ promise_id,
+ op_id,
+ deno_core::_ops::to_op_result(get_class, result),
+ )
},
);
}
@@ -179,12 +185,13 @@ fn op_read_fast_fn<'scope>(
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;
- (__promise_id, __op_id, _ops::to_op_result(__get_class, result))
+ (realm_idx, __promise_id, __op_id, _ops::to_op_result(__get_class, result))
},
);
}
diff --git a/ops/optimizer_tests/issue16934.out b/ops/optimizer_tests/issue16934.out
index 63abd2192..b823b5d53 100644
--- a/ops/optimizer_tests/issue16934.out
+++ b/ops/optimizer_tests/issue16934.out
@@ -43,6 +43,7 @@ impl send_stdin {
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,7 +86,12 @@ impl send_stdin {
arg_0,
)
.await;
- (promise_id, op_id, deno_core::_ops::to_op_result(get_class, result))
+ (
+ realm_idx,
+ promise_id,
+ op_id,
+ deno_core::_ops::to_op_result(get_class, result),
+ )
},
);
}
diff --git a/ops/optimizer_tests/issue16934_fast.out b/ops/optimizer_tests/issue16934_fast.out
index 615bc6b3b..8ff9bad4f 100644
--- a/ops/optimizer_tests/issue16934_fast.out
+++ b/ops/optimizer_tests/issue16934_fast.out
@@ -41,6 +41,7 @@ impl send_stdin {
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,
@@ -83,7 +84,12 @@ impl send_stdin {
arg_0,
)
.await;
- (promise_id, op_id, deno_core::_ops::to_op_result(get_class, result))
+ (
+ realm_idx,
+ promise_id,
+ op_id,
+ deno_core::_ops::to_op_result(get_class, result),
+ )
},
);
}