5#ifndef RUNTIME_VM_NATIVE_ARGUMENTS_H_
6#define RUNTIME_VM_NATIVE_ARGUMENTS_H_
17class BootstrapNatives;
22#if defined(TESTING) || defined(DEBUG)
24#if defined(USING_SIMULATOR)
25#define CHECK_STACK_ALIGNMENT \
27 uword current_sp = Simulator::Current()->get_register(SPREG); \
28 ASSERT(Utils::IsAligned(current_sp, OS::ActivationFrameAlignment())); \
30#elif defined(DART_HOST_OS_WINDOWS)
32#define CHECK_STACK_ALIGNMENT \
36#define CHECK_STACK_ALIGNMENT \
38 uword (*func)() = reinterpret_cast<uword (*)()>( \
39 StubCode::GetCStackPointer().EntryPoint()); \
40 uword current_sp = func(); \
41 ASSERT(Utils::IsAligned(current_sp, OS::ActivationFrameAlignment())); \
45#define DEOPTIMIZE_ALOT \
46 if (FLAG_deoptimize_alot) { \
47 DeoptimizeFunctionsOnStack(); \
52#define CHECK_STACK_ALIGNMENT \
55#define DEOPTIMIZE_ALOT \
97 argv_[-index] =
value.ptr();
103 return ArgCount() - NumHiddenArgs(function_bits);
108 return ArgAt(NumHiddenArgs(function_bits));
117 const int actual_index = index + NumHiddenArgs(function_bits);
118 return ArgAt(actual_index);
122 ASSERT(ToGenericFunction());
127 if (ToGenericFunction()) {
133 return type_args.
Length();
143 return Type::dynamic_type().ptr();
145 return type_args.
TypeAt(index);
150 *retval_ =
value.ptr();
181 int argc =
function.NumParameters();
182 int function_bits = 0;
184 function_bits |= kGenericFunctionBit;
188 tag = FunctionBits::update(function_bits, tag);
194 kGenericFunctionBit = 1,
199 kFunctionBit = kArgcBit + kArgcSize,
202 class ArgcBits :
public BitField<intptr_t, int32_t, kArgcBit, kArgcSize> {};
204 :
public BitField<intptr_t, int, kFunctionBit, kFunctionSize> {};
219 bool ToGenericFunction()
const {
223 int NumHiddenArgs(
int function_bits)
const {
224 int num_hidden_args = 0;
225 if ((function_bits & kGenericFunctionBit) == kGenericFunctionBit) {
228 return num_hidden_args;
static void encode(uint8_t output[16], const uint32_t input[4])
AbstractTypePtr NativeTypeArgAt(int index) const
int NativeArgCount() const
void SetReturn(const Object &value) const
static intptr_t retval_offset()
int NativeTypeArgCount() const
static intptr_t argc_tag_offset()
static intptr_t thread_offset()
ObjectPtr ArgAt(int index) const
static intptr_t argv_offset()
void SetArgAt(int index, const Object &value) const
TypeArgumentsPtr NativeTypeArgs() const
ObjectPtr NativeArgAt(int index) const
static intptr_t ParameterCountForResolution(const Function &function)
ObjectPtr NativeArg0() const
ObjectPtr ReturnValue() const
static int ComputeArgcTag(const Function &function)
static ObjectPtr RawCast(ObjectPtr obj)
ExecutionState execution_state() const
AbstractTypePtr TypeAt(intptr_t index) const
Dart_NativeFunction function
#define MSAN_UNPOISON(ptr, len)
constexpr intptr_t kWordSize
static DecodeResult decode(std::string path)
#define OFFSET_OF(type, field)