Ryan Dahl
11340c9ca3
There should be a single entry point for creating IsolateHandle ( #361 )
2020-04-23 16:46:53 -04:00
Bert Belder
db5bbf6e43
Move 'create_param_allocations' from OwnedIsolate to IsolateAnnex ( #365 )
2020-04-23 20:15:39 +02:00
Bert Belder
cc626550b1
Explicitly drop slots when disposing an isolate ( #364 )
2020-04-23 19:48:07 +02:00
Bert Belder
ce54d39929
Clarify the purpose of the mutex in struct IsolateAnnex ( #363 )
2020-04-23 19:22:05 +02:00
Bert Belder
0d636de447
Add safe alternative to get_data/set_data ( #360 )
2020-04-23 03:34:28 -04:00
Bert Belder
05782b846f
Make Isolate take ownership of CreateParams ( #357 )
2020-04-20 21:18:03 +02:00
Bert Belder
b85346047e
Remove the 'Delete' trait, use regular 'Drop' instead ( #353 )
2020-04-16 05:24:07 +02:00
Bert Belder
256b6710d0
Remove transmutes from UniquePtr/UniqueRef implementation ( #352 )
2020-04-16 03:21:11 +02:00
Bert Belder
d1ac68f0c8
Always use raw pointers to send V8 handles between C++ and Rust ( #349 )
...
And other pointer usage touch-ups on the C++ side:
- const parameters are passed by & reference.
- mutable parameters are passed by * pointer.
2020-04-14 00:34:32 +02:00
Ben Noordhuis
0df04f2129
Add Isolate::take_heap_snapshot() ( #302 )
...
This doesn't really follow the current V8 API (it's pretty close to how
V8 used to be back in 2012 though.) However:
1. The C++ API is very C++-y and doesn't carry over well to Rust, and
2. It addresses the immediate need of being able to take heap snapshots.
Refs #298
2020-03-09 10:30:25 -07:00
Ryan Dahl
816b6ad537
Fix BackingStore segfault ( #294 )
2020-02-28 18:40:48 -05:00
Bert Belder
eba98e7a5e
Revert "Add ability to attach arbitrary state to Isolate ( #282 )"
...
This patch introduces a bug that breaks Deno.
This reverts commit 457f7ae779
.
2020-02-25 17:21:55 -08:00
Ryan Dahl
d3bbd05634
Add new terminate_execution test ( #288 )
2020-02-19 22:55:44 -05:00
Ryan Dahl
457f7ae779
Add ability to attach arbitrary state to Isolate ( #282 )
2020-02-18 23:46:00 -05:00
Ryan Dahl
554f06f6bc
Fix get_slot and set_slot ( #281 )
2020-02-13 15:03:25 -05:00
Bert Belder
3dacbd396e
Fix use-after-free bug in IsolateHandle::dispose_isolate() ( #280 )
...
This function acquires a mutex lock which, prior to this patch, would be
unlocked _after_ releasing the IsolateAnnex memory allocation where the
mutex was stored.
2020-02-13 02:56:19 -08:00
Bert Belder
ddc8062644
Move get_*_context() methods to scope::Entered, remove InContext trait ( #279 )
...
The `get_current_context()` and `get_entered_or_microtask_context()`
methods now return `Option<Local<Context>>` to reflect that an isolate
may not have entered any context.
They're also moved from `Isolate` to `struct Entered` because it turns
out that the underlying V8 API calls actually create new local handles,
hence they should only be used inside an active HandleScope.
The `InContext` trait has been removed.
A test exercising `ContextScope` and the `get_*_context()` methods
mentioned above was added.
Closes: #248 .
2020-02-12 22:00:31 -08:00
Ryan Dahl
27277ad801
Add IsolateHandle ( #274 )
...
Co-authored-by: Bert Belder <bertbelder@gmail.com>
2020-02-12 11:33:58 -05:00
Ryan Dahl
32abe84dc6
Remove v8::Locker ( #272 )
...
This patch clarifies that v8::Isolate is a single threaded creature,
which can only be accessed from other threads in special circumstances.
To ensure optimal operation in Deno, we remove v8::Locker, which ought
to be unnecessary when a thread is dedicated to each Isolate and the
Isolates never move between threads.
There are valid use-cases for v8::Locker, and we hope to address them in
future versions of rusty_v8.
Co-authored-by: Bert Belder <bertbelder@gmail.com>
2020-02-11 17:01:27 -05:00
Bert Belder
5e55cc5a5c
Add binding for Isolate::get_entered_or_microtask_context() ( #245 )
...
A test will be added later.
2020-01-22 23:36:52 +01:00
Bert Belder
00d8eb8e16
Fix methods that should require '&mut Isolate' but didn't ( #222 )
2020-01-17 15:40:29 +01:00
Bert Belder
6925e78819
Do not export Isolate::enter() and Isolate::exit() methods ( #217 )
2020-01-17 08:57:27 +01:00
Bert Belder
a230735902
Refactor scopes and callbacks so users don't need to transmute ( #183 )
2020-01-16 22:48:27 +01:00
Ry Dahl
03cab59c5c
Add Isolate::request_interrupt ( #208 )
2020-01-15 15:33:47 -05:00
Bert Belder
e0b8f2d02c
Fix some issues with v8::StartupData ( #178 )
2020-01-04 01:26:27 +01:00
Ry Dahl
19398816ab
SnapshotCreator changes for libdeno ( #176 )
2020-01-03 16:52:05 -05:00
Ry Dahl
45b766c01f
happy new year ( #170 )
2020-01-02 13:57:00 -05:00
Ry Dahl
53fd83a6fa
Add Isolate::RunMicrotasks and Isolate::EnqueueMicrotask ( #164 )
2020-01-02 10:15:31 -05:00
Bartek Iwańczuk
23a49d0fd1
add Isolate::get_current_context() ( #155 )
2019-12-31 14:07:42 +01:00
Kevin (Kun) "Kassimo" Qian
d31960342f
isolate: add termination related methods ( #157 )
2019-12-31 06:11:43 -05:00
Bert Belder
24286a4d71
Add StartupData constructor ( #156 )
2019-12-31 02:43:27 +01:00
Ry Dahl
6f953179ba
External references for snapshots ( #141 )
2019-12-27 09:12:16 -05:00
Ry Dahl
ce38f674f7
Support dynamic import ( #136 )
2019-12-26 10:45:55 -05:00
Ry Dahl
877c22b075
Move new_default_allocator to root namespace ( #132 )
...
And add Isolate::set_data, Isolate::get_data, Isolate::get_number_of_data_slots
2019-12-25 10:56:27 -05:00
Bert Belder
934dd16e89
Clean up and remove AsRef/AsMut implementations ( #130 )
2019-12-25 12:40:14 +01:00
Bert Belder
ae4b48eb22
Get rid of HandleScope closure, add CallbackScope ( #119 )
2019-12-25 00:31:36 +01:00
Ry Dahl
57d13f7622
support for import.meta ( #128 )
2019-12-24 16:40:41 -05:00
Bartek Iwańczuk
1507a897de
first pass at snapshots ( #122 )
...
Creating a snapshot leaks memory. We will address this in future work.
2019-12-24 08:03:32 -05:00
Ry Dahl
7cb6623488
Add Isolate::throw_exception ( #123 )
2019-12-23 08:16:01 -05:00
Bert Belder
331582561b
Add Local lifetimes back ( #95 )
2019-12-21 02:11:54 +01:00
Ry Dahl
e89a968ff2
add more docs and clean up exception, json modules ( #92 )
2019-12-20 08:47:20 -05:00
Ry Dahl
68742be011
Remove lifetimes from Local, HandleScope, Locker ( #90 )
...
add v8_str
2019-12-19 23:36:29 -05:00
Ry Dahl
b610e7cda9
Add v8::Isolate::add_message_listener ( #89 )
2019-12-19 21:34:07 -05:00
Ryan Dahl
887af28790
Remove LockedIsolate
2019-12-19 20:32:47 -05:00
Ry Dahl
11ba352065
Rename CxxIsolate to Isolate and Isolate to OwnedIsolate ( #85 )
2019-12-19 19:15:52 -05:00
Bartek Iwańczuk
cb0d2e3bec
add v8::PromiseRejectMessage ( #65 )
2019-12-19 14:13:33 +01:00
Ryan Dahl
24ca978b33
Add v8::Isolate::set_capture_stack_trace_for_uncaught_exceptions
2019-12-18 17:40:45 -05:00
Bartek Iwańczuk
e6e35a57e9
add v8::Exception ( #50 )
2019-12-09 02:26:58 +01:00
Ry Dahl
803ae45263
Simplify public API and move tests to tests/test_api.rs ( #24 )
2019-12-04 00:57:06 -05:00
Bert Belder
b4674c62b8
Basic support for Local<Number> and Local<Integer> ( #23 )
2019-12-04 01:50:26 +01:00