OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "src/compiler/node-matchers.h" |
| 6 |
| 7 #include "src/compiler/js-operator.h" |
| 8 #include "src/compiler/node-properties-inl.h" |
| 9 |
| 10 namespace v8 { |
| 11 namespace internal { |
| 12 namespace compiler { |
| 13 |
| 14 Node* JSCallFunctionMatcher::frame_state() const { |
| 15 DCHECK(OperatorProperties::HasFrameStateInput(op())); |
| 16 return NodeProperties::GetFrameStateInput(node()); |
| 17 } |
| 18 |
| 19 |
| 20 JSCallFunctionMatcher::const_iterator JSCallFunctionMatcher::begin() const { |
| 21 // Skip the function input. |
| 22 return node()->inputs().begin() + 1; |
| 23 } |
| 24 |
| 25 |
| 26 JSCallFunctionMatcher::const_iterator JSCallFunctionMatcher::end() const { |
| 27 return begin() + size(); |
| 28 } |
| 29 |
| 30 |
| 31 size_t JSCallFunctionMatcher::size() const { |
| 32 // The value input count includes function and receiver. |
| 33 size_t const value_input_count = op()->ValueInputCount(); |
| 34 DCHECK_LE(2, value_input_count); |
| 35 return value_input_count - 1; |
| 36 } |
| 37 |
| 38 |
| 39 const Runtime::Function* JSCallRuntimeMatcher::function() const { |
| 40 return Runtime::FunctionForId(CallRuntimeParametersOf(node()->op()).id()); |
| 41 } |
| 42 |
| 43 } // namespace compiler |
| 44 } // namespace internal |
| 45 } // namespace v8 |
OLD | NEW |