src/share/vm/asm/codeBuffer.hpp

Print this page




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 







  25 class  CodeComments;
  26 class  AbstractAssembler;
  27 class  MacroAssembler;
  28 class  PhaseCFG;
  29 class  Compile;
  30 class  BufferBlob;
  31 class  CodeBuffer;
  32 
  33 class CodeOffsets: public StackObj {
  34 public:
  35   enum Entries { Entry,
  36                  Verified_Entry,
  37                  Frame_Complete, // Offset in the code where the frame setup is (for forte stackwalks) is complete
  38                  OSR_Entry,
  39                  Dtrace_trap = OSR_Entry,  // dtrace probes can never have an OSR entry so reuse it
  40                  Exceptions,     // Offset where exception handler lives
  41                  Deopt,          // Offset where deopt handler lives
  42                  DeoptMH,        // Offset where MethodHandle deopt handler lives
  43                  UnwindHandler,  // Offset to default unwind handler
  44                  max_Entries };


 533     }
 534   }
 535 
 536   // Transform an address from the code in this code buffer to a specified code buffer
 537   address transform_address(const CodeBuffer &cb, address addr) const;
 538 
 539   void block_comment(intptr_t offset, const char * comment) PRODUCT_RETURN;
 540 
 541 #ifndef PRODUCT
 542  public:
 543   // Printing / Decoding
 544   // decodes from decode_begin() to code_end() and sets decode_begin to end
 545   void    decode();
 546   void    decode_all();         // decodes all the code
 547   void    skip_decode();        // sets decode_begin to code_end();
 548   void    print();
 549 #endif
 550 
 551 
 552   // The following header contains architecture-specific implementations
 553   #include "incls/_codeBuffer_pd.hpp.incl"









 554 };
 555 
 556 
 557 inline void CodeSection::freeze() {
 558   _outer->freeze_section(this);
 559 }
 560 
 561 inline bool CodeSection::maybe_expand_to_ensure_remaining(csize_t amount) {
 562   if (remaining() < amount) { _outer->expand(this, amount); return true; }
 563   return false;
 564 }




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_ASM_CODEBUFFER_HPP
  26 #define SHARE_VM_ASM_CODEBUFFER_HPP
  27 
  28 #include "asm/assembler.hpp"
  29 #include "code/oopRecorder.hpp"
  30 #include "code/relocInfo.hpp"
  31 
  32 class  CodeComments;
  33 class  AbstractAssembler;
  34 class  MacroAssembler;
  35 class  PhaseCFG;
  36 class  Compile;
  37 class  BufferBlob;
  38 class  CodeBuffer;
  39 
  40 class CodeOffsets: public StackObj {
  41 public:
  42   enum Entries { Entry,
  43                  Verified_Entry,
  44                  Frame_Complete, // Offset in the code where the frame setup is (for forte stackwalks) is complete
  45                  OSR_Entry,
  46                  Dtrace_trap = OSR_Entry,  // dtrace probes can never have an OSR entry so reuse it
  47                  Exceptions,     // Offset where exception handler lives
  48                  Deopt,          // Offset where deopt handler lives
  49                  DeoptMH,        // Offset where MethodHandle deopt handler lives
  50                  UnwindHandler,  // Offset to default unwind handler
  51                  max_Entries };


 540     }
 541   }
 542 
 543   // Transform an address from the code in this code buffer to a specified code buffer
 544   address transform_address(const CodeBuffer &cb, address addr) const;
 545 
 546   void block_comment(intptr_t offset, const char * comment) PRODUCT_RETURN;
 547 
 548 #ifndef PRODUCT
 549  public:
 550   // Printing / Decoding
 551   // decodes from decode_begin() to code_end() and sets decode_begin to end
 552   void    decode();
 553   void    decode_all();         // decodes all the code
 554   void    skip_decode();        // sets decode_begin to code_end();
 555   void    print();
 556 #endif
 557 
 558 
 559   // The following header contains architecture-specific implementations
 560 #ifdef TARGET_ARCH_x86
 561 # include "codeBuffer_x86.hpp"
 562 #endif
 563 #ifdef TARGET_ARCH_sparc
 564 # include "codeBuffer_sparc.hpp"
 565 #endif
 566 #ifdef TARGET_ARCH_zero
 567 # include "codeBuffer_zero.hpp"
 568 #endif
 569 
 570 };
 571 
 572 
 573 inline void CodeSection::freeze() {
 574   _outer->freeze_section(this);
 575 }
 576 
 577 inline bool CodeSection::maybe_expand_to_ensure_remaining(csize_t amount) {
 578   if (remaining() < amount) { _outer->expand(this, amount); return true; }
 579   return false;
 580 }
 581 
 582 #endif // SHARE_VM_ASM_CODEBUFFER_HPP