Commit 0390eef8 authored by Florian Sattler's avatar Florian Sattler Committed by Commit Bot

[cleanup] Refactor interpreter to use default members.

Fixing clang-tidy warning.

Bug: v8:8015
Change-Id: I6cd63aa164af2e3b4a846933899a9a1baa54b1ef
Reviewed-on: https://chromium-review.googlesource.com/1224032Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Florian Sattler <sattlerf@google.com>
Cr-Commit-Position: refs/heads/master@{#55921}
parent 6a8c74cb
......@@ -23,7 +23,7 @@ class RegisterTransferWriter final
public NON_EXPORTED_BASE(ZoneObject) {
public:
RegisterTransferWriter(BytecodeArrayBuilder* builder) : builder_(builder) {}
~RegisterTransferWriter() override {}
~RegisterTransferWriter() override = default;
void EmitLdar(Register input) override { builder_->OutputLdarRaw(input); }
......
......@@ -19,7 +19,7 @@ class BytecodeRegisterAllocator final {
// Enables observation of register allocation and free events.
class Observer {
public:
virtual ~Observer() {}
virtual ~Observer() = default;
virtual void RegisterAllocateEvent(Register reg) = 0;
virtual void RegisterListAllocateEvent(RegisterList reg_list) = 0;
virtual void RegisterListFreeEvent(RegisterList reg_list) = 0;
......@@ -29,7 +29,7 @@ class BytecodeRegisterAllocator final {
: next_register_index_(start_index),
max_register_count_(start_index),
observer_(nullptr) {}
~BytecodeRegisterAllocator() {}
~BytecodeRegisterAllocator() = default;
// Returns a new register.
Register NewRegister() {
......
......@@ -23,8 +23,8 @@ class V8_EXPORT_PRIVATE BytecodeRegisterOptimizer final
public:
class BytecodeWriter {
public:
BytecodeWriter() {}
virtual ~BytecodeWriter() {}
BytecodeWriter() = default;
virtual ~BytecodeWriter() = default;
// Called to emit a register transfer bytecode.
virtual void EmitLdar(Register input) = 0;
......@@ -39,7 +39,7 @@ class V8_EXPORT_PRIVATE BytecodeRegisterOptimizer final
BytecodeRegisterAllocator* register_allocator,
int fixed_registers_count, int parameter_count,
BytecodeWriter* bytecode_writer);
virtual ~BytecodeRegisterOptimizer() {}
virtual ~BytecodeRegisterOptimizer() = default;
// Perform explicit register transfer operations.
void DoLdar(Register input) {
......
......@@ -20,7 +20,7 @@ class V8_EXPORT_PRIVATE ControlFlowBuilder {
public:
explicit ControlFlowBuilder(BytecodeArrayBuilder* builder)
: builder_(builder) {}
virtual ~ControlFlowBuilder() {}
virtual ~ControlFlowBuilder() = default;
protected:
BytecodeArrayBuilder* builder() const { return builder_; }
......
......@@ -1123,7 +1123,7 @@ class UnaryNumericOpAssembler : public InterpreterAssembler {
OperandScale operand_scale)
: InterpreterAssembler(state, bytecode, operand_scale) {}
virtual ~UnaryNumericOpAssembler() {}
virtual ~UnaryNumericOpAssembler() = default;
// Must return a tagged value.
virtual TNode<Number> SmiOp(TNode<Smi> smi_value, Variable* var_feedback,
......
......@@ -36,7 +36,7 @@ class InterpreterAssembler;
class Interpreter {
public:
explicit Interpreter(Isolate* isolate);
virtual ~Interpreter() {}
virtual ~Interpreter() = default;
// Returns the interrupt budget which should be used for the profiler counter.
static int InterruptBudget();
......
......@@ -38,7 +38,7 @@ InterpreterTester::InterpreterTester(Isolate* isolate, const char* source,
: InterpreterTester(isolate, source, MaybeHandle<BytecodeArray>(),
MaybeHandle<FeedbackMetadata>(), filter) {}
InterpreterTester::~InterpreterTester() {}
InterpreterTester::~InterpreterTester() = default;
Local<Message> InterpreterTester::CheckThrowsReturnMessage() {
TryCatch try_catch(reinterpret_cast<v8::Isolate*>(isolate_));
......
......@@ -36,7 +36,7 @@ class InterpreterCallable {
public:
InterpreterCallable(Isolate* isolate, Handle<JSFunction> function)
: isolate_(isolate), function_(function) {}
virtual ~InterpreterCallable() {}
virtual ~InterpreterCallable() = default;
MaybeHandle<Object> operator()(A... args) {
return CallInterpreter(isolate_, function_, args...);
......
......@@ -22,8 +22,8 @@ namespace interpreter {
class BytecodeArrayBuilderTest : public TestWithIsolateAndZone {
public:
BytecodeArrayBuilderTest() {}
~BytecodeArrayBuilderTest() override {}
BytecodeArrayBuilderTest() = default;
~BytecodeArrayBuilderTest() override = default;
};
using ToBooleanMode = BytecodeArrayBuilder::ToBooleanMode;
......
......@@ -16,8 +16,8 @@ namespace interpreter {
class BytecodeArrayIteratorTest : public TestWithIsolateAndZone {
public:
BytecodeArrayIteratorTest() {}
~BytecodeArrayIteratorTest() override {}
BytecodeArrayIteratorTest() = default;
~BytecodeArrayIteratorTest() override = default;
};
TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
......
......@@ -16,8 +16,8 @@ namespace interpreter {
class BytecodeArrayRandomIteratorTest : public TestWithIsolateAndZone {
public:
BytecodeArrayRandomIteratorTest() {}
~BytecodeArrayRandomIteratorTest() override {}
BytecodeArrayRandomIteratorTest() = default;
~BytecodeArrayRandomIteratorTest() override = default;
};
TEST_F(BytecodeArrayRandomIteratorTest, InvalidBeforeStart) {
......
......@@ -34,7 +34,7 @@ class BytecodeArrayWriterUnittest : public TestWithIsolateAndZone {
bytecode_array_writer_(
zone(), &constant_array_builder_,
SourcePositionTableBuilder::RECORD_SOURCE_POSITIONS) {}
~BytecodeArrayWriterUnittest() override {}
~BytecodeArrayWriterUnittest() override = default;
void Write(Bytecode bytecode, BytecodeSourceInfo info = BytecodeSourceInfo());
void Write(Bytecode bytecode, uint32_t operand0,
......
......@@ -16,7 +16,7 @@ namespace interpreter {
class BytecodeRegisterAllocatorTest : public TestWithIsolateAndZone {
public:
BytecodeRegisterAllocatorTest() : allocator_(0) {}
~BytecodeRegisterAllocatorTest() override {}
~BytecodeRegisterAllocatorTest() override = default;
BytecodeRegisterAllocator* allocator() { return &allocator_; }
......
......@@ -23,7 +23,7 @@ class BytecodeRegisterOptimizerTest
Register output;
};
BytecodeRegisterOptimizerTest() {}
BytecodeRegisterOptimizerTest() = default;
~BytecodeRegisterOptimizerTest() override { delete register_allocator_; }
void Initialize(int number_of_parameters, int number_of_locals) {
......
......@@ -18,8 +18,8 @@ namespace interpreter {
class ConstantArrayBuilderTest : public TestWithIsolateAndZone {
public:
ConstantArrayBuilderTest() {}
~ConstantArrayBuilderTest() override {}
ConstantArrayBuilderTest() = default;
~ConstantArrayBuilderTest() override = default;
static const size_t k8BitCapacity = ConstantArrayBuilder::k8BitCapacity;
static const size_t k16BitCapacity = ConstantArrayBuilder::k16BitCapacity;
......
......@@ -28,8 +28,8 @@ class InterpreterAssemblerTestState : public compiler::CodeAssemblerState {
class InterpreterAssemblerTest : public TestWithIsolateAndZone {
public:
InterpreterAssemblerTest() {}
~InterpreterAssemblerTest() override {}
InterpreterAssemblerTest() = default;
~InterpreterAssemblerTest() override = default;
class InterpreterAssemblerForTest final : public InterpreterAssembler {
public:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment