libv8-node 22.7.0.4-x86_64-linux-musl → 24.1.0.0-x86_64-linux-musl
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/lib/libv8/node/version.rb +3 -3
- data/vendor/v8/include/cppgc/allocation.h +11 -13
- data/vendor/v8/include/cppgc/default-platform.h +3 -2
- data/vendor/v8/include/cppgc/garbage-collected.h +8 -0
- data/vendor/v8/include/cppgc/heap-consistency.h +1 -1
- data/vendor/v8/include/cppgc/heap-statistics.h +2 -0
- data/vendor/v8/include/cppgc/internal/api-constants.h +2 -14
- data/vendor/v8/include/cppgc/internal/base-page-handle.h +2 -4
- data/vendor/v8/include/cppgc/internal/caged-heap-local-data.h +0 -4
- data/vendor/v8/include/cppgc/internal/caged-heap.h +0 -4
- data/vendor/v8/include/cppgc/internal/compiler-specific.h +9 -1
- data/vendor/v8/include/cppgc/internal/conditional-stack-allocated.h +41 -0
- data/vendor/v8/include/cppgc/internal/gc-info.h +12 -10
- data/vendor/v8/include/cppgc/internal/logging.h +3 -3
- data/vendor/v8/include/cppgc/internal/member-storage.h +69 -20
- data/vendor/v8/include/cppgc/internal/name-trait.h +5 -1
- data/vendor/v8/include/cppgc/internal/persistent-node.h +8 -3
- data/vendor/v8/include/cppgc/internal/pointer-policies.h +48 -11
- data/vendor/v8/include/cppgc/macros.h +21 -0
- data/vendor/v8/include/cppgc/member.h +70 -36
- data/vendor/v8/include/cppgc/name-provider.h +10 -0
- data/vendor/v8/include/cppgc/platform.h +11 -0
- data/vendor/v8/include/cppgc/type-traits.h +1 -0
- data/vendor/v8/include/cppgc/visitor.h +25 -1
- data/vendor/v8/include/libplatform/libplatform-export.h +2 -2
- data/vendor/v8/include/libplatform/v8-tracing.h +0 -1
- data/vendor/v8/include/v8-array-buffer.h +143 -46
- data/vendor/v8/include/v8-callbacks.h +94 -31
- data/vendor/v8/include/v8-context.h +48 -15
- data/vendor/v8/include/v8-cppgc.h +5 -56
- data/vendor/v8/include/v8-data.h +5 -0
- data/vendor/v8/include/v8-date.h +9 -0
- data/vendor/v8/include/v8-debug.h +11 -0
- data/vendor/v8/include/v8-embedder-heap.h +1 -29
- data/vendor/v8/include/v8-exception.h +72 -0
- data/vendor/v8/include/v8-external-memory-accounter.h +60 -0
- data/vendor/v8/include/v8-fast-api-calls.h +41 -206
- data/vendor/v8/include/v8-function-callback.h +190 -78
- data/vendor/v8/include/v8-function.h +11 -3
- data/vendor/v8/include/v8-handle-base.h +20 -2
- data/vendor/v8/include/v8-initialization.h +26 -1
- data/vendor/v8/include/v8-inspector.h +10 -3
- data/vendor/v8/include/v8-internal.h +638 -315
- data/vendor/v8/include/v8-isolate.h +275 -189
- data/vendor/v8/include/v8-local-handle.h +69 -42
- data/vendor/v8/include/v8-maybe.h +2 -1
- data/vendor/v8/include/v8-memory-span.h +149 -24
- data/vendor/v8/include/v8-message.h +9 -22
- data/vendor/v8/include/v8-metrics.h +14 -0
- data/vendor/v8/include/v8-microtask-queue.h +0 -5
- data/vendor/v8/include/v8-object.h +291 -37
- data/vendor/v8/include/v8-persistent-handle.h +17 -36
- data/vendor/v8/include/v8-platform.h +66 -45
- data/vendor/v8/include/v8-primitive.h +221 -5
- data/vendor/v8/include/v8-profiler.h +51 -2
- data/vendor/v8/include/v8-promise.h +2 -2
- data/vendor/v8/include/v8-proxy.h +0 -1
- data/vendor/v8/include/v8-regexp.h +0 -1
- data/vendor/v8/include/v8-sandbox.h +173 -0
- data/vendor/v8/include/v8-script.h +65 -17
- data/vendor/v8/include/v8-snapshot.h +38 -2
- data/vendor/v8/include/v8-source-location.h +6 -1
- data/vendor/v8/include/v8-template.h +111 -263
- data/vendor/v8/include/v8-trace-categories.h +23 -0
- data/vendor/v8/include/v8-traced-handle.h +20 -32
- data/vendor/v8/include/v8-typed-array.h +6 -10
- data/vendor/v8/include/v8-unwinder-state.h +2 -3
- data/vendor/v8/include/v8-unwinder.h +2 -1
- data/vendor/v8/include/v8-util.h +1 -117
- data/vendor/v8/include/v8-value-serializer-version.h +3 -3
- data/vendor/v8/include/v8-value.h +21 -2
- data/vendor/v8/include/v8-version.h +4 -4
- data/vendor/v8/include/v8-wasm.h +27 -0
- data/vendor/v8/include/v8-weak-callback-info.h +20 -12
- data/vendor/v8/include/v8.h +3 -3
- data/vendor/v8/include/v8config.h +83 -45
- data/vendor/v8/x86_64-linux-musl/libv8/obj/libv8_monolith.a +0 -0
- metadata +6 -3
- data/vendor/v8/include/cppgc/ephemeron-pair.h +0 -30
@@ -2,6 +2,9 @@
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
3
3
|
// found in the LICENSE file.
|
4
4
|
|
5
|
+
#ifndef INCLUDE_V8_FAST_API_CALLS_H_
|
6
|
+
#define INCLUDE_V8_FAST_API_CALLS_H_
|
7
|
+
|
5
8
|
/**
|
6
9
|
* This file provides additional API on top of the default one for making
|
7
10
|
* API calls, which come from embedder C++ functions. The functions are being
|
@@ -216,9 +219,6 @@
|
|
216
219
|
* associated SlowCallback.
|
217
220
|
*/
|
218
221
|
|
219
|
-
#ifndef INCLUDE_V8_FAST_API_CALLS_H_
|
220
|
-
#define INCLUDE_V8_FAST_API_CALLS_H_
|
221
|
-
|
222
222
|
#include <stddef.h>
|
223
223
|
#include <stdint.h>
|
224
224
|
|
@@ -235,6 +235,7 @@ namespace v8 {
|
|
235
235
|
|
236
236
|
class Isolate;
|
237
237
|
|
238
|
+
START_ALLOW_USE_DEPRECATED()
|
238
239
|
class CTypeInfo {
|
239
240
|
public:
|
240
241
|
enum class Type : uint8_t {
|
@@ -268,11 +269,11 @@ class CTypeInfo {
|
|
268
269
|
// than any valid Type enum.
|
269
270
|
static constexpr Type kCallbackOptionsType = Type(255);
|
270
271
|
|
271
|
-
enum class
|
272
|
+
enum class V8_DEPRECATE_SOON(
|
273
|
+
"There is no special support in V8 anymore, there is no need to"
|
274
|
+
"use a SequenceType") SequenceType : uint8_t {
|
272
275
|
kScalar,
|
273
276
|
kIsSequence, // sequence<T>
|
274
|
-
kIsTypedArray, // TypedArray of T or any ArrayBufferView if T
|
275
|
-
// is void
|
276
277
|
kIsArrayBuffer // ArrayBuffer
|
277
278
|
};
|
278
279
|
|
@@ -284,9 +285,12 @@ class CTypeInfo {
|
|
284
285
|
kIsRestrictedBit = 1 << 3, // T must be float or double
|
285
286
|
};
|
286
287
|
|
287
|
-
explicit constexpr CTypeInfo(
|
288
|
-
|
289
|
-
|
288
|
+
explicit constexpr CTypeInfo(Type type, Flags flags = Flags::kNone)
|
289
|
+
: type_(type), sequence_type_(SequenceType::kScalar), flags_(flags) {}
|
290
|
+
|
291
|
+
V8_DEPRECATE_SOON("Use CTypeInfo(Type, Flags) instead")
|
292
|
+
constexpr CTypeInfo(Type type, SequenceType sequence_type,
|
293
|
+
Flags flags = Flags::kNone)
|
290
294
|
: type_(type), sequence_type_(sequence_type), flags_(flags) {}
|
291
295
|
|
292
296
|
typedef uint32_t Identifier;
|
@@ -301,6 +305,7 @@ class CTypeInfo {
|
|
301
305
|
}
|
302
306
|
|
303
307
|
constexpr Type GetType() const { return type_; }
|
308
|
+
V8_DEPRECATE_SOON("Use the constant SequenceType::kScalar instead")
|
304
309
|
constexpr SequenceType GetSequenceType() const { return sequence_type_; }
|
305
310
|
constexpr Flags GetFlags() const { return flags_; }
|
306
311
|
|
@@ -324,63 +329,7 @@ class CTypeInfo {
|
|
324
329
|
SequenceType sequence_type_;
|
325
330
|
Flags flags_;
|
326
331
|
};
|
327
|
-
|
328
|
-
struct FastApiTypedArrayBase {
|
329
|
-
public:
|
330
|
-
// Returns the length in number of elements.
|
331
|
-
size_t V8_EXPORT length() const { return length_; }
|
332
|
-
// Checks whether the given index is within the bounds of the collection.
|
333
|
-
void V8_EXPORT ValidateIndex(size_t index) const;
|
334
|
-
|
335
|
-
protected:
|
336
|
-
size_t length_ = 0;
|
337
|
-
};
|
338
|
-
|
339
|
-
template <typename T>
|
340
|
-
struct FastApiTypedArray : public FastApiTypedArrayBase {
|
341
|
-
public:
|
342
|
-
V8_INLINE T get(size_t index) const {
|
343
|
-
#ifdef DEBUG
|
344
|
-
ValidateIndex(index);
|
345
|
-
#endif // DEBUG
|
346
|
-
T tmp;
|
347
|
-
memcpy(&tmp, static_cast<void*>(reinterpret_cast<T*>(data_) + index),
|
348
|
-
sizeof(T));
|
349
|
-
return tmp;
|
350
|
-
}
|
351
|
-
|
352
|
-
bool getStorageIfAligned(T** elements) const {
|
353
|
-
if (reinterpret_cast<uintptr_t>(data_) % alignof(T) != 0) {
|
354
|
-
return false;
|
355
|
-
}
|
356
|
-
*elements = reinterpret_cast<T*>(data_);
|
357
|
-
return true;
|
358
|
-
}
|
359
|
-
|
360
|
-
private:
|
361
|
-
// This pointer should include the typed array offset applied.
|
362
|
-
// It's not guaranteed that it's aligned to sizeof(T), it's only
|
363
|
-
// guaranteed that it's 4-byte aligned, so for 8-byte types we need to
|
364
|
-
// provide a special implementation for reading from it, which hides
|
365
|
-
// the possibly unaligned read in the `get` method.
|
366
|
-
void* data_;
|
367
|
-
};
|
368
|
-
|
369
|
-
// Any TypedArray. It uses kTypedArrayBit with base type void
|
370
|
-
// Overloaded args of ArrayBufferView and TypedArray are not supported
|
371
|
-
// (for now) because the generic “any” ArrayBufferView doesn’t have its
|
372
|
-
// own instance type. It could be supported if we specify that
|
373
|
-
// TypedArray<T> always has precedence over the generic ArrayBufferView,
|
374
|
-
// but this complicates overload resolution.
|
375
|
-
struct FastApiArrayBufferView {
|
376
|
-
void* data;
|
377
|
-
size_t byte_length;
|
378
|
-
};
|
379
|
-
|
380
|
-
struct FastApiArrayBuffer {
|
381
|
-
void* data;
|
382
|
-
size_t byte_length;
|
383
|
-
};
|
332
|
+
END_ALLOW_USE_DEPRECATED()
|
384
333
|
|
385
334
|
struct FastOneByteString {
|
386
335
|
const char* data;
|
@@ -458,13 +407,6 @@ union V8_TRIVIAL_ABI AnyCType {
|
|
458
407
|
void* pointer_value;
|
459
408
|
Local<Object> object_value;
|
460
409
|
Local<Array> sequence_value;
|
461
|
-
const FastApiTypedArray<uint8_t>* uint8_ta_value;
|
462
|
-
const FastApiTypedArray<int32_t>* int32_ta_value;
|
463
|
-
const FastApiTypedArray<uint32_t>* uint32_ta_value;
|
464
|
-
const FastApiTypedArray<int64_t>* int64_ta_value;
|
465
|
-
const FastApiTypedArray<uint64_t>* uint64_ta_value;
|
466
|
-
const FastApiTypedArray<float>* float_ta_value;
|
467
|
-
const FastApiTypedArray<double>* double_ta_value;
|
468
410
|
const FastOneByteString* string_value;
|
469
411
|
FastApiCallbackOptions* options_value;
|
470
412
|
};
|
@@ -494,51 +436,23 @@ class V8_EXPORT CFunction {
|
|
494
436
|
|
495
437
|
enum class OverloadResolution { kImpossible, kAtRuntime, kAtCompileTime };
|
496
438
|
|
497
|
-
// Returns whether an overload between this and the given CFunction can
|
498
|
-
// be resolved at runtime by the RTTI available for the arguments or at
|
499
|
-
// compile time for functions with different number of arguments.
|
500
|
-
OverloadResolution GetOverloadResolution(const CFunction* other) {
|
501
|
-
// Runtime overload resolution can only deal with functions with the
|
502
|
-
// same number of arguments. Functions with different arity are handled
|
503
|
-
// by compile time overload resolution though.
|
504
|
-
if (ArgumentCount() != other->ArgumentCount()) {
|
505
|
-
return OverloadResolution::kAtCompileTime;
|
506
|
-
}
|
507
|
-
|
508
|
-
// The functions can only differ by a single argument position.
|
509
|
-
int diff_index = -1;
|
510
|
-
for (unsigned int i = 0; i < ArgumentCount(); ++i) {
|
511
|
-
if (ArgumentInfo(i).GetSequenceType() !=
|
512
|
-
other->ArgumentInfo(i).GetSequenceType()) {
|
513
|
-
if (diff_index >= 0) {
|
514
|
-
return OverloadResolution::kImpossible;
|
515
|
-
}
|
516
|
-
diff_index = i;
|
517
|
-
|
518
|
-
// We only support overload resolution between sequence types.
|
519
|
-
if (ArgumentInfo(i).GetSequenceType() ==
|
520
|
-
CTypeInfo::SequenceType::kScalar ||
|
521
|
-
other->ArgumentInfo(i).GetSequenceType() ==
|
522
|
-
CTypeInfo::SequenceType::kScalar) {
|
523
|
-
return OverloadResolution::kImpossible;
|
524
|
-
}
|
525
|
-
}
|
526
|
-
}
|
527
|
-
|
528
|
-
return OverloadResolution::kAtRuntime;
|
529
|
-
}
|
530
|
-
|
531
439
|
template <typename F>
|
532
|
-
static CFunction Make(F* func
|
533
|
-
|
440
|
+
static CFunction Make(F* func,
|
441
|
+
CFunctionInfo::Int64Representation int64_rep =
|
442
|
+
CFunctionInfo::Int64Representation::kNumber) {
|
443
|
+
CFunction result = ArgUnwrap<F*>::Make(func, int64_rep);
|
444
|
+
result.GetInt64Representation();
|
445
|
+
return result;
|
534
446
|
}
|
535
447
|
|
536
448
|
// Provided for testing purposes.
|
537
449
|
template <typename R, typename... Args, typename R_Patch,
|
538
450
|
typename... Args_Patch>
|
539
451
|
static CFunction Make(R (*func)(Args...),
|
540
|
-
R_Patch (*patching_func)(Args_Patch...)
|
541
|
-
|
452
|
+
R_Patch (*patching_func)(Args_Patch...),
|
453
|
+
CFunctionInfo::Int64Representation int64_rep =
|
454
|
+
CFunctionInfo::Int64Representation::kNumber) {
|
455
|
+
CFunction c_func = ArgUnwrap<R (*)(Args...)>::Make(func, int64_rep);
|
542
456
|
static_assert(
|
543
457
|
sizeof...(Args_Patch) == sizeof...(Args),
|
544
458
|
"The patching function must have the same number of arguments.");
|
@@ -561,7 +475,9 @@ class V8_EXPORT CFunction {
|
|
561
475
|
template <typename R, typename... Args>
|
562
476
|
class ArgUnwrap<R (*)(Args...)> {
|
563
477
|
public:
|
564
|
-
static CFunction Make(R (*func)(Args...)
|
478
|
+
static CFunction Make(R (*func)(Args...),
|
479
|
+
CFunctionInfo::Int64Representation int64_rep =
|
480
|
+
CFunctionInfo::Int64Representation::kNumber);
|
565
481
|
};
|
566
482
|
};
|
567
483
|
|
@@ -577,35 +493,15 @@ struct FastApiCallbackOptions {
|
|
577
493
|
* returned instance may be filled with mock data.
|
578
494
|
*/
|
579
495
|
static FastApiCallbackOptions CreateForTesting(Isolate* isolate) {
|
580
|
-
return {
|
496
|
+
return {};
|
581
497
|
}
|
582
498
|
|
583
|
-
|
584
|
-
* If the callback wants to signal an error condition or to perform an
|
585
|
-
* allocation, it must set options.fallback to true and do an early return
|
586
|
-
* from the fast method. Then V8 checks the value of options.fallback and if
|
587
|
-
* it's true, falls back to executing the SlowCallback, which is capable of
|
588
|
-
* reporting the error (either by throwing a JS exception or logging to the
|
589
|
-
* console) or doing the allocation. It's the embedder's responsibility to
|
590
|
-
* ensure that the fast callback is idempotent up to the point where error and
|
591
|
-
* fallback conditions are checked, because otherwise executing the slow
|
592
|
-
* callback might produce visible side-effects twice.
|
593
|
-
*/
|
594
|
-
bool fallback;
|
499
|
+
v8::Isolate* isolate = nullptr;
|
595
500
|
|
596
501
|
/**
|
597
502
|
* The `data` passed to the FunctionTemplate constructor, or `undefined`.
|
598
|
-
* `data_ptr` allows for default constructing FastApiCallbackOptions.
|
599
503
|
*/
|
600
|
-
|
601
|
-
uintptr_t data_ptr;
|
602
|
-
v8::Local<v8::Value> data;
|
603
|
-
};
|
604
|
-
|
605
|
-
/**
|
606
|
-
* When called from WebAssembly, a view of the calling module's memory.
|
607
|
-
*/
|
608
|
-
FastApiTypedArray<uint8_t>* const wasm_memory;
|
504
|
+
v8::Local<v8::Value> data;
|
609
505
|
};
|
610
506
|
|
611
507
|
namespace internal {
|
@@ -669,9 +565,6 @@ struct TypeInfoHelper {
|
|
669
565
|
} \
|
670
566
|
\
|
671
567
|
static constexpr CTypeInfo::Type Type() { return CTypeInfo::Type::Enum; } \
|
672
|
-
static constexpr CTypeInfo::SequenceType SequenceType() { \
|
673
|
-
return CTypeInfo::SequenceType::kScalar; \
|
674
|
-
} \
|
675
568
|
};
|
676
569
|
|
677
570
|
template <CTypeInfo::Type type>
|
@@ -700,6 +593,7 @@ struct CTypeInfoTraits {};
|
|
700
593
|
V(void, kVoid) \
|
701
594
|
V(v8::Local<v8::Value>, kV8Value) \
|
702
595
|
V(v8::Local<v8::Object>, kV8Value) \
|
596
|
+
V(v8::Local<v8::Array>, kV8Value) \
|
703
597
|
V(AnyCType, kAny)
|
704
598
|
|
705
599
|
// ApiObject was a temporary solution to wrap the pointer to the v8::Value.
|
@@ -712,52 +606,8 @@ PRIMITIVE_C_TYPES(DEFINE_TYPE_INFO_TRAITS)
|
|
712
606
|
#undef PRIMITIVE_C_TYPES
|
713
607
|
#undef ALL_C_TYPES
|
714
608
|
|
715
|
-
#define SPECIALIZE_GET_TYPE_INFO_HELPER_FOR_TA(T, Enum) \
|
716
|
-
template <> \
|
717
|
-
struct TypeInfoHelper<const FastApiTypedArray<T>&> { \
|
718
|
-
static constexpr CTypeInfo::Flags Flags() { \
|
719
|
-
return CTypeInfo::Flags::kNone; \
|
720
|
-
} \
|
721
|
-
\
|
722
|
-
static constexpr CTypeInfo::Type Type() { return CTypeInfo::Type::Enum; } \
|
723
|
-
static constexpr CTypeInfo::SequenceType SequenceType() { \
|
724
|
-
return CTypeInfo::SequenceType::kIsTypedArray; \
|
725
|
-
} \
|
726
|
-
};
|
727
|
-
|
728
|
-
#define TYPED_ARRAY_C_TYPES(V) \
|
729
|
-
V(uint8_t, kUint8) \
|
730
|
-
V(int32_t, kInt32) \
|
731
|
-
V(uint32_t, kUint32) \
|
732
|
-
V(int64_t, kInt64) \
|
733
|
-
V(uint64_t, kUint64) \
|
734
|
-
V(float, kFloat32) \
|
735
|
-
V(double, kFloat64)
|
736
|
-
|
737
|
-
TYPED_ARRAY_C_TYPES(SPECIALIZE_GET_TYPE_INFO_HELPER_FOR_TA)
|
738
|
-
|
739
609
|
#undef TYPED_ARRAY_C_TYPES
|
740
610
|
|
741
|
-
template <>
|
742
|
-
struct TypeInfoHelper<v8::Local<v8::Array>> {
|
743
|
-
static constexpr CTypeInfo::Flags Flags() { return CTypeInfo::Flags::kNone; }
|
744
|
-
|
745
|
-
static constexpr CTypeInfo::Type Type() { return CTypeInfo::Type::kVoid; }
|
746
|
-
static constexpr CTypeInfo::SequenceType SequenceType() {
|
747
|
-
return CTypeInfo::SequenceType::kIsSequence;
|
748
|
-
}
|
749
|
-
};
|
750
|
-
|
751
|
-
template <>
|
752
|
-
struct TypeInfoHelper<v8::Local<v8::Uint32Array>> {
|
753
|
-
static constexpr CTypeInfo::Flags Flags() { return CTypeInfo::Flags::kNone; }
|
754
|
-
|
755
|
-
static constexpr CTypeInfo::Type Type() { return CTypeInfo::Type::kUint32; }
|
756
|
-
static constexpr CTypeInfo::SequenceType SequenceType() {
|
757
|
-
return CTypeInfo::SequenceType::kIsTypedArray;
|
758
|
-
}
|
759
|
-
};
|
760
|
-
|
761
611
|
template <>
|
762
612
|
struct TypeInfoHelper<FastApiCallbackOptions&> {
|
763
613
|
static constexpr CTypeInfo::Flags Flags() { return CTypeInfo::Flags::kNone; }
|
@@ -765,9 +615,6 @@ struct TypeInfoHelper<FastApiCallbackOptions&> {
|
|
765
615
|
static constexpr CTypeInfo::Type Type() {
|
766
616
|
return CTypeInfo::kCallbackOptionsType;
|
767
617
|
}
|
768
|
-
static constexpr CTypeInfo::SequenceType SequenceType() {
|
769
|
-
return CTypeInfo::SequenceType::kScalar;
|
770
|
-
}
|
771
618
|
};
|
772
619
|
|
773
620
|
template <>
|
@@ -777,9 +624,6 @@ struct TypeInfoHelper<const FastOneByteString&> {
|
|
777
624
|
static constexpr CTypeInfo::Type Type() {
|
778
625
|
return CTypeInfo::Type::kSeqOneByteString;
|
779
626
|
}
|
780
|
-
static constexpr CTypeInfo::SequenceType SequenceType() {
|
781
|
-
return CTypeInfo::SequenceType::kScalar;
|
782
|
-
}
|
783
627
|
};
|
784
628
|
|
785
629
|
#define STATIC_ASSERT_IMPLIES(COND, ASSERTION, MSG) \
|
@@ -796,14 +640,7 @@ class V8_EXPORT CTypeInfoBuilder {
|
|
796
640
|
constexpr CTypeInfo::Flags kFlags =
|
797
641
|
MergeFlags(internal::TypeInfoHelper<T>::Flags(), Flags...);
|
798
642
|
constexpr CTypeInfo::Type kType = internal::TypeInfoHelper<T>::Type();
|
799
|
-
constexpr CTypeInfo::SequenceType kSequenceType =
|
800
|
-
internal::TypeInfoHelper<T>::SequenceType();
|
801
643
|
|
802
|
-
STATIC_ASSERT_IMPLIES(
|
803
|
-
uint8_t(kFlags) & uint8_t(CTypeInfo::Flags::kAllowSharedBit),
|
804
|
-
(kSequenceType == CTypeInfo::SequenceType::kIsTypedArray ||
|
805
|
-
kSequenceType == CTypeInfo::SequenceType::kIsArrayBuffer),
|
806
|
-
"kAllowSharedBit is only allowed for TypedArrays and ArrayBuffers.");
|
807
644
|
STATIC_ASSERT_IMPLIES(
|
808
645
|
uint8_t(kFlags) & uint8_t(CTypeInfo::Flags::kEnforceRangeBit),
|
809
646
|
CTypeInfo::IsIntegralType(kType),
|
@@ -816,17 +653,9 @@ class V8_EXPORT CTypeInfoBuilder {
|
|
816
653
|
uint8_t(kFlags) & uint8_t(CTypeInfo::Flags::kIsRestrictedBit),
|
817
654
|
CTypeInfo::IsFloatingPointType(kType),
|
818
655
|
"kIsRestrictedBit is only allowed for floating point types.");
|
819
|
-
STATIC_ASSERT_IMPLIES(kSequenceType == CTypeInfo::SequenceType::kIsSequence,
|
820
|
-
kType == CTypeInfo::Type::kVoid,
|
821
|
-
"Sequences are only supported from void type.");
|
822
|
-
STATIC_ASSERT_IMPLIES(
|
823
|
-
kSequenceType == CTypeInfo::SequenceType::kIsTypedArray,
|
824
|
-
CTypeInfo::IsPrimitive(kType) || kType == CTypeInfo::Type::kVoid,
|
825
|
-
"TypedArrays are only supported from primitive types or void.");
|
826
656
|
|
827
657
|
// Return the same type with the merged flags.
|
828
|
-
return CTypeInfo(internal::TypeInfoHelper<T>::Type(),
|
829
|
-
internal::TypeInfoHelper<T>::SequenceType(), kFlags);
|
658
|
+
return CTypeInfo(internal::TypeInfoHelper<T>::Type(), kFlags);
|
830
659
|
}
|
831
660
|
|
832
661
|
private:
|
@@ -929,8 +758,14 @@ class CFunctionBuilder {
|
|
929
758
|
|
930
759
|
// static
|
931
760
|
template <typename R, typename... Args>
|
932
|
-
CFunction CFunction::ArgUnwrap<R (*)(Args...)>::Make(
|
933
|
-
|
761
|
+
CFunction CFunction::ArgUnwrap<R (*)(Args...)>::Make(
|
762
|
+
R (*func)(Args...), CFunctionInfo::Int64Representation int64_rep) {
|
763
|
+
if (int64_rep == CFunctionInfo::Int64Representation::kNumber) {
|
764
|
+
return internal::CFunctionBuilder().Fn(func).Build();
|
765
|
+
}
|
766
|
+
return internal::CFunctionBuilder()
|
767
|
+
.Fn(func)
|
768
|
+
.template Build<CFunctionInfo::Int64Representation::kBigInt>();
|
934
769
|
}
|
935
770
|
|
936
771
|
using CFunctionBuilder = internal::CFunctionBuilder;
|