| Index: src/compiler/node-matchers.cc
|
| diff --git a/src/compiler/node-matchers.cc b/src/compiler/node-matchers.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c90f19fde895c97a88707b8dda5d8602f755f3b6
|
| --- /dev/null
|
| +++ b/src/compiler/node-matchers.cc
|
| @@ -0,0 +1,45 @@
|
| +// Copyright 2014 the V8 project authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "src/compiler/node-matchers.h"
|
| +
|
| +#include "src/compiler/js-operator.h"
|
| +#include "src/compiler/node-properties-inl.h"
|
| +
|
| +namespace v8 {
|
| +namespace internal {
|
| +namespace compiler {
|
| +
|
| +Node* JSCallFunctionMatcher::frame_state() const {
|
| + DCHECK(OperatorProperties::HasFrameStateInput(op()));
|
| + return NodeProperties::GetFrameStateInput(node());
|
| +}
|
| +
|
| +
|
| +JSCallFunctionMatcher::const_iterator JSCallFunctionMatcher::begin() const {
|
| + // Skip the function input.
|
| + return node()->inputs().begin() + 1;
|
| +}
|
| +
|
| +
|
| +JSCallFunctionMatcher::const_iterator JSCallFunctionMatcher::end() const {
|
| + return begin() + size();
|
| +}
|
| +
|
| +
|
| +size_t JSCallFunctionMatcher::size() const {
|
| + // The value input count includes function and receiver.
|
| + size_t const value_input_count = op()->ValueInputCount();
|
| + DCHECK_LE(2, value_input_count);
|
| + return value_input_count - 1;
|
| +}
|
| +
|
| +
|
| +const Runtime::Function* JSCallRuntimeMatcher::function() const {
|
| + return Runtime::FunctionForId(CallRuntimeParametersOf(node()->op()).id());
|
| +}
|
| +
|
| +} // namespace compiler
|
| +} // namespace internal
|
| +} // namespace v8
|
|
|