v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
api-arguments.cc
Go to the documentation of this file.
1// Copyright 2018 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
6
8
9namespace v8 {
10namespace internal {
11
13 Isolate* isolate, Tagged<Object> data, Tagged<Object> self,
14 Tagged<JSObject> holder, Maybe<ShouldThrow> should_throw)
15 : Super(isolate)
16#ifdef DEBUG
17 ,
18 javascript_execution_counter_(isolate->javascript_execution_counter())
19#endif // DEBUG
20{
21 if (DEBUG_BOOL) {
22 // Zap these fields to ensure that they are initialized by a subsequent
23 // CallXXX(..).
24 Tagged<Object> zap_value(kZapValue);
27 }
32 .store(Tagged<Object>(reinterpret_cast<Address>(isolate)));
34 if (should_throw.IsJust()) {
35 value = should_throw.FromJust();
36 }
41}
42
45 Tagged<HeapObject> new_target, Address* argv, int argc)
46 : Super(isolate), argv_(argv), argc_(argc) {
48 slot_at(T::kUnusedIndex).store(ReadOnlyRoots(isolate).undefined_value());
51 .store(Tagged<Object>(reinterpret_cast<Address>(isolate)));
52 slot_at(T::kReturnValueIndex).store(ReadOnlyRoots(isolate).undefined_value());
53 slot_at(T::kContextIndex).store(isolate->context());
55}
56
57} // namespace internal
58} // namespace v8
static constexpr int kReturnValueIndex
static constexpr int kContextIndex
static constexpr int kTargetIndex
static constexpr int kUnusedIndex
static constexpr int kIsolateIndex
static constexpr int kNewTargetIndex
V8_INLINE bool IsJust() const
Definition v8-maybe.h:36
V8_INLINE T FromJust() const &
Definition v8-maybe.h:64
static constexpr int kReturnValueIndex
static constexpr int kIsolateIndex
static constexpr int kDataIndex
static constexpr int kShouldThrowOnErrorIndex
static constexpr int kHolderV2Index
static constexpr int kThisIndex
static constexpr int kHolderIndex
static constexpr int kPropertyKeyIndex
void store(Tagged< Object > value) const
Definition slots-inl.h:54
FunctionCallbackArguments(Isolate *isolate, Tagged< FunctionTemplateInfo > target, Tagged< HeapObject > new_target, Address *argv, int argc)
static const int kInferShouldThrowMode
PropertyCallbackArguments(Isolate *isolate, Tagged< Object > data, Tagged< Object > self, Tagged< JSObject > holder, Maybe< ShouldThrow > should_throw)
static constexpr Tagged< Smi > FromInt(int value)
Definition smi.h:38
static constexpr Tagged< Smi > zero()
Definition smi.h:99
#define DEBUG_BOOL
Definition globals.h:87
DirectHandle< Object > new_target
Definition execution.cc:75
V8_INLINE constexpr bool IsSmi(TaggedImpl< kRefType, StorageType > obj)
Definition objects.h:665
constexpr uint32_t kZapValue
Definition globals.h:1005
V8_INLINE constexpr bool IsHeapObject(TaggedImpl< kRefType, StorageType > obj)
Definition objects.h:669
#define DCHECK(condition)
Definition logging.h:482