Index: src/compiler/js-intrinsic-lowering.cc |
diff --git a/src/compiler/js-intrinsic-lowering.cc b/src/compiler/js-intrinsic-lowering.cc |
index 8879ebc8d92ff2a646da5550ee53af8988f61baf..49081bade7e6ed9bac0b6a1772c0edf2de6c12fc 100644 |
--- a/src/compiler/js-intrinsic-lowering.cc |
+++ b/src/compiler/js-intrinsic-lowering.cc |
@@ -22,26 +22,30 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) { |
Runtime::FunctionForId(CallRuntimeParametersOf(node->op()).id()); |
if (f->intrinsic_type != Runtime::IntrinsicType::INLINE) return NoChange(); |
switch (f->function_id) { |
+ case Runtime::kInlineConstructDouble: |
+ return ReduceInlineConstructDouble(node); |
case Runtime::kInlineDeoptimizeNow: |
return ReduceInlineDeoptimizeNow(node); |
- case Runtime::kInlineIsSmi: |
- return ReduceInlineIsSmi(node); |
- case Runtime::kInlineIsNonNegativeSmi: |
- return ReduceInlineIsNonNegativeSmi(node); |
+ case Runtime::kInlineDoubleHi: |
+ return ReduceInlineDoubleHi(node); |
+ case Runtime::kInlineDoubleLo: |
+ return ReduceInlineDoubleLo(node); |
+ case Runtime::kInlineHeapObjectGetMap: |
+ return ReduceHeapObjectGetMap(node); |
case Runtime::kInlineIsArray: |
return ReduceInlineIsInstanceType(node, JS_ARRAY_TYPE); |
case Runtime::kInlineIsFunction: |
return ReduceInlineIsInstanceType(node, JS_FUNCTION_TYPE); |
- case Runtime::kInlineJSValueGetValue: |
- return ReduceInlineJSValueGetValue(node); |
- case Runtime::kInlineConstructDouble: |
- return ReduceInlineConstructDouble(node); |
- case Runtime::kInlineDoubleLo: |
- return ReduceInlineDoubleLo(node); |
- case Runtime::kInlineDoubleHi: |
- return ReduceInlineDoubleHi(node); |
+ case Runtime::kInlineIsNonNegativeSmi: |
+ return ReduceInlineIsNonNegativeSmi(node); |
case Runtime::kInlineIsRegExp: |
return ReduceInlineIsInstanceType(node, JS_REGEXP_TYPE); |
+ case Runtime::kInlineIsSmi: |
+ return ReduceInlineIsSmi(node); |
+ case Runtime::kInlineJSValueGetValue: |
+ return ReduceInlineJSValueGetValue(node); |
+ case Runtime::kInlineMapGetInstanceType: |
+ return ReduceMapGetInstanceType(node); |
case Runtime::kInlineMathClz32: |
return ReduceInlineMathClz32(node); |
case Runtime::kInlineMathFloor: |
@@ -59,6 +63,19 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) { |
} |
+Reduction JSIntrinsicLowering::ReduceInlineConstructDouble(Node* node) { |
+ Node* high = NodeProperties::GetValueInput(node, 0); |
+ Node* low = NodeProperties::GetValueInput(node, 1); |
+ Node* value = |
+ graph()->NewNode(machine()->Float64InsertHighWord32(), |
+ graph()->NewNode(machine()->Float64InsertLowWord32(), |
+ jsgraph()->Constant(0), low), |
+ high); |
+ NodeProperties::ReplaceWithValue(node, value); |
+ return Replace(value); |
+} |
+ |
+ |
Reduction JSIntrinsicLowering::ReduceInlineDeoptimizeNow(Node* node) { |
if (!FLAG_turbo_deoptimization) return NoChange(); |
@@ -99,48 +116,25 @@ Reduction JSIntrinsicLowering::ReduceInlineDeoptimizeNow(Node* node) { |
} |
-Reduction JSIntrinsicLowering::ReduceInlineIsSmi(Node* node) { |
- return Change(node, simplified()->ObjectIsSmi()); |
+Reduction JSIntrinsicLowering::ReduceInlineDoubleHi(Node* node) { |
+ return Change(node, machine()->Float64ExtractHighWord32()); |
} |
-Reduction JSIntrinsicLowering::ReduceInlineIsNonNegativeSmi(Node* node) { |
- return Change(node, simplified()->ObjectIsNonNegativeSmi()); |
+Reduction JSIntrinsicLowering::ReduceInlineDoubleLo(Node* node) { |
+ return Change(node, machine()->Float64ExtractLowWord32()); |
} |
-Reduction JSIntrinsicLowering::ReduceInlineJSValueGetValue(Node* node) { |
+Reduction JSIntrinsicLowering::ReduceHeapObjectGetMap(Node* node) { |
Node* value = NodeProperties::GetValueInput(node, 0); |
Node* effect = NodeProperties::GetEffectInput(node); |
Node* control = NodeProperties::GetControlInput(node); |
- return Change(node, simplified()->LoadField(AccessBuilder::ForValue()), value, |
+ return Change(node, simplified()->LoadField(AccessBuilder::ForMap()), value, |
effect, control); |
} |
-Reduction JSIntrinsicLowering::ReduceInlineConstructDouble(Node* node) { |
- Node* high = NodeProperties::GetValueInput(node, 0); |
- Node* low = NodeProperties::GetValueInput(node, 1); |
- Node* value = |
- graph()->NewNode(machine()->Float64InsertHighWord32(), |
- graph()->NewNode(machine()->Float64InsertLowWord32(), |
- jsgraph()->Constant(0), low), |
- high); |
- NodeProperties::ReplaceWithValue(node, value); |
- return Replace(value); |
-} |
- |
- |
-Reduction JSIntrinsicLowering::ReduceInlineDoubleLo(Node* node) { |
- return Change(node, machine()->Float64ExtractLowWord32()); |
-} |
- |
- |
-Reduction JSIntrinsicLowering::ReduceInlineDoubleHi(Node* node) { |
- return Change(node, machine()->Float64ExtractHighWord32()); |
-} |
- |
- |
Reduction JSIntrinsicLowering::ReduceInlineIsInstanceType( |
Node* node, InstanceType instance_type) { |
// if (%_IsSmi(value)) { |
@@ -181,6 +175,35 @@ Reduction JSIntrinsicLowering::ReduceInlineIsInstanceType( |
} |
+Reduction JSIntrinsicLowering::ReduceInlineIsNonNegativeSmi(Node* node) { |
+ return Change(node, simplified()->ObjectIsNonNegativeSmi()); |
+} |
+ |
+ |
+Reduction JSIntrinsicLowering::ReduceInlineIsSmi(Node* node) { |
+ return Change(node, simplified()->ObjectIsSmi()); |
+} |
+ |
+ |
+Reduction JSIntrinsicLowering::ReduceInlineJSValueGetValue(Node* node) { |
+ Node* value = NodeProperties::GetValueInput(node, 0); |
+ Node* effect = NodeProperties::GetEffectInput(node); |
+ Node* control = NodeProperties::GetControlInput(node); |
+ return Change(node, simplified()->LoadField(AccessBuilder::ForValue()), value, |
+ effect, control); |
+} |
+ |
+ |
+Reduction JSIntrinsicLowering::ReduceMapGetInstanceType(Node* node) { |
+ Node* value = NodeProperties::GetValueInput(node, 0); |
+ Node* effect = NodeProperties::GetEffectInput(node); |
+ Node* control = NodeProperties::GetControlInput(node); |
+ return Change(node, |
+ simplified()->LoadField(AccessBuilder::ForMapInstanceType()), |
+ value, effect, control); |
+} |
+ |
+ |
Reduction JSIntrinsicLowering::ReduceInlineMathClz32(Node* node) { |
return Change(node, machine()->Word32Clz()); |
} |