#include "src/codegen/assembler.h"
#ifdef V8_CODE_COMMENTS
#include <iomanip>
#endif
#include "src/base/vector.h"
#include "src/codegen/assembler-inl.h"
#include "src/deoptimizer/deoptimizer.h"
#include "src/diagnostics/disassembler.h"
#include "src/execution/isolate.h"
#include "src/heap/heap-inl.h"
#include "src/snapshot/embedded/embedded-data.h"
#include "src/snapshot/snapshot.h"
#include "src/utils/ostreams.h"
namespace v8 {
namespace internal {
AssemblerOptions AssemblerOptions::Default(Isolate* isolate) { … }
namespace {
class DefaultAssemblerBuffer : public AssemblerBuffer { … };
class ExternalAssemblerBufferImpl : public AssemblerBuffer { … };
static thread_local std::aligned_storage_t<sizeof(ExternalAssemblerBufferImpl),
alignof(ExternalAssemblerBufferImpl)>
tls_singleton_storage;
static thread_local bool tls_singleton_taken{ … };
void* ExternalAssemblerBufferImpl::operator new(std::size_t count) { … }
void ExternalAssemblerBufferImpl::operator delete(void* ptr) noexcept { … }
}
std::unique_ptr<AssemblerBuffer> ExternalAssemblerBuffer(void* start,
int size) { … }
std::unique_ptr<AssemblerBuffer> NewAssemblerBuffer(int size) { … }
constexpr int AssemblerBase::kMinimalBufferSize;
constexpr int AssemblerBase::kDefaultBufferSize;
AssemblerBase::AssemblerBase(const AssemblerOptions& options,
std::unique_ptr<AssemblerBuffer> buffer)
: … { … }
AssemblerBase::~AssemblerBase() = default;
void AssemblerBase::Print(Isolate* isolate) { … }
#ifdef DEBUG
CpuFeatureScope::CpuFeatureScope(AssemblerBase* assembler, CpuFeature f,
CheckPolicy check)
: … { … }
CpuFeatureScope::~CpuFeatureScope() { … }
#endif
bool CpuFeatures::initialized_ = …;
bool CpuFeatures::supports_wasm_simd_128_ = …;
bool CpuFeatures::supports_cetss_ = …;
unsigned CpuFeatures::supported_ = …;
unsigned CpuFeatures::icache_line_size_ = …;
unsigned CpuFeatures::dcache_line_size_ = …;
HeapNumberRequest::HeapNumberRequest(double heap_number, int offset)
: … { … }
void Assembler::RecordDeoptReason(DeoptimizeReason reason, uint32_t node_id,
SourcePosition position, int id) { … }
void Assembler::DataAlign(int m) { … }
void AssemblerBase::RequestHeapNumber(HeapNumberRequest request) { … }
int AssemblerBase::AddCodeTarget(Handle<Code> target) { … }
Handle<Code> AssemblerBase::GetCodeTarget(intptr_t code_target_index) const { … }
AssemblerBase::EmbeddedObjectIndex AssemblerBase::AddEmbeddedObject(
Handle<HeapObject> object) { … }
Handle<HeapObject> AssemblerBase::GetEmbeddedObject(
EmbeddedObjectIndex index) const { … }
int Assembler::WriteCodeComments() { … }
#ifdef V8_CODE_COMMENTS
int Assembler::CodeComment::depth() const { … }
void Assembler::CodeComment::Open(const std::string& comment,
const SourceLocation& loc) { … }
void Assembler::CodeComment::Close() { … }
#endif
}
}