V8 Project
v8::internal::compiler::JSCallReduction Class Reference
+ Collaboration diagram for v8::internal::compiler::JSCallReduction:

Public Member Functions

 JSCallReduction (Node *node)
 
bool HasBuiltinFunctionId ()
 
BuiltinFunctionId GetBuiltinFunctionId ()
 
bool InputsMatchZero ()
 
bool InputsMatchOne (Type *t1)
 
bool InputsMatchTwo (Type *t1, Type *t2)
 
bool InputsMatchAll (Type *t)
 
Node * left ()
 
Node * right ()
 
int GetJSCallArity ()
 
Node * GetJSCallInput (int index)
 

Private Attributes

Node * node_
 

Detailed Description

Definition at line 29 of file js-builtin-reducer.cc.

Constructor & Destructor Documentation

◆ JSCallReduction()

v8::internal::compiler::JSCallReduction::JSCallReduction ( Node *  node)
inlineexplicit

Definition at line 31 of file js-builtin-reducer.cc.

Member Function Documentation

◆ GetBuiltinFunctionId()

BuiltinFunctionId v8::internal::compiler::JSCallReduction::GetBuiltinFunctionId ( )
inline

Definition at line 44 of file js-builtin-reducer.cc.

44  {
45  DCHECK_EQ(IrOpcode::kJSCallFunction, node_->opcode());
46  HeapObjectMatcher<Object> m(NodeProperties::GetValueInput(node_, 0));
47  Handle<JSFunction> function = Handle<JSFunction>::cast(m.Value().handle());
48  return function->shared()->builtin_function_id();
49  }
static Handle< T > cast(Handle< S > that)
Definition: handles.h:116
static Node * GetValueInput(Node *node, int index)
#define DCHECK_EQ(v1, v2)
Definition: logging.h:206

References v8::internal::Handle< T >::cast(), DCHECK_EQ, v8::internal::compiler::NodeProperties::GetValueInput(), and node_.

+ Here is the call graph for this function:

◆ GetJSCallArity()

int v8::internal::compiler::JSCallReduction::GetJSCallArity ( )
inline

Definition at line 80 of file js-builtin-reducer.cc.

80  {
81  DCHECK_EQ(IrOpcode::kJSCallFunction, node_->opcode());
82  // Skip first (i.e. callee) and second (i.e. receiver) operand.
84  }
static int GetValueInputCount(const Operator *op)

References DCHECK_EQ, v8::internal::compiler::OperatorProperties::GetValueInputCount(), and node_.

Referenced by GetJSCallInput(), InputsMatchAll(), InputsMatchOne(), InputsMatchTwo(), and InputsMatchZero().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetJSCallInput()

Node* v8::internal::compiler::JSCallReduction::GetJSCallInput ( int  index)
inline

Definition at line 86 of file js-builtin-reducer.cc.

86  {
87  DCHECK_EQ(IrOpcode::kJSCallFunction, node_->opcode());
88  DCHECK_LT(index, GetJSCallArity());
89  // Skip first (i.e. callee) and second (i.e. receiver) operand.
90  return NodeProperties::GetValueInput(node_, index + 2);
91  }
#define DCHECK_LT(v1, v2)
Definition: logging.h:209

References DCHECK_EQ, DCHECK_LT, GetJSCallArity(), v8::internal::compiler::NodeProperties::GetValueInput(), and node_.

Referenced by InputsMatchAll(), InputsMatchOne(), InputsMatchTwo(), left(), and right().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasBuiltinFunctionId()

bool v8::internal::compiler::JSCallReduction::HasBuiltinFunctionId ( )
inline

Definition at line 35 of file js-builtin-reducer.cc.

35  {
36  if (node_->opcode() != IrOpcode::kJSCallFunction) return false;
37  HeapObjectMatcher<Object> m(NodeProperties::GetValueInput(node_, 0));
38  if (!m.HasValue() || !m.Value().handle()->IsJSFunction()) return false;
39  Handle<JSFunction> function = Handle<JSFunction>::cast(m.Value().handle());
40  return function->shared()->HasBuiltinFunctionId();
41  }

References v8::internal::Handle< T >::cast(), v8::internal::compiler::NodeProperties::GetValueInput(), and node_.

+ Here is the call graph for this function:

◆ InputsMatchAll()

bool v8::internal::compiler::JSCallReduction::InputsMatchAll ( Type t)
inline

Definition at line 68 of file js-builtin-reducer.cc.

68  {
69  for (int i = 0; i < GetJSCallArity(); i++) {
71  return false;
72  }
73  }
74  return true;
75  }

References v8::internal::compiler::NodeProperties::GetBounds(), GetJSCallArity(), GetJSCallInput(), and v8::internal::BoundsImpl< Config >::upper.

+ Here is the call graph for this function:

◆ InputsMatchOne()

bool v8::internal::compiler::JSCallReduction::InputsMatchOne ( Type t1)
inline

Definition at line 55 of file js-builtin-reducer.cc.

55  {
56  return GetJSCallArity() == 1 &&
58  }

References v8::internal::compiler::NodeProperties::GetBounds(), GetJSCallArity(), GetJSCallInput(), and v8::internal::BoundsImpl< Config >::upper.

+ Here is the call graph for this function:

◆ InputsMatchTwo()

bool v8::internal::compiler::JSCallReduction::InputsMatchTwo ( Type t1,
Type t2 
)
inline

Definition at line 61 of file js-builtin-reducer.cc.

61  {
62  return GetJSCallArity() == 2 &&
65  }

References v8::internal::compiler::NodeProperties::GetBounds(), GetJSCallArity(), GetJSCallInput(), and v8::internal::BoundsImpl< Config >::upper.

+ Here is the call graph for this function:

◆ InputsMatchZero()

bool v8::internal::compiler::JSCallReduction::InputsMatchZero ( )
inline

Definition at line 52 of file js-builtin-reducer.cc.

52 { return GetJSCallArity() == 0; }

References GetJSCallArity().

+ Here is the call graph for this function:

◆ left()

Node* v8::internal::compiler::JSCallReduction::left ( )
inline

Definition at line 77 of file js-builtin-reducer.cc.

77 { return GetJSCallInput(0); }

References GetJSCallInput().

+ Here is the call graph for this function:

◆ right()

Node* v8::internal::compiler::JSCallReduction::right ( )
inline

Definition at line 78 of file js-builtin-reducer.cc.

78 { return GetJSCallInput(1); }

References GetJSCallInput().

+ Here is the call graph for this function:

Member Data Documentation

◆ node_

Node* v8::internal::compiler::JSCallReduction::node_
private

The documentation for this class was generated from the following file: