Revision: 12921
Author:   [email protected]
Date:     Fri Nov  9 05:43:48 2012
Log: Refactoring: Make emit_debug_code flag handling architecture-independent.

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

Modified:
 /branches/bleeding_edge/src/arm/assembler-arm.cc
 /branches/bleeding_edge/src/arm/assembler-arm.h
 /branches/bleeding_edge/src/assembler.cc
 /branches/bleeding_edge/src/assembler.h
 /branches/bleeding_edge/src/ia32/assembler-ia32.cc
 /branches/bleeding_edge/src/ia32/assembler-ia32.h
 /branches/bleeding_edge/src/mips/assembler-mips.cc
 /branches/bleeding_edge/src/mips/assembler-mips.h
 /branches/bleeding_edge/src/x64/assembler-x64.cc
 /branches/bleeding_edge/src/x64/assembler-x64.h

=======================================
--- /branches/bleeding_edge/src/arm/assembler-arm.cc Fri Nov 9 05:10:10 2012 +++ /branches/bleeding_edge/src/arm/assembler-arm.cc Fri Nov 9 05:43:48 2012
@@ -325,8 +325,7 @@
 Assembler::Assembler(Isolate* arg_isolate, void* buffer, int buffer_size)
     : AssemblerBase(arg_isolate),
       recorded_ast_id_(TypeFeedbackId::None()),
-      positions_recorder_(this),
-      emit_debug_code_(FLAG_debug_code) {
+      positions_recorder_(this) {
   if (buffer == NULL) {
     // Do our own buffer management.
     if (buffer_size <= kMinimalBufferSize) {
=======================================
--- /branches/bleeding_edge/src/arm/assembler-arm.h     Fri Nov  9 05:10:10 2012
+++ /branches/bleeding_edge/src/arm/assembler-arm.h     Fri Nov  9 05:43:48 2012
@@ -648,9 +648,6 @@
   // upon destruction of the assembler.
   Assembler(Isolate* isolate, void* buffer, int buffer_size);
   ~Assembler();
-
-  // Overrides the default provided by FLAG_debug_code.
-  void set_emit_debug_code(bool value) { emit_debug_code_ = value; }

   // GetCode emits any pending (non-emitted) code and fills the descriptor
   // desc. GetCode() is idempotent; it returns the same result if no other
@@ -1337,8 +1334,6 @@
   // member variable is a way to pass the information from the call site to
   // the relocation info.
   TypeFeedbackId recorded_ast_id_;
-
-  bool emit_debug_code() const { return emit_debug_code_; }

   int buffer_space() const { return reloc_info_writer.pos() - pc_; }

@@ -1490,9 +1485,6 @@
   friend class BlockConstPoolScope;

   PositionsRecorder positions_recorder_;
-
-  bool emit_debug_code_;
-
   friend class PositionsRecorder;
   friend class EnsureSpace;
 };
=======================================
--- /branches/bleeding_edge/src/assembler.cc    Fri Nov  9 05:10:10 2012
+++ /branches/bleeding_edge/src/assembler.cc    Fri Nov  9 05:43:48 2012
@@ -109,6 +109,7 @@
 AssemblerBase::AssemblerBase(Isolate* isolate)
     : isolate_(isolate),
       jit_cookie_(0),
+      emit_debug_code_(FLAG_debug_code),
       predictable_code_size_(false) {
   if (FLAG_mask_constants_with_cookie && isolate != NULL)  {
     jit_cookie_ = V8::RandomPrivate(isolate);
=======================================
--- /branches/bleeding_edge/src/assembler.h     Fri Nov  9 05:10:10 2012
+++ /branches/bleeding_edge/src/assembler.h     Fri Nov  9 05:43:48 2012
@@ -60,6 +60,9 @@

   Isolate* isolate() const { return isolate_; }
   int jit_cookie() const { return jit_cookie_; }
+
+  bool emit_debug_code() const { return emit_debug_code_; }
+  void set_emit_debug_code(bool value) { emit_debug_code_ = value; }

   bool predictable_code_size() const { return predictable_code_size_; }
void set_predictable_code_size(bool value) { predictable_code_size_ = value; }
@@ -71,6 +74,7 @@
  private:
   Isolate* isolate_;
   int jit_cookie_;
+  bool emit_debug_code_;
   bool predictable_code_size_;
 };

=======================================
--- /branches/bleeding_edge/src/ia32/assembler-ia32.cc Thu Nov 8 04:18:11 2012 +++ /branches/bleeding_edge/src/ia32/assembler-ia32.cc Fri Nov 9 05:43:48 2012
@@ -314,8 +314,7 @@

 Assembler::Assembler(Isolate* arg_isolate, void* buffer, int buffer_size)
     : AssemblerBase(arg_isolate),
-      positions_recorder_(this),
-      emit_debug_code_(FLAG_debug_code) {
+      positions_recorder_(this) {
   if (buffer == NULL) {
     // Do our own buffer management.
     if (buffer_size <= kMinimalBufferSize) {
=======================================
--- /branches/bleeding_edge/src/ia32/assembler-ia32.h Fri Nov 9 05:10:10 2012 +++ /branches/bleeding_edge/src/ia32/assembler-ia32.h Fri Nov 9 05:43:48 2012
@@ -583,9 +583,6 @@
   // TODO(vitalyr): the assembler does not need an isolate.
   Assembler(Isolate* isolate, void* buffer, int buffer_size);
   ~Assembler();
-
-  // Overrides the default provided by FLAG_debug_code.
-  void set_emit_debug_code(bool value) { emit_debug_code_ = value; }

   // GetCode emits any pending (non-emitted) code and fills the descriptor
   // desc. GetCode() is idempotent; it returns the same result if no other
@@ -1120,8 +1117,6 @@
   void set_byte_at(int pos, byte value) { buffer_[pos] = value; }

  protected:
-  bool emit_debug_code() const { return emit_debug_code_; }
-
   void movsd(XMMRegister dst, const Operand& src);
   void movsd(const Operand& dst, XMMRegister src);

@@ -1194,9 +1189,6 @@
   RelocInfoWriter reloc_info_writer;

   PositionsRecorder positions_recorder_;
-
-  bool emit_debug_code_;
-
   friend class PositionsRecorder;
 };

=======================================
--- /branches/bleeding_edge/src/mips/assembler-mips.cc Thu Oct 4 02:46:50 2012 +++ /branches/bleeding_edge/src/mips/assembler-mips.cc Fri Nov 9 05:43:48 2012
@@ -274,8 +274,7 @@
 Assembler::Assembler(Isolate* arg_isolate, void* buffer, int buffer_size)
     : AssemblerBase(arg_isolate),
       recorded_ast_id_(TypeFeedbackId::None()),
-      positions_recorder_(this),
-      emit_debug_code_(FLAG_debug_code) {
+      positions_recorder_(this) {
   if (buffer == NULL) {
     // Do our own buffer management.
     if (buffer_size <= kMinimalBufferSize) {
=======================================
--- /branches/bleeding_edge/src/mips/assembler-mips.h Mon Oct 22 04:15:09 2012 +++ /branches/bleeding_edge/src/mips/assembler-mips.h Fri Nov 9 05:43:48 2012
@@ -524,9 +524,6 @@
   // upon destruction of the assembler.
   Assembler(Isolate* isolate, void* buffer, int buffer_size);
   ~Assembler();
-
-  // Overrides the default provided by FLAG_debug_code.
-  void set_emit_debug_code(bool value) { emit_debug_code_ = value; }

   // Dummy for cross platform compatibility.
   void set_predictable_code_size(bool value) { }
@@ -1032,8 +1029,6 @@
   // member variable is a way to pass the information from the call site to
   // the relocation info.
   TypeFeedbackId recorded_ast_id_;
-
-  bool emit_debug_code() const { return emit_debug_code_; }

   int32_t buffer_space() const { return reloc_info_writer.pos() - pc_; }

@@ -1285,7 +1280,6 @@
   friend class BlockTrampolinePoolScope;

   PositionsRecorder positions_recorder_;
-  bool emit_debug_code_;
   friend class PositionsRecorder;
   friend class EnsureSpace;
 };
=======================================
--- /branches/bleeding_edge/src/x64/assembler-x64.cc Fri Nov 9 05:10:10 2012 +++ /branches/bleeding_edge/src/x64/assembler-x64.cc Fri Nov 9 05:43:48 2012
@@ -349,8 +349,7 @@
 Assembler::Assembler(Isolate* arg_isolate, void* buffer, int buffer_size)
     : AssemblerBase(arg_isolate),
       code_targets_(100),
-      positions_recorder_(this),
-      emit_debug_code_(FLAG_debug_code) {
+      positions_recorder_(this) {
   if (buffer == NULL) {
     // Do our own buffer management.
     if (buffer_size <= kMinimalBufferSize) {
=======================================
--- /branches/bleeding_edge/src/x64/assembler-x64.h     Fri Nov  9 05:10:10 2012
+++ /branches/bleeding_edge/src/x64/assembler-x64.h     Fri Nov  9 05:43:48 2012
@@ -557,9 +557,6 @@
   // upon destruction of the assembler.
   Assembler(Isolate* isolate, void* buffer, int buffer_size);
   ~Assembler();
-
-  // Overrides the default provided by FLAG_debug_code.
-  void set_emit_debug_code(bool value) { emit_debug_code_ = value; }

   // GetCode emits any pending (non-emitted) code and fills the descriptor
   // desc. GetCode() is idempotent; it returns the same result if no other
@@ -1443,9 +1440,6 @@

   byte byte_at(int pos)  { return buffer_[pos]; }
   void set_byte_at(int pos, byte value) { buffer_[pos] = value; }
-
- protected:
-  bool emit_debug_code() const { return emit_debug_code_; }

  private:
   byte* addr_at(int pos)  { return buffer_ + pos; }
@@ -1648,9 +1642,6 @@
   List< Handle<Code> > code_targets_;

   PositionsRecorder positions_recorder_;
-
-  bool emit_debug_code_;
-
   friend class PositionsRecorder;
 };

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to