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

Side by Side Diff: src/compiler/js-builtin-reducer.cc

Issue 2612513003: [turbofan] Inline calls to Date.now builtin. (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/compiler/js-builtin-reducer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/js-builtin-reducer.h" 5 #include "src/compiler/js-builtin-reducer.h"
6 6
7 #include "src/compilation-dependencies.h" 7 #include "src/compilation-dependencies.h"
8 #include "src/compiler/access-builder.h" 8 #include "src/compiler/access-builder.h"
9 #include "src/compiler/js-graph.h" 9 #include "src/compiler/js-graph.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 } 943 }
944 break; 944 break;
945 } 945 }
946 } 946 }
947 dominator = NodeProperties::GetEffectInput(dominator); 947 dominator = NodeProperties::GetEffectInput(dominator);
948 } 948 }
949 } 949 }
950 950
951 } // namespace 951 } // namespace
952 952
953 // ES6 section 20.3.3.1 Date.now ( )
954 Reduction JSBuiltinReducer::ReduceDateNow(Node* node) {
955 NodeProperties::RemoveValueInputs(node);
956 NodeProperties::ChangeOp(
957 node, javascript()->CallRuntime(Runtime::kDateCurrentTime));
958 return Changed(node);
959 }
960
953 // ES6 section 20.3.4.10 Date.prototype.getTime ( ) 961 // ES6 section 20.3.4.10 Date.prototype.getTime ( )
954 Reduction JSBuiltinReducer::ReduceDateGetTime(Node* node) { 962 Reduction JSBuiltinReducer::ReduceDateGetTime(Node* node) {
955 Node* receiver = NodeProperties::GetValueInput(node, 1); 963 Node* receiver = NodeProperties::GetValueInput(node, 1);
956 Node* effect = NodeProperties::GetEffectInput(node); 964 Node* effect = NodeProperties::GetEffectInput(node);
957 Node* control = NodeProperties::GetControlInput(node); 965 Node* control = NodeProperties::GetControlInput(node);
958 if (HasInstanceTypeWitness(receiver, effect, JS_DATE_TYPE)) { 966 if (HasInstanceTypeWitness(receiver, effect, JS_DATE_TYPE)) {
959 Node* value = effect = graph()->NewNode( 967 Node* value = effect = graph()->NewNode(
960 simplified()->LoadField(AccessBuilder::ForJSDateValue()), receiver, 968 simplified()->LoadField(AccessBuilder::ForJSDateValue()), receiver,
961 effect, control); 969 effect, control);
962 ReplaceWithValue(node, value, effect, control); 970 ReplaceWithValue(node, value, effect, control);
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after
1851 case kArrayKeys: 1859 case kArrayKeys:
1852 return ReduceArrayIterator(node, IterationKind::kKeys); 1860 return ReduceArrayIterator(node, IterationKind::kKeys);
1853 case kArrayValues: 1861 case kArrayValues:
1854 return ReduceArrayIterator(node, IterationKind::kValues); 1862 return ReduceArrayIterator(node, IterationKind::kValues);
1855 case kArrayIteratorNext: 1863 case kArrayIteratorNext:
1856 return ReduceArrayIteratorNext(node); 1864 return ReduceArrayIteratorNext(node);
1857 case kArrayPop: 1865 case kArrayPop:
1858 return ReduceArrayPop(node); 1866 return ReduceArrayPop(node);
1859 case kArrayPush: 1867 case kArrayPush:
1860 return ReduceArrayPush(node); 1868 return ReduceArrayPush(node);
1869 case kDateNow:
1870 return ReduceDateNow(node);
1861 case kDateGetTime: 1871 case kDateGetTime:
1862 return ReduceDateGetTime(node); 1872 return ReduceDateGetTime(node);
1863 case kGlobalIsFinite: 1873 case kGlobalIsFinite:
1864 reduction = ReduceGlobalIsFinite(node); 1874 reduction = ReduceGlobalIsFinite(node);
1865 break; 1875 break;
1866 case kGlobalIsNaN: 1876 case kGlobalIsNaN:
1867 reduction = ReduceGlobalIsNaN(node); 1877 reduction = ReduceGlobalIsNaN(node);
1868 break; 1878 break;
1869 case kMathAbs: 1879 case kMathAbs:
1870 reduction = ReduceMathAbs(node); 1880 reduction = ReduceMathAbs(node);
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
2056 return jsgraph()->simplified(); 2066 return jsgraph()->simplified();
2057 } 2067 }
2058 2068
2059 JSOperatorBuilder* JSBuiltinReducer::javascript() const { 2069 JSOperatorBuilder* JSBuiltinReducer::javascript() const {
2060 return jsgraph()->javascript(); 2070 return jsgraph()->javascript();
2061 } 2071 }
2062 2072
2063 } // namespace compiler 2073 } // namespace compiler
2064 } // namespace internal 2074 } // namespace internal
2065 } // namespace v8 2075 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-builtin-reducer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698