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 ...@@ -23,7 +23,7 @@ class RegisterTransferWriter final
public NON_EXPORTED_BASE(ZoneObject) { public NON_EXPORTED_BASE(ZoneObject) {
public: public:
RegisterTransferWriter(BytecodeArrayBuilder* builder) : builder_(builder) {} RegisterTransferWriter(BytecodeArrayBuilder* builder) : builder_(builder) {}
~RegisterTransferWriter() override {} ~RegisterTransferWriter() override = default;
void EmitLdar(Register input) override { builder_->OutputLdarRaw(input); } void EmitLdar(Register input) override { builder_->OutputLdarRaw(input); }
......
...@@ -19,7 +19,7 @@ class BytecodeRegisterAllocator final { ...@@ -19,7 +19,7 @@ class BytecodeRegisterAllocator final {
// Enables observation of register allocation and free events. // Enables observation of register allocation and free events.
class Observer { class Observer {
public: public:
virtual ~Observer() {} virtual ~Observer() = default;
virtual void RegisterAllocateEvent(Register reg) = 0; virtual void RegisterAllocateEvent(Register reg) = 0;
virtual void RegisterListAllocateEvent(RegisterList reg_list) = 0; virtual void RegisterListAllocateEvent(RegisterList reg_list) = 0;
virtual void RegisterListFreeEvent(RegisterList reg_list) = 0; virtual void RegisterListFreeEvent(RegisterList reg_list) = 0;
...@@ -29,7 +29,7 @@ class BytecodeRegisterAllocator final { ...@@ -29,7 +29,7 @@ class BytecodeRegisterAllocator final {
: next_register_index_(start_index), : next_register_index_(start_index),
max_register_count_(start_index), max_register_count_(start_index),
observer_(nullptr) {} observer_(nullptr) {}
~BytecodeRegisterAllocator() {} ~BytecodeRegisterAllocator() = default;
// Returns a new register. // Returns a new register.
Register NewRegister() { Register NewRegister() {
......
...@@ -23,8 +23,8 @@ class V8_EXPORT_PRIVATE BytecodeRegisterOptimizer final ...@@ -23,8 +23,8 @@ class V8_EXPORT_PRIVATE BytecodeRegisterOptimizer final
public: public:
class BytecodeWriter { class BytecodeWriter {
public: public:
BytecodeWriter() {} BytecodeWriter() = default;
virtual ~BytecodeWriter() {} virtual ~BytecodeWriter() = default;
// Called to emit a register transfer bytecode. // Called to emit a register transfer bytecode.
virtual void EmitLdar(Register input) = 0; virtual void EmitLdar(Register input) = 0;
...@@ -39,7 +39,7 @@ class V8_EXPORT_PRIVATE BytecodeRegisterOptimizer final ...@@ -39,7 +39,7 @@ class V8_EXPORT_PRIVATE BytecodeRegisterOptimizer final
BytecodeRegisterAllocator* register_allocator, BytecodeRegisterAllocator* register_allocator,
int fixed_registers_count, int parameter_count, int fixed_registers_count, int parameter_count,
BytecodeWriter* bytecode_writer); BytecodeWriter* bytecode_writer);
virtual ~BytecodeRegisterOptimizer() {} virtual ~BytecodeRegisterOptimizer() = default;
// Perform explicit register transfer operations. // Perform explicit register transfer operations.
void DoLdar(Register input) { void DoLdar(Register input) {
......
...@@ -20,7 +20,7 @@ class V8_EXPORT_PRIVATE ControlFlowBuilder { ...@@ -20,7 +20,7 @@ class V8_EXPORT_PRIVATE ControlFlowBuilder {
public: public:
explicit ControlFlowBuilder(BytecodeArrayBuilder* builder) explicit ControlFlowBuilder(BytecodeArrayBuilder* builder)
: builder_(builder) {} : builder_(builder) {}
virtual ~ControlFlowBuilder() {} virtual ~ControlFlowBuilder() = default;
protected: protected:
BytecodeArrayBuilder* builder() const { return builder_; } BytecodeArrayBuilder* builder() const { return builder_; }
......
...@@ -1123,7 +1123,7 @@ class UnaryNumericOpAssembler : public InterpreterAssembler { ...@@ -1123,7 +1123,7 @@ class UnaryNumericOpAssembler : public InterpreterAssembler {
OperandScale operand_scale) OperandScale operand_scale)
: InterpreterAssembler(state, bytecode, operand_scale) {} : InterpreterAssembler(state, bytecode, operand_scale) {}
virtual ~UnaryNumericOpAssembler() {} virtual ~UnaryNumericOpAssembler() = default;
// Must return a tagged value. // Must return a tagged value.
virtual TNode<Number> SmiOp(TNode<Smi> smi_value, Variable* var_feedback, virtual TNode<Number> SmiOp(TNode<Smi> smi_value, Variable* var_feedback,
......
...@@ -36,7 +36,7 @@ class InterpreterAssembler; ...@@ -36,7 +36,7 @@ class InterpreterAssembler;
class Interpreter { class Interpreter {
public: public:
explicit Interpreter(Isolate* isolate); explicit Interpreter(Isolate* isolate);
virtual ~Interpreter() {} virtual ~Interpreter() = default;
// Returns the interrupt budget which should be used for the profiler counter. // Returns the interrupt budget which should be used for the profiler counter.
static int InterruptBudget(); static int InterruptBudget();
......
...@@ -38,7 +38,7 @@ InterpreterTester::InterpreterTester(Isolate* isolate, const char* source, ...@@ -38,7 +38,7 @@ InterpreterTester::InterpreterTester(Isolate* isolate, const char* source,
: InterpreterTester(isolate, source, MaybeHandle<BytecodeArray>(), : InterpreterTester(isolate, source, MaybeHandle<BytecodeArray>(),
MaybeHandle<FeedbackMetadata>(), filter) {} MaybeHandle<FeedbackMetadata>(), filter) {}
InterpreterTester::~InterpreterTester() {} InterpreterTester::~InterpreterTester() = default;
Local<Message> InterpreterTester::CheckThrowsReturnMessage() { Local<Message> InterpreterTester::CheckThrowsReturnMessage() {
TryCatch try_catch(reinterpret_cast<v8::Isolate*>(isolate_)); TryCatch try_catch(reinterpret_cast<v8::Isolate*>(isolate_));
......
...@@ -36,7 +36,7 @@ class InterpreterCallable { ...@@ -36,7 +36,7 @@ class InterpreterCallable {
public: public:
InterpreterCallable(Isolate* isolate, Handle<JSFunction> function) InterpreterCallable(Isolate* isolate, Handle<JSFunction> function)
: isolate_(isolate), function_(function) {} : isolate_(isolate), function_(function) {}
virtual ~InterpreterCallable() {} virtual ~InterpreterCallable() = default;
MaybeHandle<Object> operator()(A... args) { MaybeHandle<Object> operator()(A... args) {
return CallInterpreter(isolate_, function_, args...); return CallInterpreter(isolate_, function_, args...);
......
...@@ -22,8 +22,8 @@ namespace interpreter { ...@@ -22,8 +22,8 @@ namespace interpreter {
class BytecodeArrayBuilderTest : public TestWithIsolateAndZone { class BytecodeArrayBuilderTest : public TestWithIsolateAndZone {
public: public:
BytecodeArrayBuilderTest() {} BytecodeArrayBuilderTest() = default;
~BytecodeArrayBuilderTest() override {} ~BytecodeArrayBuilderTest() override = default;
}; };
using ToBooleanMode = BytecodeArrayBuilder::ToBooleanMode; using ToBooleanMode = BytecodeArrayBuilder::ToBooleanMode;
......
...@@ -16,8 +16,8 @@ namespace interpreter { ...@@ -16,8 +16,8 @@ namespace interpreter {
class BytecodeArrayIteratorTest : public TestWithIsolateAndZone { class BytecodeArrayIteratorTest : public TestWithIsolateAndZone {
public: public:
BytecodeArrayIteratorTest() {} BytecodeArrayIteratorTest() = default;
~BytecodeArrayIteratorTest() override {} ~BytecodeArrayIteratorTest() override = default;
}; };
TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) { TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
......
...@@ -16,8 +16,8 @@ namespace interpreter { ...@@ -16,8 +16,8 @@ namespace interpreter {
class BytecodeArrayRandomIteratorTest : public TestWithIsolateAndZone { class BytecodeArrayRandomIteratorTest : public TestWithIsolateAndZone {
public: public:
BytecodeArrayRandomIteratorTest() {} BytecodeArrayRandomIteratorTest() = default;
~BytecodeArrayRandomIteratorTest() override {} ~BytecodeArrayRandomIteratorTest() override = default;
}; };
TEST_F(BytecodeArrayRandomIteratorTest, InvalidBeforeStart) { TEST_F(BytecodeArrayRandomIteratorTest, InvalidBeforeStart) {
......
...@@ -34,7 +34,7 @@ class BytecodeArrayWriterUnittest : public TestWithIsolateAndZone { ...@@ -34,7 +34,7 @@ class BytecodeArrayWriterUnittest : public TestWithIsolateAndZone {
bytecode_array_writer_( bytecode_array_writer_(
zone(), &constant_array_builder_, zone(), &constant_array_builder_,
SourcePositionTableBuilder::RECORD_SOURCE_POSITIONS) {} SourcePositionTableBuilder::RECORD_SOURCE_POSITIONS) {}
~BytecodeArrayWriterUnittest() override {} ~BytecodeArrayWriterUnittest() override = default;
void Write(Bytecode bytecode, BytecodeSourceInfo info = BytecodeSourceInfo()); void Write(Bytecode bytecode, BytecodeSourceInfo info = BytecodeSourceInfo());
void Write(Bytecode bytecode, uint32_t operand0, void Write(Bytecode bytecode, uint32_t operand0,
......
...@@ -16,7 +16,7 @@ namespace interpreter { ...@@ -16,7 +16,7 @@ namespace interpreter {
class BytecodeRegisterAllocatorTest : public TestWithIsolateAndZone { class BytecodeRegisterAllocatorTest : public TestWithIsolateAndZone {
public: public:
BytecodeRegisterAllocatorTest() : allocator_(0) {} BytecodeRegisterAllocatorTest() : allocator_(0) {}
~BytecodeRegisterAllocatorTest() override {} ~BytecodeRegisterAllocatorTest() override = default;
BytecodeRegisterAllocator* allocator() { return &allocator_; } BytecodeRegisterAllocator* allocator() { return &allocator_; }
......
...@@ -23,7 +23,7 @@ class BytecodeRegisterOptimizerTest ...@@ -23,7 +23,7 @@ class BytecodeRegisterOptimizerTest
Register output; Register output;
}; };
BytecodeRegisterOptimizerTest() {} BytecodeRegisterOptimizerTest() = default;
~BytecodeRegisterOptimizerTest() override { delete register_allocator_; } ~BytecodeRegisterOptimizerTest() override { delete register_allocator_; }
void Initialize(int number_of_parameters, int number_of_locals) { void Initialize(int number_of_parameters, int number_of_locals) {
......
...@@ -18,8 +18,8 @@ namespace interpreter { ...@@ -18,8 +18,8 @@ namespace interpreter {
class ConstantArrayBuilderTest : public TestWithIsolateAndZone { class ConstantArrayBuilderTest : public TestWithIsolateAndZone {
public: public:
ConstantArrayBuilderTest() {} ConstantArrayBuilderTest() = default;
~ConstantArrayBuilderTest() override {} ~ConstantArrayBuilderTest() override = default;
static const size_t k8BitCapacity = ConstantArrayBuilder::k8BitCapacity; static const size_t k8BitCapacity = ConstantArrayBuilder::k8BitCapacity;
static const size_t k16BitCapacity = ConstantArrayBuilder::k16BitCapacity; static const size_t k16BitCapacity = ConstantArrayBuilder::k16BitCapacity;
......
...@@ -28,8 +28,8 @@ class InterpreterAssemblerTestState : public compiler::CodeAssemblerState { ...@@ -28,8 +28,8 @@ class InterpreterAssemblerTestState : public compiler::CodeAssemblerState {
class InterpreterAssemblerTest : public TestWithIsolateAndZone { class InterpreterAssemblerTest : public TestWithIsolateAndZone {
public: public:
InterpreterAssemblerTest() {} InterpreterAssemblerTest() = default;
~InterpreterAssemblerTest() override {} ~InterpreterAssemblerTest() override = default;
class InterpreterAssemblerForTest final : public InterpreterAssembler { class InterpreterAssemblerForTest final : public InterpreterAssembler {
public: 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