< prev index next >

src/hotspot/share/asm/assembler.cpp

Print this page




   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 #include "precompiled.hpp"
  26 #include "asm/codeBuffer.hpp"
  27 #include "asm/macroAssembler.hpp"
  28 #include "asm/macroAssembler.inline.hpp"

  29 #include "runtime/atomic.hpp"
  30 #include "runtime/icache.hpp"
  31 #include "runtime/os.hpp"
  32 #include "runtime/thread.hpp"
  33 
  34 
  35 // Implementation of AbstractAssembler
  36 //
  37 // The AbstractAssembler is generating code into a CodeBuffer. To make code generation faster,
  38 // the assembler keeps a copy of the code buffers boundaries & modifies them when
  39 // emitting bytes rather than using the code buffers accessor functions all the time.
  40 // The code buffer is updated via set_code_end(...) after emitting a whole instruction.
  41 
  42 AbstractAssembler::AbstractAssembler(CodeBuffer* code) {
  43   if (code == NULL)  return;
  44   CodeSection* cs = code->insts();
  45   cs->clear_mark();   // new assembler kills old mark
  46   if (cs->start() == NULL)  {
  47     vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "CodeCache: no room for %s", code->name());
  48   }




   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 #include "precompiled.hpp"
  26 #include "asm/codeBuffer.hpp"
  27 #include "asm/macroAssembler.hpp"
  28 #include "asm/macroAssembler.inline.hpp"
  29 #include "gc/shared/barrierSetAssembler.hpp"
  30 #include "runtime/atomic.hpp"
  31 #include "runtime/icache.hpp"
  32 #include "runtime/os.hpp"
  33 #include "runtime/thread.hpp"
  34 
  35 
  36 // Implementation of AbstractAssembler
  37 //
  38 // The AbstractAssembler is generating code into a CodeBuffer. To make code generation faster,
  39 // the assembler keeps a copy of the code buffers boundaries & modifies them when
  40 // emitting bytes rather than using the code buffers accessor functions all the time.
  41 // The code buffer is updated via set_code_end(...) after emitting a whole instruction.
  42 
  43 AbstractAssembler::AbstractAssembler(CodeBuffer* code) {
  44   if (code == NULL)  return;
  45   CodeSection* cs = code->insts();
  46   cs->clear_mark();   // new assembler kills old mark
  47   if (cs->start() == NULL)  {
  48     vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "CodeCache: no room for %s", code->name());
  49   }


< prev index next >