libv8-node 16.10.0.0-aarch64-linux → 18.8.0.0-aarch64-linux
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/libv8-node/paths.rb +5 -1
- data/lib/libv8/node/version.rb +3 -3
- data/vendor/v8/aarch64-linux/libv8/obj/libv8_monolith.a +0 -0
- data/vendor/v8/include/cppgc/allocation.h +100 -22
- data/vendor/v8/include/cppgc/cross-thread-persistent.h +114 -33
- data/vendor/v8/include/cppgc/default-platform.h +2 -10
- data/vendor/v8/include/cppgc/explicit-management.h +22 -4
- data/vendor/v8/include/cppgc/garbage-collected.h +15 -26
- data/vendor/v8/include/cppgc/heap-consistency.h +30 -0
- data/vendor/v8/include/cppgc/heap-state.h +12 -0
- data/vendor/v8/include/cppgc/heap.h +7 -2
- data/vendor/v8/include/cppgc/internal/api-constants.h +8 -0
- data/vendor/v8/include/cppgc/internal/caged-heap-local-data.h +25 -14
- data/vendor/v8/include/cppgc/internal/finalizer-trait.h +4 -1
- data/vendor/v8/include/cppgc/internal/gc-info.h +90 -10
- data/vendor/v8/include/cppgc/internal/logging.h +3 -3
- data/vendor/v8/include/cppgc/internal/name-trait.h +11 -0
- data/vendor/v8/include/cppgc/internal/persistent-node.h +73 -29
- data/vendor/v8/include/cppgc/internal/pointer-policies.h +26 -15
- data/vendor/v8/include/cppgc/internal/write-barrier.h +62 -23
- data/vendor/v8/include/cppgc/liveness-broker.h +4 -1
- data/vendor/v8/include/cppgc/member.h +7 -2
- data/vendor/v8/include/cppgc/persistent.h +38 -33
- data/vendor/v8/include/cppgc/platform.h +4 -1
- data/vendor/v8/include/cppgc/prefinalizer.h +35 -12
- data/vendor/v8/include/cppgc/testing.h +9 -2
- data/vendor/v8/include/cppgc/type-traits.h +6 -13
- data/vendor/v8/include/cppgc/visitor.h +9 -7
- data/vendor/v8/include/libplatform/libplatform.h +0 -11
- data/vendor/v8/include/libplatform/v8-tracing.h +0 -1
- data/vendor/v8/include/v8-array-buffer.h +445 -0
- data/vendor/v8/include/v8-callbacks.h +397 -0
- data/vendor/v8/include/v8-container.h +129 -0
- data/vendor/v8/include/v8-context.h +407 -0
- data/vendor/v8/include/v8-cppgc.h +21 -128
- data/vendor/v8/include/v8-data.h +80 -0
- data/vendor/v8/include/v8-date.h +43 -0
- data/vendor/v8/include/v8-debug.h +168 -0
- data/vendor/v8/include/v8-embedder-heap.h +218 -0
- data/vendor/v8/include/v8-embedder-state-scope.h +51 -0
- data/vendor/v8/include/v8-exception.h +217 -0
- data/vendor/v8/include/v8-extension.h +62 -0
- data/vendor/v8/include/v8-external.h +37 -0
- data/vendor/v8/include/v8-fast-api-calls.h +172 -24
- data/vendor/v8/include/v8-forward.h +81 -0
- data/vendor/v8/include/v8-function-callback.h +475 -0
- data/vendor/v8/include/v8-function.h +125 -0
- data/vendor/v8/include/v8-initialization.h +315 -0
- data/vendor/v8/include/v8-inspector.h +56 -28
- data/vendor/v8/include/v8-internal.h +217 -55
- data/vendor/v8/include/v8-isolate.h +1709 -0
- data/vendor/v8/include/v8-json.h +47 -0
- data/vendor/v8/include/v8-local-handle.h +455 -0
- data/vendor/v8/include/v8-locker.h +149 -0
- data/vendor/v8/include/v8-maybe.h +137 -0
- data/vendor/v8/include/v8-memory-span.h +43 -0
- data/vendor/v8/include/v8-message.h +216 -0
- data/vendor/v8/include/v8-metrics.h +69 -16
- data/vendor/v8/include/v8-microtask-queue.h +152 -0
- data/vendor/v8/include/v8-microtask.h +28 -0
- data/vendor/v8/include/v8-object.h +775 -0
- data/vendor/v8/include/v8-persistent-handle.h +590 -0
- data/vendor/v8/include/v8-platform.h +400 -17
- data/vendor/v8/include/v8-primitive-object.h +118 -0
- data/vendor/v8/include/v8-primitive.h +866 -0
- data/vendor/v8/include/v8-profiler.h +88 -13
- data/vendor/v8/include/v8-promise.h +174 -0
- data/vendor/v8/include/v8-proxy.h +50 -0
- data/vendor/v8/include/v8-regexp.h +105 -0
- data/vendor/v8/include/v8-script.h +747 -0
- data/vendor/v8/include/v8-snapshot.h +196 -0
- data/vendor/v8/include/v8-statistics.h +217 -0
- data/vendor/v8/include/v8-template.h +1079 -0
- data/vendor/v8/include/v8-traced-handle.h +420 -0
- data/vendor/v8/include/v8-typed-array.h +282 -0
- data/vendor/v8/include/v8-unwinder-state.h +4 -3
- data/vendor/v8/include/v8-unwinder.h +132 -0
- data/vendor/v8/include/v8-util.h +7 -1
- data/vendor/v8/include/v8-value-serializer-version.h +1 -1
- data/vendor/v8/include/v8-value-serializer.h +279 -0
- data/vendor/v8/include/v8-value.h +526 -0
- data/vendor/v8/include/v8-version.h +4 -4
- data/vendor/v8/include/v8-wasm.h +257 -0
- data/vendor/v8/include/v8-weak-callback-info.h +87 -0
- data/vendor/v8/include/v8.h +41 -12601
- data/vendor/v8/include/v8config.h +102 -12
- metadata +47 -5
- data/vendor/v8/include/cppgc/internal/prefinalizer-handler.h +0 -30
@@ -0,0 +1,62 @@
|
|
1
|
+
// Copyright 2021 the V8 project authors. All rights reserved.
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
3
|
+
// found in the LICENSE file.
|
4
|
+
|
5
|
+
#ifndef INCLUDE_V8_EXTENSION_H_
|
6
|
+
#define INCLUDE_V8_EXTENSION_H_
|
7
|
+
|
8
|
+
#include <memory>
|
9
|
+
|
10
|
+
#include "v8-local-handle.h" // NOLINT(build/include_directory)
|
11
|
+
#include "v8-primitive.h" // NOLINT(build/include_directory)
|
12
|
+
#include "v8config.h" // NOLINT(build/include_directory)
|
13
|
+
|
14
|
+
namespace v8 {
|
15
|
+
|
16
|
+
class FunctionTemplate;
|
17
|
+
|
18
|
+
// --- Extensions ---
|
19
|
+
|
20
|
+
/**
|
21
|
+
* Ignore
|
22
|
+
*/
|
23
|
+
class V8_EXPORT Extension {
|
24
|
+
public:
|
25
|
+
// Note that the strings passed into this constructor must live as long
|
26
|
+
// as the Extension itself.
|
27
|
+
Extension(const char* name, const char* source = nullptr, int dep_count = 0,
|
28
|
+
const char** deps = nullptr, int source_length = -1);
|
29
|
+
virtual ~Extension() { delete source_; }
|
30
|
+
virtual Local<FunctionTemplate> GetNativeFunctionTemplate(
|
31
|
+
Isolate* isolate, Local<String> name) {
|
32
|
+
return Local<FunctionTemplate>();
|
33
|
+
}
|
34
|
+
|
35
|
+
const char* name() const { return name_; }
|
36
|
+
size_t source_length() const { return source_length_; }
|
37
|
+
const String::ExternalOneByteStringResource* source() const {
|
38
|
+
return source_;
|
39
|
+
}
|
40
|
+
int dependency_count() const { return dep_count_; }
|
41
|
+
const char** dependencies() const { return deps_; }
|
42
|
+
void set_auto_enable(bool value) { auto_enable_ = value; }
|
43
|
+
bool auto_enable() { return auto_enable_; }
|
44
|
+
|
45
|
+
// Disallow copying and assigning.
|
46
|
+
Extension(const Extension&) = delete;
|
47
|
+
void operator=(const Extension&) = delete;
|
48
|
+
|
49
|
+
private:
|
50
|
+
const char* name_;
|
51
|
+
size_t source_length_; // expected to initialize before source_
|
52
|
+
String::ExternalOneByteStringResource* source_;
|
53
|
+
int dep_count_;
|
54
|
+
const char** deps_;
|
55
|
+
bool auto_enable_;
|
56
|
+
};
|
57
|
+
|
58
|
+
void V8_EXPORT RegisterExtension(std::unique_ptr<Extension>);
|
59
|
+
|
60
|
+
} // namespace v8
|
61
|
+
|
62
|
+
#endif // INCLUDE_V8_EXTENSION_H_
|
@@ -0,0 +1,37 @@
|
|
1
|
+
// Copyright 2021 the V8 project authors. All rights reserved.
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
3
|
+
// found in the LICENSE file.
|
4
|
+
|
5
|
+
#ifndef INCLUDE_V8_EXTERNAL_H_
|
6
|
+
#define INCLUDE_V8_EXTERNAL_H_
|
7
|
+
|
8
|
+
#include "v8-value.h" // NOLINT(build/include_directory)
|
9
|
+
#include "v8config.h" // NOLINT(build/include_directory)
|
10
|
+
|
11
|
+
namespace v8 {
|
12
|
+
|
13
|
+
class Isolate;
|
14
|
+
|
15
|
+
/**
|
16
|
+
* A JavaScript value that wraps a C++ void*. This type of value is mainly used
|
17
|
+
* to associate C++ data structures with JavaScript objects.
|
18
|
+
*/
|
19
|
+
class V8_EXPORT External : public Value {
|
20
|
+
public:
|
21
|
+
static Local<External> New(Isolate* isolate, void* value);
|
22
|
+
V8_INLINE static External* Cast(Value* value) {
|
23
|
+
#ifdef V8_ENABLE_CHECKS
|
24
|
+
CheckCast(value);
|
25
|
+
#endif
|
26
|
+
return static_cast<External*>(value);
|
27
|
+
}
|
28
|
+
|
29
|
+
void* Value() const;
|
30
|
+
|
31
|
+
private:
|
32
|
+
static void CheckCast(v8::Value* obj);
|
33
|
+
};
|
34
|
+
|
35
|
+
} // namespace v8
|
36
|
+
|
37
|
+
#endif // INCLUDE_V8_EXTERNAL_H_
|
@@ -225,8 +225,11 @@
|
|
225
225
|
#include <tuple>
|
226
226
|
#include <type_traits>
|
227
227
|
|
228
|
-
#include "v8.h"
|
229
|
-
#include "
|
228
|
+
#include "v8-internal.h" // NOLINT(build/include_directory)
|
229
|
+
#include "v8-local-handle.h" // NOLINT(build/include_directory)
|
230
|
+
#include "v8-typed-array.h" // NOLINT(build/include_directory)
|
231
|
+
#include "v8-value.h" // NOLINT(build/include_directory)
|
232
|
+
#include "v8config.h" // NOLINT(build/include_directory)
|
230
233
|
|
231
234
|
namespace v8 {
|
232
235
|
|
@@ -246,6 +249,15 @@ class CTypeInfo {
|
|
246
249
|
kV8Value,
|
247
250
|
kApiObject, // This will be deprecated once all users have
|
248
251
|
// migrated from v8::ApiObject to v8::Local<v8::Value>.
|
252
|
+
kAny, // This is added to enable untyped representation of fast
|
253
|
+
// call arguments for test purposes. It can represent any of
|
254
|
+
// the other types stored in the same memory as a union (see
|
255
|
+
// the AnyCType struct declared below). This allows for
|
256
|
+
// uniform passing of arguments w.r.t. their location
|
257
|
+
// (in a register or on the stack), independent of their
|
258
|
+
// actual type. It's currently used by the arm64 simulator
|
259
|
+
// and can be added to the other simulators as well when fast
|
260
|
+
// calls having both GP and FP params need to be supported.
|
249
261
|
};
|
250
262
|
|
251
263
|
// kCallbackOptionsType is not part of the Type enum
|
@@ -274,6 +286,17 @@ class CTypeInfo {
|
|
274
286
|
Flags flags = Flags::kNone)
|
275
287
|
: type_(type), sequence_type_(sequence_type), flags_(flags) {}
|
276
288
|
|
289
|
+
typedef uint32_t Identifier;
|
290
|
+
explicit constexpr CTypeInfo(Identifier identifier)
|
291
|
+
: CTypeInfo(static_cast<Type>(identifier >> 16),
|
292
|
+
static_cast<SequenceType>((identifier >> 8) & 255),
|
293
|
+
static_cast<Flags>(identifier & 255)) {}
|
294
|
+
constexpr Identifier GetId() const {
|
295
|
+
return static_cast<uint8_t>(type_) << 16 |
|
296
|
+
static_cast<uint8_t>(sequence_type_) << 8 |
|
297
|
+
static_cast<uint8_t>(flags_);
|
298
|
+
}
|
299
|
+
|
277
300
|
constexpr Type GetType() const { return type_; }
|
278
301
|
constexpr SequenceType GetSequenceType() const { return sequence_type_; }
|
279
302
|
constexpr Flags GetFlags() const { return flags_; }
|
@@ -298,10 +321,44 @@ class CTypeInfo {
|
|
298
321
|
Flags flags_;
|
299
322
|
};
|
300
323
|
|
324
|
+
struct FastApiTypedArrayBase {
|
325
|
+
public:
|
326
|
+
// Returns the length in number of elements.
|
327
|
+
size_t V8_EXPORT length() const { return length_; }
|
328
|
+
// Checks whether the given index is within the bounds of the collection.
|
329
|
+
void V8_EXPORT ValidateIndex(size_t index) const;
|
330
|
+
|
331
|
+
protected:
|
332
|
+
size_t length_ = 0;
|
333
|
+
};
|
334
|
+
|
301
335
|
template <typename T>
|
302
|
-
struct FastApiTypedArray {
|
303
|
-
|
304
|
-
|
336
|
+
struct FastApiTypedArray : public FastApiTypedArrayBase {
|
337
|
+
public:
|
338
|
+
V8_INLINE T get(size_t index) const {
|
339
|
+
#ifdef DEBUG
|
340
|
+
ValidateIndex(index);
|
341
|
+
#endif // DEBUG
|
342
|
+
T tmp;
|
343
|
+
memcpy(&tmp, reinterpret_cast<T*>(data_) + index, sizeof(T));
|
344
|
+
return tmp;
|
345
|
+
}
|
346
|
+
|
347
|
+
bool getStorageIfAligned(T** elements) const {
|
348
|
+
if (reinterpret_cast<uintptr_t>(data_) % alignof(T) != 0) {
|
349
|
+
return false;
|
350
|
+
}
|
351
|
+
*elements = reinterpret_cast<T*>(data_);
|
352
|
+
return true;
|
353
|
+
}
|
354
|
+
|
355
|
+
private:
|
356
|
+
// This pointer should include the typed array offset applied.
|
357
|
+
// It's not guaranteed that it's aligned to sizeof(T), it's only
|
358
|
+
// guaranteed that it's 4-byte aligned, so for 8-byte types we need to
|
359
|
+
// provide a special implementation for reading from it, which hides
|
360
|
+
// the possibly unaligned read in the `get` method.
|
361
|
+
void* data_;
|
305
362
|
};
|
306
363
|
|
307
364
|
// Any TypedArray. It uses kTypedArrayBit with base type void
|
@@ -356,6 +413,37 @@ class V8_EXPORT CFunctionInfo {
|
|
356
413
|
const CTypeInfo* arg_info_;
|
357
414
|
};
|
358
415
|
|
416
|
+
struct FastApiCallbackOptions;
|
417
|
+
|
418
|
+
// Provided for testing.
|
419
|
+
struct AnyCType {
|
420
|
+
AnyCType() : int64_value(0) {}
|
421
|
+
|
422
|
+
union {
|
423
|
+
bool bool_value;
|
424
|
+
int32_t int32_value;
|
425
|
+
uint32_t uint32_value;
|
426
|
+
int64_t int64_value;
|
427
|
+
uint64_t uint64_value;
|
428
|
+
float float_value;
|
429
|
+
double double_value;
|
430
|
+
Local<Object> object_value;
|
431
|
+
Local<Array> sequence_value;
|
432
|
+
const FastApiTypedArray<int32_t>* int32_ta_value;
|
433
|
+
const FastApiTypedArray<uint32_t>* uint32_ta_value;
|
434
|
+
const FastApiTypedArray<int64_t>* int64_ta_value;
|
435
|
+
const FastApiTypedArray<uint64_t>* uint64_ta_value;
|
436
|
+
const FastApiTypedArray<float>* float_ta_value;
|
437
|
+
const FastApiTypedArray<double>* double_ta_value;
|
438
|
+
FastApiCallbackOptions* options_value;
|
439
|
+
};
|
440
|
+
};
|
441
|
+
|
442
|
+
static_assert(
|
443
|
+
sizeof(AnyCType) == 8,
|
444
|
+
"The AnyCType struct should have size == 64 bits, as this is assumed "
|
445
|
+
"by EffectControlLinearizer.");
|
446
|
+
|
359
447
|
class V8_EXPORT CFunction {
|
360
448
|
public:
|
361
449
|
constexpr CFunction() : address_(nullptr), type_info_(nullptr) {}
|
@@ -412,10 +500,17 @@ class V8_EXPORT CFunction {
|
|
412
500
|
return ArgUnwrap<F*>::Make(func);
|
413
501
|
}
|
414
502
|
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
503
|
+
// Provided for testing purposes.
|
504
|
+
template <typename R, typename... Args, typename R_Patch,
|
505
|
+
typename... Args_Patch>
|
506
|
+
static CFunction Make(R (*func)(Args...),
|
507
|
+
R_Patch (*patching_func)(Args_Patch...)) {
|
508
|
+
CFunction c_func = ArgUnwrap<R (*)(Args...)>::Make(func);
|
509
|
+
static_assert(
|
510
|
+
sizeof...(Args_Patch) == sizeof...(Args),
|
511
|
+
"The patching function must have the same number of arguments.");
|
512
|
+
c_func.address_ = reinterpret_cast<void*>(patching_func);
|
513
|
+
return c_func;
|
419
514
|
}
|
420
515
|
|
421
516
|
CFunction(const void* address, const CFunctionInfo* type_info);
|
@@ -437,10 +532,6 @@ class V8_EXPORT CFunction {
|
|
437
532
|
};
|
438
533
|
};
|
439
534
|
|
440
|
-
struct ApiObject {
|
441
|
-
uintptr_t address;
|
442
|
-
};
|
443
|
-
|
444
535
|
/**
|
445
536
|
* A struct which may be passed to a fast call callback, like so:
|
446
537
|
* \code
|
@@ -513,7 +604,8 @@ class CFunctionInfoImpl : public CFunctionInfo {
|
|
513
604
|
kReturnType == CTypeInfo::Type::kInt32 ||
|
514
605
|
kReturnType == CTypeInfo::Type::kUint32 ||
|
515
606
|
kReturnType == CTypeInfo::Type::kFloat32 ||
|
516
|
-
kReturnType == CTypeInfo::Type::kFloat64
|
607
|
+
kReturnType == CTypeInfo::Type::kFloat64 ||
|
608
|
+
kReturnType == CTypeInfo::Type::kAny,
|
517
609
|
"64-bit int and api object values are not currently "
|
518
610
|
"supported return types.");
|
519
611
|
}
|
@@ -564,7 +656,7 @@ struct CTypeInfoTraits {};
|
|
564
656
|
V(void, kVoid) \
|
565
657
|
V(v8::Local<v8::Value>, kV8Value) \
|
566
658
|
V(v8::Local<v8::Object>, kV8Value) \
|
567
|
-
V(
|
659
|
+
V(AnyCType, kAny)
|
568
660
|
|
569
661
|
// ApiObject was a temporary solution to wrap the pointer to the v8::Value.
|
570
662
|
// Please use v8::Local<v8::Value> in new code for the arguments and
|
@@ -578,7 +670,7 @@ PRIMITIVE_C_TYPES(DEFINE_TYPE_INFO_TRAITS)
|
|
578
670
|
|
579
671
|
#define SPECIALIZE_GET_TYPE_INFO_HELPER_FOR_TA(T, Enum) \
|
580
672
|
template <> \
|
581
|
-
struct TypeInfoHelper<FastApiTypedArray<T
|
673
|
+
struct TypeInfoHelper<const FastApiTypedArray<T>&> { \
|
582
674
|
static constexpr CTypeInfo::Flags Flags() { \
|
583
675
|
return CTypeInfo::Flags::kNone; \
|
584
676
|
} \
|
@@ -636,17 +728,19 @@ struct TypeInfoHelper<FastApiCallbackOptions&> {
|
|
636
728
|
#define STATIC_ASSERT_IMPLIES(COND, ASSERTION, MSG) \
|
637
729
|
static_assert(((COND) == 0) || (ASSERTION), MSG)
|
638
730
|
|
731
|
+
} // namespace internal
|
732
|
+
|
639
733
|
template <typename T, CTypeInfo::Flags... Flags>
|
640
|
-
class CTypeInfoBuilder {
|
734
|
+
class V8_EXPORT CTypeInfoBuilder {
|
641
735
|
public:
|
642
736
|
using BaseType = T;
|
643
737
|
|
644
738
|
static constexpr CTypeInfo Build() {
|
645
739
|
constexpr CTypeInfo::Flags kFlags =
|
646
|
-
MergeFlags(TypeInfoHelper<T>::Flags(), Flags...);
|
647
|
-
constexpr CTypeInfo::Type kType = TypeInfoHelper<T>::Type();
|
740
|
+
MergeFlags(internal::TypeInfoHelper<T>::Flags(), Flags...);
|
741
|
+
constexpr CTypeInfo::Type kType = internal::TypeInfoHelper<T>::Type();
|
648
742
|
constexpr CTypeInfo::SequenceType kSequenceType =
|
649
|
-
TypeInfoHelper<T>::SequenceType();
|
743
|
+
internal::TypeInfoHelper<T>::SequenceType();
|
650
744
|
|
651
745
|
STATIC_ASSERT_IMPLIES(
|
652
746
|
uint8_t(kFlags) & uint8_t(CTypeInfo::Flags::kAllowSharedBit),
|
@@ -674,8 +768,8 @@ class CTypeInfoBuilder {
|
|
674
768
|
"TypedArrays are only supported from primitive types or void.");
|
675
769
|
|
676
770
|
// Return the same type with the merged flags.
|
677
|
-
return CTypeInfo(TypeInfoHelper<T>::Type(),
|
678
|
-
TypeInfoHelper<T>::SequenceType(), kFlags);
|
771
|
+
return CTypeInfo(internal::TypeInfoHelper<T>::Type(),
|
772
|
+
internal::TypeInfoHelper<T>::SequenceType(), kFlags);
|
679
773
|
}
|
680
774
|
|
681
775
|
private:
|
@@ -687,6 +781,7 @@ class CTypeInfoBuilder {
|
|
687
781
|
static constexpr CTypeInfo::Flags MergeFlags() { return CTypeInfo::Flags(0); }
|
688
782
|
};
|
689
783
|
|
784
|
+
namespace internal {
|
690
785
|
template <typename RetBuilder, typename... ArgBuilders>
|
691
786
|
class CFunctionBuilderWithFunction {
|
692
787
|
public:
|
@@ -770,6 +865,10 @@ CFunction CFunction::ArgUnwrap<R (*)(Args...)>::Make(R (*func)(Args...)) {
|
|
770
865
|
|
771
866
|
using CFunctionBuilder = internal::CFunctionBuilder;
|
772
867
|
|
868
|
+
static constexpr CTypeInfo kTypeInfoInt32 = CTypeInfo(CTypeInfo::Type::kInt32);
|
869
|
+
static constexpr CTypeInfo kTypeInfoFloat64 =
|
870
|
+
CTypeInfo(CTypeInfo::Type::kFloat64);
|
871
|
+
|
773
872
|
/**
|
774
873
|
* Copies the contents of this JavaScript array to a C++ buffer with
|
775
874
|
* a given max_length. A CTypeInfo is passed as an argument,
|
@@ -783,8 +882,57 @@ using CFunctionBuilder = internal::CFunctionBuilder;
|
|
783
882
|
* returns true on success. `type_info` will be used for conversions.
|
784
883
|
*/
|
785
884
|
template <const CTypeInfo* type_info, typename T>
|
786
|
-
|
787
|
-
|
885
|
+
V8_DEPRECATED(
|
886
|
+
"Use TryToCopyAndConvertArrayToCppBuffer<CTypeInfo::Identifier, T>()")
|
887
|
+
bool V8_EXPORT V8_WARN_UNUSED_RESULT
|
888
|
+
TryCopyAndConvertArrayToCppBuffer(Local<Array> src, T* dst,
|
889
|
+
uint32_t max_length);
|
890
|
+
|
891
|
+
template <>
|
892
|
+
V8_DEPRECATED(
|
893
|
+
"Use TryToCopyAndConvertArrayToCppBuffer<CTypeInfo::Identifier, T>()")
|
894
|
+
inline bool V8_WARN_UNUSED_RESULT
|
895
|
+
TryCopyAndConvertArrayToCppBuffer<&kTypeInfoInt32, int32_t>(
|
896
|
+
Local<Array> src, int32_t* dst, uint32_t max_length) {
|
897
|
+
return false;
|
898
|
+
}
|
899
|
+
|
900
|
+
template <>
|
901
|
+
V8_DEPRECATED(
|
902
|
+
"Use TryToCopyAndConvertArrayToCppBuffer<CTypeInfo::Identifier, T>()")
|
903
|
+
inline bool V8_WARN_UNUSED_RESULT
|
904
|
+
TryCopyAndConvertArrayToCppBuffer<&kTypeInfoFloat64, double>(
|
905
|
+
Local<Array> src, double* dst, uint32_t max_length) {
|
906
|
+
return false;
|
907
|
+
}
|
908
|
+
|
909
|
+
template <CTypeInfo::Identifier type_info_id, typename T>
|
910
|
+
bool V8_EXPORT V8_WARN_UNUSED_RESULT TryToCopyAndConvertArrayToCppBuffer(
|
911
|
+
Local<Array> src, T* dst, uint32_t max_length);
|
912
|
+
|
913
|
+
template <>
|
914
|
+
bool V8_EXPORT V8_WARN_UNUSED_RESULT
|
915
|
+
TryToCopyAndConvertArrayToCppBuffer<CTypeInfoBuilder<int32_t>::Build().GetId(),
|
916
|
+
int32_t>(Local<Array> src, int32_t* dst,
|
917
|
+
uint32_t max_length);
|
918
|
+
|
919
|
+
template <>
|
920
|
+
bool V8_EXPORT V8_WARN_UNUSED_RESULT
|
921
|
+
TryToCopyAndConvertArrayToCppBuffer<CTypeInfoBuilder<uint32_t>::Build().GetId(),
|
922
|
+
uint32_t>(Local<Array> src, uint32_t* dst,
|
923
|
+
uint32_t max_length);
|
924
|
+
|
925
|
+
template <>
|
926
|
+
bool V8_EXPORT V8_WARN_UNUSED_RESULT
|
927
|
+
TryToCopyAndConvertArrayToCppBuffer<CTypeInfoBuilder<float>::Build().GetId(),
|
928
|
+
float>(Local<Array> src, float* dst,
|
929
|
+
uint32_t max_length);
|
930
|
+
|
931
|
+
template <>
|
932
|
+
bool V8_EXPORT V8_WARN_UNUSED_RESULT
|
933
|
+
TryToCopyAndConvertArrayToCppBuffer<CTypeInfoBuilder<double>::Build().GetId(),
|
934
|
+
double>(Local<Array> src, double* dst,
|
935
|
+
uint32_t max_length);
|
788
936
|
|
789
937
|
} // namespace v8
|
790
938
|
|
@@ -0,0 +1,81 @@
|
|
1
|
+
// Copyright 2021 the V8 project authors. All rights reserved.
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
3
|
+
// found in the LICENSE file.
|
4
|
+
|
5
|
+
#ifndef INCLUDE_V8_FORWARD_H_
|
6
|
+
#define INCLUDE_V8_FORWARD_H_
|
7
|
+
|
8
|
+
// This header is intended to be used by headers that pass around V8 types,
|
9
|
+
// either by pointer or using Local<Type>. The full definitions can be included
|
10
|
+
// either via v8.h or the more fine-grained headers.
|
11
|
+
|
12
|
+
#include "v8-local-handle.h" // NOLINT(build/include_directory)
|
13
|
+
|
14
|
+
namespace v8 {
|
15
|
+
|
16
|
+
class AccessorSignature;
|
17
|
+
class Array;
|
18
|
+
class ArrayBuffer;
|
19
|
+
class ArrayBufferView;
|
20
|
+
class BigInt;
|
21
|
+
class BigInt64Array;
|
22
|
+
class BigIntObject;
|
23
|
+
class BigUint64Array;
|
24
|
+
class Boolean;
|
25
|
+
class BooleanObject;
|
26
|
+
class Context;
|
27
|
+
class DataView;
|
28
|
+
class Data;
|
29
|
+
class Date;
|
30
|
+
class Extension;
|
31
|
+
class External;
|
32
|
+
class FixedArray;
|
33
|
+
class Float32Array;
|
34
|
+
class Float64Array;
|
35
|
+
class Function;
|
36
|
+
template <class F>
|
37
|
+
class FunctionCallbackInfo;
|
38
|
+
class FunctionTemplate;
|
39
|
+
class Int16Array;
|
40
|
+
class Int32;
|
41
|
+
class Int32Array;
|
42
|
+
class Int8Array;
|
43
|
+
class Integer;
|
44
|
+
class Isolate;
|
45
|
+
class Map;
|
46
|
+
class Module;
|
47
|
+
class Name;
|
48
|
+
class Number;
|
49
|
+
class NumberObject;
|
50
|
+
class Object;
|
51
|
+
class ObjectTemplate;
|
52
|
+
class Platform;
|
53
|
+
class Primitive;
|
54
|
+
class Private;
|
55
|
+
class Promise;
|
56
|
+
class Proxy;
|
57
|
+
class RegExp;
|
58
|
+
class Script;
|
59
|
+
class Set;
|
60
|
+
class SharedArrayBuffer;
|
61
|
+
class Signature;
|
62
|
+
class String;
|
63
|
+
class StringObject;
|
64
|
+
class Symbol;
|
65
|
+
class SymbolObject;
|
66
|
+
class Template;
|
67
|
+
class TryCatch;
|
68
|
+
class TypedArray;
|
69
|
+
class Uint16Array;
|
70
|
+
class Uint32;
|
71
|
+
class Uint32Array;
|
72
|
+
class Uint8Array;
|
73
|
+
class Uint8ClampedArray;
|
74
|
+
class UnboundModuleScript;
|
75
|
+
class Value;
|
76
|
+
class WasmMemoryObject;
|
77
|
+
class WasmModuleObject;
|
78
|
+
|
79
|
+
} // namespace v8
|
80
|
+
|
81
|
+
#endif // INCLUDE_V8_FORWARD_H_
|