Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: src/compiler/js-intrinsic-lowering.cc

Issue 1169723002: [turbofan] Initial support for the %_DateField intrinsic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Attempt to fix Windows. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/js-intrinsic-lowering.h ('k') | src/compiler/linkage.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/compiler/js-intrinsic-lowering.h ('k') | src/compiler/linkage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698