22 linkage_(new (jsgraph->zone())
Linkage(info)) {}
31 node->InsertInput(
zone(), index, input);
61 switch (node->opcode()) {
62 #define DECLARE_CASE(x) \
63 case IrOpcode::k##x: \
77 #define REPLACE_BINARY_OP_IC_CALL(op, token) \
78 void JSGenericLowering::Lower##op(Node* node) { \
79 ReplaceWithStubCall(node, CodeFactory::BinaryOpIC(isolate(), token), \
80 CallDescriptor::kPatchableCallSiteWithNop); \
93 #undef REPLACE_BINARY_OP_IC_CALL
96 #define REPLACE_COMPARE_IC_CALL(op, token, pure) \
97 void JSGenericLowering::Lower##op(Node* node) { \
98 ReplaceWithCompareIC(node, token, pure); \
108 #undef REPLACE_COMPARE_IC_CALL
111 #define REPLACE_RUNTIME_CALL(op, fun) \
112 void JSGenericLowering::Lower##op(Node* node) { \
113 ReplaceWithRuntimeCall(node, fun); \
123 #undef REPLACE_RUNTIME
126 #define REPLACE_UNIMPLEMENTED(op) \
127 void JSGenericLowering::Lower##op(Node* node) { UNIMPLEMENTED(); }
131 #undef REPLACE_UNIMPLEMENTED
135 CallDescriptor::Flags result = CallDescriptor::kNoFlags;
137 result |= CallDescriptor::kNeedsFrameState;
145 Callable callable = CodeFactory::CompareIC(
isolate(), token);
148 callable.descriptor(), 0,
149 CallDescriptor::kPatchableCallSiteWithNop |
FlagsForNode(node));
151 inputs.reserve(node->InputCount() + 1);
160 inputs.push_back(
graph()->start());
161 inputs.push_back(
graph()->start());
163 DCHECK(has_frame_state == FLAG_turbo_deoptimization);
164 if (FLAG_turbo_deoptimization) {
172 static_cast<int>(inputs.size()), &inputs.front());
174 node->ReplaceInput(0, compare);
177 if (has_frame_state) {
187 CallDescriptor::Flags
flags) {
201 CallDescriptor* desc =
206 JSFunction::cast(
info()->context()->builtins()->javascript_builtin(
id)));
217 int nargs_override) {
220 int nargs = (nargs_override < 0) ? fun->
nargs : nargs_override;
221 CallDescriptor* desc =
235 void JSGenericLowering::LowerBranch(Node* node) {
236 if (!
info()->is_typing_enabled()) {
242 node->ReplaceInput(0, test);
247 void JSGenericLowering::LowerJSUnaryNot(Node* node) {
248 Callable callable = CodeFactory::ToBoolean(
254 void JSGenericLowering::LowerJSToBoolean(Node* node) {
261 void JSGenericLowering::LowerJSToNumber(Node* node) {
267 void JSGenericLowering::LowerJSToString(Node* node) {
272 void JSGenericLowering::LowerJSToObject(Node* node) {
277 void JSGenericLowering::LowerJSLoadProperty(Node* node) {
278 Callable callable = CodeFactory::KeyedLoadIC(
isolate());
283 void JSGenericLowering::LowerJSLoadNamed(Node* node) {
284 LoadNamedParameters p = OpParameter<LoadNamedParameters>(node);
285 Callable callable = CodeFactory::LoadIC(
isolate(), p.contextual_mode);
291 void JSGenericLowering::LowerJSStoreProperty(Node* node) {
292 StrictMode strict_mode = OpParameter<StrictMode>(node);
293 Callable callable = CodeFactory::KeyedStoreIC(
isolate(), strict_mode);
298 void JSGenericLowering::LowerJSStoreNamed(Node* node) {
299 StoreNamedParameters params = OpParameter<StoreNamedParameters>(node);
300 Callable callable = CodeFactory::StoreIC(
isolate(), params.strict_mode);
306 void JSGenericLowering::LowerJSDeleteProperty(Node* node) {
307 StrictMode strict_mode = OpParameter<StrictMode>(node);
313 void JSGenericLowering::LowerJSHasProperty(Node* node) {
318 void JSGenericLowering::LowerJSInstanceOf(Node* node) {
323 CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor();
331 void JSGenericLowering::LowerJSLoadContext(Node* node) {
332 ContextAccess access = OpParameter<ContextAccess>(node);
335 for (
int i = 0;
i < access.depth(); ++
i) {
348 void JSGenericLowering::LowerJSStoreContext(Node* node) {
349 ContextAccess access = OpParameter<ContextAccess>(node);
352 for (
int i = 0;
i < access.depth(); ++
i) {
367 void JSGenericLowering::LowerJSCallConstruct(Node* node) {
368 int arity = OpParameter<int>(node);
370 CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor();
371 CallDescriptor* desc =
383 void JSGenericLowering::LowerJSCallFunction(Node* node) {
384 CallParameters p = OpParameter<CallParameters>(node);
385 CallFunctionStub stub(
isolate(), p.arity - 2, p.flags);
386 CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor();
387 CallDescriptor* desc =
395 void JSGenericLowering::LowerJSCallRuntime(Node* node) {
static int SlotOffset(int index)
static const Function * FunctionForId(FunctionId id)
@ RESULT_AS_INVERSE_ODDBALL
Node * NewNode(const Operator *op, int input_count, Node **inputs)
virtual Reduction Reduce(Node *node)
Node * Int32Constant(int immediate)
CompilationInfo * info() const
void ReplaceWithBuiltinCall(Node *node, Builtins::JavaScript id, int args)
Isolate * isolate() const
MachineOperatorBuilder * machine() const
Node * FunctionConstant(Handle< JSFunction > function)
void ReplaceWithRuntimeCall(Node *node, Runtime::FunctionId f, int args=-1)
Node * CodeConstant(Handle< Code > code)
Node * ExternalConstant(ExternalReference ref)
void PatchOperator(Node *node, const Operator *new_op)
Linkage * linkage() const
CommonOperatorBuilder * common() const
SetOncePointer< Node > centrystub_constant_
void ReplaceWithCompareIC(Node *node, Token::Value token, bool pure)
void PatchInsertInput(Node *node, int index, Node *input)
void ReplaceWithStubCall(Node *node, Callable c, CallDescriptor::Flags flags)
JSGraph * jsgraph() const
JSGenericLowering(CompilationInfo *info, JSGraph *graph)
Node * SmiConstant(int immediate)
Node * SmiConstant(int32_t immediate)
Node * ExternalConstant(ExternalReference ref)
Node * Int32Constant(int32_t value)
Node * HeapConstant(Unique< Object > value)
CallDescriptor * GetStubCallDescriptor(CallInterfaceDescriptor descriptor, int stack_parameter_count=0, CallDescriptor::Flags flags=CallDescriptor::kNoFlags)
CallDescriptor * GetRuntimeCallDescriptor(Runtime::FunctionId function, int parameter_count, Operator::Properties properties)
static Node * GetContextInput(Node *node)
static Node * GetValueInput(Node *node, int index)
static Node * GetFrameStateInput(Node *node)
static int FirstFrameStateIndex(Node *node)
static Node * GetEffectInput(Node *node, int index=0)
static Node * GetControlInput(Node *node, int index=0)
static int GetValueInputCount(const Operator *op)
static bool HasFrameStateInput(const Operator *op)
base::Flags< Property, uint8_t > Properties
static Reduction Changed(Node *node)
static Reduction NoChange()
enable harmony numeric enable harmony object literal extensions true
#define REPLACE_RUNTIME_CALL(op, fun)
#define REPLACE_COMPARE_IC_CALL(op, token, pure)
#define REPLACE_UNIMPLEMENTED(op)
#define REPLACE_BINARY_OP_IC_CALL(op, token)
#define DCHECK(condition)
static CallDescriptor::Flags FlagsForNode(Node *node)
int ToNumber(Register reg)
@ NO_CALL_CONSTRUCTOR_FLAGS
Debugger support for the V8 JavaScript engine.