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 // Allow narrowing `ReturnValue<Base>` to `ReturnValue<Derived>`, as any
46 // `Derived` value set on this `ReturnValue<T>` is also a valid `Base`
47 // value for the underlying `ReturnValue<S>` slot. Disallow widening
48 // `ReturnValue<Derived>` to `ReturnValue<Base>`, which would allow storing
49 // a general `Base` value into a slot that expects `Derived`.
50 static_assert(std::is_base_of_v<S, T>, "type check");
51 }
52 // Handle-based setters.
53 template <typename S>
54 V8_INLINE void Set(const Global<S>& handle);
55 template <typename S>
56 V8_INLINE void SetNonEmpty(const Global<S>& handle);
57 template <typename S>
58 V8_INLINE void Set(const BasicTracedReference<S>& handle);
59 template <typename S>
61 template <typename S>
62 V8_INLINE void Set(const Local<S> handle);
63 template <typename S>
64 V8_INLINE void SetNonEmpty(const Local<S> handle);
65
66 // Fast primitive number setters.
67 V8_INLINE void Set(bool value);
68 V8_INLINE void Set(double i);
69 V8_INLINE void Set(int16_t i);
70 V8_INLINE void Set(int32_t i);
71 V8_INLINE void Set(int64_t i);
72 V8_INLINE void Set(uint16_t i);
73 V8_INLINE void Set(uint32_t i);
74 V8_INLINE void Set(uint64_t i);
75
76 // Fast JS primitive setters.
77 V8_INLINE void SetNull();
79 V8_INLINE void SetFalse();
81
82 // Convenience getter for the Isolate.
84
85 // Pointer setter: Uncompilable to prevent inadvertent misuse.
86 template <typename S>
87 V8_INLINE void Set(S* whatever);
88
89 // Getter. Creates a new Local<> so it comes with a certain performance
90 // hit. If the ReturnValue was not yet set, this will return the undefined
91 // value.
93
94 private:
95 template <class F>
96 friend class ReturnValue;
97 template <class F>
99 template <class F>
101 template <class F, class G, class H>
103 V8_INLINE void SetInternal(internal::Address value);
104 // Default value depends on <T>:
105 // - <void> -> true_value,
106 // - <v8::Boolean> -> true_value,
107 // - <v8::Integer> -> 0,
108 // - <v8::Value> -> undefined_value,
109 // - <v8::Array> -> undefined_value.
110 V8_INLINE void SetDefaultValue();
112
113 // See FunctionCallbackInfo.
114 static constexpr int kIsolateValueIndex = -1;
115
116 internal::Address* value_;
117};
118
125template <typename T>
127 public:
129 V8_INLINE int Length() const;
134 V8_INLINE Local<Value> operator[](int i) const;
140 V8_INLINE bool IsConstructCall() const;
143 V8_DEPRECATE_SOON("Use Data() instead")
149
150 private:
155 using I = internal::Internals;
156
157 // Frame block, matches the layout of ApiCallbackExitFrame.
158 // See ApiCallbackExitFrameConstants.
159 enum {
160 //
161 // Optional frame arguments block (exists only for API_CONSTRUCT_EXIT
162 // frame).
163
164 // Frame arguments block.
165 kNewTargetIndex = -1,
166
167 //
168 // Mandatory part, exists for both API_CALLBACK_EXIT and API_CONSTRUCT_EXIT
169 // frames.
170 //
171
172 // Frame arguments block.
173 kArgcIndex,
174
175 // Regular ExitFrame structure.
176 kFrameSPIndex,
177 kFrameTypeIndex,
178 kFrameConstantPoolIndex, // Optional, see I::kFrameCPSlotCount.
179 kFrameFPIndex = kFrameConstantPoolIndex + I::kFrameCPSlotCount,
180 kFramePCIndex,
181
182 // Api arguments block, starts at kFirstArgumentIndex.
183 kFirstApiArgumentIndex,
184 kIsolateIndex = kFirstApiArgumentIndex,
185 kReturnValueIndex,
186 kContextIndex,
187 kTargetIndex,
188
189 // JS args block, starts at kFrameFirstImplicitArgsIndex.
190 kReceiverIndex,
191 kFirstJSArgumentIndex,
192
193 // Mandatory part includes receiver.
194 kArgsLength = kReceiverIndex + 1,
195 // Optional part size (exists only for API_CONSTRUCT_EXIT frame).
196 kOptionalArgsLength = 1,
197
198 // The length of just Api arguments part.
199 kApiArgsLength = kReceiverIndex - kFirstApiArgumentIndex,
200 };
201
202 static_assert(kArgcIndex == 0);
204 kIsolateIndex - kReturnValueIndex);
205
206 internal::Address* address_of_first_argument() const {
207 return &values_[kFirstJSArgumentIndex];
208 }
209
210 V8_INLINE FunctionCallbackInfo() = default;
211
212 // FunctionCallbackInfo object provides a view of the stack area where the
213 // data is stored and thus it's not supposed to be copyable/movable.
214 FunctionCallbackInfo(const FunctionCallbackInfo&) = delete;
215 FunctionCallbackInfo& operator=(const FunctionCallbackInfo&) = delete;
216 FunctionCallbackInfo(FunctionCallbackInfo&&) = delete;
217 FunctionCallbackInfo& operator=(FunctionCallbackInfo&&) = delete;
218
219 // Declare as mutable to let GC modify the contents of the slots even though
220 // it's not possible to change values via this class.
221 // Define the array size as 1 to make it clear that we are going to access
222 // it out-of-bounds from both sides anyway.
223 mutable internal::Address values_[1];
224};
225
230template <typename T>
232 public:
237
242 V8_DEPRECATE_SOON("Use Data() instead")
244
253
263
279
280 private:
281 template <typename U>
283 friend class MacroAssembler;
284 friend class internal::PropertyCallbackArguments;
285 friend class internal::CustomArguments<PropertyCallbackInfo>;
286 friend void internal::PrintPropertyCallbackInfo(void*);
287 using I = internal::Internals;
288
289 // ShouldThrowOnError() can return true only for setter/definer/deleter
290 // callbacks which match [[Set]]/[[DefineOwnProperty]]/[[Delete]]
291 // operations. We detect these operations by return value type - they
292 // all return boolean value.
293 static constexpr bool HasShouldThrowOnError() {
294 return std::is_same_v<T, v8::Boolean>;
295 }
296
297 // Indicates whether this is a named accessor/interceptor callback call
298 // or an indexed one.
299 V8_INLINE bool IsNamed() const;
300
301 // Frame block, matches the layout of ApiAccessorExitFrame.
302 // See ApiAccessorExitFrameConstants.
303 enum {
304 // Frame arguments block.
305 kPropertyKeyIndex,
306
307 // Regular ExitFrame structure.
308 kFrameSPIndex,
309 kFrameTypeIndex,
310 kFrameConstantPoolIndex, // Optional, see I::kFrameCPSlotCount.
311 kFrameFPIndex = kFrameConstantPoolIndex + I::kFrameCPSlotCount,
312 kFramePCIndex,
313
314 // Other arguments block, starts at kFirstArgumentIndex.
315 kFirstApiArgumentIndex,
316 kIsolateIndex = kFirstApiArgumentIndex,
317 kReturnValueIndex,
318 kCallbackInfoIndex,
319 kHolderIndex,
320
321 //
322 // Optional part, used only by setter/definer/deleter callbacks.
323 //
324 kFirstOptionalArgument,
325 kShouldThrowOnErrorIndex = kFirstOptionalArgument,
326
327 // Used as value handle storage when called via CallApiSetter builtin.
328 kValueIndex,
329
330 kFullArgsLength,
331 kMandatoryArgsLength = kFirstOptionalArgument,
332 kOptionalArgsLength = kFullArgsLength - kFirstOptionalArgument,
333
334 // Various lengths of just Api arguments part.
335 kMandatoryApiArgsLength = kMandatoryArgsLength - kFirstApiArgumentIndex,
336 kFullApiArgsLength = kFullArgsLength - kFirstApiArgumentIndex,
337 };
338
339 // PropertyCallbackInfo object provides a view of the stack area where the
340 // data is stored and thus it's not supposed to be copyable/movable.
342 PropertyCallbackInfo& operator=(const PropertyCallbackInfo&) = delete;
344 PropertyCallbackInfo& operator=(PropertyCallbackInfo&&) = delete;
345
346 PropertyCallbackInfo() = default;
347
348 // Declare as mutable to let GC modify the contents of the slots even though
349 // it's not possible to change values via this class.
350 // Define the array size as 1 to make it clear that we are going to access
351 // it out-of-bounds anyway.
352 mutable internal::Address args_[1];
353};
354
355using FunctionCallback = void (*)(const FunctionCallbackInfo<Value>& info);
356
357// --- Implementation ---
358
359template <typename T>
360ReturnValue<T>::ReturnValue(internal::Address* slot) : value_(slot) {}
361
362template <typename T>
363void ReturnValue<T>::SetInternal(internal::Address value) {
364#if V8_STATIC_ROOTS_BOOL
365 using I = internal::Internals;
366 // Ensure that the upper 32-bits are not modified. Compiler should be
367 // able to optimize this to a store of a lower 32-bits of the value.
368 // This is fine since the callback can return only JavaScript values which
369 // are either Smis or heap objects allocated in the main cage.
370 *value_ = I::DecompressTaggedField(*value_, I::CompressTagged(value));
371#else
372 *value_ = value;
373#endif // V8_STATIC_ROOTS_BOOL
374}
375
376template <typename T>
377template <typename S>
378void ReturnValue<T>::Set(const Global<S>& handle) {
379 static_assert(std::is_base_of_v<T, S>, "type check");
380 if (V8_UNLIKELY(handle.IsEmpty())) {
381 SetDefaultValue();
382 } else {
383 SetInternal(handle.ptr());
384 }
385}
386
387template <typename T>
388template <typename S>
390 static_assert(std::is_base_of_v<T, S>, "type check");
391#ifdef V8_ENABLE_CHECKS
392 internal::VerifyHandleIsNonEmpty(handle.IsEmpty());
393#endif // V8_ENABLE_CHECKS
394 SetInternal(handle.ptr());
395}
396
397template <typename T>
398template <typename S>
400 static_assert(std::is_base_of_v<T, S>, "type check");
401 if (V8_UNLIKELY(handle.IsEmpty())) {
402 SetDefaultValue();
403 } else {
404 SetInternal(handle.ptr());
405 }
406}
407
408template <typename T>
409template <typename S>
411 static_assert(std::is_base_of_v<T, S>, "type check");
412#ifdef V8_ENABLE_CHECKS
413 internal::VerifyHandleIsNonEmpty(handle.IsEmpty());
414#endif // V8_ENABLE_CHECKS
415 SetInternal(handle.ptr());
416}
417
418template <typename T>
419template <typename S>
420void ReturnValue<T>::Set(const Local<S> handle) {
421 static_assert(std::is_base_of_v<T, S>, "type check");
422 if (V8_UNLIKELY(handle.IsEmpty())) {
423 SetDefaultValue();
424 } else {
425 SetInternal(handle.ptr());
426 }
427}
428
429template <typename T>
430template <typename S>
432 static_assert(std::is_base_of_v<T, S>, "type check");
433#ifdef V8_ENABLE_CHECKS
434 internal::VerifyHandleIsNonEmpty(handle.IsEmpty());
435#endif // V8_ENABLE_CHECKS
436 SetInternal(handle.ptr());
437}
438
439template <typename T>
440void ReturnValue<T>::Set(double i) {
441 static_assert(std::is_base_of_v<T, Number>, "type check");
442 SetNonEmpty(Number::New(GetIsolate(), i));
443}
444
445template <typename T>
446void ReturnValue<T>::Set(int16_t i) {
447 static_assert(std::is_base_of_v<T, Integer>, "type check");
448 using I = internal::Internals;
449 static_assert(I::IsValidSmi(std::numeric_limits<int16_t>::min()));
450 static_assert(I::IsValidSmi(std::numeric_limits<int16_t>::max()));
451 SetInternal(I::IntegralToSmi(i));
452}
453
454template <typename T>
455void ReturnValue<T>::Set(int32_t i) {
456 static_assert(std::is_base_of_v<T, Integer>, "type check");
457 if (const auto result = internal::Internals::TryIntegralToSmi(i)) {
458 SetInternal(*result);
459 return;
460 }
461 SetNonEmpty(Integer::New(GetIsolate(), i));
462}
463
464template <typename T>
465void ReturnValue<T>::Set(int64_t i) {
466 static_assert(std::is_base_of_v<T, Integer>, "type check");
467 if (const auto result = internal::Internals::TryIntegralToSmi(i)) {
468 SetInternal(*result);
469 return;
470 }
471 SetNonEmpty(Number::New(GetIsolate(), static_cast<double>(i)));
472}
473
474template <typename T>
475void ReturnValue<T>::Set(uint16_t i) {
476 static_assert(std::is_base_of_v<T, Integer>, "type check");
477 using I = internal::Internals;
478 static_assert(I::IsValidSmi(std::numeric_limits<uint16_t>::min()));
479 static_assert(I::IsValidSmi(std::numeric_limits<uint16_t>::max()));
480 SetInternal(I::IntegralToSmi(i));
481}
482
483template <typename T>
484void ReturnValue<T>::Set(uint32_t i) {
485 static_assert(std::is_base_of_v<T, Integer>, "type check");
486 if (const auto result = internal::Internals::TryIntegralToSmi(i)) {
487 SetInternal(*result);
488 return;
489 }
490 SetNonEmpty(Integer::NewFromUnsigned(GetIsolate(), i));
491}
492
493template <typename T>
494void ReturnValue<T>::Set(uint64_t i) {
495 static_assert(std::is_base_of_v<T, Integer>, "type check");
496 if (const auto result = internal::Internals::TryIntegralToSmi(i)) {
497 SetInternal(*result);
498 return;
499 }
500 SetNonEmpty(Number::New(GetIsolate(), static_cast<double>(i)));
501}
502
503template <typename T>
504void ReturnValue<T>::Set(bool value) {
505 static_assert(std::is_void_v<T> || std::is_base_of_v<T, Boolean>,
506 "type check");
507 using I = internal::Internals;
508#if V8_STATIC_ROOTS_BOOL
509#ifdef V8_ENABLE_CHECKS
510 internal::PerformCastCheck(
511 internal::ValueHelper::SlotAsValue<Value, true>(value_));
512#endif // V8_ENABLE_CHECKS
513 SetInternal(value ? I::StaticReadOnlyRoot::kTrueValue
514 : I::StaticReadOnlyRoot::kFalseValue);
515#else
516 int root_index;
517 if (value) {
518 root_index = I::kTrueValueRootIndex;
519 } else {
520 root_index = I::kFalseValueRootIndex;
521 }
522 *value_ = I::GetRoot(GetIsolate(), root_index);
523#endif // V8_STATIC_ROOTS_BOOL
524}
525
526template <typename T>
528 using I = internal::Internals;
529 if constexpr (std::is_same_v<void, T> || std::is_same_v<v8::Boolean, T>) {
530 Set(true);
531 } else if constexpr (std::is_same_v<v8::Integer, T>) {
532 SetInternal(I::IntegralToSmi(0));
533 } else {
534 static_assert(std::is_same_v<v8::Value, T> || std::is_same_v<v8::Array, T>);
535#if V8_STATIC_ROOTS_BOOL
536 SetInternal(I::StaticReadOnlyRoot::kUndefinedValue);
537#else
538 *value_ = I::GetRoot(GetIsolate(), I::kUndefinedValueRootIndex);
539#endif // V8_STATIC_ROOTS_BOOL
540 }
541}
542
543template <typename T>
545 static_assert(std::is_base_of_v<T, Primitive>, "type check");
546 using I = internal::Internals;
547#if V8_STATIC_ROOTS_BOOL
548#ifdef V8_ENABLE_CHECKS
549 internal::PerformCastCheck(
550 internal::ValueHelper::SlotAsValue<Value, true>(value_));
551#endif // V8_ENABLE_CHECKS
552 SetInternal(I::StaticReadOnlyRoot::kNullValue);
553#else
554 *value_ = I::GetRoot(GetIsolate(), I::kNullValueRootIndex);
555#endif // V8_STATIC_ROOTS_BOOL
556}
557
558template <typename T>
560 static_assert(std::is_base_of_v<T, Primitive>, "type check");
561 using I = internal::Internals;
562#if V8_STATIC_ROOTS_BOOL
563#ifdef V8_ENABLE_CHECKS
564 internal::PerformCastCheck(
565 internal::ValueHelper::SlotAsValue<Value, true>(value_));
566#endif // V8_ENABLE_CHECKS
567 SetInternal(I::StaticReadOnlyRoot::kUndefinedValue);
568#else
569 *value_ = I::GetRoot(GetIsolate(), I::kUndefinedValueRootIndex);
570#endif // V8_STATIC_ROOTS_BOOL
571}
572
573template <typename T>
575 static_assert(std::is_void_v<T> || std::is_base_of_v<T, Boolean>,
576 "type check");
577 using I = internal::Internals;
578#if V8_STATIC_ROOTS_BOOL
579#ifdef V8_ENABLE_CHECKS
580 internal::PerformCastCheck(
581 internal::ValueHelper::SlotAsValue<Value, true>(value_));
582#endif // V8_ENABLE_CHECKS
583 SetInternal(I::StaticReadOnlyRoot::kFalseValue);
584#else
585 *value_ = I::GetRoot(GetIsolate(), I::kFalseValueRootIndex);
586#endif // V8_STATIC_ROOTS_BOOL
587}
588
589template <typename T>
591 static_assert(std::is_base_of_v<T, String>, "type check");
592 using I = internal::Internals;
593#if V8_STATIC_ROOTS_BOOL
594#ifdef V8_ENABLE_CHECKS
595 internal::PerformCastCheck(
596 internal::ValueHelper::SlotAsValue<Value, true>(value_));
597#endif // V8_ENABLE_CHECKS
598 SetInternal(I::StaticReadOnlyRoot::kEmptyString);
599#else
600 *value_ = I::GetRoot(GetIsolate(), I::kEmptyStringRootIndex);
601#endif // V8_STATIC_ROOTS_BOOL
602}
603
604template <typename T>
606 return *reinterpret_cast<Isolate**>(&value_[kIsolateValueIndex]);
607}
608
609template <typename T>
611 return Local<Value>::New(GetIsolate(),
612 internal::ValueHelper::SlotAsValue<Value>(value_));
613}
614
615template <typename T>
616template <typename S>
617void ReturnValue<T>::Set(S* whatever) {
618 static_assert(sizeof(S) < 0, "incompilable to prevent inadvertent misuse");
619}
620
621template <typename T>
623 if (i < 0 || Length() <= i) return Undefined(GetIsolate());
624 return Local<Value>::FromSlot(&values_[kFirstJSArgumentIndex + i]);
625}
626
627template <typename T>
629 return Local<Object>::FromSlot(&values_[kReceiverIndex]);
630}
631
632template <typename T>
634 if (IsConstructCall()) {
635 // Can't use &values_[kNewTargetIndex] because of "array index -1 is
636 // before the beginning of the array" error.
637 internal::Address* values = &values_[0];
638 return Local<Value>::FromSlot(values + kNewTargetIndex);
639 }
640 return Undefined(GetIsolate());
641}
642
643template <typename T>
645 auto target = Local<v8::Data>::FromSlot(&values_[kTargetIndex]);
646 return api_internal::GetFunctionTemplateData(GetIsolate(), target);
647}
648
649template <typename T>
651 return Data();
652}
653
654template <typename T>
656 return reinterpret_cast<Isolate*>(values_[kIsolateIndex]);
657}
658
659template <typename T>
661 return ReturnValue<T>(&values_[kReturnValueIndex]);
662}
663
664template <typename T>
666 return I::SmiValue(values_[kFrameTypeIndex]) == I::kFrameTypeApiConstructExit;
667}
668
669template <typename T>
671 return static_cast<int>(values_[kArgcIndex]);
672}
673
674template <typename T>
676 return I::SmiValue(args_[kFrameTypeIndex]) ==
677 I::kFrameTypeApiNamedAccessorExit;
678}
679
680template <typename T>
682 return *reinterpret_cast<Isolate**>(&args_[kIsolateIndex]);
683}
684
685template <typename T>
687 internal::Address callback_info = args_[kCallbackInfoIndex];
688 internal::Address data =
689 I::ReadTaggedPointerField(callback_info, I::kCallbackInfoDataOffset);
690 return Local<v8::Data>::New(GetIsolate(), data);
691}
692
693template <typename T>
695 return Data();
696}
697
698template <typename T>
700 return Local<Object>::FromSlot(&args_[kHolderIndex]);
701}
702
703template <typename T>
705 return ReturnValue<T>(&args_[kReturnValueIndex]);
706}
707
708template <typename T>
710 if constexpr (!HasShouldThrowOnError()) return false;
711 if (args_[kShouldThrowOnErrorIndex] !=
712 I::IntegralToSmi(I::kInferShouldThrowMode)) {
713 return args_[kShouldThrowOnErrorIndex] != I::IntegralToSmi(I::kDontThrow);
714 }
716 reinterpret_cast<v8::internal::Isolate*>(GetIsolate()));
717}
718
719} // namespace v8
720
721#endif // INCLUDE_V8_FUNCTION_CALLBACK_H_
Definition: v8-traced-handle.h:125
Definition: v8-data.h:18
Definition: v8-function-callback.h:126
Local< v8::Data > Data() const
Definition: v8-function-callback.h:644
ReturnValue< T > GetReturnValue() const
Definition: v8-function-callback.h:660
Local< Object > This() const
Definition: v8-function-callback.h:628
Local< Value > operator[](int i) const
Definition: v8-function-callback.h:622
Isolate * GetIsolate() const
Definition: v8-function-callback.h:655
Local< Value > NewTarget() const
Definition: v8-function-callback.h:633
friend class debug::ConsoleCallArguments
Definition: v8-function-callback.h:153
friend class internal::FunctionCallbackArguments
Definition: v8-function-callback.h:151
Local< v8::Data > DataV2() const
Definition: v8-function-callback.h:650
bool IsConstructCall() const
Definition: v8-function-callback.h:665
int Length() const
Definition: v8-function-callback.h:670
Definition: v8-persistent-handle.h:353
Definition: v8-isolate.h:305
Definition: v8-local-handle.h:356
Definition: v8-object.h:269
Definition: v8-util.h:166
Definition: v8-function-callback.h:231
friend class internal::PropertyCallbackArguments
Definition: v8-function-callback.h:284
Local< v8::Data > Data() const
Definition: v8-function-callback.h:686
friend class PropertyCallbackInfo
Definition: v8-function-callback.h:282
Local< Object > Holder() const
Definition: v8-function-callback.h:699
bool ShouldThrowOnError() const
Definition: v8-function-callback.h:709
ReturnValue< T > GetReturnValue() const
Definition: v8-function-callback.h:704
Local< v8::Data > DataV2() const
Definition: v8-function-callback.h:694
friend void internal::PrintPropertyCallbackInfo(void *)
friend class MacroAssembler
Definition: v8-function-callback.h:283
Isolate * GetIsolate() const
Definition: v8-function-callback.h:681
Definition: v8-function-callback.h:41
void SetFalse()
Definition: v8-function-callback.h:574
void SetEmptyString()
Definition: v8-function-callback.h:590
friend class ReturnValue
Definition: v8-function-callback.h:96
ReturnValue(const ReturnValue< S > &that)
Definition: v8-function-callback.h:44
void SetNonEmpty(const Global< S > &handle)
Definition: v8-function-callback.h:389
Local< Value > Get() const
Definition: v8-function-callback.h:610
void SetNull()
Definition: v8-function-callback.h:544
Isolate * GetIsolate() const
Definition: v8-function-callback.h:605
void SetUndefined()
Definition: v8-function-callback.h:559
Definition: v8-container.h:147
internal::Address ptr() const
Definition: v8-handle-base.h:80
bool IsEmpty() const
Definition: v8-handle-base.h:60
Definition: v8-local-handle.h:73
Definition: v8-internal.h:969
static constexpr int kFrameCPSlotCount
Definition: v8-internal.h:1117
v8::Local< v8::Data > 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:1080
void(*)(const FunctionCallbackInfo< Value > &info) FunctionCallback
Definition: v8-function-callback.h:355
#define V8_EXPORT
Definition: v8config.h:875
#define V8_INLINE
Definition: v8config.h:519
#define V8_DEPRECATE_SOON(message)
Definition: v8config.h:632
#define V8_UNLIKELY(condition)
Definition: v8config.h:678