Divy Srivastava
a29740df6b
Add aarch64-linux-android support ( #860 )
2022-01-04 21:32:48 +01:00
Aaron O'Mullan
b3e09e69a0
feat: v8::StackTrace::CurrentStackTrace() bindings ( #800 )
2021-12-28 16:52:12 +01:00
Bert Belder
65e78fd960
chore: upgrade Rust to 1.57.0 ( #856 )
2021-12-14 21:25:10 -08:00
Andreu Botella
06648dd1bd
fix: segfault when dropping BackingStore
constructed from empty slice ( #851 )
...
This fixes in a segmentation fault when dropping a `BackingStore`
constructed through `ArrayBuffer::new_backing_store_from_boxed_slice()`
from an empty slice, since zero length boxed slices are invalid
(dangling) pointers, while Rust expects a `Box<c_void>` to always be a
valid pointer.
Fixes: #849
2021-12-13 15:37:59 -08:00
Bert Belder
251f1e9ac9
fix: url
param to v8::WasmStreaming::SetUrl()
must be null terminated ( #854 )
2021-12-12 21:25:11 -08:00
Sujay Jayakar
62d33c4d7e
Add Function::GetScript{Line,Column}Number bindings ( #843 )
2021-11-30 21:55:41 +01:00
Andreu Botella
aac37a6d4f
refactor: Have BackingStore::data
return Option<NonNull<c_void>>
( #817 )
...
The pointer returned by `BackingStore::data` might be null if the
backing store has zero length, but the return type `*mut c_void` does
not force the user to consider this case. This change makes the return
type `Option<NonNull<c_void>>`, which is semantically equivalent, but
which forces users of the API to handle the `None` case.
This is a breaking API change.
2021-11-17 12:14:03 +01:00
Rafael Ávila de Espíndola
a043407ae8
Make lifetime in FunctionCallback
signature more restrictive ( #822 )
...
This makes the callbacks themselves less restrictive. A test is added
the would fail to compile before.
2021-11-08 12:51:53 -08:00
github-actions[bot]
7cc28c5e47
Rolling to V8 9.7.106.2 ( #827 )
...
Co-authored-by: Luca Casonato <hello@lcas.dev>
2021-11-08 01:24:05 +01:00
Ryan Dahl
8297216a1c
Narrow dead_code allowance ( #818 )
2021-10-28 16:29:04 -04:00
Luca Casonato
5ee0a375f2
chore: rename rusty_v8 to v8 ( #803 )
2021-10-27 14:32:12 +02:00
Andreu Botella
2a21f5abf9
fix: Make derefing a zero-size BackingStore
no longer UB ( #809 )
...
For zero-size `BackingStore`s, it seems like `BackingStore::data` always
returns a null pointer. The `Deref` impl for `BackingStore` called
`std::slice::from_raw_parts` on that pointer, even though it is UB to
call that function on a null pointer even for empty slices. This change
fixes that by obtaining a valid pointer from `NonNull::dangling()` if
the original is null.
Reported in
https://github.com/denoland/rusty_v8/issues/711#issuecomment-950637136 .
2021-10-25 22:40:14 +02:00
Bert Belder
d478c450dd
Rename Handle::get() to Handle::open() instead ( #806 )
...
This also adds a deprecated `Global::get()` method to avoid unnecessarily
breaking a lot of users code.
Ref: #799
2021-10-13 21:45:10 +02:00
Rafael Ávila de Espíndola
8285b3da34
Rename Handle::get() to Handle::inner() ( #799 )
2021-10-13 16:47:34 +02:00
Aaron O'Mullan
6ccf15c69d
feat: Function::get/set_name() ( #792 )
...
Add bindings for v8::Function::GetName() and v8::Function::SetName()
2021-10-01 22:38:05 +02:00
Andreu Botella
b32d0b0540
feat: WasmStreaming::set_url
, CompiledWasmModule::source_url
( #786 )
...
Needed for denoland/deno#12151
2021-09-22 14:34:39 -04:00
Ben Noordhuis
09347d32c8
Throw DataCloneError if SAB cannot be cloned ( #781 )
...
Best case, it produces serialized output that cannot be deserialized.
Worst case, it hits this assert in V8:
# Fatal error in v8::FromJust
# Maybe value is Nothing.
2021-09-18 15:21:04 +02:00
Andreu Botella
babe41a990
feat: Add v8::CompiledWasmModule
( #776 )
...
`v8::CompiledWasmModule` is a representation of a compiled WebAssembly
module, which can be shared by multiple `v8::WasmModuleObject`s.
Closes #759 .
2021-09-17 12:02:40 -04:00
Aaron O'Mullan
8094d5d971
fix(json): relax lifetime for json_object ( #778 )
...
Amongst other things this will enable serde_v8 to print JSON object dumps
2021-09-13 23:34:17 +02:00
Rami Sabbagh
16708359bc
feat: Implement Isolate::remove_slot ( #769 )
2021-09-09 00:41:50 +02:00
Ben Noordhuis
cb07d4f914
feat: implement counter_lookup_callback ( #756 )
2021-08-19 14:05:48 +02:00
Ben Noordhuis
5a27cb7655
Upgrade V8 to 9.4.146.2 ( #753 )
2021-08-15 15:13:08 +02:00
PerfectLaugh
580a89cf10
Fix x86 build
2021-08-12 06:00:20 +02:00
Bartek Iwańczuk
c525555e42
feat: add V8InspectorSession::can_dispatch_method ( #746 )
2021-08-09 15:53:30 +02:00
Bartek Iwańczuk
45006fb7e7
Add Isolate::has_pending_background_tasks ( #724 )
2021-07-02 20:17:48 +02:00
Bert Belder
0bc6ea49f9
chore: clang-format ( #719 )
2021-07-01 19:03:21 +02:00
Tim Ramlot
14bcf04bef
Add support for Platform::pump_message_loop and Platform::run_idle_tasks ( #706 )
...
Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
2021-07-01 16:05:07 +02:00
Jomer
89c8ae8af3
feat: add various FunctionTemplate methods ( #718 )
...
This commit adds the following methods:
* `FunctionTemplate::inherit()`
* `FunctionTemplate::prototype_template()`
* `FunctionTemplate::read_only_prototype()`
* `FunctionTemplate::remove_prototype()`
2021-06-30 16:55:14 +02:00
Luca Casonato
cfa5d7060f
fix: pass serializer helpers as mut refs ( #712 )
...
They are only useful in read_host_object and write_host_object if
the helpers are available as a mut ref.
2021-06-24 15:59:03 +02:00
Andreu Botella
dfd5842913
Add missing methods for one- and two-byte strings ( #704 )
...
Fixes #703 .
2021-06-22 14:11:38 +02:00
Yusuke Tanaka
f85508868e
chore: upgrade Rust to 1.53.0 ( #705 )
2021-06-18 11:35:53 -04:00
Ryan Dahl
fca78fb0c1
Rename set_common_data to set_common_data_69 ( #702 )
2021-06-18 06:55:38 -04:00
Ryan Dahl
3c22821499
CreateParams cleanup ( #701 )
2021-06-15 12:05:53 -04:00
Ryan Dahl
fe298359d9
Upgrade V8 to 9.2.230.10 ( #700 )
...
* We are floating a revert of v8/v8@7f9d7f0 because of the issue described in #694 .
* Upgrade ICU 68 -> 69
* Upgrade //build and //buildtools
* set v8_enable_shared_ro_heap = false to fix tests
2021-06-15 11:12:23 -04:00
Matthew McAllister
6d25d19b4c
Add ObjectTemplate::set_accessor{_with_setter}
( #687 )
2021-05-11 16:40:53 +02:00
Nicholas Sielicki
4b7f57081a
Avoid warnings by adding explicit dyn
s in a few spots ( #677 )
2021-04-29 22:12:54 +02:00
Ben Noordhuis
92ea90bdbf
Add ScriptCompiler::compile_function_in_context() ( #670 )
2021-04-27 20:32:40 +02:00
Ben Noordhuis
efa6c71b10
Add Signature::new() ( #666 )
...
Refs #478 .
2021-04-20 12:48:20 +02:00
Ben Noordhuis
84f1241b68
Fix bad assumption in static_assert ( #668 )
...
v8::Location is the size of two ints, not the size of one size_t.
`2 * sizeof(int) == sizeof(size_t)` on 64 bits architectures but not on
32 bits architectures.
Fixes #667 .
2021-04-19 16:43:58 +02:00
Ben Noordhuis
03e74c6f1b
Add new_single_threaded_default_platform() ( #659 )
...
This is a v8::Platform implementation that doesn't spawn additional
threads. Useful in combination with the --single_threaded flag.
2021-04-12 21:40:52 +02:00
Bert Belder
de9a7e2698
String::new_external_onebyte_static() should take &[u8]
instead of &str
( #658 )
2021-04-09 19:49:55 +02:00
Ryan Dahl
d520fe85bd
Add String::new_from_one_byte ( #654 )
2021-04-02 16:23:05 -04:00
Ben Noordhuis
3a5ce45245
Remove dead platform code ( #653 )
...
The Task struct and Platform::pump_message_loop() method were
non-functional, remove them.
2021-03-30 14:33:39 +02:00
Yusuke Tanaka
3c7ff01ad4
Upgrade Rust to 1.51.0 ( #652 )
2021-03-27 20:16:35 +01:00
Ben Noordhuis
7d514ae4cb
Add ArrayBuffer::detach() and is_detachable() ( #648 )
...
Fixes #646 .
2021-03-16 23:35:27 +01:00
Aaron O'Mullan
f2766ed1af
Support for external v8 strings ( #641 )
2021-03-07 10:21:59 -05:00
Heyang Zhou
a6d36d1193
Add more ScriptCompiler APIs ( #638 )
2021-03-07 08:05:50 -05:00
Heyang Zhou
be89cfc131
Add code cache API ( #635 )
2021-03-05 05:26:37 -05:00
Ryan Dahl
83052c4535
Enter isolate on construction, exit on drop
...
Fixes #626
2021-02-20 09:41:26 -05:00
Bartek Iwańczuk
8551c62511
Add Module::source_offset_to_location, deprecate old APIs ( #624 )
2021-02-15 12:08:39 +01:00