0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2024-12-26 09:13:46 -05:00
Commit graph

832 commits

Author SHA1 Message Date
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
Andy Finch
ffdf69bd00
Add AArch64/ARM64 builds and tests (#266) 2020-02-12 18:43:38 -08:00
Bert Belder
432edd9f24
Split compile_fail tests to have only one error in each test (#277) 2020-02-12 15:21:02 -08:00
Ryan Dahl
47aafbc62e
Add compile_fail test for boxed Local (#275) 2020-02-12 14:45:14 -08:00
Ryan Dahl
d893a050c0 v0.3.0 2020-02-12 11:46:28 -05: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
Nikolai Vavilov
46bf0989fe
Add a note about building on Windows (#271) 2020-02-10 11:56:59 -05:00
Ryan Dahl
d5ae74cfad
Upgrade Rust to 1.41.0 (#264) 2020-01-30 21:58:05 -05:00
Ryan Dahl
4f449b6ec6
Upgrade V8 to 8.1.310 (#263)
Co-authored-by: Bert Belder <bertbelder@gmail.com>
2020-01-30 20:44:28 -05:00
Ryan Dahl
87fdcdc131
dedup inspector client/channel test implementations (#262) 2020-01-29 13:11:22 -05:00
Ryan Dahl
3dbf414752
v0.2.1 2020-01-28 18:27:25 -05:00
Ryan Dahl
71c650bc05
Put gn_ninja_binaries in target/debug instead of out_dir (#261) 2020-01-28 18:27:11 -05:00
Ryan Dahl
62a52e0241
Do not use std::os::raw::c_int in public API (#259) 2020-01-28 17:16:31 -05:00
Ryan Dahl
2e61735f44
add test for schedule_pause_on_next_statement (#258) 2020-01-28 16:33:34 -05:00
Ben Noordhuis
9e14f18347 Add Object::creation_context() (#255)
And also Array::creation_context(), Function::creation_context(), etc.,
because they inherit from Object.
2020-01-26 17:42:28 +01:00
Ben Noordhuis
683aa2b2a9 Add V8InspectorClientImpl::console_api_message() (#252)
This makes it possible to intercept console.log() messages through
the V8 inspector API.
2020-01-24 09:33:54 -05:00
Ryan Dahl
6303158de0 Add no_inline_line_tables support 2020-01-23 14:53:04 -05:00
Ryan Dahl
093e09217c SharedArrayBuffer::new_backing_store_from_boxed_slice doesn't need to be unsafe 2020-01-23 14:24:03 -05:00
Ryan Dahl
96309e9679 v0.2.0 2020-01-23 11:57:25 -05:00
Ryan Dahl
db33bc9aec Expose TaskBase and TaskImpl 2020-01-23 11:57:25 -05:00
Ryan Dahl
aca89c2055
new_backing_store_from_boxed_slice doesn't need to be unsafe (#247) 2020-01-23 10:17:23 -05:00
Bert Belder
7e27c88708
Remove TODO comment that's no longer relevant (#246) 2020-01-23 00:01:53 +01: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
2286052468
Rename String::new_empty() to String::empty() (#244)
This is more consistent with the C++ API.
2020-01-22 23:21:56 +01:00
Bert Belder
8617f77fd3
Refactor v8::Object bindings (#243)
* Rename `Object::new2()` to `Object::with_prototype_and_properties()`.
* Make `Object::with_prototype_and_properties()` take a slice of keys
  and a slice of values as arguments, instead of using
  `Vec<v8::Local<v8::Name>>` and `Vec<v8::Local<v8::Value>>>`.
* Remove type `MaybeBool` from the public interface. These methods now
  return `Option<bool>` instead.
* Fix parameter type mismatches between Rust and C++ APIs.
2020-01-22 23:13:58 +01:00
Bert Belder
dcb94533f8
Make SharedRef<T> deref to UnsafeCell<T> instead of T (#242)
Closes: #240
2020-01-22 22:29:03 +01:00
Bert Belder
bf128554fc
Implement Clone for SharedRef<T> (#241) 2020-01-22 22:02:44 +01:00
Ben Noordhuis
ab3a086132 Add String::new_empty() (#238) 2020-01-22 17:23:42 +01:00
Andy Finch
d302180ffa remove pub use support::int; #235 (#239) 2020-01-22 11:01:49 -05:00
Bert Belder
9124720c5a
8-bit StringView uses latin-1 encoding, not UTF-8 (#237) 2020-01-22 00:11:29 +01:00
Ben Noordhuis
4b8573a993 Implement fmt::Display for StringView (#236)
Make StringView objects inspectable to make it easier to debug the
V8 inspector's wire protocol.

StringBuffer objects can't be inspected yet because they need a mutable
reference if they want to call `StringBuffer::string()`, which makes
sense because that method calls out to a C++ virtual method that can
modify the object.

For now, instances can be inspected like this:

    let mut sb = StringBuffer::create(...);
    println!("StringBuffer({})", sb.string().unwrap());

Closes #233
2020-01-21 17:33:51 -05:00
Bert Belder
1a1bac3883
Make BackingStore APIs more consistent with C++ (#234) 2020-01-21 16:23:47 +01:00
Ryan Dahl
3c1c52fb33 v0.1.1 2020-01-21 09:45:32 -05:00
Ryan Dahl
791cbc627a Add docs about scopes to lib.rs 2020-01-21 09:45:32 -05:00
Bert Belder
b3d93dad78
Some clean-ups after making Locker a Scope (#231) 2020-01-21 03:16:55 +01:00
Bert Belder
44d58f8f48
Make Locker also a Scope (#229) 2020-01-21 02:03:45 +01:00
Bert Belder
937704ab76
Disable test 'handle_scope_escape_to_nowhere' on Windows CI (#227) 2020-01-20 23:34:34 +01:00
Bert Belder
36a12142f2
Make EscapableHandleScope::escape() inheritable, tighten lifetimes (#227) 2020-01-20 23:34:28 +01:00
Ben Noordhuis
6efb395fdc Add Object::define_own_property() (#228)
This commit introduces the NONE, READ_ONLY, DONT_ENUM and DONT_DELETE
property attributes.
2020-01-20 11:16:24 -05:00
Ben Noordhuis
42af31ff38
Add Context::new_from_template() (#225) 2020-01-19 21:58:44 +01:00
Ben Noordhuis
2db5e10b9f
Add FunctionTemplate::set_class_name() (#225) 2020-01-19 21:58:35 +01:00
Ben Noordhuis
7b0269b447
Add ObjectTemplate and Template::set() (#225)
The ObjectTemplate type already existed but now it can also be
instantiated.

This commit also adds Template::set() to actually make that useful.
2020-01-19 21:58:20 +01:00
Bert Belder
2a7868daa9
Forgot to delete file (#224) 2020-01-18 15:31:39 +01:00
Bert Belder
6c1d65252a
Add ContextScope and lay foundations for scope inheritance (#223) 2020-01-18 13:41:28 +01:00
Bert Belder
00d8eb8e16
Fix methods that should require '&mut Isolate' but didn't (#222) 2020-01-17 15:40:29 +01:00
Ry Dahl
52067dc4da
Upgrade deps (#221) 2020-01-17 09:27:13 -05:00
Ry Dahl
7a198e0c7e
Reduce nested symbols in API (#220)
- Don't expose empty mod array_buffer_view
- Move v8::platform::new_default_platform() to v8::new_default_platform()
- Move v8::platform::Task to v8::Task
- Move v8::platform::Platform to v8::Platform
2020-01-17 09:26:42 -05:00