VisitForStackValue(args->at(i));
}
+ PrepareForBailoutForId(expr->CallId(), NO_REGISTERS);
EmitCallJSRuntimeFunction(expr);
// Restore context register.
}
// Call the C runtime function.
+ PrepareForBailoutForId(expr->CallId(), NO_REGISTERS);
__ CallRuntime(expr->function(), arg_count);
context()->Plug(r0);
}
VisitForStackValue(args->at(i));
}
+ PrepareForBailoutForId(expr->CallId(), NO_REGISTERS);
EmitCallJSRuntimeFunction(expr);
// Restore context register.
}
// Call the C runtime function.
+ PrepareForBailoutForId(expr->CallId(), NO_REGISTERS);
__ CallRuntime(expr->function(), arg_count);
context()->Plug(x0);
}
return callruntime_feedback_slot_;
}
- static int num_ids() { return parent_num_ids(); }
+ static int num_ids() { return parent_num_ids() + 1; }
+ BailoutId CallId() { return BailoutId(local_id(0)); }
protected:
CallRuntime(Zone* zone, const AstRawString* name,
static int parent_num_ids() { return Expression::num_ids(); }
private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+
const AstRawString* raw_name_;
const Runtime::Function* function_;
ZoneList<Expression*>* arguments_;
if (functionId == Runtime::kInlineGeneratorNext) SetStackOverflow();
if (functionId == Runtime::kInlineGeneratorThrow) SetStackOverflow();
const Operator* call = javascript()->CallRuntime(functionId, args->length());
+ FrameStateBeforeAndAfter states(this, expr->CallId());
Node* value = ProcessArguments(call, args->length());
- PrepareFrameState(value, expr->id(), ast_context()->GetStateCombine());
+ states.AddToNode(value, expr->id(), ast_context()->GetStateCombine());
ast_context()->ProduceValue(value);
}
return ReduceGetTypeFeedbackVector(node);
case Runtime::kInlineGetCallerJSFunction:
return ReduceGetCallerJSFunction(node);
+ case Runtime::kInlineThrowNotDateError:
+ return ReduceThrowNotDateError(node);
default:
break;
}
}
+Reduction JSIntrinsicLowering::ReduceThrowNotDateError(Node* node) {
+ if (mode() != kDeoptimizationEnabled) return NoChange();
+ Node* const frame_state = NodeProperties::GetFrameStateInput(node, 1);
+ Node* const effect = NodeProperties::GetEffectInput(node);
+ Node* const control = NodeProperties::GetControlInput(node);
+
+ // TODO(bmeurer): Move MergeControlToEnd() to the AdvancedReducer.
+ Node* deoptimize =
+ graph()->NewNode(common()->Deoptimize(), frame_state, effect, control);
+ NodeProperties::MergeControlToEnd(graph(), common(), deoptimize);
+
+ node->set_op(common()->Dead());
+ node->TrimInputCount(0);
+ return Changed(node);
+}
+
+
Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a,
Node* b) {
node->set_op(op);
Reduction ReduceFixedArraySet(Node* node);
Reduction ReduceGetTypeFeedbackVector(Node* node);
Reduction ReduceGetCallerJSFunction(Node* node);
+ Reduction ReduceThrowNotDateError(Node* node);
Reduction Change(Node* node, const Operator* op);
Reduction Change(Node* node, const Operator* op, Node* a, Node* b);
locations.AddParam(regloc(LinkageTraits::ContextReg()));
types.AddParam(kMachAnyTagged);
- CallDescriptor::Flags flags = Linkage::NeedsFrameState(function_id)
+ CallDescriptor::Flags flags = Linkage::FrameStateInputCount(function_id) > 0
? CallDescriptor::kNeedsFrameState
: CallDescriptor::kNoFlags;
// static
-bool Linkage::NeedsFrameState(Runtime::FunctionId function) {
+int Linkage::FrameStateInputCount(Runtime::FunctionId function) {
// Most runtime functions need a FrameState. A few chosen ones that we know
// not to call into arbitrary JavaScript, not to throw, and not to deoptimize
// are blacklisted here and can be called without a FrameState.
case Runtime::kToFastProperties: // TODO(jarin): Is it safe?
case Runtime::kTraceEnter:
case Runtime::kTraceExit:
- return false;
+ return 0;
case Runtime::kInlineArguments:
case Runtime::kInlineCallFunction:
- case Runtime::kInlineDeoptimizeNow:
case Runtime::kInlineGetCallerJSFunction:
case Runtime::kInlineGetPrototype:
case Runtime::kInlineRegExpExec:
+ return 1;
+ case Runtime::kInlineDeoptimizeNow:
case Runtime::kInlineThrowNotDateError:
- return true;
+ return 2;
default:
break;
}
// Most inlined runtime functions (except the ones listed above) can be called
// without a FrameState or will be lowered by JSIntrinsicLowering internally.
const Runtime::Function* const f = Runtime::FunctionForId(function);
- if (f->intrinsic_type == Runtime::IntrinsicType::INLINE) return false;
+ if (f->intrinsic_type == Runtime::IntrinsicType::INLINE) return 0;
- return true;
+ return 1;
}
// the frame offset, e.g. to index into part of a double slot.
FrameOffset GetFrameOffset(int spill_slot, Frame* frame, int extra = 0) const;
- static bool NeedsFrameState(Runtime::FunctionId function);
+ static int FrameStateInputCount(Runtime::FunctionId function);
// Get the location where an incoming OSR value is stored.
LinkageLocation GetOsrValueLocation(int index) const;
return 1;
case IrOpcode::kJSCallRuntime: {
const CallRuntimeParameters& p = CallRuntimeParametersOf(op);
- return Linkage::NeedsFrameState(p.id());
+ return Linkage::FrameStateInputCount(p.id());
}
// Strict equality cannot lazily deoptimize.
VisitForStackValue(args->at(i));
}
+ PrepareForBailoutForId(expr->CallId(), NO_REGISTERS);
EmitCallJSRuntimeFunction(expr);
// Restore context register.
}
// Call the C runtime function.
+ PrepareForBailoutForId(expr->CallId(), NO_REGISTERS);
__ CallRuntime(expr->function(), arg_count);
context()->Plug(eax);
}
VisitForStackValue(args->at(i));
}
+ PrepareForBailoutForId(expr->CallId(), NO_REGISTERS);
EmitCallJSRuntimeFunction(expr);
// Restore context register.
}
// Call the C runtime function.
+ PrepareForBailoutForId(expr->CallId(), NO_REGISTERS);
__ CallRuntime(expr->function(), arg_count);
context()->Plug(v0);
}
VisitForStackValue(args->at(i));
}
+ PrepareForBailoutForId(expr->CallId(), NO_REGISTERS);
EmitCallJSRuntimeFunction(expr);
// Restore context register.
}
// Call the C runtime function.
+ PrepareForBailoutForId(expr->CallId(), NO_REGISTERS);
__ CallRuntime(expr->function(), arg_count);
context()->Plug(v0);
}
VisitForStackValue(args->at(i));
}
+ PrepareForBailoutForId(expr->CallId(), NO_REGISTERS);
EmitCallJSRuntimeFunction(expr);
// Restore context register.
}
// Call the C runtime function.
+ PrepareForBailoutForId(expr->CallId(), NO_REGISTERS);
__ CallRuntime(expr->function(), arg_count);
context()->Plug(r3);
}
VisitForStackValue(args->at(i));
}
+ PrepareForBailoutForId(expr->CallId(), NO_REGISTERS);
EmitCallJSRuntimeFunction(expr);
// Restore context register.
}
// Call the C runtime.
+ PrepareForBailoutForId(expr->CallId(), NO_REGISTERS);
__ CallRuntime(function, arg_count);
context()->Plug(rax);
}
VisitForStackValue(args->at(i));
}
+ PrepareForBailoutForId(expr->CallId(), NO_REGISTERS);
EmitCallJSRuntimeFunction(expr);
// Restore context register.
}
// Call the C runtime function.
+ PrepareForBailoutForId(expr->CallId(), NO_REGISTERS);
__ CallRuntime(expr->function(), arg_count);
context()->Plug(eax);
}