Index: src/compiler/js-intrinsic-lowering.cc |
diff --git a/src/compiler/js-intrinsic-lowering.cc b/src/compiler/js-intrinsic-lowering.cc |
index b679a75fab7ab2a188e27c6b1f001af9f5324aaf..891e17fb3715fb46784e18922d33fa74fe0f4702 100644 |
--- a/src/compiler/js-intrinsic-lowering.cc |
+++ b/src/compiler/js-intrinsic-lowering.cc |
@@ -32,6 +32,8 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) { |
switch (f->function_id) { |
case Runtime::kInlineConstructDouble: |
return ReduceConstructDouble(node); |
+ case Runtime::kInlineDateField: |
+ return ReduceDateField(node); |
case Runtime::kInlineDeoptimizeNow: |
return ReduceDeoptimizeNow(node); |
case Runtime::kInlineDoubleHi: |
@@ -106,6 +108,24 @@ Reduction JSIntrinsicLowering::ReduceConstructDouble(Node* node) { |
} |
+Reduction JSIntrinsicLowering::ReduceDateField(Node* node) { |
+ Node* const value = NodeProperties::GetValueInput(node, 0); |
+ Node* const index = NodeProperties::GetValueInput(node, 1); |
+ Node* const effect = NodeProperties::GetEffectInput(node); |
+ Node* const control = NodeProperties::GetControlInput(node); |
+ NumberMatcher mindex(index); |
+ if (mindex.Is(JSDate::kDateValue)) { |
+ return Change( |
+ node, |
+ simplified()->LoadField(AccessBuilder::ForJSDateField( |
+ static_cast<JSDate::FieldIndex>(static_cast<int>(mindex.Value())))), |
+ value, effect, control); |
+ } |
+ // TODO(turbofan): Optimize more patterns. |
+ return NoChange(); |
+} |
+ |
+ |
Reduction JSIntrinsicLowering::ReduceDeoptimizeNow(Node* node) { |
if (mode() != kDeoptimizationEnabled) return NoChange(); |
Node* frame_state = NodeProperties::GetFrameStateInput(node, 0); |