< prev index next >

src/share/vm/c1/c1_LIRAssembler.cpp

Print this page


   1 /*
   2  * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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  *


 111   return PatchingStub::load_mirror_id;
 112 }
 113 
 114 //---------------------------------------------------------------
 115 
 116 
 117 LIR_Assembler::LIR_Assembler(Compilation* c):
 118    _compilation(c)
 119  , _masm(c->masm())
 120  , _bs(Universe::heap()->barrier_set())
 121  , _frame_map(c->frame_map())
 122  , _current_block(NULL)
 123  , _pending_non_safepoint(NULL)
 124  , _pending_non_safepoint_offset(0)
 125 {
 126   _slow_case_stubs = new CodeStubList();
 127 }
 128 
 129 
 130 LIR_Assembler::~LIR_Assembler() {



 131 }
 132 
 133 
 134 void LIR_Assembler::check_codespace() {
 135   CodeSection* cs = _masm->code_section();
 136   if (cs->remaining() < (int)(NOT_LP64(1*K)LP64_ONLY(2*K))) {
 137     BAILOUT("CodeBuffer overflow");
 138   }
 139 }
 140 
 141 
 142 void LIR_Assembler::append_code_stub(CodeStub* stub) {
 143   _slow_case_stubs->append(stub);
 144 }
 145 
 146 void LIR_Assembler::emit_stubs(CodeStubList* stub_list) {
 147   for (int m = 0; m < stub_list->length(); m++) {
 148     CodeStub* s = (*stub_list)[m];
 149 
 150     check_codespace();


   1 /*
   2  * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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  *


 111   return PatchingStub::load_mirror_id;
 112 }
 113 
 114 //---------------------------------------------------------------
 115 
 116 
 117 LIR_Assembler::LIR_Assembler(Compilation* c):
 118    _compilation(c)
 119  , _masm(c->masm())
 120  , _bs(Universe::heap()->barrier_set())
 121  , _frame_map(c->frame_map())
 122  , _current_block(NULL)
 123  , _pending_non_safepoint(NULL)
 124  , _pending_non_safepoint_offset(0)
 125 {
 126   _slow_case_stubs = new CodeStubList();
 127 }
 128 
 129 
 130 LIR_Assembler::~LIR_Assembler() {
 131   // The unwind handler label may be unbound if this destructor is invoked because of a bail-out.
 132   // Reset it here to avoid an assertion.
 133   _unwind_handler_entry.reset();
 134 }
 135 
 136 
 137 void LIR_Assembler::check_codespace() {
 138   CodeSection* cs = _masm->code_section();
 139   if (cs->remaining() < (int)(NOT_LP64(1*K)LP64_ONLY(2*K))) {
 140     BAILOUT("CodeBuffer overflow");
 141   }
 142 }
 143 
 144 
 145 void LIR_Assembler::append_code_stub(CodeStub* stub) {
 146   _slow_case_stubs->append(stub);
 147 }
 148 
 149 void LIR_Assembler::emit_stubs(CodeStubList* stub_list) {
 150   for (int m = 0; m < stub_list->length(); m++) {
 151     CodeStub* s = (*stub_list)[m];
 152 
 153     check_codespace();


< prev index next >