5#ifndef RUNTIME_VM_STUB_CODE_H_
6#define RUNTIME_VM_STUB_CODE_H_
13#if !defined(DART_PRECOMPILED_RUNTIME)
23class ObjectPointerVisitor;
42 return initialized_.
load(std::memory_order_acquire);
45 initialized_.
store(
true, std::memory_order_release);
59#define STUB_CODE_ACCESSOR(name) \
60 static const Code& name() { return *entries_[k##name##Index].code; } \
61 static intptr_t name##Size() { return name().Size(); }
63#undef STUB_CODE_ACCESSOR
65#if !defined(DART_PRECOMPILED_RUNTIME)
69 return StubCode::Subtype1TestCache();
71 return StubCode::Subtype2TestCache();
73 return StubCode::Subtype3TestCache();
75 return StubCode::Subtype4TestCache();
77 return StubCode::Subtype6TestCache();
79 return StubCode::Subtype7TestCache();
82 return StubCode::Subtype7TestCache();
89#if !defined(DART_PRECOMPILED_RUNTIME)
99 static const char*
NameAt(intptr_t index) {
return entries_[index].name; }
101 static const Code&
EntryAt(intptr_t index) {
return *(entries_[index].code); }
105 entries_[index].code = entry;
109#if !defined(DART_PRECOMPILED_RUNTIME)
110#define GENERATE_STUB(name) \
111 static CodePtr BuildIsolateSpecific##name##Stub( \
112 compiler::ObjectPoolBuilder* opw) { \
113 return StubCode::Generate( \
114 "_iso_stub_" #name, opw, \
115 &compiler::StubCodeCompiler::Generate##name##Stub); \
125#define STUB_CODE_ENTRY(name) k##name##Index,
127#undef STUB_CODE_ENTRY
131 struct StubCodeEntry {
134#if !defined(DART_PRECOMPILED_RUNTIME)
135 void (compiler::StubCodeCompiler::* generator)();
138 static StubCodeEntry entries_[kNumStubEntries];
139 static AcqRelAtomic<bool> initialized_;
#define DEBUG_ASSERT(cond)
T load(std::memory_order order=std::memory_order_acquire) const
void store(T arg, std::memory_order order=std::memory_order_release)
static CodePtr GetAllocationStubForClass(const Class &cls)
static const Code & UnoptimizedStaticCallEntry(intptr_t num_args_tested)
VM_STUB_CODE_LIST(GENERATE_STUB)
static CodePtr GetAllocationStubForTypedData(classid_t class_id)
static const char * NameOfStub(uword entry_point)
static const Code & EntryAt(intptr_t index)
static bool HasBeenInitialized()
static const Code & SubtypeTestCacheStubForUsedInputs(intptr_t i)
static CodePtr Generate(const char *name, compiler::ObjectPoolBuilder *object_pool_builder, void(compiler::StubCodeCompiler::*GenerateStub)())
static const char * NameAt(intptr_t index)
static void InitializationDone()
static bool InInvocationStub(uword pc)
static intptr_t NumEntries()
static void EntryAtPut(intptr_t index, Code *entry)
VM_STUB_CODE_LIST(STUB_CODE_ACCESSOR)
static bool InJumpToFrameStub(uword pc)
#define GENERATE_STUB(name)
#define STUB_CODE_ENTRY(name)
#define STUB_CODE_ACCESSOR(name)