0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-31 09:14:20 -04:00
Commit graph

24 commits

Author SHA1 Message Date
Aaron O'Mullan
91e80ada8a
core: remove serde_json-isms in op_close() and op_resources() (#10026)
Core no longer uses `serde_json` now, besides re-exporting it or in the module specifier tests
2021-04-05 23:17:00 -04:00
Aaron O'Mullan
6eace4de5c
perf(core): js errors as unions vs tuples to reduce allocs (#9947) 2021-04-01 07:24:30 -04:00
Aaron O'Mullan
fec1b2a5a4
refactor: new optimized op-layer using serde_v8 (#9843)
- 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-31 10:37:38 -04:00
Inteon
1251c89321
refactor: Move bin ops to deno_core and unify logic with json ops (#9457)
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-20 17:51:08 +01:00
Inteon
20627c9136
refactor: update minimal ops & rename to buffer ops (#9719)
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-03-18 14:10:27 +01:00
Luca Casonato
975705a649
chore(core): optional args for registerErrorClass (#9602) 2021-02-25 20:06:06 +01:00
Inteon
dccf5e0c5c
refactor(core): Allow multiple overflown responses in single poll (#9433)
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-23 13:08:50 +01:00
Jared Beller
b50691efed
refactor(core): Strongly typed deserialization of JSON ops (#9423)
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-13 11:56:56 -05:00
Developing
923214c537
chore: use strict mode for internal runtime, core, and op_crates js (#9391) 2021-02-04 23:18:32 +01:00
Ryan Dahl
2b75a11559
update copyright to 2021 (#9081) 2021-01-10 21:59:07 -05:00
Bartek Iwańczuk
46c0cab763
refactor(core): simplify Deno.core initialisation, remove stale TODO (#8847)
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.
2021-01-05 22:10:50 +01:00
De Rouck Antoine
671f96025a
refactor(core): Improve code readability in core.js (#8345) 2020-11-21 14:19:43 +01:00
Bartek Iwańczuk
8e914be742
build: migrate to dlint (#8176)
This commit migrates repository from using "eslint" 
to "dlint" for linting JavaScript code.
2020-11-03 16:19:29 +01:00
Kitson Kelly
f632b3b6e7
fix(core): handle unregistered errors in core better (#7817) 2020-10-05 20:35:51 +11:00
Bartek Iwańczuk
bda9379385
refactor: move op_resources and op_close to deno_core (#7539)
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-17 18:09:50 +02:00
Bartek Iwańczuk
6c4da0e429
refactor: remove dispatch_json.js from cli/rt and cli/tsc (#7521)
Instead use Deno.core.jsonOpSync and Deno.core.jsonOpAsync
2020-09-16 22:22:43 +02:00
Bartek Iwańczuk
f57a2c1e85
refactor(core): rename CoreIsolate to JsRuntime (#7373)
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-09-06 21:44:29 +02:00
Bert Belder
c8b5f1e454
Simplify ErrBox-to-class mapping & hook it up to core json ops (#7195) 2020-08-26 18:48:04 +02:00
Bert Belder
fd83df7cdb
Convert the remaining http_bench ops to json ops (#7143) 2020-08-21 13:11:04 +02:00
Ryan Dahl
0095611af9
First pass at json ops in core (#7033)
Adds Deno.core.jsonOpSync and Deno.core.jsonOpAsync
2020-08-20 09:45:59 -04:00
Bartek Iwańczuk
59ca66a207
Encode op errors as strings instead of numbers (#6977) 2020-08-07 16:47:18 -04:00
Bartek Iwańczuk
79adc7b000
core: add Deno.core.dispatchByName (#6395)
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-21 16:34:43 +02:00
Valentin Anger
becbb56b19
feat(core): Ops can take several zero copy buffers (#4788) 2020-06-01 14:20:47 -04:00
Ryan Dahl
593c3aa857
Clean up core/shared_queue.js (#5237) 2020-05-12 11:09:28 -04:00
Renamed from core/shared_queue.js (Browse further)