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

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

Issue 1348073002: [turbofan] Get rid of type lower bounds. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years, 3 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/graph-visualizer.cc ('k') | src/compiler/js-intrinsic-lowering.cc » ('j') | 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/diamond.h" 5 #include "src/compiler/diamond.h"
6 #include "src/compiler/js-builtin-reducer.h" 6 #include "src/compiler/js-builtin-reducer.h"
7 #include "src/compiler/js-graph.h" 7 #include "src/compiler/js-graph.h"
8 #include "src/compiler/node-matchers.h" 8 #include "src/compiler/node-matchers.h"
9 #include "src/compiler/node-properties.h" 9 #include "src/compiler/node-properties.h"
10 #include "src/objects-inl.h" 10 #include "src/objects-inl.h"
(...skipping 27 matching lines...) Expand all
38 Handle<JSFunction> function = Handle<JSFunction>::cast(m.Value()); 38 Handle<JSFunction> function = Handle<JSFunction>::cast(m.Value());
39 return function->shared()->builtin_function_id(); 39 return function->shared()->builtin_function_id();
40 } 40 }
41 41
42 // Determines whether the call takes zero inputs. 42 // Determines whether the call takes zero inputs.
43 bool InputsMatchZero() { return GetJSCallArity() == 0; } 43 bool InputsMatchZero() { return GetJSCallArity() == 0; }
44 44
45 // Determines whether the call takes one input of the given type. 45 // Determines whether the call takes one input of the given type.
46 bool InputsMatchOne(Type* t1) { 46 bool InputsMatchOne(Type* t1) {
47 return GetJSCallArity() == 1 && 47 return GetJSCallArity() == 1 &&
48 NodeProperties::GetBounds(GetJSCallInput(0)).upper->Is(t1); 48 NodeProperties::GetType(GetJSCallInput(0))->Is(t1);
49 } 49 }
50 50
51 // Determines whether the call takes two inputs of the given types. 51 // Determines whether the call takes two inputs of the given types.
52 bool InputsMatchTwo(Type* t1, Type* t2) { 52 bool InputsMatchTwo(Type* t1, Type* t2) {
53 return GetJSCallArity() == 2 && 53 return GetJSCallArity() == 2 &&
54 NodeProperties::GetBounds(GetJSCallInput(0)).upper->Is(t1) && 54 NodeProperties::GetType(GetJSCallInput(0))->Is(t1) &&
55 NodeProperties::GetBounds(GetJSCallInput(1)).upper->Is(t2); 55 NodeProperties::GetType(GetJSCallInput(1))->Is(t2);
56 } 56 }
57 57
58 // Determines whether the call takes inputs all of the given type. 58 // Determines whether the call takes inputs all of the given type.
59 bool InputsMatchAll(Type* t) { 59 bool InputsMatchAll(Type* t) {
60 for (int i = 0; i < GetJSCallArity(); i++) { 60 for (int i = 0; i < GetJSCallArity(); i++) {
61 if (!NodeProperties::GetBounds(GetJSCallInput(i)).upper->Is(t)) { 61 if (!NodeProperties::GetType(GetJSCallInput(i))->Is(t)) {
62 return false; 62 return false;
63 } 63 }
64 } 64 }
65 return true; 65 return true;
66 } 66 }
67 67
68 Node* left() { return GetJSCallInput(0); } 68 Node* left() { return GetJSCallInput(0); }
69 Node* right() { return GetJSCallInput(1); } 69 Node* right() { return GetJSCallInput(1); }
70 70
71 int GetJSCallArity() { 71 int GetJSCallArity() {
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 } 180 }
181 181
182 182
183 MachineOperatorBuilder* JSBuiltinReducer::machine() const { 183 MachineOperatorBuilder* JSBuiltinReducer::machine() const {
184 return jsgraph()->machine(); 184 return jsgraph()->machine();
185 } 185 }
186 186
187 } // namespace compiler 187 } // namespace compiler
188 } // namespace internal 188 } // namespace internal
189 } // namespace v8 189 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/graph-visualizer.cc ('k') | src/compiler/js-intrinsic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698