2016-02-10 16:38:49 +00:00
|
|
|
// Copyright 2015 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.
|
|
|
|
|
|
|
|
#ifndef V8_UNITTESTS_INTERPRETER_INTERPRETER_ASSEMBLER_UNITTEST_H_
|
|
|
|
#define V8_UNITTESTS_INTERPRETER_INTERPRETER_ASSEMBLER_UNITTEST_H_
|
|
|
|
|
|
|
|
#include "src/compiler/machine-operator.h"
|
|
|
|
#include "src/interpreter/interpreter-assembler.h"
|
|
|
|
#include "test/unittests/test-utils.h"
|
|
|
|
#include "testing/gmock-support.h"
|
|
|
|
|
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
namespace interpreter {
|
|
|
|
|
|
|
|
using ::testing::Matcher;
|
|
|
|
|
|
|
|
class InterpreterAssemblerTest : public TestWithIsolateAndZone {
|
|
|
|
public:
|
|
|
|
InterpreterAssemblerTest() {}
|
|
|
|
~InterpreterAssemblerTest() override {}
|
|
|
|
|
|
|
|
class InterpreterAssemblerForTest final : public InterpreterAssembler {
|
|
|
|
public:
|
2016-03-21 17:08:21 +00:00
|
|
|
InterpreterAssemblerForTest(
|
2016-11-16 07:53:51 +00:00
|
|
|
InterpreterAssemblerTest* test, Bytecode bytecode,
|
2016-03-21 17:08:21 +00:00
|
|
|
OperandScale operand_scale = OperandScale::kSingle)
|
2016-11-16 07:53:51 +00:00
|
|
|
: InterpreterAssembler(test->isolate(), test->zone(), bytecode,
|
|
|
|
operand_scale) {}
|
2016-04-06 07:57:35 +00:00
|
|
|
~InterpreterAssemblerForTest() override;
|
2016-02-10 16:38:49 +00:00
|
|
|
|
|
|
|
Matcher<compiler::Node*> IsLoad(
|
|
|
|
const Matcher<compiler::LoadRepresentation>& rep_matcher,
|
|
|
|
const Matcher<compiler::Node*>& base_matcher,
|
|
|
|
const Matcher<compiler::Node*>& index_matcher);
|
|
|
|
Matcher<compiler::Node*> IsStore(
|
|
|
|
const Matcher<compiler::StoreRepresentation>& rep_matcher,
|
|
|
|
const Matcher<compiler::Node*>& base_matcher,
|
|
|
|
const Matcher<compiler::Node*>& index_matcher,
|
|
|
|
const Matcher<compiler::Node*>& value_matcher);
|
|
|
|
|
2016-03-21 17:08:21 +00:00
|
|
|
Matcher<compiler::Node*> IsUnsignedByteOperand(int offset);
|
|
|
|
Matcher<compiler::Node*> IsSignedByteOperand(int offset);
|
|
|
|
Matcher<compiler::Node*> IsUnsignedShortOperand(int offset);
|
|
|
|
Matcher<compiler::Node*> IsSignedShortOperand(int offset);
|
|
|
|
Matcher<compiler::Node*> IsUnsignedQuadOperand(int offset);
|
|
|
|
Matcher<compiler::Node*> IsSignedQuadOperand(int offset);
|
|
|
|
|
|
|
|
Matcher<compiler::Node*> IsSignedOperand(int offset,
|
|
|
|
OperandSize operand_size);
|
|
|
|
Matcher<compiler::Node*> IsUnsignedOperand(int offset,
|
|
|
|
OperandSize operand_size);
|
2016-02-10 16:38:49 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(InterpreterAssemblerForTest);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace interpreter
|
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|
|
|
|
|
|
|
|
#endif // V8_UNITTESTS_INTERPRETER_INTERPRETER_ASSEMBLER_UNITTEST_H_
|