Flutter Engine
The Flutter Engine
Namespaces | Macros | Functions | Variables
runtime_api.cc File Reference
#include "platform/thread_sanitizer.h"
#include "vm/compiler/runtime_api.h"
#include "vm/object.h"
#include "vm/compiler/backend/flow_graph_compiler.h"
#include "vm/compiler/runtime_offsets_list.h"
#include "vm/dart_api_state.h"
#include "vm/dart_entry.h"
#include "vm/longjump.h"
#include "vm/native_arguments.h"
#include "vm/native_entry.h"
#include "vm/object_store.h"
#include "vm/runtime_entry.h"
#include "vm/symbols.h"
#include "vm/timeline.h"
#include "vm/compiler/runtime_offsets_extracted.h"

Go to the source code of this file.

Namespaces

namespace  dart
 
namespace  dart::compiler
 
namespace  dart::compiler::target
 

Macros

#define DO(clazz)
 
#define DEFINE_ALIAS(name)    const RuntimeEntry& k##name##RuntimeEntry(dart::k##name##RuntimeEntry);
 
#define DEFINE_ALIAS(type, name, ...)    const RuntimeEntry& k##name##RuntimeEntry(dart::k##name##RuntimeEntry);
 
#define HANDLE_CASE(clazz)   case kFfi##clazz##Cid:
 
#define HANDLE_CASE(clazz)
 
#define DEFINE_CONSTANT(Class, Name)   const word Class::Name = Class##_##Name;
 
#define DEFINE_ARRAY_SIZEOF(clazz, name, ElementOffset)
 
#define DEFINE_PAYLOAD_SIZEOF(clazz, name, header)
 
#define DEFINE_JIT_FIELD(clazz, name)
 
#define DEFINE_JIT_ARRAY(clazz, name)
 
#define DEFINE_JIT_SIZEOF(clazz, name, what)
 
#define DEFINE_JIT_RANGE(Class, Getter, Type, First, Last, Filter)
 
#define DEFINE_AOT_FIELD(clazz, name)
 
#define DEFINE_AOT_ARRAY(clazz, name)
 
#define DEFINE_AOT_SIZEOF(clazz, name, what)
 
#define DEFINE_AOT_RANGE(Class, Getter, Type, First, Last, Filter)
 
#define DEFINE_FIELD(clazz, name)
 
#define DEFINE_ARRAY(clazz, name)
 
#define DEFINE_SIZEOF(clazz, name, what)
 
#define DEFINE_RANGE(Class, Getter, Type, First, Last, Filter)
 

Functions

bool dart::compiler::target::IsSmi (int64_t v)
 
bool dart::compiler::target::WillAllocateNewOrRememberedObject (intptr_t instance_size)
 
bool dart::compiler::target::WillAllocateNewOrRememberedContext (intptr_t num_context_variables)
 
bool dart::compiler::target::WillAllocateNewOrRememberedArray (intptr_t length)
 
bool dart::compiler::IsSameObject (const Object &a, const Object &b)
 
bool dart::compiler::IsEqualType (const AbstractType &a, const AbstractType &b)
 
bool dart::compiler::IsDoubleType (const AbstractType &type)
 
bool dart::compiler::IsBoolType (const AbstractType &type)
 
bool dart::compiler::IsSubtypeOfInt (const AbstractType &type)
 
bool dart::compiler::IsSmiType (const AbstractType &type)
 
bool dart::compiler::IsInOldSpace (const Object &obj)
 
intptr_t dart::compiler::ObjectHash (const Object &obj)
 
const char * dart::compiler::ObjectToCString (const Object &obj)
 
void dart::compiler::SetToNull (Object *obj)
 
Object & dart::compiler::NewZoneHandle (Zone *zone)
 
Object & dart::compiler::NewZoneHandle (Zone *zone, const Object &obj)
 
const Object & dart::compiler::NullObject ()
 
const Object & dart::compiler::SentinelObject ()
 
const Bool & dart::compiler::TrueObject ()
 
const Bool & dart::compiler::FalseObject ()
 
const Object & dart::compiler::EmptyTypeArguments ()
 
const Typedart::compiler::DynamicType ()
 
const Typedart::compiler::ObjectType ()
 
const Typedart::compiler::VoidType ()
 
const Typedart::compiler::IntType ()
 
const Class & dart::compiler::GrowableObjectArrayClass ()
 
const Class & dart::compiler::MintClass ()
 
const Class & dart::compiler::DoubleClass ()
 
const Class & dart::compiler::Float32x4Class ()
 
const Class & dart::compiler::Float64x2Class ()
 
const Class & dart::compiler::Int32x4Class ()
 
const Class & dart::compiler::ClosureClass ()
 
const Array & dart::compiler::ArgumentsDescriptorBoxed (intptr_t type_args_len, intptr_t num_arguments)
 
bool dart::compiler::IsOriginalObject (const Object &object)
 
const String & dart::compiler::AllocateString (const char *buffer)
 
bool dart::compiler::HasIntegerValue (const dart::Object &object, int64_t *value)
 
int32_t dart::compiler::CreateJitCookie ()
 
word dart::compiler::TypedDataElementSizeInBytes (classid_t cid)
 
word dart::compiler::TypedDataMaxNewSpaceElements (classid_t cid)
 
const Field & dart::compiler::LookupMathRandomStateFieldOffset ()
 
const Field & dart::compiler::LookupConvertUtf8DecoderScanFlagsField ()
 
word dart::compiler::LookupFieldOffsetInBytes (const Field &field)
 
const Code & dart::compiler::StubCodeAllocateArray ()
 
const Code & dart::compiler::StubCodeSubtype2TestCache ()
 
const Code & dart::compiler::StubCodeSubtype3TestCache ()
 
const Code & dart::compiler::StubCodeSubtype4TestCache ()
 
const Code & dart::compiler::StubCodeSubtype6TestCache ()
 
const Code & dart::compiler::StubCodeSubtype7TestCache ()
 
void dart::compiler::BailoutWithBranchOffsetError ()
 
static word dart::compiler::target::TranslateOffsetInWordsToHost (word offset)
 
bool dart::compiler::target::SizeFitsInSizeTag (uword instance_size)
 
uword dart::compiler::target::MakeTagWordForNewSpaceObject (classid_t cid, uword instance_size)
 
bool dart::compiler::target::IsTypedDataClassId (intptr_t cid)
 
static word dart::compiler::target::TranslateOffsetInWords (word offset)
 
static uword dart::compiler::target::GetInstanceSizeImpl (const dart::Class &handle)
 
 dart::compiler::target::JIT_OFFSETS_LIST (DEFINE_JIT_FIELD, DEFINE_JIT_ARRAY, DEFINE_JIT_SIZEOF, DEFINE_ARRAY_SIZEOF, DEFINE_PAYLOAD_SIZEOF, DEFINE_JIT_RANGE, DEFINE_CONSTANT) AOT_OFFSETS_LIST(DEFINE_AOT_FIELD
 
static DART_FORCE_INLINE bool dart::compiler::target::BareInstructionsPayloads ()
 
bool dart::compiler::target::CanLoadFromThread (const dart::Object &object, intptr_t *offset)
 
bool dart::compiler::target::IsSmi (const dart::Object &a)
 
word dart::compiler::target::ToRawSmi (const dart::Object &a)
 
word dart::compiler::target::ToRawSmi (intptr_t value)
 
word dart::compiler::target::SmiValue (const dart::Object &a)
 
bool dart::compiler::target::IsDouble (const dart::Object &a)
 
double dart::compiler::target::DoubleValue (const dart::Object &a)
 
void dart::compiler::target::UnboxFieldIfSupported (const dart::Field &field, const dart::AbstractType &type)
 

Variables

const word dart::compiler::target::kPageSize = dart::kPageSize
 
const word dart::compiler::target::kPageSizeInWords = dart::kPageSize / kWordSize
 
const word dart::compiler::target::kPageMask = dart::kPageMask
 
 dart::compiler::target::DEFINE_AOT_ARRAY
 
 dart::compiler::target::DEFINE_AOT_SIZEOF
 
 dart::compiler::target::DEFINE_ARRAY_SIZEOF
 
 dart::compiler::target::DEFINE_PAYLOAD_SIZEOF
 
 dart::compiler::target::DEFINE_AOT_RANGE
 

Macro Definition Documentation

◆ DEFINE_ALIAS [1/2]

#define DEFINE_ALIAS (   name)     const RuntimeEntry& k##name##RuntimeEntry(dart::k##name##RuntimeEntry);

Definition at line 323 of file runtime_api.cc.

◆ DEFINE_ALIAS [2/2]

#define DEFINE_ALIAS (   type,
  name,
  ... 
)     const RuntimeEntry& k##name##RuntimeEntry(dart::k##name##RuntimeEntry);

Definition at line 323 of file runtime_api.cc.

◆ DEFINE_AOT_ARRAY

#define DEFINE_AOT_ARRAY (   clazz,
  name 
)
Value:
word clazz::name(intptr_t index) { \
FATAL("Use of AOT-only array %s outside of the precompiler", \
#clazz "::" #name); \
}
intptr_t word
Definition: globals.h:500
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ DEFINE_AOT_FIELD

#define DEFINE_AOT_FIELD (   clazz,
  name 
)
Value:
FATAL("Use of AOT-only field %s outside of the precompiler", \
#clazz "::" #name); \
}

◆ DEFINE_AOT_RANGE

#define DEFINE_AOT_RANGE (   Class,
  Getter,
  Type,
  First,
  Last,
  Filter 
)
Value:
word Class::Getter(Type index) { \
FATAL("Use of AOT-only range %s outside of the precompiler", \
#Class "::" #Getter); \
}

◆ DEFINE_AOT_SIZEOF

#define DEFINE_AOT_SIZEOF (   clazz,
  name,
  what 
)
Value:
FATAL("Use of AOT-only sizeof %s outside of the precompiler", \
#clazz "::" #name); \
}

◆ DEFINE_ARRAY

#define DEFINE_ARRAY (   clazz,
  name 
)
Value:
word clazz::name(intptr_t index) { \
if (FLAG_precompiled_mode) { \
return AOT_##clazz##_elements_start_offset + \
index * AOT_##clazz##_element_size; \
} else { \
return clazz##_elements_start_offset + index * clazz##_element_size; \
} \
}

Definition at line 817 of file runtime_api.cc.

◆ DEFINE_ARRAY_SIZEOF

#define DEFINE_ARRAY_SIZEOF (   clazz,
  name,
  ElementOffset 
)
Value:
return 0; \
} \
word clazz::name(intptr_t length) { \
return RoundedAllocationSize(clazz::ElementOffset(length)); \
}
size_t length
intptr_t RoundedAllocationSize(intptr_t size)
Definition: runtime_api.h:333

Definition at line 639 of file runtime_api.cc.

◆ DEFINE_CONSTANT

#define DEFINE_CONSTANT (   Class,
  Name 
)    const word Class::Name = Class##_##Name;

Definition at line 637 of file runtime_api.cc.

◆ DEFINE_FIELD

#define DEFINE_FIELD (   clazz,
  name 
)
Value:
return FLAG_precompiled_mode ? AOT_##clazz##_##name : clazz##_##name; \
}

Definition at line 812 of file runtime_api.cc.

◆ DEFINE_JIT_ARRAY

#define DEFINE_JIT_ARRAY (   clazz,
  name 
)
Value:
word clazz::name(intptr_t index) { \
if (FLAG_precompiled_mode) { \
FATAL("Use of JIT-only array %s in precompiled mode", \
#clazz "::" #name); \
} \
return clazz##_elements_start_offset + index * clazz##_element_size; \
}

Definition at line 705 of file runtime_api.cc.

◆ DEFINE_JIT_FIELD

#define DEFINE_JIT_FIELD (   clazz,
  name 
)
Value:
if (FLAG_precompiled_mode) { \
FATAL("Use of JIT-only field %s in precompiled mode", \
#clazz "::" #name); \
} \
return clazz##_##name; \
}

Definition at line 696 of file runtime_api.cc.

◆ DEFINE_JIT_RANGE

#define DEFINE_JIT_RANGE (   Class,
  Getter,
  Type,
  First,
  Last,
  Filter 
)
Value:
word Class::Getter(Type index) { \
if (FLAG_precompiled_mode) { \
FATAL("Use of JIT-only range %s in precompiled mode", \
#Class "::" #Getter); \
} \
return Class##_##Getter[static_cast<intptr_t>(index) - \
static_cast<intptr_t>(First)]; \
}

Definition at line 723 of file runtime_api.cc.

◆ DEFINE_JIT_SIZEOF

#define DEFINE_JIT_SIZEOF (   clazz,
  name,
  what 
)
Value:
if (FLAG_precompiled_mode) { \
FATAL("Use of JIT-only sizeof %s in precompiled mode", \
#clazz "::" #name); \
} \
return clazz##_##name; \
}

Definition at line 714 of file runtime_api.cc.

◆ DEFINE_PAYLOAD_SIZEOF

#define DEFINE_PAYLOAD_SIZEOF (   clazz,
  name,
  header 
)
Value:
return 0; \
} \
word clazz::name(word payload_size) { \
return RoundedAllocationSize(clazz::header() + payload_size); \
}
static const char header[]
Definition: skpbench.cpp:88

Definition at line 647 of file runtime_api.cc.

◆ DEFINE_RANGE

#define DEFINE_RANGE (   Class,
  Getter,
  Type,
  First,
  Last,
  Filter 
)
Value:
word Class::Getter(Type index) { \
if (FLAG_precompiled_mode) { \
return AOT_##Class##_##Getter[static_cast<intptr_t>(index) - \
static_cast<intptr_t>(First)]; \
} else { \
return Class##_##Getter[static_cast<intptr_t>(index) - \
static_cast<intptr_t>(First)]; \
} \
}

Definition at line 832 of file runtime_api.cc.

◆ DEFINE_SIZEOF

#define DEFINE_SIZEOF (   clazz,
  name,
  what 
)
Value:
return FLAG_precompiled_mode ? AOT_##clazz##_##name : clazz##_##name; \
}

Definition at line 827 of file runtime_api.cc.

◆ DO

#define DO (   clazz)
Value:
bool Is##clazz##Handle(const Object& obj) { \
return obj.Is##clazz(); \
}

Definition at line 94 of file runtime_api.cc.

◆ HANDLE_CASE [1/2]

#define HANDLE_CASE (   clazz)    case kFfi##clazz##Cid:

◆ HANDLE_CASE [2/2]

#define HANDLE_CASE (   clazz)
Value:
case kTypedData##clazz##Cid: \
case kTypedData##clazz##ViewCid: \
case kExternalTypedData##clazz##Cid: \
case kUnmodifiableTypedData##clazz##ViewCid: