5 #ifndef V8_COMPILER_NODE_MATCHERS_H_
6 #define V8_COMPILER_NODE_MATCHERS_H_
26 Node*
InputAt(
int index)
const {
return node()->InputAt(index); }
28 #define DEFINE_IS_OPCODE(Opcode) \
29 bool Is##Opcode() const { return opcode() == IrOpcode::k##Opcode; }
31 #undef DEFINE_IS_OPCODE
39 template <
typename T, IrOpcode::Value kOpcode>
54 bool Is(
const T& value)
const {
69 template <
typename T, IrOpcode::Value kOpcode>
74 return this->HasValue() && this->
Value() > 0 &&
79 typedef IntMatcher<int32_t, IrOpcode::kInt32Constant>
Int32Matcher;
81 typedef IntMatcher<int64_t, IrOpcode::kInt64Constant>
Int64Matcher;
86 template <
typename T, IrOpcode::Value kOpcode>
90 bool IsNaN()
const {
return this->HasValue() && std::isnan(this->
Value()); }
100 struct HeapObjectMatcher
FINAL
101 :
public ValueMatcher<Unique<T>, IrOpcode::kHeapConstant> {
110 template <
typename Left,
typename Right>
111 struct BinopMatcher
FINAL :
public NodeMatcher {
113 :
NodeMatcher(node), left_(InputAt(0)), right_(InputAt(1)) {
117 const Left&
left()
const {
return left_; }
118 const Right&
right()
const {
return right_; }
120 bool IsFoldable()
const {
return left().HasValue() && right().HasValue(); }
125 if (left().HasValue() && !right().HasValue()) {
126 std::swap(left_, right_);
127 node()->ReplaceInput(0, left().node());
128 node()->ReplaceInput(1, right().node());
165 if (
opcode() != IrOpcode::kInt32Mul)
return;
167 if (!m.right().HasValue())
return;
168 int32_t value = m.right().Value();
181 left_ = m.left().node();
210 if (
opcode() == IrOpcode::kInt32Add) {
213 if (m.right().HasValue()) {
The superclass of all JavaScript values and objects.
Source to read snapshot and builtins files from.
const Right & right() const
bool LeftEqualsRight() const
void PutConstantOnRight()
const Left & left() const
HeapObjectMatcher(Node *node)
IndexAndDisplacementMatcher(Node *node)
bool HasProperty(Property property) const
ScaleFactorMatcher(Node *node)
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define DCHECK(condition)
FloatMatcher< float, IrOpcode::kFloat32Constant > Float32Matcher
IntMatcher< int64_t, IrOpcode::kInt64Constant > Int64Matcher
BinopMatcher< Uint64Matcher, Uint64Matcher > Uint64BinopMatcher
BinopMatcher< Uint32Matcher, Uint32Matcher > Uint32BinopMatcher
BinopMatcher< Int32Matcher, Int32Matcher > Int32BinopMatcher
FloatMatcher< double, IrOpcode::kFloat64Constant > Float64Matcher
BinopMatcher< Float64Matcher, Float64Matcher > Float64BinopMatcher
BinopMatcher< Int64Matcher, Int64Matcher > Int64BinopMatcher
IntMatcher< uint64_t, IrOpcode::kInt64Constant > Uint64Matcher
IntMatcher< int32_t, IrOpcode::kInt32Constant > Int32Matcher
IntMatcher< uint32_t, IrOpcode::kInt32Constant > Uint32Matcher
FloatMatcher< double, IrOpcode::kNumberConstant > NumberMatcher
Debugger support for the V8 JavaScript engine.
#define DEFINE_IS_OPCODE(Opcode)
Node * InputAt(int index) const
const Operator * op() const
bool HasProperty(Operator::Property property) const
IrOpcode::Value opcode() const
bool IsInRange(const T &low, const T &high) const
bool Is(const T &value) const
#define T(name, string, precedence)