Flutter Engine
The Flutter Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
dart::compiler::StubCodeCompiler Class Reference

#include <stub_code_compiler.h>

Public Types

enum  Optimized { kUnoptimized , kOptimized }
 
enum  CallType { kInstanceCall , kStaticCall }
 
enum  Exactness { kCheckExactness , kIgnoreExactness }
 
using STCSearchExitGenerator = std::function< void(Assembler *, int)>
 

Public Member Functions

 StubCodeCompiler (Assembler *assembler_, DescriptorList *pc_descriptors_list)
 
void EnsureIsNewOrRemembered ()
 
void GenerateAllocationStubForClass (UnresolvedPcRelativeCalls *unresolved_calls, const Class &cls, const dart::Code &allocate_object, const dart::Code &allocat_object_parametrized)
 
void GenerateNArgsCheckInlineCacheStub (intptr_t num_args, const RuntimeEntry &handle_ic_miss, Token::Kind kind, Optimized optimized, CallType type, Exactness exactness)
 
void GenerateNArgsCheckInlineCacheStubForEntryKind (intptr_t num_args, const RuntimeEntry &handle_ic_miss, Token::Kind kind, Optimized optimized, CallType type, Exactness exactness, CodeEntryKind entry_kind)
 
void GenerateUsageCounterIncrement (Register temp_reg)
 
void GenerateOptimizedUsageCounterIncrement ()
 

Static Public Member Functions

static ArrayPtr BuildStaticCallsTable (Zone *zone, compiler::UnresolvedPcRelativeCalls *unresolved_calls)
 
static intptr_t WordOffsetFromFpToCpuRegister (Register cpu_register)
 

Public Attributes

Assemblerassembler
 

Detailed Description

Definition at line 53 of file stub_code_compiler.h.

Member Typedef Documentation

◆ STCSearchExitGenerator

Definition at line 119 of file stub_code_compiler.h.

Member Enumeration Documentation

◆ CallType

Enumerator
kInstanceCall 
kStaticCall 

Definition at line 79 of file stub_code_compiler.h.

◆ Exactness

Enumerator
kCheckExactness 
kIgnoreExactness 

Definition at line 83 of file stub_code_compiler.h.

◆ Optimized

Enumerator
kUnoptimized 
kOptimized 

Definition at line 75 of file stub_code_compiler.h.

Constructor & Destructor Documentation

◆ StubCodeCompiler()

dart::compiler::StubCodeCompiler::StubCodeCompiler ( Assembler assembler_,
DescriptorList pc_descriptors_list 
)
inline

Definition at line 55 of file stub_code_compiler.h.

56 : assembler(assembler_), pc_descriptors_list_(pc_descriptors_list) {}

Member Function Documentation

◆ BuildStaticCallsTable()

ArrayPtr dart::compiler::StubCodeCompiler::BuildStaticCallsTable ( Zone zone,
compiler::UnresolvedPcRelativeCalls unresolved_calls 
)
static

Definition at line 147 of file stub_code.cc.

149 {
150 if (unresolved_calls->length() == 0) {
151 return Array::null();
152 }
153 const intptr_t array_length =
154 unresolved_calls->length() * Code::kSCallTableEntryLength;
155 const auto& static_calls_table =
156 Array::Handle(zone, Array::New(array_length, Heap::kOld));
157 StaticCallsTable entries(static_calls_table);
158 auto& kind_type_and_offset = Smi::Handle(zone);
159 for (intptr_t i = 0; i < unresolved_calls->length(); i++) {
160 auto& unresolved_call = (*unresolved_calls)[i];
161 auto call_kind = unresolved_call->is_tail_call() ? Code::kPcRelativeTailCall
163 kind_type_and_offset =
166 Code::OffsetField::encode(unresolved_call->offset()));
167 auto view = entries[i];
168 view.Set<Code::kSCallTableKindAndOffset>(kind_type_and_offset);
169 view.Set<Code::kSCallTableCodeOrTypeTarget>(unresolved_call->target());
170 }
171 return static_calls_table.ptr();
172}
static ArrayPtr New(intptr_t len, Heap::Space space=Heap::kNew)
Definition: object.h:10959
static constexpr intptr_t encode(CallKind value)
Definition: bitfield.h:165
@ kPcRelativeCall
Definition: object.h:6969
@ kPcRelativeTailCall
Definition: object.h:6971
@ kSCallTableEntryLength
Definition: object.h:6984
@ kSCallTableCodeOrTypeTarget
Definition: object.h:6982
@ kSCallTableKindAndOffset
Definition: object.h:6981
@ kDefaultEntry
Definition: object.h:6976
@ kOld
Definition: heap.h:39
static ObjectPtr null()
Definition: object.h:433
static Object & Handle()
Definition: object.h:407
static SmiPtr New(intptr_t value)
Definition: object.h:10006
ArrayOfTuplesView< Code::SCallTableEntry, std::tuple< Smi, Object, Function > > StaticCallsTable
Definition: object.h:13546

◆ EnsureIsNewOrRemembered()

void dart::compiler::StubCodeCompiler::EnsureIsNewOrRemembered ( )

◆ GenerateAllocationStubForClass()

void dart::compiler::StubCodeCompiler::GenerateAllocationStubForClass ( UnresolvedPcRelativeCalls unresolved_calls,
const Class cls,
const dart::Code allocate_object,
const dart::Code allocat_object_parametrized 
)

◆ GenerateNArgsCheckInlineCacheStub()

void dart::compiler::StubCodeCompiler::GenerateNArgsCheckInlineCacheStub ( intptr_t  num_args,
const RuntimeEntry handle_ic_miss,
Token::Kind  kind,
Optimized  optimized,
CallType  type,
Exactness  exactness 
)

◆ GenerateNArgsCheckInlineCacheStubForEntryKind()

void dart::compiler::StubCodeCompiler::GenerateNArgsCheckInlineCacheStubForEntryKind ( intptr_t  num_args,
const RuntimeEntry handle_ic_miss,
Token::Kind  kind,
Optimized  optimized,
CallType  type,
Exactness  exactness,
CodeEntryKind  entry_kind 
)

◆ GenerateOptimizedUsageCounterIncrement()

void dart::compiler::StubCodeCompiler::GenerateOptimizedUsageCounterIncrement ( )

◆ GenerateUsageCounterIncrement()

void dart::compiler::StubCodeCompiler::GenerateUsageCounterIncrement ( Register  temp_reg)

◆ WordOffsetFromFpToCpuRegister()

intptr_t dart::compiler::StubCodeCompiler::WordOffsetFromFpToCpuRegister ( Register  cpu_register)
static

Definition at line 27 of file stub_code_compiler.cc.

28 {
30
31 intptr_t slots_from_fp = target::frame_layout.param_end_from_fp + 1;
32 for (intptr_t i = 0; i < kNumberOfCpuRegisters; i++) {
33 Register reg = static_cast<Register>(i);
34 if (reg == cpu_register) break;
36 slots_from_fp++;
37 }
38 }
39 return slots_from_fp;
40}
bool Contains(Location loc)
Definition: locations.h:774
#define ASSERT(E)
FrameLayout frame_layout
Definition: stack_frame.cc:76
@ kNumberOfCpuRegisters
Definition: constants_arm.h:98
constexpr RegList kDartAvailableCpuRegs
intptr_t param_end_from_fp
Definition: frame_layout.h:30

Member Data Documentation

◆ assembler

Assembler* dart::compiler::StubCodeCompiler::assembler

Definition at line 58 of file stub_code_compiler.h.


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