Reviewers: Rodolph Perfetta (ARM), ulan,

Description:
A64: Remove Assembler::finalized_ flag and logic

The flag is supposed to check that the assembled code was used. However,
codegen uses masm::CodeObject() to retrieve the code which is not
detected by this logic. We could make CodeObject() set finalized_ as
wel, however, it's used all over the place which would make the flag
worthless.

BUG=none
[email protected],[email protected]
LOG=n

Please review this at https://codereview.chromium.org/135123017/

SVN Base: https://v8.googlecode.com/svn/branches/experimental/a64

Affected files (+0, -28 lines):
  M src/a64/assembler-a64.h
  M src/a64/assembler-a64.cc


Index: src/a64/assembler-a64.cc
diff --git a/src/a64/assembler-a64.cc b/src/a64/assembler-a64.cc
index fba1be9144fefae3d03ec40a4e2fc2587a62a25a..418706aa51932e12ca324e965a4271ac2290e2cc 100644
--- a/src/a64/assembler-a64.cc
+++ b/src/a64/assembler-a64.cc
@@ -283,7 +283,6 @@ Assembler::Assembler(Isolate* isolate, void* buffer, int buffer_size)


 Assembler::~Assembler() {
-  ASSERT(finalized_ || (pc_ == buffer_));
   ASSERT(num_pending_reloc_info_ == 0);
   ASSERT(const_pool_blocked_nesting_ == 0);
 }
@@ -294,7 +293,6 @@ void Assembler::Reset() {
   ASSERT((pc_ >= buffer_) && (pc_ < buffer_ + buffer_size_));
   ASSERT(const_pool_blocked_nesting_ == 0);
   memset(buffer_, 0, pc_ - buffer_);
-  finalized_ = false;
 #endif
   pc_ = buffer_;
reloc_info_writer.Reposition(reinterpret_cast<byte*>(buffer_ + buffer_size_),
@@ -321,10 +319,6 @@ void Assembler::GetCode(CodeDesc* desc) {
                        reloc_info_writer.pos();
     desc->origin = this;
   }
-
-#ifdef DEBUG
-  finalized_ = true;
-#endif
 }


Index: src/a64/assembler-a64.h
diff --git a/src/a64/assembler-a64.h b/src/a64/assembler-a64.h
index c65f62dded0bc515f22acb0664e1cb0c85dc3e2e..f8d8f127c4e6f60c46d34cad26222647db5d6d3d 100644
--- a/src/a64/assembler-a64.h
+++ b/src/a64/assembler-a64.h
@@ -701,10 +701,6 @@ class Assembler : public AssemblerBase {
   // upon destruction of the assembler.
   Assembler(Isolate* arg_isolate, void* buffer, int buffer_size);

-  // The default destructor asserts that one of the following is true:
-  //  * The Assembler object has not been used.
-  //  * Nothing has been emitted since the last Reset() call.
-  //  * Nothing has been emitted since the last GetCode() call.
   virtual ~Assembler();

// System functions ---------------------------------------------------------
@@ -1882,10 +1878,6 @@ class Assembler : public AssemblerBase {
     STATIC_ASSERT(sizeof(instruction) == kInstructionSize);
     ASSERT((pc_ + sizeof(instruction)) <= (buffer_ + buffer_size_));

-#ifdef DEBUG
-    finalized_ = false;
-#endif
-
     memcpy(pc_, &instruction, sizeof(instruction));
     pc_ += sizeof(instruction);
     CheckBuffer();
@@ -1896,10 +1888,6 @@ class Assembler : public AssemblerBase {
     ASSERT(sizeof(*pc_) == 1);
     ASSERT((pc_ + size) <= (buffer_ + buffer_size_));

-#ifdef DEBUG
-    finalized_ = false;
-#endif
-
     // TODO(all): Somehow register we have some data here. Then we can
     // disassemble it correctly.
     memcpy(pc_, data, size);
@@ -1994,10 +1982,6 @@ class Assembler : public AssemblerBase {
   // stream.
   static const int kGap = 128;

-#ifdef DEBUG
-  bool finalized_;
-#endif
-
  private:
   // TODO(jbramley): VIXL uses next_literal_pool_check_ and
   // literal_pool_monitor_ to determine when to consider emitting a literal
@@ -2047,12 +2031,6 @@ class PatchingAssembler : public Assembler {
     // Flush the Instruction cache.
     size_t length = buffer_size_ - kGap;
     CPU::FlushICache(buffer_, length);
-
-#ifdef DEBUG
- // The Patching Assembler doesn't need to be finalized, but the Assembler
-    // class's destructor will check the finalized_ flag.
-    finalized_ = true;
-#endif
   }
 };



--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to