| Index: src/compiler/js-intrinsic-lowering.cc
|
| diff --git a/src/compiler/js-intrinsic-lowering.cc b/src/compiler/js-intrinsic-lowering.cc
|
| index b299e8bb0e40d91b19469f21f33731fb2b49e115..a0bb2fab96e48e760364b011678edfd936965ae1 100644
|
| --- a/src/compiler/js-intrinsic-lowering.cc
|
| +++ b/src/compiler/js-intrinsic-lowering.cc
|
| @@ -24,7 +24,9 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
|
| if (node->opcode() != IrOpcode::kJSCallRuntime) return NoChange();
|
| const Runtime::Function* const f =
|
| Runtime::FunctionForId(CallRuntimeParametersOf(node->op()).id());
|
| - if (f->intrinsic_type != Runtime::IntrinsicType::INLINE) return NoChange();
|
| + if (f->intrinsic_type != Runtime::IntrinsicType::INLINE) {
|
| + return NoChange();
|
| + }
|
| switch (f->function_id) {
|
| case Runtime::kInlineConstructDouble:
|
| return ReduceConstructDouble(node);
|
| @@ -38,6 +40,8 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
|
| return ReduceHeapObjectGetMap(node);
|
| case Runtime::kInlineIncrementStatsCounter:
|
| return ReduceIncrementStatsCounter(node);
|
| + case Runtime::kInlineIsMinusZero:
|
| + return ReduceIsMinusZero(node);
|
| case Runtime::kInlineIsArray:
|
| return ReduceIsInstanceType(node, JS_ARRAY_TYPE);
|
| case Runtime::kInlineIsFunction:
|
| @@ -74,6 +78,10 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
|
| return ReduceUnLikely(node, BranchHint::kFalse);
|
| case Runtime::kInlineValueOf:
|
| return ReduceValueOf(node);
|
| + case Runtime::kInlineFixedArraySet:
|
| + return ReduceFixedArraySet(node);
|
| + case Runtime::kInlineGetTypeFeedbackVector:
|
| + return ReduceGetTypeFeedbackVector(node);
|
| default:
|
| break;
|
| }
|
| @@ -170,6 +178,30 @@ Reduction JSIntrinsicLowering::ReduceIncrementStatsCounter(Node* node) {
|
| }
|
|
|
|
|
| +Reduction JSIntrinsicLowering::ReduceIsMinusZero(Node* node) {
|
| + Node* value = NodeProperties::GetValueInput(node, 0);
|
| + Node* effect = NodeProperties::GetEffectInput(node);
|
| +
|
| + Node* double_lo =
|
| + graph()->NewNode(machine()->Float64ExtractLowWord32(), value);
|
| + Node* check1 = graph()->NewNode(machine()->Word32Equal(), double_lo,
|
| + jsgraph()->ZeroConstant());
|
| +
|
| + Node* double_hi =
|
| + graph()->NewNode(machine()->Float64ExtractHighWord32(), value);
|
| + Node* check2 = graph()->NewNode(
|
| + machine()->Word32Equal(), double_hi,
|
| + jsgraph()->Int32Constant(static_cast<int32_t>(0x80000000)));
|
| +
|
| + NodeProperties::ReplaceWithValue(node, node, effect);
|
| +
|
| + Node* and_result = graph()->NewNode(machine()->Word32And(), check1, check2);
|
| +
|
| + return Change(node, machine()->Word32Equal(), and_result,
|
| + jsgraph()->Int32Constant(1));
|
| +}
|
| +
|
| +
|
| Reduction JSIntrinsicLowering::ReduceIsInstanceType(
|
| Node* node, InstanceType instance_type) {
|
| // if (%_IsSmi(value)) {
|
| @@ -398,6 +430,43 @@ Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op) {
|
| }
|
|
|
|
|
| +Reduction JSIntrinsicLowering::ReduceFixedArraySet(Node* node) {
|
| + Node* base = node->InputAt(0);
|
| + Node* index = node->InputAt(1);
|
| + Node* value = node->InputAt(2);
|
| + Node* effect = NodeProperties::GetEffectInput(node);
|
| + Node* control = NodeProperties::GetControlInput(node);
|
| + Node* store = (graph()->NewNode(
|
| + simplified()->StoreElement(AccessBuilder::ForFixedArrayElement()), base,
|
| + index, value, effect, control));
|
| + NodeProperties::ReplaceWithValue(node, value, store);
|
| + return Changed(store);
|
| +}
|
| +
|
| +
|
| +Reduction JSIntrinsicLowering::ReduceGetTypeFeedbackVector(Node* node) {
|
| + Node* func = node->InputAt(0);
|
| + Node* effect = NodeProperties::GetEffectInput(node);
|
| + Node* control = NodeProperties::GetControlInput(node);
|
| + FieldAccess access = AccessBuilder::ForJSFunctionSharedFunctionInfo();
|
| + Node* load =
|
| + graph()->NewNode(simplified()->LoadField(access), func, effect, control);
|
| + access = AccessBuilder::ForSharedFunctionInfoTypeFeedbackVector();
|
| + return Change(node, simplified()->LoadField(access), load, load, control);
|
| +}
|
| +
|
| +
|
| +Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a,
|
| + Node* b) {
|
| + node->set_op(op);
|
| + node->ReplaceInput(0, a);
|
| + node->ReplaceInput(1, b);
|
| + node->TrimInputCount(2);
|
| + NodeProperties::ReplaceWithValue(node, node, node);
|
| + return Changed(node);
|
| +}
|
| +
|
| +
|
| Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a,
|
| Node* b, Node* c) {
|
| node->set_op(op);
|
|
|