Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Namespaces | Macros | Functions
compiler_state.cc File Reference
#include "vm/compiler/compiler_state.h"
#include <functional>
#include "vm/compiler/aot/precompiler.h"
#include "vm/compiler/backend/flow_graph_compiler.h"
#include "vm/compiler/backend/il_printer.h"
#include "vm/compiler/backend/slot.h"
#include "vm/growable_array.h"
#include "vm/scopes.h"

Go to the source code of this file.

Namespaces

namespace  dart
 

Macros

#define DEFINE_TYPED_LIST_NATIVE_FUNCTION_GETTER(Upper, Lower)
 
#define DEFINE_CLASS_GETTER(Lib, Upper, Lower, Symbol)
 

Functions

template<typename T >
Tdart::PutIfAbsent (Thread *thread, ZoneGrowableArray< T * > **array_slot, intptr_t index, std::function< T *()> create)
 

Macro Definition Documentation

◆ DEFINE_CLASS_GETTER

#define DEFINE_CLASS_GETTER (   Lib,
  Upper,
  Lower,
  Symbol 
)
Value:
const Class& CompilerState::Upper##Class() { \
if (Lower##_class_ == nullptr) { \
Thread* thread = Thread::Current(); \
Zone* zone = thread->zone(); \
const auto& lib = Library::Handle(zone, Library::Lib##Library()); \
const auto& cls = \
Class::Handle(zone, lib.LookupClassAllowPrivate(Symbols::Symbol())); \
ASSERT(!cls.IsNull()); \
const Error& error = Error::Handle(zone, cls.EnsureIsFinalized(thread)); \
ASSERT(error.IsNull()); \
Lower##_class_ = &cls; \
} \
return *Lower##_class_; \
}
const uint8_t uint32_t uint32_t GError ** error

Definition at line 127 of file compiler_state.cc.

128 { \
129 if (Lower##_class_ == nullptr) { \
130 Thread* thread = Thread::Current(); \
131 Zone* zone = thread->zone(); \
132 const auto& lib = Library::Handle(zone, Library::Lib##Library()); \
133 const auto& cls = \
134 Class::Handle(zone, lib.LookupClassAllowPrivate(Symbols::Symbol())); \
135 ASSERT(!cls.IsNull()); \
136 const Error& error = Error::Handle(zone, cls.EnsureIsFinalized(thread)); \
137 ASSERT(error.IsNull()); \
138 Lower##_class_ = &cls; \
139 } \
140 return *Lower##_class_; \
141 }

◆ DEFINE_TYPED_LIST_NATIVE_FUNCTION_GETTER

#define DEFINE_TYPED_LIST_NATIVE_FUNCTION_GETTER (   Upper,
  Lower 
)
Value:
const Function& CompilerState::TypedListGet##Upper() { \
if (typed_list_get_##Lower##_ == nullptr) { \
Thread* thread = Thread::Current(); \
Zone* zone = thread->zone(); \
const auto& cls = CompilerState::TypedListClass(); \
typed_list_get_##Lower##_ = &Function::ZoneHandle( \
zone, cls.LookupFunctionAllowPrivate(Symbols::_nativeGet##Upper())); \
ASSERT(!typed_list_get_##Lower##_->IsNull()); \
} \
return *typed_list_get_##Lower##_; \
} \
const Function& CompilerState::TypedListSet##Upper() { \
if (typed_list_set_##Lower##_ == nullptr) { \
Thread* thread = Thread::Current(); \
Zone* zone = thread->zone(); \
const auto& cls = CompilerState::TypedListClass(); \
typed_list_set_##Lower##_ = &Function::ZoneHandle( \
zone, cls.LookupFunctionAllowPrivate(Symbols::_nativeSet##Upper())); \
ASSERT(!typed_list_set_##Lower##_->IsNull()); \
} \
return *typed_list_set_##Lower##_; \
}

Definition at line 95 of file compiler_state.cc.

96 { \
97 if (typed_list_get_##Lower##_ == nullptr) { \
98 Thread* thread = Thread::Current(); \
99 Zone* zone = thread->zone(); \
100 const auto& cls = CompilerState::TypedListClass(); \
101 typed_list_get_##Lower##_ = &Function::ZoneHandle( \
102 zone, cls.LookupFunctionAllowPrivate(Symbols::_nativeGet##Upper())); \
103 ASSERT(!typed_list_get_##Lower##_->IsNull()); \
104 } \
105 return *typed_list_get_##Lower##_; \
106 } \
107 const Function& CompilerState::TypedListSet##Upper() { \
108 if (typed_list_set_##Lower##_ == nullptr) { \
109 Thread* thread = Thread::Current(); \
110 Zone* zone = thread->zone(); \
111 const auto& cls = CompilerState::TypedListClass(); \
112 typed_list_set_##Lower##_ = &Function::ZoneHandle( \
113 zone, cls.LookupFunctionAllowPrivate(Symbols::_nativeSet##Upper())); \
114 ASSERT(!typed_list_set_##Lower##_->IsNull()); \
115 } \
116 return *typed_list_set_##Lower##_; \
117 }