-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(core): Move Deno.core bindings to ops #14793
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work overall, pretty much what I had in mind following #14582
However I would suggest the following changes for this first pass:
- Scope changes to
core/
, have outside callers still useDeno.core.foo()
by adding light wrappers in01_core.js
. - Keep the "v8 ops" separate from the other "regular ops", e.g: in an
ops_v8.rs
orops_builtin_v8.rs
or just in bindings for now
Okay, I added wrappers for the ones used in std but it's fairer to do it with all of them after all :-) I think in a couple of versions we should remove all of those basic wrappers, including existing |
Both |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great stuff
@@ -1,4 +1,5 @@ | |||
[WILDCARD]error: Uncaught Error: foo | |||
Warning Couldn't format source line: Column 31 is out of bounds (source may have changed at runtime) | |||
at file:https:///[WILDCARD]/eval_context_conflicting_source.ts:1:31 | |||
at [WILDCARD] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's changed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a new stack frame for opSync
@@ -205,7 +205,7 @@ | |||
const transferables = []; | |||
const hostObjects = []; | |||
const arrayBufferIdsInTransferables = []; | |||
const transferedArrayBuffers = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are technically unrelated, but thanks for fixing it
Blocked by update after #14604 was merged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I'll wait for one more approval before landing
Move most
Deno.core
bindings which are defined in Rust to ops e.g.Deno.core.encode(foo)
->Deno.core.opSync("op_encode", foo)
using#[op(v8)]
. Ref #14574, #14582. One more change to the macro was required to avoid late-bound lifetime parameters when returning a value with a lifetime compatible based onscope
's.The following which are used in std are preserved as wrappers in
01_core.js
, we should deprecate this syntax and update them to ops:Deno.core.setMacrotaskCallback()
Deno.core.setNextTickCallback()
Deno.core.runMicrotasks()
Deno.core.hasTickScheduled()
Deno.core.setHasTickScheduled()
Deno.core.evalContext()
Deno.core.encode()