Commit 2565c9dd authored by Zhi An Ng's avatar Zhi An Ng Committed by Commit Bot

[cleanup] Remove DISALLOW_COPY_AND_ASSIGN in interpreter/

Bug: v8:11074
Change-Id: I181af917c141fb327213ae6303057f1bb87f4ac4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2524418Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71064}
parent a547b61d
......@@ -91,6 +91,9 @@ class V8_EXPORT_PRIVATE BytecodeArrayAccessor {
BytecodeArrayAccessor(Handle<BytecodeArray> bytecode_array,
int initial_offset);
BytecodeArrayAccessor(const BytecodeArrayAccessor&) = delete;
BytecodeArrayAccessor& operator=(const BytecodeArrayAccessor&) = delete;
void SetOffset(int offset);
void ApplyDebugBreak();
......@@ -157,8 +160,6 @@ class V8_EXPORT_PRIVATE BytecodeArrayAccessor {
int bytecode_offset_;
OperandScale operand_scale_;
int prefix_offset_;
DISALLOW_COPY_AND_ASSIGN(BytecodeArrayAccessor);
};
} // namespace interpreter
......
......@@ -43,6 +43,9 @@ class V8_EXPORT_PRIVATE BytecodeArrayBuilder final {
SourcePositionTableBuilder::RecordingMode source_position_mode =
SourcePositionTableBuilder::RECORD_SOURCE_POSITIONS);
BytecodeArrayBuilder(const BytecodeArrayBuilder&) = delete;
BytecodeArrayBuilder& operator=(const BytecodeArrayBuilder&) = delete;
template <typename LocalIsolate>
EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE)
Handle<BytecodeArray> ToBytecodeArray(LocalIsolate* isolate);
......@@ -644,8 +647,6 @@ class V8_EXPORT_PRIVATE BytecodeArrayBuilder final {
BytecodeRegisterOptimizer* register_optimizer_;
BytecodeSourceInfo latest_source_info_;
BytecodeSourceInfo deferred_source_info_;
DISALLOW_COPY_AND_ASSIGN(BytecodeArrayBuilder);
};
V8_EXPORT_PRIVATE std::ostream& operator<<(
......
......@@ -20,11 +20,11 @@ class V8_EXPORT_PRIVATE BytecodeArrayIterator final
explicit BytecodeArrayIterator(Handle<BytecodeArray> array);
BytecodeArrayIterator(const BytecodeArrayIterator&) = delete;
BytecodeArrayIterator& operator=(const BytecodeArrayIterator&) = delete;
void Advance();
bool done() const;
private:
DISALLOW_COPY_AND_ASSIGN(BytecodeArrayIterator);
};
} // namespace interpreter
......
......@@ -23,6 +23,10 @@ class V8_EXPORT_PRIVATE BytecodeArrayRandomIterator final
BytecodeArrayRandomIterator(Handle<BytecodeArray> bytecode_array, Zone* zone);
BytecodeArrayRandomIterator(const BytecodeArrayRandomIterator&) = delete;
BytecodeArrayRandomIterator& operator=(const BytecodeArrayRandomIterator&) =
delete;
BytecodeArrayRandomIterator& operator++() {
++current_index_;
UpdateOffsetFromIndex();
......@@ -72,8 +76,6 @@ class V8_EXPORT_PRIVATE BytecodeArrayRandomIterator final
void Initialize();
void UpdateOffsetFromIndex();
DISALLOW_COPY_AND_ASSIGN(BytecodeArrayRandomIterator);
};
} // namespace interpreter
......
......@@ -36,6 +36,8 @@ class V8_EXPORT_PRIVATE BytecodeArrayWriter final {
BytecodeArrayWriter(
Zone* zone, ConstantArrayBuilder* constant_array_builder,
SourcePositionTableBuilder::RecordingMode source_position_mode);
BytecodeArrayWriter(const BytecodeArrayWriter&) = delete;
BytecodeArrayWriter& operator=(const BytecodeArrayWriter&) = delete;
void Write(BytecodeNode* node);
void WriteJump(BytecodeNode* node, BytecodeLabel* label);
......@@ -126,7 +128,6 @@ class V8_EXPORT_PRIVATE BytecodeArrayWriter final {
bool exit_seen_in_block_;
friend class bytecode_array_writer_unittest::BytecodeArrayWriterUnittest;
DISALLOW_COPY_AND_ASSIGN(BytecodeArrayWriter);
};
} // namespace interpreter
......
......@@ -108,6 +108,8 @@ class BytecodeGenerator::ControlScope {
generator_->set_execution_control(this);
}
virtual ~ControlScope() { generator_->set_execution_control(outer()); }
ControlScope(const ControlScope&) = delete;
ControlScope& operator=(const ControlScope&) = delete;
void Break(Statement* stmt) {
PerformCommand(CMD_BREAK, stmt, kNoSourcePosition);
......@@ -154,8 +156,6 @@ class BytecodeGenerator::ControlScope {
BytecodeGenerator* generator_;
ControlScope* outer_;
ContextScope* context_;
DISALLOW_COPY_AND_ASSIGN(ControlScope);
};
// Helper class for a try-finally control scope. It can record intercepted
......@@ -562,13 +562,14 @@ class BytecodeGenerator::RegisterAllocationScope final {
outer_next_register_index_);
}
RegisterAllocationScope(const RegisterAllocationScope&) = delete;
RegisterAllocationScope& operator=(const RegisterAllocationScope&) = delete;
BytecodeGenerator* generator() const { return generator_; }
private:
BytecodeGenerator* generator_;
int outer_next_register_index_;
DISALLOW_COPY_AND_ASSIGN(RegisterAllocationScope);
};
class BytecodeGenerator::AccumulatorPreservingScope final {
......@@ -591,11 +592,13 @@ class BytecodeGenerator::AccumulatorPreservingScope final {
}
}
AccumulatorPreservingScope(const AccumulatorPreservingScope&) = delete;
AccumulatorPreservingScope& operator=(const AccumulatorPreservingScope&) =
delete;
private:
BytecodeGenerator* generator_;
Register saved_accumulator_register_;
DISALLOW_COPY_AND_ASSIGN(AccumulatorPreservingScope);
};
// Scoped base class for determining how the result of an expression will be
......@@ -614,6 +617,9 @@ class BytecodeGenerator::ExpressionResultScope {
allocator_.generator()->set_execution_result(outer_);
}
ExpressionResultScope(const ExpressionResultScope&) = delete;
ExpressionResultScope& operator=(const ExpressionResultScope&) = delete;
bool IsEffect() const { return kind_ == Expression::kEffect; }
bool IsValue() const { return kind_ == Expression::kValue; }
bool IsTest() const { return kind_ == Expression::kTest; }
......@@ -641,8 +647,6 @@ class BytecodeGenerator::ExpressionResultScope {
RegisterAllocationScope allocator_;
Expression::Context kind_;
TypeHint type_hint_;
DISALLOW_COPY_AND_ASSIGN(ExpressionResultScope);
};
// Scoped class used when the result of the current expression is not
......@@ -674,6 +678,9 @@ class BytecodeGenerator::TestResultScope final : public ExpressionResultScope {
then_labels_(then_labels),
else_labels_(else_labels) {}
TestResultScope(const TestResultScope&) = delete;
TestResultScope& operator=(const TestResultScope&) = delete;
// Used when code special cases for TestResultScope and consumes any
// possible value by testing and jumping to a then/else label.
void SetResultConsumedByTest() { result_consumed_by_test_ = true; }
......@@ -719,8 +726,6 @@ class BytecodeGenerator::TestResultScope final : public ExpressionResultScope {
TestFallthrough fallthrough_;
BytecodeLabels* then_labels_;
BytecodeLabels* else_labels_;
DISALLOW_COPY_AND_ASSIGN(TestResultScope);
};
// Used to build a list of toplevel declaration data.
......
......@@ -84,6 +84,8 @@ class V8_EXPORT_PRIVATE BytecodeLabel final {
class V8_EXPORT_PRIVATE BytecodeLabels {
public:
explicit BytecodeLabels(Zone* zone) : labels_(zone), is_bound_(false) {}
BytecodeLabels(const BytecodeLabels&) = delete;
BytecodeLabels& operator=(const BytecodeLabels&) = delete;
BytecodeLabel* New();
......@@ -103,8 +105,6 @@ class V8_EXPORT_PRIVATE BytecodeLabels {
private:
ZoneLinkedList<BytecodeLabel> labels_;
bool is_bound_;
DISALLOW_COPY_AND_ASSIGN(BytecodeLabels);
};
} // namespace interpreter
......
......@@ -30,6 +30,9 @@ class BytecodeRegisterAllocator final {
max_register_count_(start_index),
observer_(nullptr) {}
~BytecodeRegisterAllocator() = default;
BytecodeRegisterAllocator(const BytecodeRegisterAllocator&) = delete;
BytecodeRegisterAllocator& operator=(const BytecodeRegisterAllocator&) =
delete;
// Returns a new register.
Register NewRegister() {
......@@ -101,8 +104,6 @@ class BytecodeRegisterAllocator final {
int next_register_index_;
int max_register_count_;
Observer* observer_;
DISALLOW_COPY_AND_ASSIGN(BytecodeRegisterAllocator);
};
} // namespace interpreter
......
......@@ -24,6 +24,8 @@ class BytecodeRegisterOptimizer::RegisterInfo final : public ZoneObject {
needs_flush_(false),
next_(this),
prev_(this) {}
RegisterInfo(const RegisterInfo&) = delete;
RegisterInfo& operator=(const RegisterInfo&) = delete;
void AddToEquivalenceSetOf(RegisterInfo* info);
void MoveToNewEquivalenceSet(uint32_t equivalence_id, bool materialized);
......@@ -85,8 +87,6 @@ class BytecodeRegisterOptimizer::RegisterInfo final : public ZoneObject {
// Equivalence set pointers.
RegisterInfo* next_;
RegisterInfo* prev_;
DISALLOW_COPY_AND_ASSIGN(RegisterInfo);
};
void BytecodeRegisterOptimizer::RegisterInfo::AddToEquivalenceSetOf(
......
......@@ -25,14 +25,13 @@ class V8_EXPORT_PRIVATE BytecodeRegisterOptimizer final
public:
BytecodeWriter() = default;
virtual ~BytecodeWriter() = default;
BytecodeWriter(const BytecodeWriter&) = delete;
BytecodeWriter& operator=(const BytecodeWriter&) = delete;
// Called to emit a register transfer bytecode.
virtual void EmitLdar(Register input) = 0;
virtual void EmitStar(Register output) = 0;
virtual void EmitMov(Register input, Register output) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(BytecodeWriter);
};
BytecodeRegisterOptimizer(Zone* zone,
......@@ -40,6 +39,9 @@ class V8_EXPORT_PRIVATE BytecodeRegisterOptimizer final
int fixed_registers_count, int parameter_count,
BytecodeWriter* bytecode_writer);
~BytecodeRegisterOptimizer() override = default;
BytecodeRegisterOptimizer(const BytecodeRegisterOptimizer&) = delete;
BytecodeRegisterOptimizer& operator=(const BytecodeRegisterOptimizer&) =
delete;
// Perform explicit register transfer operations.
void DoLdar(Register input) {
......@@ -201,8 +203,6 @@ class V8_EXPORT_PRIVATE BytecodeRegisterOptimizer final
BytecodeWriter* bytecode_writer_;
bool flush_required_;
Zone* zone_;
DISALLOW_COPY_AND_ASSIGN(BytecodeRegisterOptimizer);
};
} // namespace interpreter
......
......@@ -198,6 +198,9 @@ class V8_EXPORT_PRIVATE ConstantArrayBuilder final {
struct ConstantArraySlice final : public ZoneObject {
ConstantArraySlice(Zone* zone, size_t start_index, size_t capacity,
OperandSize operand_size);
ConstantArraySlice(const ConstantArraySlice&) = delete;
ConstantArraySlice& operator=(const ConstantArraySlice&) = delete;
void Reserve();
void Unreserve();
size_t Allocate(Entry entry, size_t count = 1);
......@@ -223,8 +226,6 @@ class V8_EXPORT_PRIVATE ConstantArrayBuilder final {
size_t reserved_;
OperandSize operand_size_;
ZoneVector<Entry> constants_;
DISALLOW_COPY_AND_ASSIGN(ConstantArraySlice);
};
ConstantArraySlice* IndexToSlice(size_t index) const;
......
......@@ -25,6 +25,8 @@ namespace interpreter {
class V8_EXPORT_PRIVATE HandlerTableBuilder final {
public:
explicit HandlerTableBuilder(Zone* zone);
HandlerTableBuilder(const HandlerTableBuilder&) = delete;
HandlerTableBuilder& operator=(const HandlerTableBuilder&) = delete;
// Builds the actual handler table by copying the current values into a heap
// object. Any further mutations to the builder won't be reflected.
......@@ -55,8 +57,6 @@ class V8_EXPORT_PRIVATE HandlerTableBuilder final {
};
ZoneVector<Entry> entries_;
DISALLOW_COPY_AND_ASSIGN(HandlerTableBuilder);
};
} // namespace interpreter
......
......@@ -22,6 +22,8 @@ class V8_EXPORT_PRIVATE InterpreterAssembler : public CodeStubAssembler {
InterpreterAssembler(compiler::CodeAssemblerState* state, Bytecode bytecode,
OperandScale operand_scale);
~InterpreterAssembler();
InterpreterAssembler(const InterpreterAssembler&) = delete;
InterpreterAssembler& operator=(const InterpreterAssembler&) = delete;
// Returns the 32-bit unsigned count immediate for bytecode operand
// |operand_index| in the current bytecode.
......@@ -400,8 +402,6 @@ class V8_EXPORT_PRIVATE InterpreterAssembler : public CodeStubAssembler {
bool made_call_;
bool reloaded_frame_ptr_;
bool bytecode_array_valid_;
DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler);
};
} // namespace interpreter
......
......@@ -44,12 +44,13 @@ using Label = CodeStubAssembler::Label;
explicit Name##Assembler(compiler::CodeAssemblerState* state, \
Bytecode bytecode, OperandScale scale) \
: BaseAssembler(state, bytecode, scale) {} \
Name##Assembler(const Name##Assembler&) = delete; \
Name##Assembler& operator=(const Name##Assembler&) = delete; \
static void Generate(compiler::CodeAssemblerState* state, \
OperandScale scale); \
\
private: \
void GenerateImpl(); \
DISALLOW_COPY_AND_ASSIGN(Name##Assembler); \
}; \
void Name##Assembler::Generate(compiler::CodeAssemblerState* state, \
OperandScale scale) { \
......
......@@ -28,6 +28,8 @@ class IntrinsicsGenerator {
: isolate_(assembler->isolate()),
zone_(assembler->zone()),
assembler_(assembler) {}
IntrinsicsGenerator(const IntrinsicsGenerator&) = delete;
IntrinsicsGenerator& operator=(const IntrinsicsGenerator&) = delete;
TNode<Object> InvokeIntrinsic(
TNode<Uint32T> function_id, TNode<Context> context,
......@@ -63,8 +65,6 @@ class IntrinsicsGenerator {
Isolate* isolate_;
Zone* zone_;
InterpreterAssembler* assembler_;
DISALLOW_COPY_AND_ASSIGN(IntrinsicsGenerator);
};
TNode<Object> GenerateInvokeIntrinsic(
......
......@@ -35,6 +35,9 @@ class InterpreterCompilationJob final : public UnoptimizedCompilationJob {
ParseInfo* parse_info, FunctionLiteral* literal,
AccountingAllocator* allocator,
std::vector<FunctionLiteral*>* eager_inner_literals);
InterpreterCompilationJob(const InterpreterCompilationJob&) = delete;
InterpreterCompilationJob& operator=(const InterpreterCompilationJob&) =
delete;
protected:
Status ExecuteJobImpl() final;
......@@ -57,8 +60,6 @@ class InterpreterCompilationJob final : public UnoptimizedCompilationJob {
Zone zone_;
UnoptimizedCompilationInfo compilation_info_;
BytecodeGenerator generator_;
DISALLOW_COPY_AND_ASSIGN(InterpreterCompilationJob);
};
Interpreter::Interpreter(Isolate* isolate)
......
......@@ -37,6 +37,8 @@ class Interpreter {
public:
explicit Interpreter(Isolate* isolate);
virtual ~Interpreter() = default;
Interpreter(const Interpreter&) = delete;
Interpreter& operator=(const Interpreter&) = delete;
// Creates a compilation job which will generate bytecode for |literal|.
// Additionally, if |eager_inner_literals| is not null, adds any eagerly
......@@ -105,8 +107,6 @@ class Interpreter {
Address dispatch_table_[kDispatchTableSize];
std::unique_ptr<uintptr_t[]> bytecode_dispatch_counters_table_;
Address interpreter_entry_trampoline_instruction_start_;
DISALLOW_COPY_AND_ASSIGN(Interpreter);
};
} // namespace interpreter
......
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