summaryrefslogtreecommitdiff
path: root/core/core.js
AgeCommit message (Collapse)Author
2021-07-02refactor: introduce primordials (#10939)Luca Casonato
This commit introduces primordials to deno_core. Primordials are a frozen set of all intrinsic objects in the runtime. They are not vulnerable to prototype pollution.
2021-06-29feat: Add "deno_net" extension (#11150)Bartek Iwańczuk
This commits moves implementation of net related APIs available on "Deno" namespace to "deno_net" extension. Following APIs were moved: - Deno.listen() - Deno.connect() - Deno.listenTls() - Deno.serveHttp() - Deno.shutdown() - Deno.resolveDns() - Deno.listenDatagram() - Deno.startTls() - Deno.Conn - Deno.Listener - Deno.DatagramConn
2021-05-18cleanup(core.js): make op wrapper arg names generic (#10675)Aaron O'Mullan
These bits were missed in #10448.
2021-05-15cleanup(core): flatten print's op args (#10643)Aaron O'Mullan
2021-05-03fix(core): error registration could pollute constructors (#10422)Aaron O'Mullan
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2021-05-02refactor(core): convert core.print() to a builtin op (#10436)Aaron O'Mullan
2021-04-30refactor(core.js): provide window.__bootstrap (#10423)Aaron O'Mullan
2021-04-25refactor(core): move op cache sync responsibility to rust space (#10340)Aaron O'Mullan
Even if bootstrapping the JS runtime is low level, it's an abstraction leak of core to require users to call `Deno.core.ops()` in JS space. So instead we're introducing a `JsRuntime::sync_ops_cache()` method, once we have runtime extensions a new runtime will ensure the ops cache is setup (for the provided extensions) and then loading/unloading plugins should be the only operations that require op cache syncs
2021-04-23refactor(core): rename send() to opcall() (#10307)Aaron O'Mullan
I think it's a better fit since recv() was killed and opcall <> syscall (send/recv was too reminiscent of request/response and custom payloads)
2021-04-21refactor(core): simplify error handling (#10297)Aaron O'Mullan
- register builtin v8 errors in core.js so consumers don't have to - remove complexity of error args handling (consumers must provide a constructor with custom args, core simply provides msg arg)
2021-04-21refactor(core): kill recv() and init() (#10299)Aaron O'Mullan
`init()` was previously needed to init the shared queue, but now that it's gone `init()` only registers the async msg handler which is snapshot safe and constant since the op layer refactor.
2021-04-12refactor(deno): remove concept of bin & json ops (#10145)Aaron O'Mullan
2021-04-09fix: async op error stacktraces (#10080)Nayeem Rahman
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
2021-04-07perf(core.js): introduce promise ring (#9979)Aaron O'Mullan
This is another optimization to help improve the baseline overhead of async ops. It shaves off ~55ns/op or ~7% of the current total async op overhead. It achieves these gains by taking advantage of the sequential nature of promise IDs and optimistically stores them sequentially in a pre-allocated circular buffer and fallbacks to the promise Map for slow to resolve promises.
2021-04-05core: remove serde_json-isms in op_close() and op_resources() (#10026)Aaron O'Mullan
Core no longer uses `serde_json` now, besides re-exporting it or in the module specifier tests
2021-04-01perf(core): js errors as unions vs tuples to reduce allocs (#9947)Aaron O'Mullan
2021-03-31refactor: new optimized op-layer using serde_v8 (#9843)Aaron O'Mullan
- Improves op performance. - Handle op-metadata (errors, promise IDs) explicitly in the op-layer vs per op-encoding (aka: out-of-payload). - Remove shared queue & custom "asyncHandlers", all async values are returned in batches via js_recv_cb. - The op-layer should be thought of as simple function calls with little indirection or translation besides the conceptually straightforward serde_v8 bijections. - Preserve concepts of json/bin/min as semantic groups of their inputs/outputs instead of their op-encoding strategy, preserving these groups will also facilitate partial transitions over to v8 Fast API for the "min" and "bin" groups
2021-03-20refactor: Move bin ops to deno_core and unify logic with json ops (#9457)Inteon
This commit moves implementation of bin ops to "deno_core" crates as well as unifying logic between bin ops and json ops to reuse as much code as possible (both in Rust and JavaScript).
2021-03-18refactor: update minimal ops & rename to buffer ops (#9719)Inteon
This commit rewrites "dispatch_minimal" into "dispatch_buffer". It's part of an effort to unify JS interface for ops for both json and minimal (buffer) ops. Before this commit "minimal ops" could be either sync or async depending on the return type from the op, but this commit changes it to have separate signatures for sync and async ops (just like in case of json ops).
2021-02-25chore(core): optional args for registerErrorClass (#9602)Luca Casonato
2021-02-23refactor(core): Allow multiple overflown responses in single poll (#9433)Inteon
This commit rewrites "JsRuntime::poll" function to fix a corner case that might caused "overflown_response" to be overwritten by other overflown response. The logic has been changed to allow returning multiple overflown response alongside responses from shared queue.
2021-02-13refactor(core): Strongly typed deserialization of JSON ops (#9423)Jared Beller
This PR makes json_op_sync/async generic to all Deserialize/Serialize types instead of the loosely-typed serde_json::Value. Since serde_json::Value implements Deserialize/Serialize, very little existing code needs to be updated, however as json_op_sync/async are now generic, type inference is broken in some cases (see cli/build.rs:146). I've found this reduces a good bit of boilerplate, as seen in the updated deno_core examples. This change may also reduce serialization and deserialization overhead as serde has a better idea of what types it is working with. I am currently working on benchmarks to confirm this and I will update this PR with my findings.
2021-02-04chore: use strict mode for internal runtime, core, and op_crates js (#9391)Developing
2021-01-10update copyright to 2021 (#9081)Ryan Dahl
2021-01-05refactor(core): simplify Deno.core initialisation, remove stale TODO (#8847)Bartek Iwańczuk
This commit rewrites initialisation of the "shared queue" and in effect prevents from double execution of "core/core.js" and "core/error.js". Previously both of these files were executed every time a "JsRuntime" was created. That lead to a situation where one copy of each script was included in the snapshot and then another copy would be executed after loading the snapshot. Effectively "JsRuntime::shared_init" was removed; instead execution of those scripts and actual initialisation of shared queue was split into two helper functions: "JsRuntime::js_init" and "JsRuntime::share_queue_init". Additionally stale TODO comments were removed.
2020-11-21refactor(core): Improve code readability in core.js (#8345)De Rouck Antoine
2020-11-03build: migrate to dlint (#8176)Bartek Iwańczuk
This commit migrates repository from using "eslint" to "dlint" for linting JavaScript code.
2020-10-05fix(core): handle unregistered errors in core better (#7817)Kitson Kelly
2020-09-17refactor: move op_resources and op_close to deno_core (#7539)Bartek Iwańczuk
Moves op_close and op_resources to deno_core::ops and exports them. Adds serde dependency to deno_core and reexports it. Moves JS implementation of those ops to Deno.core and reexports them in Deno.
2020-09-16refactor: remove dispatch_json.js from cli/rt and cli/tsc (#7521)Bartek Iwańczuk
Instead use Deno.core.jsonOpSync and Deno.core.jsonOpAsync
2020-09-06refactor(core): rename CoreIsolate to JsRuntime (#7373)Bartek Iwańczuk
deno_core/ - rename core_isolate.rs to runtime.rs - rename CoreIsolate to JsRuntime - rename JSError to JsError - rename JSStackFrame to JsStackFrame cli/ - update references from deno_core::CoreIsolate to deno_core::JsRuntime - rename deno_core::JSError to deno_core::JsError - rename fmt_errors::JSError to fmt_errors::JsError
2020-08-26Simplify ErrBox-to-class mapping & hook it up to core json ops (#7195)Bert Belder
2020-08-21Convert the remaining http_bench ops to json ops (#7143)Bert Belder
2020-08-20First pass at json ops in core (#7033)Ryan Dahl
Adds Deno.core.jsonOpSync and Deno.core.jsonOpAsync
2020-08-07Encode op errors as strings instead of numbers (#6977)Bartek Iwańczuk
2020-06-21core: add Deno.core.dispatchByName (#6395)Bartek Iwańczuk
This commit adds alternate dispatch method to core JS API. "Deno.core.dispatchByName()" works like "Deno.core.dispatch()", but takes op name instead of op id as a first argument.
2020-06-01feat(core): Ops can take several zero copy buffers (#4788)Valentin Anger
2020-05-12Clean up core/shared_queue.js (#5237)Ryan Dahl