| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |