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