diff options
author | 2023-06-16 12:18:27 +0100 | |
---|---|---|
committer | 2023-06-21 07:59:13 +0000 | |
commit | 70bba9c9f5fbba03c62a4542411e1d938375f14e (patch) | |
tree | 0b4ef702e671db908321639d39912636603166bc /compiler/optimizing/optimizing_cfi_test.cc | |
parent | 5bf0f68407d3467a3fbfa9ab9ae0c8fabead615b (diff) |
Remove CodeAllocator and the extra copy of generated code.
The code used to copy the final generated code twice: from assembler to
CodeAllocator, and then to CodeAllocator to SwapAllocator/JitMemory.
The assemblers never depended on the exact location of the generated
code, so just drop that feature.
Test: test.py
Change-Id: I8dc82e4926097092b9aac336a5a5d40f79dc62ca
Diffstat (limited to 'compiler/optimizing/optimizing_cfi_test.cc')
-rw-r--r-- | compiler/optimizing/optimizing_cfi_test.cc | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/compiler/optimizing/optimizing_cfi_test.cc b/compiler/optimizing/optimizing_cfi_test.cc index f12e748941..632c32a70b 100644 --- a/compiler/optimizing/optimizing_cfi_test.cc +++ b/compiler/optimizing/optimizing_cfi_test.cc @@ -89,7 +89,7 @@ class OptimizingCFITest : public CFITest, public OptimizingUnitTestHelper { void Finish() { code_gen_->GenerateFrameExit(); - code_gen_->Finalize(&code_allocator_); + code_gen_->Finalize(); } void Check(InstructionSet isa, @@ -97,7 +97,7 @@ class OptimizingCFITest : public CFITest, public OptimizingUnitTestHelper { const std::vector<uint8_t>& expected_asm, const std::vector<uint8_t>& expected_cfi) { // Get the outputs. - ArrayRef<const uint8_t> actual_asm = code_allocator_.GetMemory(); + ArrayRef<const uint8_t> actual_asm = code_gen_->GetCode(); Assembler* opt_asm = code_gen_->GetAssembler(); ArrayRef<const uint8_t> actual_cfi(*(opt_asm->cfi().data())); @@ -123,27 +123,9 @@ class OptimizingCFITest : public CFITest, public OptimizingUnitTestHelper { } private: - class InternalCodeAllocator : public CodeAllocator { - public: - InternalCodeAllocator() {} - - uint8_t* Allocate(size_t size) override { - memory_.resize(size); - return memory_.data(); - } - - ArrayRef<const uint8_t> GetMemory() const override { return ArrayRef<const uint8_t>(memory_); } - - private: - std::vector<uint8_t> memory_; - - DISALLOW_COPY_AND_ASSIGN(InternalCodeAllocator); - }; - HGraph* graph_; std::unique_ptr<CodeGenerator> code_gen_; ArenaVector<HBasicBlock*> blocks_; - InternalCodeAllocator code_allocator_; }; #define TEST_ISA(isa) \ |