src/share/vm/asm/assembler.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 7110832 Sdiff src/share/vm/asm

src/share/vm/asm/assembler.cpp

Print this page




  44 # include "assembler_ppc.inline.hpp"
  45 #endif
  46 
  47 
  48 // Implementation of AbstractAssembler
  49 //
  50 // The AbstractAssembler is generating code into a CodeBuffer. To make code generation faster,
  51 // the assembler keeps a copy of the code buffers boundaries & modifies them when
  52 // emitting bytes rather than using the code buffers accessor functions all the time.
  53 // The code buffer is updated via set_code_end(...) after emitting a whole instruction.
  54 
  55 AbstractAssembler::AbstractAssembler(CodeBuffer* code) {
  56   if (code == NULL)  return;
  57   CodeSection* cs = code->insts();
  58   cs->clear_mark();   // new assembler kills old mark
  59   _code_section = cs;
  60   _code_begin  = cs->start();
  61   _code_limit  = cs->limit();
  62   _code_pos    = cs->end();
  63   _oop_recorder= code->oop_recorder();

  64   if (_code_begin == NULL)  {
  65     vm_exit_out_of_memory(0, err_msg("CodeCache: no room for %s",
  66                                      code->name()));
  67   }
  68 }
  69 
  70 void AbstractAssembler::set_code_section(CodeSection* cs) {
  71   assert(cs->outer() == code_section()->outer(), "sanity");
  72   assert(cs->is_allocated(), "need to pre-allocate this section");
  73   cs->clear_mark();  // new assembly into this section kills old mark
  74   _code_section = cs;
  75   _code_begin  = cs->start();
  76   _code_limit  = cs->limit();
  77   _code_pos    = cs->end();
  78 }
  79 
  80 // Inform CodeBuffer that incoming code and relocation will be for stubs
  81 address AbstractAssembler::start_a_stub(int required_space) {
  82   CodeBuffer*  cb = code();
  83   CodeSection* cs = cb->stubs();




  44 # include "assembler_ppc.inline.hpp"
  45 #endif
  46 
  47 
  48 // Implementation of AbstractAssembler
  49 //
  50 // The AbstractAssembler is generating code into a CodeBuffer. To make code generation faster,
  51 // the assembler keeps a copy of the code buffers boundaries & modifies them when
  52 // emitting bytes rather than using the code buffers accessor functions all the time.
  53 // The code buffer is updated via set_code_end(...) after emitting a whole instruction.
  54 
  55 AbstractAssembler::AbstractAssembler(CodeBuffer* code) {
  56   if (code == NULL)  return;
  57   CodeSection* cs = code->insts();
  58   cs->clear_mark();   // new assembler kills old mark
  59   _code_section = cs;
  60   _code_begin  = cs->start();
  61   _code_limit  = cs->limit();
  62   _code_pos    = cs->end();
  63   _oop_recorder= code->oop_recorder();
  64   DEBUG_ONLY( _short_branch_delta = 0; )
  65   if (_code_begin == NULL)  {
  66     vm_exit_out_of_memory(0, err_msg("CodeCache: no room for %s",
  67                                      code->name()));
  68   }
  69 }
  70 
  71 void AbstractAssembler::set_code_section(CodeSection* cs) {
  72   assert(cs->outer() == code_section()->outer(), "sanity");
  73   assert(cs->is_allocated(), "need to pre-allocate this section");
  74   cs->clear_mark();  // new assembly into this section kills old mark
  75   _code_section = cs;
  76   _code_begin  = cs->start();
  77   _code_limit  = cs->limit();
  78   _code_pos    = cs->end();
  79 }
  80 
  81 // Inform CodeBuffer that incoming code and relocation will be for stubs
  82 address AbstractAssembler::start_a_stub(int required_space) {
  83   CodeBuffer*  cb = code();
  84   CodeSection* cs = cb->stubs();


src/share/vm/asm/assembler.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File