Ryan Dahl
d70b04c6d7
Add deno_config struct for isolate creation. ( #1277 )
...
In preperation for adding other callbacks to libdeno.
2018-12-04 15:06:20 -08:00
Ryan Dahl
0bec0fa594
Remove leaks from snapshot_creator
2018-12-03 19:34:01 -08:00
Ryan Dahl
f25220b2cf
Fix test_cc memory leaks.
...
These were discovered using the LSAN.
http://dev.chromium.org/developers/testing/leaksanitizer
2018-12-03 15:31:06 -08:00
Ryan Dahl
b39f4c146e
gn snapshot template's target_name should be target
2018-12-03 13:44:21 -08:00
Ryan Dahl
cc126528f0
Add prebuilt/win/v8_debug.lib ( #1249 )
...
The windows debug build was broken due to libc link errors.
2018-11-29 23:25:59 -08:00
Ryan Dahl
84a1b4d793
Move libdeno build config to libdeno/BUILD.gn
2018-11-29 17:46:09 -08:00
Ryan Dahl
570269b73d
Don't use snapshot for src/isolate.rs tests.
2018-11-27 11:33:23 -08:00
Ryan Dahl
b3400d822f
Decode main.js.map during snapshotting.
...
Pro:
time ./out/debug/deno tests/error_001.ts 3.0s -> 0.4s
Con:
time ./tool/build.py snapshot 33s -> 1m52s
out/debug/gen/snapshot_deno.bin 39M -> 121M
2018-11-05 13:26:54 -08:00
Bert Belder
b73b651612
build: remove absolute path
2018-11-01 13:34:16 +01:00
Ryan Dahl
0501330607
Add libdeno.shared global shared ArrayBuffer.
2018-10-24 14:52:38 -07:00
Ryan Dahl
61cda72881
libdeno: Expose snapshot creation.
2018-10-24 14:52:38 -07:00
Ryan Dahl
6afe94b3c8
libdeno: clean up
...
- Use a proper class for DenoIsolate.
- Move extern C stuff to api.cc
2018-10-24 14:52:38 -07:00
Ryan Dahl
fd68f85ce8
libdeno: deno_new should take a snapshot parameter.
2018-10-24 14:52:38 -07:00
Ryan Dahl
3438dbe350
Remove deno_ns
2018-10-24 14:52:38 -07:00
Bert Belder
142e532910
libdeno: store v8::Persistent in map by value instead of by reference
2018-10-19 02:35:49 +02:00
Ryan Dahl
d534ea41ad
Optimization: Use std::map for tracking zero-copy buffers
...
Instead of V8 map.
2018-10-18 17:49:03 -04:00
Ryan Dahl
4d669c63f4
Reduce ArrayBuffer allocations in ImportBuf()
2018-10-17 16:02:00 -04:00
Kevin (Kun) "Kassimo" Qian
45d3b8955d
Fix promise reject issue ( #936 )
2018-10-12 14:22:52 -04:00
Bert Belder
4f3250bc43
Remove deno_get_data()
...
Instead, pass the isolate data to the dispatch callback directly.
2018-10-08 18:19:36 +02:00
Bert Belder
e742af10aa
Abide by the rules when passing Isolate between c and rust
...
Ensure that at most one mutable Isolate reference exists at a time.
`deno_execute()` and `deno_respond()` now borrow a reference to the rust-side
isolate from the caller. When we need a reference to the isolate while one of
these functions is on the stack, `deno_get_data()` can be used to borrow back
that reference.
2018-10-08 18:19:32 +02:00
Bert Belder
ad4c4c214a
Rename Deno.data to Deno.user_data
...
Also use the correct rust type for it.
2018-10-08 18:10:28 +02:00
Ryan Dahl
f998f7b9af
Fix unused variable warning in release mode.
2018-10-06 20:24:47 -04:00
Bert Belder
7f29e14b2a
libdeno: use cstream instead of printf to write to stderr
2018-09-28 12:56:38 -07:00
Bert Belder
3ddac4d86c
libdeno: remove dead code
2018-09-28 12:56:37 -07:00
Ryan Dahl
d38ccfc6dc
Support zero-copy data in libdeno.send(). ( #838 )
...
This is a large API refactor of deno.h which replaces
deno_send() and deno_set_response() with deno_respond().
It also adds a req_id parameter to the deno_recv_cb.
Make writeFile/writeFileSync use it.
2018-09-27 17:33:10 -04:00
Kevin (Kun) "Kassimo" Qian
f156a86024
console.warn goes to stderr ( #810 )
2018-09-25 01:27:02 -04:00
Ryan Dahl
234d5ea780
libdeno.send(): Use GetContents instead of Externalize
...
Fixes #744 .
2018-09-24 22:16:23 -04:00
ztplz
f3684c28e5
Rename deno.argv, libdeno::DenoC and deno_set_flags ( #796 )
2018-09-22 08:47:44 -04:00
Ryan Dahl
62470c4f45
Upgrade V8 to 7.0.276.15
2018-09-17 21:41:29 -07:00
Ryan Dahl
0d03fafbfe
Map promises onto futures.
...
Refactors handlers.rs
The idea is that all Deno "ops" (aka bindings) should map onto
a Rust Future. By setting the "sync" flag in the Base message
users can determine if the future is executed immediately or put
on the event loop.
In the case of async futures, a promise is automatically created.
Errors are automatically forwarded and raised.
TODO:
- The file system ops in src/handler.rs are not using the thread pool
yet. This will be done in the future using tokio_threadpool::blocking.
That is, if you try to call them asynchronously, you will get a promise
and it will act asynchronous, but currently it will be blocking.
- Handlers in src/handler.rs returned boxed futures. This was to make
it easy while developing. We should try to remove this allocation.
2018-09-09 18:47:22 -04:00
Ryan Dahl
902e6e2ee6
Fix warnings.
...
Ref #374
2018-08-30 05:48:40 -04:00
Bert Belder
dfcde3e1ee
format
2018-08-26 19:22:37 +02:00
Bert Belder
79f60f6731
build: do not bake absolute paths into deno_ns
2018-08-26 18:27:23 +02:00
Bert Belder
26707446fc
libdeno: add file utilities Dirname() and ExePath()
2018-08-26 18:27:23 +02:00
Yoshiya Hinosawa
17d6d6b336
refactor: add and use libdeno.setGlobalErrorHandler instead of window.onerror
2018-08-26 11:03:41 -04:00
Yoshiya Hinosawa
aaabc853e8
chore: move libdeno files to //libdeno/
2018-08-19 11:27:47 -04:00