d1c28849c7
Moves InterpreterAssembler out of the compiler directory and into the interpreter directory. Makes InterpreterAssembler as subclass of CodeStubAssembler. As part of this change, the special bytecode dispatch linkage type is removed and instead we use a InterfaceDispatchDescriptor and a normal CodeStub linkage type. Removes a bunch of duplicated logic in InterpreterAssembler and instead uses the CodeStubAssembler logic. Refactors Interpreter with these changes. Modifies CodeStubAssembler to add the extra operations required by the Interpreter (extra call types, raw memory access and some extra binary ops). Also adds the ability for subclasses to add extra prologue and epilogue operations around calls, which is required for the Interpreter. BUG=v8:4280 LOG=N Review URL: https://codereview.chromium.org/1673333004 Cr-Commit-Position: refs/heads/master@{#33873}
58 lines
2.0 KiB
C++
58 lines
2.0 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)
|
|
: InterpreterAssembler(test->isolate(), test->zone(), bytecode) {}
|
|
~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*> IsBytecodeOperand(int offset);
|
|
Matcher<compiler::Node*> IsBytecodeOperandSignExtended(int offset);
|
|
Matcher<compiler::Node*> IsBytecodeOperandShort(int offset);
|
|
Matcher<compiler::Node*> IsBytecodeOperandShortSignExtended(int offset);
|
|
|
|
using InterpreterAssembler::graph;
|
|
|
|
private:
|
|
DISALLOW_COPY_AND_ASSIGN(InterpreterAssemblerForTest);
|
|
};
|
|
};
|
|
|
|
} // namespace interpreter
|
|
} // namespace internal
|
|
} // namespace v8
|
|
|
|
#endif // V8_UNITTESTS_INTERPRETER_INTERPRETER_ASSEMBLER_UNITTEST_H_
|