Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
dart::compiler::ffi::ArgumentAllocator Class Reference
Inheritance diagram for dart::compiler::ffi::ArgumentAllocator:
dart::ValueObject

Public Member Functions

 ArgumentAllocator (Zone *zone, bool has_varargs)
 
const NativeLocationAllocateArgumentVariadic (const NativeType &payload_type, bool is_first_vararg=false, bool is_vararg=false)
 
- Public Member Functions inherited from dart::ValueObject
 ValueObject ()
 
 ~ValueObject ()
 

Detailed Description

Definition at line 98 of file native_calling_convention.cc.

Constructor & Destructor Documentation

◆ ArgumentAllocator()

dart::compiler::ffi::ArgumentAllocator::ArgumentAllocator ( Zone zone,
bool  has_varargs 
)
inlineexplicit

Definition at line 100 of file native_calling_convention.cc.

101 : has_varargs_(has_varargs), zone_(zone) {}

Member Function Documentation

◆ AllocateArgumentVariadic()

const NativeLocation & dart::compiler::ffi::ArgumentAllocator::AllocateArgumentVariadic ( const NativeType payload_type,
bool  is_first_vararg = false,
bool  is_vararg = false 
)
inline

Definition at line 103 of file native_calling_convention.cc.

105 {
106#if defined(TARGET_ARCH_ARM64) && \
107 (defined(DART_TARGET_OS_MACOS_IOS) || defined(DART_TARGET_OS_MACOS))
108 if (is_first_vararg) {
109 // Block all registers.
110 BlockAllFpuRegisters();
111 cpu_regs_used = CallingConventions::kNumArgRegs;
112 }
113#endif
114#if defined(TARGET_ARCH_RISCV64) || defined(TARGET_ARCH_RISCV32)
115 if (is_first_vararg) {
116 // Block all FPU registers.
117 BlockAllFpuRegisters();
118 }
119#endif
120 const auto& result = AllocateArgument(payload_type, is_vararg);
121#if defined(TARGET_ARCH_X64) && defined(DART_TARGET_OS_WINDOWS)
122 if (has_varargs_) {
123 if (result.IsRegisters()) {
124 // If an integer register is used, block the corresponding xmm register.
126 } else if (result.IsFpuRegisters()) {
127 // If an xmm register is used, also the corresponding integer register.
129 const auto& fpu_reg_location = result.AsFpuRegisters();
130 const FpuRegisterKind kind = kQuadFpuReg;
131 ASSERT(fpu_reg_location.fpu_reg_kind() == kind);
132 FpuRegister fpu_register = fpu_reg_location.fpu_reg();
133 const intptr_t reg_index = fpu_register;
134 ASSERT(cpu_regs_used == reg_index + 1);
135 Register cpu_register =
137 const auto& container_type = ConvertFloatToInt(zone_, payload_type);
138 const auto& cpu_reg_location = *new (zone_) NativeRegistersLocation(
139 zone_, payload_type, container_type, cpu_register);
140 return *new (zone_)
141 BothNativeLocations(fpu_reg_location, cpu_reg_location);
142 }
143 }
144#endif
145 return result;
146 }
static const Register ArgumentRegisters[]
static constexpr bool kArgumentIntRegXorFpuReg
static constexpr intptr_t kNumArgRegs
#define ASSERT(E)
GAsyncResult * result
static const NativeType & ConvertFloatToInt(Zone *zone, const NativeType &type)
QRegister FpuRegister

The documentation for this class was generated from the following file: