v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
assembler.h File Reference
#include <cstring>
#include <iomanip>
#include <iterator>
#include <limits>
#include <memory>
#include <optional>
#include <type_traits>
#include <utility>
#include "include/v8-source-location.h"
#include "src/base/logging.h"
#include "src/base/macros.h"
#include "src/base/small-vector.h"
#include "src/base/string-format.h"
#include "src/base/template-utils.h"
#include "src/base/vector.h"
#include "src/codegen/callable.h"
#include "src/codegen/code-factory.h"
#include "src/codegen/heap-object-list.h"
#include "src/codegen/reloc-info.h"
#include "src/compiler/access-builder.h"
#include "src/compiler/code-assembler.h"
#include "src/compiler/common-operator.h"
#include "src/compiler/globals.h"
#include "src/compiler/js-heap-broker.h"
#include "src/compiler/simplified-operator.h"
#include "src/compiler/turboshaft/access-builder.h"
#include "src/compiler/turboshaft/builtin-call-descriptors.h"
#include "src/compiler/turboshaft/graph.h"
#include "src/compiler/turboshaft/index.h"
#include "src/compiler/turboshaft/operation-matcher.h"
#include "src/compiler/turboshaft/operations.h"
#include "src/compiler/turboshaft/phase.h"
#include "src/compiler/turboshaft/reducer-traits.h"
#include "src/compiler/turboshaft/representations.h"
#include "src/compiler/turboshaft/runtime-call-descriptors.h"
#include "src/compiler/turboshaft/sidetable.h"
#include "src/compiler/turboshaft/snapshot-table.h"
#include "src/compiler/turboshaft/uniform-reducer-adapter.h"
#include "src/compiler/turboshaft/utils.h"
#include "src/compiler/write-barrier-kind.h"
#include "src/flags/flags.h"
#include "src/logging/runtime-call-stats.h"
#include "src/objects/dictionary.h"
#include "src/objects/elements-kind.h"
#include "src/objects/fixed-array.h"
#include "src/objects/heap-number.h"
#include "src/objects/oddball.h"
#include "src/objects/property-cell.h"
#include "src/objects/scope-info.h"
#include "src/objects/swiss-name-dictionary.h"
#include "src/objects/tagged.h"
#include "src/objects/turbofan-types.h"
#include "v8-primitive.h"
#include "src/compiler/turboshaft/define-assembler-macros.inc"
#include "src/compiler/turboshaft/undef-assembler-macros.inc"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  v8::internal::compiler::turboshaft::Range< T >
 
class  v8::internal::compiler::turboshaft::IndexRange< T >
 
class  v8::internal::compiler::turboshaft::Sequence< T >
 
class  v8::internal::compiler::turboshaft::Zip< Iterables >
 
class  v8::internal::compiler::turboshaft::ConditionWithHint
 
struct  v8::internal::compiler::turboshaft::detail::IndexTypeFor< T >
 
struct  v8::internal::compiler::turboshaft::detail::IndexTypeFor< std::tuple< T > >
 
class  v8::internal::compiler::turboshaft::LabelBase< loop, Ts >
 
struct  v8::internal::compiler::turboshaft::LabelBase< loop, Ts >::BlockData
 
class  v8::internal::compiler::turboshaft::Label< Ts >
 
class  v8::internal::compiler::turboshaft::LoopLabel< Ts >
 
struct  v8::internal::compiler::turboshaft::detail::LoopLabelForHelper< V< T > >
 
struct  v8::internal::compiler::turboshaft::detail::LoopLabelForHelper< std::tuple< V< Ts >... > >
 
class  v8::internal::compiler::turboshaft::Uninitialized< T >
 
struct  v8::internal::compiler::turboshaft::StackBottom< Reducers >
 
struct  v8::internal::compiler::turboshaft::ReducerStack< ReducerList >
 
class  v8::internal::compiler::turboshaft::Var< T, Assembler >
 
class  v8::internal::compiler::turboshaft::ScopedVar< T, Assembler >
 
class  v8::internal::compiler::turboshaft::EmitProjectionReducer< Next >
 
class  v8::internal::compiler::turboshaft::TSReducerBase< Next >
 
class  v8::internal::compiler::turboshaft::ReducerBaseForwarder< Next >
 
class  v8::internal::compiler::turboshaft::GenericReducerBase< Next >
 
class  v8::internal::compiler::turboshaft::GenericAssemblerOpInterface< Assembler >
 
struct  v8::internal::compiler::turboshaft::GenericAssemblerOpInterface< Assembler >::ControlFlowHelper_IfState
 
class  v8::internal::compiler::turboshaft::TurboshaftAssemblerOpInterface< Assembler >
 
struct  v8::internal::compiler::turboshaft::AssemblerData
 
class  v8::internal::compiler::turboshaft::Assembler< Reducers >
 
class  v8::internal::compiler::turboshaft::CatchScopeImpl< AssemblerT >
 
class  v8::internal::compiler::turboshaft::TSAssembler< Reducers >
 

Namespaces

namespace  v8
 
namespace  v8::internal
 
namespace  v8::internal::compiler
 
namespace  v8::internal::compiler::turboshaft
 
namespace  v8::internal::compiler::turboshaft::detail
 

Concepts

concept  v8::internal::compiler::turboshaft::ForeachIterable
 

Macros

#define V8_COMPILER_TURBOSHAFT_ASSEMBLER_MACROS_DEFINED   1
 
#define TSA_DCHECK(assembler, condition)
 
#define TSA_SLOW_DCHECK(assembler, ...)
 
#define LIKELY(...)
 
#define UNLIKELY(...)
 
#define BIND(label, ...)
 
#define BIND_LOOP(loop_label, ...)
 
#define WHILE(...)
 
#define FOREACH_IMPL_2(arg, iterable)
 
#define FOREACH_IMPL_3(arg0, arg1, iterable)
 
#define FOREACH(...)
 
#define BREAK   Asm().ControlFlowHelper_Goto(loop_exit_xx, {})
 
#define CONTINUE   Asm().ControlFlowHelper_Goto(loop_header_xx, {})
 
#define GOTO(label, ...)
 
#define GOTO_IF(cond, label, ...)
 
#define GOTO_IF_NOT(cond, label, ...)
 
#define FORCE_UNROLL_LOOP
 
#define SUPPRESSED_DANGLING_ELSE_WARNING_IF(...)
 
#define SUPPRESSED_DANGLING_ELSE_WARNING_ELSE   else
 
#define NO_SHADOW
 
#define RE_SHADOW   _Pragma("GCC diagnostic pop")
 
#define IF(...)
 
#define IF_NOT(...)
 
#define ELSE
 
#define Assert(condition)
 
#define REDUCE(operation)
 
#define REDUCE_INPUT_GRAPH(operation)
 
#define __   Asm().
 
#define TURBOSHAFT_REDUCER_GENERIC_BOILERPLATE(Name)
 
#define TURBOSHAFT_REDUCER_BOILERPLATE(Name)
 
#define LABEL_BLOCK(label)
 
#define EMIT_OP(Name)
 
#define REDUCE_THROWING_OP(Name)
 
#define DECL_GENERIC_BINOP(Name)
 
#define DECL_GENERIC_UNOP(Name)
 
#define DECL_MULTI_REP_BINOP(name, operation, rep_type, kind)
 
#define DECL_MULTI_REP_BINOP_V(name, operation, kind, tag)
 
#define DECL_SINGLE_REP_BINOP_V(name, operation, kind, tag)
 
#define DECL_MULTI_REP_CHECK_BINOP_V(name, operation, kind, tag)
 
#define DECL_SINGLE_REP_CHECK_BINOP_V(name, operation, kind, tag)
 
#define DECL_SINGLE_REP_SHIFT_V(name, kind, tag)
 
#define DECL_SINGLE_REP_EQUAL_V(name, tag)
 
#define DECL_SINGLE_REP_COMPARISON_V(name, kind, tag)
 
#define DECL_MULTI_REP_UNARY(name, operation, rep_type, kind)
 
#define DECL_MULTI_REP_UNARY_V(name, operation, rep_type, kind, tag)
 
#define DECL_SINGLE_REP_UNARY_V(name, operation, kind, tag)
 
#define DECL_SINGLE_REP_BINOP_DEOPT_OVERFLOW(operation, rep_type)
 
#define DECL_TAGGED_BITCAST(FromT, ToT, kind)
 
#define DECL_OBJECT_IS(kind)
 
#define CONVERT_PRIMITIVE_TO_OBJECT(name, kind, input_rep, input_interpretation)
 
#define DECL_CHANGE_V(name, kind, assumption, from, to)
 
#define DECL_TRY_CHANGE_V(name, kind, from, to)
 
#define DECL_SIGNED_FLOAT_TRUNCATE(FloatBits, ResultBits)
 
#define DECL_UNSIGNED_FLOAT_TRUNCATE(FloatBits, ResultBits)
 
#define DEF_SELECT(Rep)
 
#define DECL_GENERIC_BINOP_BUILTIN_CALL(Name)
 
#define DECL_GENERIC_UNOP_BUILTIN_CALL(Name)
 
#define BIGINT_BINOP(kind)
 
#define BIGINT_COMPARE(kind)
 
#define HEAP_CONSTANT_ACCESSOR(rootIndexName, rootAccessorName, name)
 
#define HEAP_CONSTANT_ACCESSOR(rootIndexName, rootAccessorName, name)
 
#define HEAP_CONSTANT_TEST(rootIndexName, rootAccessorName, name)
 
#define REDUCE_OP(Op)
 

Typedefs

template<typename T >
using v8::internal::compiler::turboshaft::detail::index_type_for_t = typename IndexTypeFor<T>::type
 
template<typename T >
using v8::internal::compiler::turboshaft::LoopLabelFor = detail::LoopLabelForHelper<T>::type
 

Enumerations

enum  v8::internal::compiler::turboshaft::ConditionalGotoStatus { v8::internal::compiler::turboshaft::kGotoDestination = 1 , v8::internal::compiler::turboshaft::kGotoEliminated = 2 , v8::internal::compiler::turboshaft::kBranch = 3 }
 

Functions

template<typename T >
 v8::internal::compiler::turboshaft::Range (V< T >, V< T >, V< T >) -> Range< T >
 
template<typename T >
 v8::internal::compiler::turboshaft::Range (V< T >, V< T >, typename ConstOrV< T >::constant_type) -> Range< T >
 
template<typename T >
 v8::internal::compiler::turboshaft::Range (V< T >, typename ConstOrV< T >::constant_type, typename ConstOrV< T >::constant_type) -> Range< T >
 
template<typename T >
 v8::internal::compiler::turboshaft::Sequence (V< T >, V< T >) -> Sequence< T >
 
template<typename T >
 v8::internal::compiler::turboshaft::Sequence (V< T >, typename ConstOrV< T >::constant_type) -> Sequence< T >
 
template<typename T >
 v8::internal::compiler::turboshaft::Sequence (V< T >) -> Sequence< T >
 
template<typename... Iterables>
 v8::internal::compiler::turboshaft::Zip (Iterables... iterables) -> Zip< Iterables... >
 
template<typename A , typename ConstOrValues >
auto v8::internal::compiler::turboshaft::detail::ResolveAll (A &assembler, const ConstOrValues &const_or_values)
 
bool v8::internal::compiler::turboshaft::detail::SuppressUnusedWarning (bool b)
 
template<typename T >
auto v8::internal::compiler::turboshaft::detail::unwrap_unary_tuple (std::tuple< T > &&tpl)
 
template<typename T1 , typename T2 , typename... Rest>
auto v8::internal::compiler::turboshaft::detail::unwrap_unary_tuple (std::tuple< T1, T2, Rest... > &&tpl)
 
Handle< Codev8::internal::compiler::turboshaft::BuiltinCodeHandle (Builtin builtin, Isolate *isolate)
 
template<typename T >
T && v8::internal::compiler::turboshaft::detail::MakeShadowy (T &&value)
 
ShadowyOpIndex v8::internal::compiler::turboshaft::detail::MakeShadowy (OpIndex value)
 
template<typename T >
ShadowyOpIndex v8::internal::compiler::turboshaft::detail::MakeShadowy (V< T > value)
 
ShadowyOpIndexVectorWrapper v8::internal::compiler::turboshaft::detail::MakeShadowy (base::Vector< const OpIndex > value)
 
template<typename T >
ShadowyOpIndexVectorWrapper v8::internal::compiler::turboshaft::detail::MakeShadowy (base::Vector< const V< T > > value)
 
template<typename LoopLabel , typename Iterable , typename Iterator , typename ValueTuple , size_t... Indices>
auto v8::internal::compiler::turboshaft::detail::BuildResultTupleImpl (bool bound, Iterable &&iterable, LoopLabel &&loop_header, Label<> loop_exit, Iterator current_iterator, ValueTuple current_values, std::index_sequence< Indices... >)
 
template<typename LoopLabel , typename Iterable , typename Iterator , typename Value >
auto v8::internal::compiler::turboshaft::detail::BuildResultTuple (bool bound, Iterable &&iterable, LoopLabel &&loop_header, Label<> loop_exit, Iterator current_iterator, Value current_value)
 
template<typename LoopLabel , typename Iterable , typename Iterator , typename... Values>
auto v8::internal::compiler::turboshaft::detail::BuildResultTuple (bool bound, Iterable &&iterable, LoopLabel &&loop_header, Label<> loop_exit, Iterator current_iterator, std::tuple< Values... > current_values)
 

Macro Definition Documentation

◆ __

#define __   Asm().

◆ Assert

#define Assert ( condition)
Value:
AssertImpl(condition, #condition, __FILE__, __LINE__)

◆ BIGINT_BINOP

#define BIGINT_BINOP ( kind)
Value:
V<BigInt> BigInt##kind(V<BigInt> left, V<BigInt> right, \
V<turboshaft::FrameState> frame_state) { \
return BigIntBinop(left, right, frame_state, \
BigIntBinopOp::Kind::k##kind); \
}
#define V(Name)
Builtins::Kind kind
Definition builtins.cc:40

Definition at line 4491 of file assembler.h.

◆ BIGINT_COMPARE

#define BIGINT_COMPARE ( kind)
Value:
V<Boolean> BigInt##kind(V<BigInt> left, V<BigInt> right) { \
return BigIntComparison(left, right, BigIntComparisonOp::Kind::k##kind); \
}

Definition at line 4513 of file assembler.h.

◆ BIND

#define BIND ( label,
... )
Value:
auto [CONCAT(is_bound_, __LINE__), ##__VA_ARGS__] = \
Asm().ControlFlowHelper_Bind(label); \
CONCAT(is_bound_, __LINE__)))
Label label
#define CONCAT(a,...)
Definition macros.h:22

◆ BIND_LOOP

#define BIND_LOOP ( loop_label,
... )
Value:
for(auto [CONCAT(run_loop_, __LINE__), ##__VA_ARGS__] = \
Asm().ControlFlowHelper_BindLoop(loop_label); CONCAT(run_loop_, __LINE__); \
Asm().ControlFlowHelper_EndLoop(loop_label), \
CONCAT(run_loop_, __LINE__) = false)

◆ BREAK

#define BREAK   Asm().ControlFlowHelper_Goto(loop_exit_xx, {})

◆ CONTINUE

#define CONTINUE   Asm().ControlFlowHelper_Goto(loop_header_xx, {})

◆ CONVERT_PRIMITIVE_TO_OBJECT

#define CONVERT_PRIMITIVE_TO_OBJECT ( name,
kind,
input_rep,
input_interpretation )
Value:
return V<kind>::Cast(ConvertUntaggedToJSPrimitive( \
input, ConvertUntaggedToJSPrimitiveOp::JSPrimitiveKind::k##kind, \
RegisterRepresentation::input_rep(), \
ConvertUntaggedToJSPrimitiveOp::InputInterpretation:: \
k##input_interpretation, \
CheckForMinusZeroMode::kDontCheckForMinusZero)); \
}
const char * name
Definition builtins.cc:39

Definition at line 2161 of file assembler.h.

◆ DECL_CHANGE_V

#define DECL_CHANGE_V ( name,
kind,
assumption,
from,
to )
Value:
V<to> name(ConstOrV<from> input) { \
return ReduceIfReachableChange(resolve(input), ChangeOp::Kind::kind, \
ChangeOp::Assumption::assumption, \
V<from>::rep, V<to>::rep); \
}

Definition at line 2432 of file assembler.h.

◆ DECL_GENERIC_BINOP

#define DECL_GENERIC_BINOP ( Name)
Value:
V<Object> Generic##Name( \
V<Object> left, V<Object> right, V<turboshaft::FrameState> frame_state, \
V<Context> context, LazyDeoptOnThrow lazy_deopt_on_throw) { \
return GenericBinop(left, right, frame_state, context, \
GenericBinopOp::Kind::k##Name, lazy_deopt_on_throw); \
}

Definition at line 1554 of file assembler.h.

◆ DECL_GENERIC_BINOP_BUILTIN_CALL

#define DECL_GENERIC_BINOP_BUILTIN_CALL ( Name)
Value:
V<Object> CallBuiltin_##Name( \
Isolate* isolate, V<turboshaft::FrameState> frame_state, \
V<Context> context, V<Object> lhs, V<Object> rhs, \
LazyDeoptOnThrow lazy_deopt_on_throw) { \
return CallBuiltin<typename BuiltinCallDescriptor::Name>( \
isolate, frame_state, context, {lhs, rhs}, lazy_deopt_on_throw); \
}

Definition at line 3514 of file assembler.h.

◆ DECL_GENERIC_UNOP

#define DECL_GENERIC_UNOP ( Name)
Value:
V<Object> Generic##Name( \
V<Object> input, V<turboshaft::FrameState> frame_state, \
V<Context> context, LazyDeoptOnThrow lazy_deopt_on_throw) { \
return GenericUnop(input, frame_state, context, \
GenericUnopOp::Kind::k##Name, lazy_deopt_on_throw); \
}

Definition at line 1570 of file assembler.h.

◆ DECL_GENERIC_UNOP_BUILTIN_CALL

#define DECL_GENERIC_UNOP_BUILTIN_CALL ( Name)
Value:
V<Object> CallBuiltin_##Name(Isolate* isolate, \
V<Context> context, V<Object> input, \
LazyDeoptOnThrow lazy_deopt_on_throw) { \
return CallBuiltin<typename BuiltinCallDescriptor::Name>( \
isolate, frame_state, context, {input}, lazy_deopt_on_throw); \
}

Definition at line 3525 of file assembler.h.

◆ DECL_MULTI_REP_BINOP

#define DECL_MULTI_REP_BINOP ( name,
operation,
rep_type,
kind )
Value:
OpIndex name(OpIndex left, OpIndex right, rep_type rep) { \
return ReduceIfReachable##operation(left, right, \
operation##Op::Kind::k##kind, rep); \
}

Definition at line 1601 of file assembler.h.

◆ DECL_MULTI_REP_BINOP_V

#define DECL_MULTI_REP_BINOP_V ( name,
operation,
kind,
tag )
Value:
V<tag> name(V<tag> left, V<tag> right, v_traits<tag>::rep_type rep) { \
return ReduceIfReachable##operation(left, right, \
operation##Op::Kind::k##kind, rep); \
}

Definition at line 1607 of file assembler.h.

◆ DECL_MULTI_REP_CHECK_BINOP_V

#define DECL_MULTI_REP_CHECK_BINOP_V ( name,
operation,
kind,
tag )
Value:
v_traits<tag>::rep_type rep) { \
return ReduceIfReachable##operation(left, right, \
operation##Op::Kind::k##kind, rep); \
}

Definition at line 1687 of file assembler.h.

◆ DECL_MULTI_REP_UNARY

#define DECL_MULTI_REP_UNARY ( name,
operation,
rep_type,
kind )
Value:
OpIndex name(OpIndex input, rep_type rep) { \
return ReduceIfReachable##operation(input, operation##Op::Kind::k##kind, \
rep); \
}

Definition at line 1893 of file assembler.h.

◆ DECL_MULTI_REP_UNARY_V

#define DECL_MULTI_REP_UNARY_V ( name,
operation,
rep_type,
kind,
tag )
Value:
V<tag> name(V<tag> input, rep_type rep) { \
return ReduceIfReachable##operation(input, operation##Op::Kind::k##kind, \
rep); \
}

Definition at line 1898 of file assembler.h.

◆ DECL_OBJECT_IS

#define DECL_OBJECT_IS ( kind)
Value:
V<Word32> ObjectIs##kind(V<Object> object) { \
return ObjectIs(object, ObjectIsOp::Kind::k##kind, \
ObjectIsOp::InputAssumptions::kNone); \
}

Definition at line 2088 of file assembler.h.

◆ DECL_SIGNED_FLOAT_TRUNCATE

#define DECL_SIGNED_FLOAT_TRUNCATE ( FloatBits,
ResultBits )
Value:
TruncateFloat##FloatBits##ToInt##ResultBits##OverflowUndefined, \
kSignedFloatTruncateOverflowToMin, kNoOverflow, Float##FloatBits, \
Word##ResultBits) \
DECL_TRY_CHANGE_V(TryTruncateFloat##FloatBits##ToInt##ResultBits, \
kSignedFloatTruncateOverflowUndefined, Float##FloatBits, \
Word##ResultBits)
#define DECL_CHANGE_V(name, kind, assumption, from, to)
Definition assembler.h:2432

Definition at line 2544 of file assembler.h.

◆ DECL_SINGLE_REP_BINOP_DEOPT_OVERFLOW

#define DECL_SINGLE_REP_BINOP_DEOPT_OVERFLOW ( operation,
rep_type )
Value:
OpIndex rep_type##operation##DeoptOnOverflow( \
ConstOrV<rep_type> left, ConstOrV<rep_type> right, \
V<turboshaft::FrameState> frame_state, FeedbackSource feedback, \
CheckForMinusZeroMode mode = \
CheckForMinusZeroMode::kDontCheckForMinusZero) { \
return WordBinopDeoptOnOverflow( \
resolve(left), resolve(right), frame_state, \
WordBinopDeoptOnOverflowOp::Kind::k##operation, \
WordRepresentation::rep_type(), feedback, mode); \
}

Definition at line 2014 of file assembler.h.

◆ DECL_SINGLE_REP_BINOP_V

#define DECL_SINGLE_REP_BINOP_V ( name,
operation,
kind,
tag )
Value:
V<tag> name(ConstOrV<tag> left, ConstOrV<tag> right) { \
return ReduceIfReachable##operation(resolve(left), resolve(right), \
operation##Op::Kind::k##kind, \
V<tag>::rep); \
}

Definition at line 1613 of file assembler.h.

◆ DECL_SINGLE_REP_CHECK_BINOP_V

#define DECL_SINGLE_REP_CHECK_BINOP_V ( name,
operation,
kind,
tag )
Value:
V<turboshaft::Tuple<tag, Word32>> name(ConstOrV<tag> left, \
ConstOrV<tag> right) { \
return ReduceIfReachable##operation(resolve(left), resolve(right), \
operation##Op::Kind::k##kind, \
V<tag>::rep); \
}

Definition at line 1693 of file assembler.h.

◆ DECL_SINGLE_REP_COMPARISON_V

#define DECL_SINGLE_REP_COMPARISON_V ( name,
kind,
tag )
Value:
V<Word32> name(ConstOrV<tag> left, ConstOrV<tag> right) { \
return ReduceIfReachableComparison(resolve(left), resolve(right), \
ComparisonOp::Kind::k##kind, \
V<tag>::rep); \
}

Definition at line 1829 of file assembler.h.

◆ DECL_SINGLE_REP_EQUAL_V

#define DECL_SINGLE_REP_EQUAL_V ( name,
tag )
Value:
V<Word32> name(ConstOrV<tag> left, ConstOrV<tag> right) { \
return ReduceIfReachableComparison(resolve(left), resolve(right), \
ComparisonOp::Kind::kEqual, \
V<tag>::rep); \
}

Definition at line 1816 of file assembler.h.

◆ DECL_SINGLE_REP_SHIFT_V

#define DECL_SINGLE_REP_SHIFT_V ( name,
kind,
tag )
Value:
V<tag> name(ConstOrV<tag> left, ConstOrV<Word32> right) { \
return ReduceIfReachableShift(resolve(left), resolve(right), \
ShiftOp::Kind::k##kind, V<tag>::rep); \
}

Definition at line 1748 of file assembler.h.

◆ DECL_SINGLE_REP_UNARY_V

#define DECL_SINGLE_REP_UNARY_V ( name,
operation,
kind,
tag )
Value:
V<tag> name(ConstOrV<tag> input) { \
return ReduceIfReachable##operation( \
resolve(input), operation##Op::Kind::k##kind, V<tag>::rep); \
}

Definition at line 1903 of file assembler.h.

◆ DECL_TAGGED_BITCAST

#define DECL_TAGGED_BITCAST ( FromT,
ToT,
kind )
Value:
V<ToT> Bitcast##FromT##To##ToT(V<FromT> input) { \
return TaggedBitcast(input, V<FromT>::rep, V<ToT>::rep, \
TaggedBitcastOp::Kind::kind); \
}

Definition at line 2056 of file assembler.h.

◆ DECL_TRY_CHANGE_V

#define DECL_TRY_CHANGE_V ( name,
kind,
from,
to )
Value:
return ReduceIfReachableTryChange(input, TryChangeOp::Kind::kind, \
V<from>::rep, V<to>::rep); \
}

Definition at line 2438 of file assembler.h.

◆ DECL_UNSIGNED_FLOAT_TRUNCATE

#define DECL_UNSIGNED_FLOAT_TRUNCATE ( FloatBits,
ResultBits )
Value:
TruncateFloat##FloatBits##ToUint##ResultBits##OverflowUndefined, \
kUnsignedFloatTruncateOverflowToMin, kNoOverflow, Float##FloatBits, \
Word##ResultBits) \
DECL_CHANGE_V(TruncateFloat##FloatBits##ToUint##ResultBits##OverflowToMin, \
kUnsignedFloatTruncateOverflowToMin, kNoAssumption, \
Float##FloatBits, Word##ResultBits) \
DECL_TRY_CHANGE_V(TryTruncateFloat##FloatBits##ToUint##ResultBits, \
kUnsignedFloatTruncateOverflowUndefined, Float##FloatBits, \
Word##ResultBits)

Definition at line 2565 of file assembler.h.

◆ DEF_SELECT

#define DEF_SELECT ( Rep)
Value:
V<Rep> Rep##Select(ConstOrV<Word32> cond, ConstOrV<Rep> vtrue, \
ConstOrV<Rep> vfalse) { \
return Select<Rep>(resolve(cond), resolve(vtrue), resolve(vfalse), \
RegisterRepresentation::Rep(), BranchHint::kNone, \
SelectOp::Implementation::kCMove); \
}

Definition at line 3266 of file assembler.h.

◆ ELSE

#define ELSE
Value:
iteration == 1 && (bound = Asm().ControlFlowHelper_BindElse(&state)))
#define SUPPRESSED_DANGLING_ELSE_WARNING_ELSE

◆ EMIT_OP

#define EMIT_OP ( Name)
Value:
OpIndex ReduceInputGraph##Name(OpIndex ig_index, const Name##Op& op) { \
return this->Asm().AssembleOutputGraph##Name(op); \
} \
template <class... Args> \
OpIndex Reduce##Name(Args... args) { \
return this->Asm().template Emit<Name##Op>(detail::MakeShadowy(args)...); \
}
base::Vector< const DirectHandle< Object > > args
Definition execution.cc:74

Definition at line 1068 of file assembler.h.

◆ FORCE_UNROLL_LOOP

#define FORCE_UNROLL_LOOP

◆ FOREACH

#define FOREACH ( ...)
Value:
CONCAT(FOREACH_IMPL_, COUNT_MACRO_ARGS(__VA_ARGS__))(__VA_ARGS__)
#define COUNT_MACRO_ARGS(...)
Definition macros.h:28

◆ FOREACH_IMPL_2

#define FOREACH_IMPL_2 ( arg,
iterable )
Value:
for (auto [CONCAT(run_loop_, __LINE__), iterable_xx, loop_header_yy, \
loop_exit_xx, current_iterator_xx, arg] = \
Asm().ControlFlowHelper_Foreach(iterable); \
CONCAT(run_loop_, __LINE__); \
Asm().ControlFlowHelper_EndForeachLoop( \
std::move(iterable_xx), loop_header_yy, loop_exit_xx, \
current_iterator_xx), \
CONCAT(run_loop_, __LINE__) = false)

◆ FOREACH_IMPL_3

#define FOREACH_IMPL_3 ( arg0,
arg1,
iterable )
Value:
for (auto [CONCAT(run_loop_, __LINE__), iterable_xx, loop_header_yy, \
loop_exit_xx, current_iterator_xx, arg0, arg1] = \
Asm().ControlFlowHelper_Foreach(iterable); \
CONCAT(run_loop_, __LINE__); \
Asm().ControlFlowHelper_EndForeachLoop( \
std::move(iterable_xx), loop_header_yy, loop_exit_xx, \
current_iterator_xx), \
CONCAT(run_loop_, __LINE__) = false)

◆ GOTO

#define GOTO ( label,
... )
Value:
Asm().ControlFlowHelper_Goto(label, {__VA_ARGS__})

◆ GOTO_IF

#define GOTO_IF ( cond,
label,
... )
Value:
Asm().ControlFlowHelper_GotoIf(cond, label, {__VA_ARGS__})

◆ GOTO_IF_NOT

#define GOTO_IF_NOT ( cond,
label,
... )
Value:
Asm().ControlFlowHelper_GotoIfNot(cond, label, {__VA_ARGS__})

◆ HEAP_CONSTANT_ACCESSOR [1/2]

#define HEAP_CONSTANT_ACCESSOR ( rootIndexName,
rootAccessorName,
name )
Value:
V<RemoveTagged< \
decltype(std::declval<ReadOnlyRoots>().rootAccessorName())>::type> \
name##Constant() { \
const TurboshaftPipelineKind kind = __ data() -> pipeline_kind(); \
if (V8_UNLIKELY(kind == TurboshaftPipelineKind::kCSA || \
kind == TurboshaftPipelineKind::kTSABuiltin)) { \
DCHECK(RootsTable::IsImmortalImmovable(RootIndex::k##rootIndexName)); \
return V<RemoveTagged< \
decltype(std::declval<ReadOnlyRoots>().rootAccessorName())>::type>:: \
Cast(__ LoadRoot(RootIndex::k##rootIndexName)); \
} else { \
Isolate* isolate = __ data() -> isolate(); \
DCHECK_NOT_NULL(isolate); \
Factory* factory = isolate->factory(); \
DCHECK_NOT_NULL(factory); \
return __ HeapConstant(factory->rootAccessorName()); \
} \
}
union v8::internal::@341::BuiltinMetadata::KindSpecificData data
#define __
TurboshaftPipelineKind pipeline_kind
Isolate * isolate
#define V8_UNLIKELY(condition)
Definition v8config.h:660

Definition at line 4801 of file assembler.h.

◆ HEAP_CONSTANT_ACCESSOR [2/2]

#define HEAP_CONSTANT_ACCESSOR ( rootIndexName,
rootAccessorName,
name )
Value:
V<RemoveTagged<decltype(std::declval<Heap>().rootAccessorName())>::type> \
name##Constant() { \
const TurboshaftPipelineKind kind = __ data() -> pipeline_kind(); \
if (V8_UNLIKELY(kind == TurboshaftPipelineKind::kCSA || \
kind == TurboshaftPipelineKind::kTSABuiltin)) { \
DCHECK(RootsTable::IsImmortalImmovable(RootIndex::k##rootIndexName)); \
return V< \
RemoveTagged<decltype(std::declval<Heap>().rootAccessorName())>:: \
type>::Cast(__ LoadRoot(RootIndex::k##rootIndexName)); \
} else { \
Isolate* isolate = __ data() -> isolate(); \
DCHECK_NOT_NULL(isolate); \
Factory* factory = isolate->factory(); \
DCHECK_NOT_NULL(factory); \
return __ HeapConstant(factory->rootAccessorName()); \
} \
}

Definition at line 4801 of file assembler.h.

◆ HEAP_CONSTANT_TEST

#define HEAP_CONSTANT_TEST ( rootIndexName,
rootAccessorName,
name )
Value:
V<Word32> Is##name(V<Object> value) { \
return TaggedEqual(value, name##Constant()); \
} \
V<Word32> IsNot##name(V<Object> value) { \
return TaggedNotEqual(value, name##Constant()); \
}

Definition at line 4844 of file assembler.h.

◆ IF

#define IF ( ...)
Value:
NO_SHADOW \
SUPPRESSED_DANGLING_ELSE_WARNING_IF( \
typename std::decay_t<decltype(Asm())>::ControlFlowHelper_IfState state; \
true) \
for (int iteration = 0, bound = false; iteration < 3; \
(bound ? Asm().ControlFlowHelper_FinishIfBlock(&state) : (void)0), \
bound = false, iteration++) \
RE_SHADOW \
SUPPRESSED_DANGLING_ELSE_WARNING_IF(iteration == 2) { \
Asm().ControlFlowHelper_EndIf(&state); \
} \
iteration == 0 && \
(bound = Asm().ControlFlowHelper_BindIf(__VA_ARGS__, &state)))
#define FORCE_UNROLL_LOOP

◆ IF_NOT

#define IF_NOT ( ...)
Value:
NO_SHADOW \
SUPPRESSED_DANGLING_ELSE_WARNING_IF( \
typename std::decay_t<decltype(Asm())>::ControlFlowHelper_IfState state; \
true) \
for (int iteration = 0, bound = false; iteration < 3; \
(bound ? Asm().ControlFlowHelper_FinishIfBlock(&state) : (void)0), \
bound = false, iteration++) \
RE_SHADOW \
SUPPRESSED_DANGLING_ELSE_WARNING_IF(iteration == 2) { \
Asm().ControlFlowHelper_EndIf(&state); \
} \
iteration == 0 && \
(bound = Asm().ControlFlowHelper_BindIfNot(__VA_ARGS__, &state)))

◆ LABEL_BLOCK

#define LABEL_BLOCK ( label)
Value:
for (; false; UNREACHABLE()) \
#define UNREACHABLE()
Definition logging.h:67

Definition at line 910 of file assembler.h.

◆ LIKELY

#define LIKELY ( ...)
Value:
ConditionWithHint(__VA_ARGS__, BranchHint::kTrue)

◆ NO_SHADOW

#define NO_SHADOW
Value:
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wshadow\"")

◆ RE_SHADOW

#define RE_SHADOW   _Pragma("GCC diagnostic pop")

◆ REDUCE

#define REDUCE ( operation)
Value:
Reduce##operation

◆ REDUCE_INPUT_GRAPH

#define REDUCE_INPUT_GRAPH ( operation)
Value:
ReduceInputGraph##operation

◆ REDUCE_OP

#define REDUCE_OP ( Op)
Value:
template <class... Args> \
V8_INLINE OpIndex ReduceIfReachable##Op(Args... args) { \
if (V8_UNLIKELY(Asm().generating_unreachable_operations())) { \
return OpIndex::Invalid(); \
} \
/* With an empty reducer stack, `Asm().Reduce##Op` will just create a */ \
/* new `Op` operation (defined in operations.h). To figure out where */ \
/* this operation is lowered or optimized (if anywhere), search for */ \
/* `REDUCE(<your operation>)`. Then, to know when this lowering */ \
/* actually happens, search for phases that are instantiated with */ \
/* that reducer. You can also look in operation.h where the opcode is */ \
/* declared: operations declared in */ \
/* TURBOSHAFT_SIMPLIFIED_OPERATION_LIST are typically lowered in */ \
/* machine-lowering-reducer-inl.h, and operations in */ \
/* TURBOSHAFT_MACHINE_OPERATION_LIST are typically not lowered before */ \
/* reaching instruction-selector.h. */ \
return Asm().Reduce##Op(args...); \
}
#define V8_INLINE
Definition v8config.h:500

Definition at line 5179 of file assembler.h.

◆ REDUCE_THROWING_OP

#define REDUCE_THROWING_OP ( Name)
Value:
template <typename... Args> \
V<Any> Reduce##Name(Args... args) { \
OpIndex raw_op_index = Base::Reduce##Name(args...); \
bool has_catch_block = CatchIfInCatchScope(raw_op_index); \
const Name##Op& raw_op = \
Asm().output_graph().Get(raw_op_index).template Cast<Name##Op>(); \
return ReduceDidntThrow(raw_op_index, has_catch_block, &raw_op.kOutReps, \
raw_op.Effects()); \
}

Definition at line 1263 of file assembler.h.

◆ SUPPRESSED_DANGLING_ELSE_WARNING_ELSE

#define SUPPRESSED_DANGLING_ELSE_WARNING_ELSE   else

◆ SUPPRESSED_DANGLING_ELSE_WARNING_IF

#define SUPPRESSED_DANGLING_ELSE_WARNING_IF ( ...)
Value:
if (__VA_ARGS__)

◆ TSA_DCHECK

#define TSA_DCHECK ( assembler,
condition )
Value:
(assembler)->Asm().Dcheck(condition, #condition, __FILE__, __LINE__ )
AssemblerT assembler

◆ TSA_SLOW_DCHECK

#define TSA_SLOW_DCHECK ( assembler,
... )
Value:
((void)0)

◆ TURBOSHAFT_REDUCER_BOILERPLATE

#define TURBOSHAFT_REDUCER_BOILERPLATE ( Name)
Value:
using node_t = typename Next::node_t; \
using block_t = typename Next::block_t;
#define TURBOSHAFT_REDUCER_GENERIC_BOILERPLATE(Name)
Definition assembler.h:813

Definition at line 823 of file assembler.h.

◆ TURBOSHAFT_REDUCER_GENERIC_BOILERPLATE

#define TURBOSHAFT_REDUCER_GENERIC_BOILERPLATE ( Name)
Value:
using ReducerList = typename Next::ReducerList; \
using assembler_t = compiler::turboshaft::Assembler<ReducerList>; \
assembler_t& Asm() { return *static_cast<assembler_t*>(this); } \
template <class T> \
using ScopedVar = compiler::turboshaft::ScopedVar<T, assembler_t>; \
using CatchScope = compiler::turboshaft::CatchScopeImpl<assembler_t>; \
static constexpr auto& ReducerName() { return #Name; }

Definition at line 813 of file assembler.h.

◆ UNLIKELY

#define UNLIKELY ( ...)
Value:
ConditionWithHint(__VA_ARGS__, BranchHint::kFalse)

◆ V8_COMPILER_TURBOSHAFT_ASSEMBLER_MACROS_DEFINED

#define V8_COMPILER_TURBOSHAFT_ASSEMBLER_MACROS_DEFINED   1

◆ WHILE

#define WHILE ( ...)
Value:
for (auto [CONCAT(run_loop_, __LINE__), loop_header_xx, loop_exit_xx] \
= Asm().ControlFlowHelper_While([&]() { \
return Asm().resolve(ConstOrV<Word32>(__VA_ARGS__)); \
}); \
CONCAT(run_loop_, __LINE__); \
Asm().ControlFlowHelper_EndWhileLoop(loop_header_xx, loop_exit_xx), \
CONCAT(run_loop_, __LINE__) = false)