v8/test/unittests/interpreter/interpreter-assembler-unittest.h
oth 7f3442133e [interpreter] Add accumulator use description to bytecodes.
Anotates bytecodes with a description of how each uses the accumulator.

Validates annotations and uses of accumulator when generating bytecode
handlers.

Only prints the accumulator during tracing where used.

BUG=v8:4280
LOG=N

Review URL: https://codereview.chromium.org/1852213002

Cr-Commit-Position: refs/heads/master@{#35281}
2016-04-06 07:57:56 +00:00

67 lines
2.4 KiB
C++

// 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:
InterpreterAssemblerForTest(
InterpreterAssemblerTest* test, Bytecode bytecode,
OperandScale operand_scale = OperandScale::kSingle)
: InterpreterAssembler(test->isolate(), test->zone(), bytecode,
operand_scale) {}
~InterpreterAssemblerForTest() override;
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);
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);
using InterpreterAssembler::graph;
private:
DISALLOW_COPY_AND_ASSIGN(InterpreterAssemblerForTest);
};
};
} // namespace interpreter
} // namespace internal
} // namespace v8
#endif // V8_UNITTESTS_INTERPRETER_INTERPRETER_ASSEMBLER_UNITTEST_H_