Loading...
Searching...
No Matches
v8-function-callback.h
Go to the documentation of this file.
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_FUNCTION_CALLBACK_H_
6#define INCLUDE_V8_FUNCTION_CALLBACK_H_
7
8#include <cstdint>
9#include <limits>
10
11#include "v8-internal.h" // NOLINT(build/include_directory)
12#include "v8-local-handle.h" // NOLINT(build/include_directory)
13#include "v8-primitive.h" // NOLINT(build/include_directory)
14#include "v8config.h" // NOLINT(build/include_directory)
15
16namespace v8 {
17
18template <typename T>
19class BasicTracedReference;
20template <typename T>
21class Global;
22class Object;
23class Value;
24
25namespace internal {
26class FunctionCallbackArguments;
27class PropertyCallbackArguments;
28class Builtins;
29} // namespace internal
30
31namespace debug {
32class ConsoleCallArguments;
33} // namespace debug
34
35namespace api_internal {
37 v8::Isolate* isolate, v8::Local<v8::Data> raw_target);
38} // namespace api_internal
39
40template <typename T>
42 public:
43 template <class S>
44 V8_INLINE ReturnValue(const ReturnValue<S>& that) : value_(that.value_) {
45 static_assert(std::is_base_of_v<T, S>, "type check");
46 }
47 // Handle-based setters.
48 template <typename S>
49 V8_INLINE void Set(const Global<S>& handle);
50 template <typename S>
51 V8_INLINE void SetNonEmpty(const Global<S>& handle);
52 template <typename S>
53 V8_INLINE void Set(const BasicTracedReference<S>& handle);
54 template <typename S>
56 template <typename S>
57 V8_INLINE void Set(const Local<S> handle);
58 template <typename S>
59 V8_INLINE void SetNonEmpty(const Local<S> handle);
60
61 // Fast primitive number setters.
62 V8_INLINE void Set(bool value);
63 V8_INLINE void Set(double i);
64 V8_INLINE void Set(int16_t i);
65 V8_INLINE void Set(int32_t i);
66 V8_INLINE void Set(int64_t i);
67 V8_INLINE void Set(uint16_t i);
68 V8_INLINE void Set(uint32_t i);
69 V8_INLINE void Set(uint64_t i);
70
71 // Fast JS primitive setters.
72 V8_INLINE void SetNull();
74 V8_INLINE void SetFalse();
76
77 // Convenience getter for the Isolate.
79
80 // Pointer setter: Uncompilable to prevent inadvertent misuse.
81 template <typename S>
82 V8_INLINE void Set(S* whatever);
83
84 // Getter. Creates a new Local<> so it comes with a certain performance
85 // hit. If the ReturnValue was not yet set, this will return the undefined
86 // value.
88
89 private:
90 template <class F>
91 friend class ReturnValue;
92 template <class F>
94 template <class F>
96 template <class F, class G, class H>
98 V8_INLINE void SetInternal(internal::Address value);
99 // Default value depends on <T>:
100 // - <void> -> true_value,
101 // - <v8::Boolean> -> true_value,
102 // - <v8::Integer> -> 0,
103 // - <v8::Value> -> undefined_value,
104 // - <v8::Array> -> undefined_value.
105 V8_INLINE void SetDefaultValue();
107
108 // See FunctionCallbackInfo.
109 static constexpr int kIsolateValueIndex = -1;
110
111 internal::Address* value_;
112};
113
120template <typename T>
122 public:
124 V8_INLINE int Length() const;
129 V8_INLINE Local<Value> operator[](int i) const;
135 V8_INLINE bool IsConstructCall() const;
142
143 private:
148 using I = internal::Internals;
149
150 // Frame block, matches the layout of ApiCallbackExitFrame.
151 // See ApiCallbackExitFrameConstants.
152 enum {
153 //
154 // Optional frame arguments block (exists only for API_CONSTRUCT_EXIT
155 // frame).
156
157 // Frame arguments block.
158 kNewTargetIndex = -1,
159
160 //
161 // Mandatory part, exists for both API_CALLBACK_EXIT and API_CONSTRUCT_EXIT
162 // frames.
163 //
164
165 // Frame arguments block.
166 kArgcIndex,
167
168 // Regular ExitFrame structure.
169 kFrameSPIndex,
170 kFrameTypeIndex,
171 kFrameConstantPoolIndex, // Optional, see I::kFrameCPSlotCount.
172 kFrameFPIndex = kFrameConstantPoolIndex + I::kFrameCPSlotCount,
173 kFramePCIndex,
174
175 // Api arguments block, starts at kFirstArgumentIndex.
176 kFirstApiArgumentIndex,
177 kIsolateIndex = kFirstApiArgumentIndex,
178 kReturnValueIndex,
179 kContextIndex,
180 kTargetIndex,
181
182 // JS args block, starts at kFrameFirstImplicitArgsIndex.
183 kReceiverIndex,
184 kFirstJSArgumentIndex,
185
186 // Mandatory part includes receiver.
187 kArgsLength = kReceiverIndex + 1,
188 // Optional part size (exists only for API_CONSTRUCT_EXIT frame).
189 kOptionalArgsLength = 1,
190
191 // The length of just Api arguments part.
192 kApiArgsLength = kReceiverIndex - kFirstApiArgumentIndex,
193 };
194
195 static_assert(kArgcIndex == 0);
197 kIsolateIndex - kReturnValueIndex);
198
199 internal::Address* address_of_first_argument() const {
200 return &values_[kFirstJSArgumentIndex];
201 }
202
203 V8_INLINE FunctionCallbackInfo() = default;
204
205 // FunctionCallbackInfo object provides a view of the stack area where the
206 // data is stored and thus it's not supposed to be copyable/movable.
207 FunctionCallbackInfo(const FunctionCallbackInfo&) = delete;
208 FunctionCallbackInfo& operator=(const FunctionCallbackInfo&) = delete;
209 FunctionCallbackInfo(FunctionCallbackInfo&&) = delete;
210 FunctionCallbackInfo& operator=(FunctionCallbackInfo&&) = delete;
211
212 // Declare as mutable to let GC modify the contents of the slots even though
213 // it's not possible to change values via this class.
214 // Define the array size as 1 to make it clear that we are going to access
215 // it out-of-bounds from both sides anyway.
216 mutable internal::Address values_[1];
217};
218
223template <typename T>
225 public:
230
237
280 "Access to receiver will be deprecated soon. Use HolderV2() instead. \n"
281 "See http://crbug.com/455600234. ")
283
293
303
319
320 private:
321 template <typename U>
323 friend class MacroAssembler;
324 friend class internal::PropertyCallbackArguments;
325 friend class internal::CustomArguments<PropertyCallbackInfo>;
326 friend void internal::PrintPropertyCallbackInfo(void*);
327 using I = internal::Internals;
328
329 // ShouldThrowOnError() can return true only for setter/definer/deleter
330 // callbacks which match [[Set]]/[[DefineOwnProperty]]/[[Delete]]
331 // operations. We detect these operations by return value type - they
332 // all return boolean value, even though setter/deleter callbacks are
333 // still using v8::PropertyCallbackInfo<void>.
334 // TODO(https://crbug.com/348660658): cleanup this, once the callbacks are
335 // migrated to a new return type.
336 static constexpr bool HasShouldThrowOnError() {
337 return std::is_same_v<T, v8::Boolean> || std::is_same_v<T, void>;
338 }
339
340 // Indicates whether this is a named accessor/interceptor callback call
341 // or an indexed one.
342 V8_INLINE bool IsNamed() const;
343
344 // Frame block, matches the layout of ApiAccessorExitFrame.
345 // See ApiAccessorExitFrameConstants.
346 enum {
347 // Frame arguments block.
348 kPropertyKeyIndex,
349
350 // Regular ExitFrame structure.
351 kFrameSPIndex,
352 kFrameTypeIndex,
353 kFrameConstantPoolIndex, // Optional, see I::kFrameCPSlotCount.
354 kFrameFPIndex = kFrameConstantPoolIndex + I::kFrameCPSlotCount,
355 kFramePCIndex,
356
357 // Other arguments block, starts at kFirstArgumentIndex.
358 kFirstApiArgumentIndex,
359 kIsolateIndex = kFirstApiArgumentIndex,
360 kReturnValueIndex,
361 kCallbackInfoIndex,
362 // TODO(http://crbug.com/455600234): drop this once This() is removed.
363 kUnusedIndex, // Optional, see I::kSPAlignmentSlotCount.
364 kHolderIndex = kUnusedIndex + I::kSPAlignmentSlotCount,
365 // TODO(http://crbug.com/455600234): drop this once This() is removed.
366 kThisIndex,
367
368 //
369 // Optional part, used only by setter/definer/deleter callbacks.
370 //
371 kFirstOptionalArgument,
372 kShouldThrowOnErrorIndex = kFirstOptionalArgument,
373
374 // Used as value handle storage when called via CallApiSetter builtin.
375 kValueIndex,
376
377 kFullArgsLength,
378 kMandatoryArgsLength = kFirstOptionalArgument,
379 kOptionalArgsLength = kFullArgsLength - kFirstOptionalArgument,
380
381 // Various lengths of just Api arguments part.
382 kMandatoryApiArgsLength = kMandatoryArgsLength - kFirstApiArgumentIndex,
383 kFullApiArgsLength = kFullArgsLength - kFirstApiArgumentIndex,
384 };
385
386 // PropertyCallbackInfo object provides a view of the stack area where the
387 // data is stored and thus it's not supposed to be copyable/movable.
389 PropertyCallbackInfo& operator=(const PropertyCallbackInfo&) = delete;
391 PropertyCallbackInfo& operator=(PropertyCallbackInfo&&) = delete;
392
393 PropertyCallbackInfo() = default;
394
395 // Declare as mutable to let GC modify the contents of the slots even though
396 // it's not possible to change values via this class.
397 // Define the array size as 1 to make it clear that we are going to access
398 // it out-of-bounds anyway.
399 mutable internal::Address args_[1];
400};
401
402using FunctionCallback = void (*)(const FunctionCallbackInfo<Value>& info);
403
404// --- Implementation ---
405
406template <typename T>
407ReturnValue<T>::ReturnValue(internal::Address* slot) : value_(slot) {}
408
409template <typename T>
410void ReturnValue<T>::SetInternal(internal::Address value) {
411#if V8_STATIC_ROOTS_BOOL
412 using I = internal::Internals;
413 // Ensure that the upper 32-bits are not modified. Compiler should be
414 // able to optimize this to a store of a lower 32-bits of the value.
415 // This is fine since the callback can return only JavaScript values which
416 // are either Smis or heap objects allocated in the main cage.
417 *value_ = I::DecompressTaggedField(*value_, I::CompressTagged(value));
418#else
419 *value_ = value;
420#endif // V8_STATIC_ROOTS_BOOL
421}
422
423template <typename T>
424template <typename S>
425void ReturnValue<T>::Set(const Global<S>& handle) {
426 static_assert(std::is_base_of_v<T, S>, "type check");
427 if (V8_UNLIKELY(handle.IsEmpty())) {
428 SetDefaultValue();
429 } else {
430 SetInternal(handle.ptr());
431 }
432}
433
434template <typename T>
435template <typename S>
437 static_assert(std::is_base_of_v<T, S>, "type check");
438#ifdef V8_ENABLE_CHECKS
439 internal::VerifyHandleIsNonEmpty(handle.IsEmpty());
440#endif // V8_ENABLE_CHECKS
441 SetInternal(handle.ptr());
442}
443
444template <typename T>
445template <typename S>
447 static_assert(std::is_base_of_v<T, S>, "type check");
448 if (V8_UNLIKELY(handle.IsEmpty())) {
449 SetDefaultValue();
450 } else {
451 SetInternal(handle.ptr());
452 }
453}
454
455template <typename T>
456template <typename S>
458 static_assert(std::is_base_of_v<T, S>, "type check");
459#ifdef V8_ENABLE_CHECKS
460 internal::VerifyHandleIsNonEmpty(handle.IsEmpty());
461#endif // V8_ENABLE_CHECKS
462 SetInternal(handle.ptr());
463}
464
465template <typename T>
466template <typename S>
467void ReturnValue<T>::Set(const Local<S> handle) {
468 static_assert(std::is_base_of_v<T, S>, "type check");
469 if (V8_UNLIKELY(handle.IsEmpty())) {
470 SetDefaultValue();
471 } else {
472 SetInternal(handle.ptr());
473 }
474}
475
476template <typename T>
477template <typename S>
479 static_assert(std::is_base_of_v<T, S>, "type check");
480#ifdef V8_ENABLE_CHECKS
481 internal::VerifyHandleIsNonEmpty(handle.IsEmpty());
482#endif // V8_ENABLE_CHECKS
483 SetInternal(handle.ptr());
484}
485
486template <typename T>
487void ReturnValue<T>::Set(double i) {
488 static_assert(std::is_base_of_v<T, Number>, "type check");
489 SetNonEmpty(Number::New(GetIsolate(), i));
490}
491
492template <typename T>
493void ReturnValue<T>::Set(int16_t i) {
494 static_assert(std::is_base_of_v<T, Integer>, "type check");
495 using I = internal::Internals;
496 static_assert(I::IsValidSmi(std::numeric_limits<int16_t>::min()));
497 static_assert(I::IsValidSmi(std::numeric_limits<int16_t>::max()));
498 SetInternal(I::IntegralToSmi(i));
499}
500
501template <typename T>
502void ReturnValue<T>::Set(int32_t i) {
503 static_assert(std::is_base_of_v<T, Integer>, "type check");
504 if (const auto result = internal::Internals::TryIntegralToSmi(i)) {
505 SetInternal(*result);
506 return;
507 }
508 SetNonEmpty(Integer::New(GetIsolate(), i));
509}
510
511template <typename T>
512void ReturnValue<T>::Set(int64_t i) {
513 static_assert(std::is_base_of_v<T, Integer>, "type check");
514 if (const auto result = internal::Internals::TryIntegralToSmi(i)) {
515 SetInternal(*result);
516 return;
517 }
518 SetNonEmpty(Number::New(GetIsolate(), static_cast<double>(i)));
519}
520
521template <typename T>
522void ReturnValue<T>::Set(uint16_t i) {
523 static_assert(std::is_base_of_v<T, Integer>, "type check");
524 using I = internal::Internals;
525 static_assert(I::IsValidSmi(std::numeric_limits<uint16_t>::min()));
526 static_assert(I::IsValidSmi(std::numeric_limits<uint16_t>::max()));
527 SetInternal(I::IntegralToSmi(i));
528}
529
530template <typename T>
531void ReturnValue<T>::Set(uint32_t i) {
532 static_assert(std::is_base_of_v<T, Integer>, "type check");
533 if (const auto result = internal::Internals::TryIntegralToSmi(i)) {
534 SetInternal(*result);
535 return;
536 }
537 SetNonEmpty(Integer::NewFromUnsigned(GetIsolate(), i));
538}
539
540template <typename T>
541void ReturnValue<T>::Set(uint64_t i) {
542 static_assert(std::is_base_of_v<T, Integer>, "type check");
543 if (const auto result = internal::Internals::TryIntegralToSmi(i)) {
544 SetInternal(*result);
545 return;
546 }
547 SetNonEmpty(Number::New(GetIsolate(), static_cast<double>(i)));
548}
549
550template <typename T>
551void ReturnValue<T>::Set(bool value) {
552 static_assert(std::is_void_v<T> || std::is_base_of_v<T, Boolean>,
553 "type check");
554 using I = internal::Internals;
555#if V8_STATIC_ROOTS_BOOL
556#ifdef V8_ENABLE_CHECKS
557 internal::PerformCastCheck(
558 internal::ValueHelper::SlotAsValue<Value, true>(value_));
559#endif // V8_ENABLE_CHECKS
560 SetInternal(value ? I::StaticReadOnlyRoot::kTrueValue
561 : I::StaticReadOnlyRoot::kFalseValue);
562#else
563 int root_index;
564 if (value) {
565 root_index = I::kTrueValueRootIndex;
566 } else {
567 root_index = I::kFalseValueRootIndex;
568 }
569 *value_ = I::GetRoot(GetIsolate(), root_index);
570#endif // V8_STATIC_ROOTS_BOOL
571}
572
573template <typename T>
575 using I = internal::Internals;
576 if constexpr (std::is_same_v<void, T> || std::is_same_v<v8::Boolean, T>) {
577 Set(true);
578 } else if constexpr (std::is_same_v<v8::Integer, T>) {
579 SetInternal(I::IntegralToSmi(0));
580 } else {
581 static_assert(std::is_same_v<v8::Value, T> || std::is_same_v<v8::Array, T>);
582#if V8_STATIC_ROOTS_BOOL
583 SetInternal(I::StaticReadOnlyRoot::kUndefinedValue);
584#else
585 *value_ = I::GetRoot(GetIsolate(), I::kUndefinedValueRootIndex);
586#endif // V8_STATIC_ROOTS_BOOL
587 }
588}
589
590template <typename T>
592 static_assert(std::is_base_of_v<T, Primitive>, "type check");
593 using I = internal::Internals;
594#if V8_STATIC_ROOTS_BOOL
595#ifdef V8_ENABLE_CHECKS
596 internal::PerformCastCheck(
597 internal::ValueHelper::SlotAsValue<Value, true>(value_));
598#endif // V8_ENABLE_CHECKS
599 SetInternal(I::StaticReadOnlyRoot::kNullValue);
600#else
601 *value_ = I::GetRoot(GetIsolate(), I::kNullValueRootIndex);
602#endif // V8_STATIC_ROOTS_BOOL
603}
604
605template <typename T>
607 static_assert(std::is_base_of_v<T, Primitive>, "type check");
608 using I = internal::Internals;
609#if V8_STATIC_ROOTS_BOOL
610#ifdef V8_ENABLE_CHECKS
611 internal::PerformCastCheck(
612 internal::ValueHelper::SlotAsValue<Value, true>(value_));
613#endif // V8_ENABLE_CHECKS
614 SetInternal(I::StaticReadOnlyRoot::kUndefinedValue);
615#else
616 *value_ = I::GetRoot(GetIsolate(), I::kUndefinedValueRootIndex);
617#endif // V8_STATIC_ROOTS_BOOL
618}
619
620template <typename T>
622 static_assert(std::is_void_v<T> || std::is_base_of_v<T, Boolean>,
623 "type check");
624 using I = internal::Internals;
625#if V8_STATIC_ROOTS_BOOL
626#ifdef V8_ENABLE_CHECKS
627 internal::PerformCastCheck(
628 internal::ValueHelper::SlotAsValue<Value, true>(value_));
629#endif // V8_ENABLE_CHECKS
630 SetInternal(I::StaticReadOnlyRoot::kFalseValue);
631#else
632 *value_ = I::GetRoot(GetIsolate(), I::kFalseValueRootIndex);
633#endif // V8_STATIC_ROOTS_BOOL
634}
635
636template <typename T>
638 static_assert(std::is_base_of_v<T, String>, "type check");
639 using I = internal::Internals;
640#if V8_STATIC_ROOTS_BOOL
641#ifdef V8_ENABLE_CHECKS
642 internal::PerformCastCheck(
643 internal::ValueHelper::SlotAsValue<Value, true>(value_));
644#endif // V8_ENABLE_CHECKS
645 SetInternal(I::StaticReadOnlyRoot::kEmptyString);
646#else
647 *value_ = I::GetRoot(GetIsolate(), I::kEmptyStringRootIndex);
648#endif // V8_STATIC_ROOTS_BOOL
649}
650
651template <typename T>
653 return *reinterpret_cast<Isolate**>(&value_[kIsolateValueIndex]);
654}
655
656template <typename T>
658 return Local<Value>::New(GetIsolate(),
659 internal::ValueHelper::SlotAsValue<Value>(value_));
660}
661
662template <typename T>
663template <typename S>
664void ReturnValue<T>::Set(S* whatever) {
665 static_assert(sizeof(S) < 0, "incompilable to prevent inadvertent misuse");
666}
667
668template <typename T>
670 if (i < 0 || Length() <= i) return Undefined(GetIsolate());
671 return Local<Value>::FromSlot(&values_[kFirstJSArgumentIndex + i]);
672}
673
674template <typename T>
676 return Local<Object>::FromSlot(&values_[kReceiverIndex]);
677}
678
679template <typename T>
681 if (IsConstructCall()) {
682 // Can't use &values_[kNewTargetIndex] because of "array index -1 is
683 // before the beginning of the array" error.
684 internal::Address* values = &values_[0];
685 return Local<Value>::FromSlot(values + kNewTargetIndex);
686 }
687 return Undefined(GetIsolate());
688}
689
690template <typename T>
692 auto target = Local<v8::Data>::FromSlot(&values_[kTargetIndex]);
693 return api_internal::GetFunctionTemplateData(GetIsolate(), target);
694}
695
696template <typename T>
698 return reinterpret_cast<Isolate*>(values_[kIsolateIndex]);
699}
700
701template <typename T>
703 return ReturnValue<T>(&values_[kReturnValueIndex]);
704}
705
706template <typename T>
708 return I::SmiValue(values_[kFrameTypeIndex]) == I::kFrameTypeApiConstructExit;
709}
710
711template <typename T>
713 return static_cast<int>(values_[kArgcIndex]);
714}
715
716template <typename T>
718 return I::SmiValue(args_[kFrameTypeIndex]) ==
719 I::kFrameTypeApiNamedAccessorExit;
720}
721
722template <typename T>
724 return *reinterpret_cast<Isolate**>(&args_[kIsolateIndex]);
725}
726
727template <typename T>
729 internal::Address callback_info = args_[kCallbackInfoIndex];
730 internal::Address data =
731 I::ReadTaggedPointerField(callback_info, I::kCallbackInfoDataOffset);
732 return Local<Value>::New(GetIsolate(), data);
733}
734
735template <typename T>
737 return Local<Object>::FromSlot(&args_[kThisIndex]);
738}
739
740template <typename T>
742 return Local<Object>::FromSlot(&args_[kHolderIndex]);
743}
744
745template <typename T>
747 return ReturnValue<T>(&args_[kReturnValueIndex]);
748}
749
750template <typename T>
752 if constexpr (!HasShouldThrowOnError()) return false;
753 if (args_[kShouldThrowOnErrorIndex] !=
754 I::IntegralToSmi(I::kInferShouldThrowMode)) {
755 return args_[kShouldThrowOnErrorIndex] != I::IntegralToSmi(I::kDontThrow);
756 }
758 reinterpret_cast<v8::internal::Isolate*>(GetIsolate()));
759}
760
761} // namespace v8
762
763#endif // INCLUDE_V8_FUNCTION_CALLBACK_H_
Definition: v8-traced-handle.h:124
Definition: v8-function-callback.h:121
ReturnValue< T > GetReturnValue() const
Definition: v8-function-callback.h:702
Local< Object > This() const
Definition: v8-function-callback.h:675
Local< Value > operator[](int i) const
Definition: v8-function-callback.h:669
Isolate * GetIsolate() const
Definition: v8-function-callback.h:697
Local< Value > NewTarget() const
Definition: v8-function-callback.h:680
friend class debug::ConsoleCallArguments
Definition: v8-function-callback.h:146
friend class internal::FunctionCallbackArguments
Definition: v8-function-callback.h:144
Local< Value > Data() const
Definition: v8-function-callback.h:691
bool IsConstructCall() const
Definition: v8-function-callback.h:707
int Length() const
Definition: v8-function-callback.h:712
Definition: v8-persistent-handle.h:349
Definition: v8-isolate.h:291
Definition: v8-local-handle.h:366
Definition: v8-object.h:262
Definition: v8-util.h:166
Definition: v8-function-callback.h:224
Local< Value > Data() const
Definition: v8-function-callback.h:728
friend class internal::PropertyCallbackArguments
Definition: v8-function-callback.h:324
friend class PropertyCallbackInfo
Definition: v8-function-callback.h:322
bool ShouldThrowOnError() const
Definition: v8-function-callback.h:751
ReturnValue< T > GetReturnValue() const
Definition: v8-function-callback.h:746
Local< Object > HolderV2() const
Definition: v8-function-callback.h:741
friend void internal::PrintPropertyCallbackInfo(void *)
friend class MacroAssembler
Definition: v8-function-callback.h:323
Local< Object > This() const
Definition: v8-function-callback.h:736
Isolate * GetIsolate() const
Definition: v8-function-callback.h:723
Definition: v8-function-callback.h:41
void SetFalse()
Definition: v8-function-callback.h:621
void SetEmptyString()
Definition: v8-function-callback.h:637
friend class ReturnValue
Definition: v8-function-callback.h:91
ReturnValue(const ReturnValue< S > &that)
Definition: v8-function-callback.h:44
void SetNonEmpty(const Global< S > &handle)
Definition: v8-function-callback.h:436
Local< Value > Get() const
Definition: v8-function-callback.h:657
void SetNull()
Definition: v8-function-callback.h:591
Isolate * GetIsolate() const
Definition: v8-function-callback.h:652
void SetUndefined()
Definition: v8-function-callback.h:606
Definition: v8-container.h:148
internal::Address ptr() const
Definition: v8-handle-base.h:80
bool IsEmpty() const
Definition: v8-handle-base.h:60
Definition: v8-local-handle.h:75
Definition: v8-internal.h:885
static constexpr int kSPAlignmentSlotCount
Definition: v8-internal.h:1036
static constexpr int kFrameCPSlotCount
Definition: v8-internal.h:1029
v8::Local< v8::Value > GetFunctionTemplateData(v8::Isolate *isolate, v8::Local< v8::Data > raw_target)
bool ShouldThrowOnError(internal::Isolate *isolate)
uintptr_t Address
Definition: v8-internal.h:38
void PrintFunctionCallbackInfo(void *function_callback_info)
Definition: libplatform.h:15
Local< Primitive > Undefined(Isolate *isolate)
Definition: v8-primitive.h:1018
void(*)(const FunctionCallbackInfo< Value > &info) FunctionCallback
Definition: v8-function-callback.h:402
#define V8_EXPORT
Definition: v8config.h:855
#define V8_INLINE
Definition: v8config.h:508
#define V8_DEPRECATED(message)
Definition: v8config.h:614
#define V8_UNLIKELY(condition)
Definition: v8config.h:668