1 /*
2 * Copyright (c) 2000, 2015, 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 *
110
111
112 LIR_Assembler::~LIR_Assembler() {
113 }
114
115
116 void LIR_Assembler::check_codespace() {
117 CodeSection* cs = _masm->code_section();
118 if (cs->remaining() < (int)(NOT_LP64(1*K)LP64_ONLY(2*K))) {
119 BAILOUT("CodeBuffer overflow");
120 }
121 }
122
123
124 void LIR_Assembler::append_code_stub(CodeStub* stub) {
125 _slow_case_stubs->append(stub);
126 }
127
128 void LIR_Assembler::emit_stubs(CodeStubList* stub_list) {
129 for (int m = 0; m < stub_list->length(); m++) {
130 CodeStub* s = (*stub_list)[m];
131
132 check_codespace();
133 CHECK_BAILOUT();
134
135 #ifndef PRODUCT
136 if (CommentedAssembly) {
137 stringStream st;
138 s->print_name(&st);
139 st.print(" slow case");
140 _masm->block_comment(st.as_string());
141 }
142 #endif
143 s->emit_code(this);
144 #ifdef ASSERT
145 s->assert_no_unbound_labels();
146 #endif
147 }
148 }
149
150
|
1 /*
2 * Copyright (c) 2000, 2016, 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 *
110
111
112 LIR_Assembler::~LIR_Assembler() {
113 }
114
115
116 void LIR_Assembler::check_codespace() {
117 CodeSection* cs = _masm->code_section();
118 if (cs->remaining() < (int)(NOT_LP64(1*K)LP64_ONLY(2*K))) {
119 BAILOUT("CodeBuffer overflow");
120 }
121 }
122
123
124 void LIR_Assembler::append_code_stub(CodeStub* stub) {
125 _slow_case_stubs->append(stub);
126 }
127
128 void LIR_Assembler::emit_stubs(CodeStubList* stub_list) {
129 for (int m = 0; m < stub_list->length(); m++) {
130 CodeStub* s = stub_list->at(m);
131
132 check_codespace();
133 CHECK_BAILOUT();
134
135 #ifndef PRODUCT
136 if (CommentedAssembly) {
137 stringStream st;
138 s->print_name(&st);
139 st.print(" slow case");
140 _masm->block_comment(st.as_string());
141 }
142 #endif
143 s->emit_code(this);
144 #ifdef ASSERT
145 s->assert_no_unbound_labels();
146 #endif
147 }
148 }
149
150
|