Revision: 19261
Author:   [email protected]
Date:     Tue Feb 11 09:25:07 2014 UTC
Log:      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

Review URL: https://codereview.chromium.org/135123017
http://code.google.com/p/v8/source/detail?r=19261

Modified:
 /branches/experimental/a64/src/a64/assembler-a64.cc
 /branches/experimental/a64/src/a64/assembler-a64.h

=======================================
--- /branches/experimental/a64/src/a64/assembler-a64.cc Mon Feb 10 21:33:23 2014 UTC +++ /branches/experimental/a64/src/a64/assembler-a64.cc Tue Feb 11 09:25:07 2014 UTC
@@ -283,7 +283,6 @@


 Assembler::~Assembler() {
-  ASSERT(finalized_ || (pc_ == buffer_));
   ASSERT(num_pending_reloc_info_ == 0);
   ASSERT(const_pool_blocked_nesting_ == 0);
 }
@@ -294,7 +293,6 @@
   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 @@
                        reloc_info_writer.pos();
     desc->origin = this;
   }
-
-#ifdef DEBUG
-  finalized_ = true;
-#endif
 }


=======================================
--- /branches/experimental/a64/src/a64/assembler-a64.h Mon Feb 10 15:37:43 2014 UTC +++ /branches/experimental/a64/src/a64/assembler-a64.h Tue Feb 11 09:25:07 2014 UTC
@@ -701,10 +701,6 @@
   // 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 @@
     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 @@
     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 @@
   // 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 @@
     // 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