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