< prev index next >

src/share/vm/asm/codeBuffer.hpp

Print this page
rev 12037 : 8166562: C2: Suppress relocations in scratch emit.

@@ -90,10 +90,11 @@
   relocInfo*  _locs_end;        // first byte after relocation information
   relocInfo*  _locs_limit;      // first byte after relocation information buf
   address     _locs_point;      // last relocated position (grows upward)
   bool        _locs_own;        // did I allocate the locs myself?
   bool        _frozen;          // no more expansion of this section
+  bool        _scratch_emit;    // Buffer is used for scratch emit, don't relocate.
   char        _index;           // my section number (SECT_INST, etc.)
   CodeBuffer* _outer;           // enclosing CodeBuffer
 
   // (Note:  _locs_point used to be called _last_reloc_offset.)
 

@@ -106,10 +107,11 @@
     _locs_end      = NULL;
     _locs_limit    = NULL;
     _locs_point    = NULL;
     _locs_own      = false;
     _frozen        = false;
+    _scratch_emit  = false;
     debug_only(_index = (char)-1);
     debug_only(_outer = (CodeBuffer*)badAddress);
   }
 
   void initialize_outer(CodeBuffer* outer, int index) {

@@ -164,10 +166,14 @@
   bool        is_allocated() const  { return _start != NULL; }
   bool        is_empty() const      { return _start == _end; }
   bool        is_frozen() const     { return _frozen; }
   bool        has_locs() const      { return _locs_end != NULL; }
 
+  // Mark scratch buffer.
+  void        set_scratch_emit()    { _scratch_emit = true; }
+  bool        scratch_emit()        { return _scratch_emit; }
+
   CodeBuffer* outer() const         { return _outer; }
 
   // is a given address in this section?  (2nd version is end-inclusive)
   bool contains(address pc) const   { return pc >= _start && pc <  _end; }
   bool contains2(address pc) const  { return pc >= _start && pc <= _end; }
< prev index next >