v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
builtins-utils-gen.h File Reference
Include dependency graph for builtins-utils-gen.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  v8
 
namespace  v8::internal
 
namespace  v8::internal::compiler
 

Macros

#define TF_BUILTIN(Name, AssemblerBase)
 
#define TS_BUILTIN(Name, BaseAssembler)
 

Macro Definition Documentation

◆ TF_BUILTIN

#define TF_BUILTIN ( Name,
AssemblerBase )
Value:
class Name##Assembler : public AssemblerBase { \
public: \
using Descriptor = Builtin_##Name##_InterfaceDescriptor; \
\
explicit Name##Assembler(compiler::CodeAssemblerState* state) \
: AssemblerBase(state) {} \
void Generate##Name##Impl(); \
\
template <class T> \
TNode<T> Parameter( \
Descriptor::ParameterIndices index, \
return CodeAssembler::Parameter<T>(static_cast<int>(index), loc); \
} \
\
template <class T> \
TNode<T> UncheckedParameter(Descriptor::ParameterIndices index) { \
return CodeAssembler::UncheckedParameter<T>(static_cast<int>(index)); \
} \
}; \
void Builtins::Generate_##Name(compiler::CodeAssemblerState* state) { \
Name##Assembler assembler(state); \
state->SetInitialDebugInformation(#Name, __FILE__, __LINE__); \
if (Builtins::KindOf(Builtin::k##Name) == Builtins::TFJ) { \
assembler.PerformStackCheck(assembler.GetJSContextParameter()); \
} \
assembler.Generate##Name##Impl(); \
} \
void Name##Assembler::Generate##Name##Impl()
static constexpr SourceLocation Current()
AssemblerT assembler

Definition at line 30 of file builtins-utils-gen.h.

◆ TS_BUILTIN

#define TS_BUILTIN ( Name,
BaseAssembler )
Value:
class Name##Assembler : public BaseAssembler { \
public: \
using Descriptor = Builtin_##Name##_InterfaceDescriptor; \
Name##Assembler(compiler::turboshaft::PipelineData* data, \
Isolate* isolate, compiler::turboshaft::Graph& graph, \
: BaseAssembler(data, graph, phase_zone) {} \
void Generate##Name##Impl(); \
}; \
void Builtins::Generate_##Name( \
compiler::turboshaft::PipelineData* data, Isolate* isolate, \
compiler::turboshaft::Graph& graph, Zone* phase_zone) { \
Name##Assembler assembler(data, isolate, graph, phase_zone); \
assembler.EmitBuiltinProlog(Builtin::k##Name); \
Block* catch_block = nullptr; \
std::optional<Name##Assembler::CatchScope> catch_scope; \
/* If this builtin collects feedback, we need to setup a catch block */ \
if (assembler.HasFeedbackCollector()) { \
catch_block = assembler.NewBlock(); \
catch_scope.emplace(assembler, catch_block); \
} \
assembler.Generate##Name##Impl(); \
/* Builtin definition must generate something! */ \
DCHECK_GT(graph.op_id_count(), 0); \
assembler.EmitEpilog(catch_block); \
} \
void Name##Assembler::Generate##Name##Impl()
friend Zone
Definition asm-types.cc:195

Definition at line 61 of file builtins-utils-gen.h.