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 "gc/shared/collectedHeap.hpp"
27 #include "interpreter/interp_masm.hpp"
28 #include "interpreter/templateTable.hpp"
29 #include "runtime/timer.hpp"
30
31
32 #ifdef CC_INTERP
33
34 void templateTable_init() {
35 }
36
37 #else
38
39 //----------------------------------------------------------------------------------------------------
40 // Implementation of Template
41
42
43 void Template::initialize(int flags, TosState tos_in, TosState tos_out, generator gen, int arg) {
44 _flags = flags;
45 _tos_in = tos_in;
46 _tos_out = tos_out;
47 _gen = gen;
48 _arg = arg;
229 // table init if this macro is not defined. My symptom was an assertion
230 // assert(Universe::heap()->is_in(obj), "sanity check") in handles.cpp line 24.
231 // when called from interpreterRuntime.resolve_invoke().
232 //
233 #define iload TemplateTable::iload
234 #define lload TemplateTable::lload
235 #define fload TemplateTable::fload
236 #define dload TemplateTable::dload
237 #define aload TemplateTable::aload
238 #define istore TemplateTable::istore
239 #define lstore TemplateTable::lstore
240 #define fstore TemplateTable::fstore
241 #define dstore TemplateTable::dstore
242 #define astore TemplateTable::astore
243 #endif // TEMPLATE_TABLE_BUG
244
245 void TemplateTable::initialize() {
246 if (_is_initialized) return;
247
248 // Initialize table
249 TraceTime timer("TemplateTable initialization", TraceStartupTime);
250
251 _bs = Universe::heap()->barrier_set();
252
253 // For better readability
254 const char _ = ' ';
255 const int ____ = 0;
256 const int ubcp = 1 << Template::uses_bcp_bit;
257 const int disp = 1 << Template::does_dispatch_bit;
258 const int clvm = 1 << Template::calls_vm_bit;
259 const int iswd = 1 << Template::wide_bit;
260 // interpr. templates
261 // Java spec bytecodes ubcp|disp|clvm|iswd in out generator argument
262 def(Bytecodes::_nop , ____|____|____|____, vtos, vtos, nop , _ );
263 def(Bytecodes::_aconst_null , ____|____|____|____, vtos, atos, aconst_null , _ );
264 def(Bytecodes::_iconst_m1 , ____|____|____|____, vtos, itos, iconst , -1 );
265 def(Bytecodes::_iconst_0 , ____|____|____|____, vtos, itos, iconst , 0 );
266 def(Bytecodes::_iconst_1 , ____|____|____|____, vtos, itos, iconst , 1 );
267 def(Bytecodes::_iconst_2 , ____|____|____|____, vtos, itos, iconst , 2 );
268 def(Bytecodes::_iconst_3 , ____|____|____|____, vtos, itos, iconst , 3 );
269 def(Bytecodes::_iconst_4 , ____|____|____|____, vtos, itos, iconst , 4 );
|
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 "gc/shared/collectedHeap.hpp"
27 #include "interpreter/interp_masm.hpp"
28 #include "interpreter/templateTable.hpp"
29 #include "logging/log.hpp"
30 #include "runtime/timer.hpp"
31
32
33 #ifdef CC_INTERP
34
35 void templateTable_init() {
36 }
37
38 #else
39
40 //----------------------------------------------------------------------------------------------------
41 // Implementation of Template
42
43
44 void Template::initialize(int flags, TosState tos_in, TosState tos_out, generator gen, int arg) {
45 _flags = flags;
46 _tos_in = tos_in;
47 _tos_out = tos_out;
48 _gen = gen;
49 _arg = arg;
230 // table init if this macro is not defined. My symptom was an assertion
231 // assert(Universe::heap()->is_in(obj), "sanity check") in handles.cpp line 24.
232 // when called from interpreterRuntime.resolve_invoke().
233 //
234 #define iload TemplateTable::iload
235 #define lload TemplateTable::lload
236 #define fload TemplateTable::fload
237 #define dload TemplateTable::dload
238 #define aload TemplateTable::aload
239 #define istore TemplateTable::istore
240 #define lstore TemplateTable::lstore
241 #define fstore TemplateTable::fstore
242 #define dstore TemplateTable::dstore
243 #define astore TemplateTable::astore
244 #endif // TEMPLATE_TABLE_BUG
245
246 void TemplateTable::initialize() {
247 if (_is_initialized) return;
248
249 // Initialize table
250 TraceTime timer("TemplateTable initialization",
251 log_is_enabled(Info, startuptime),
252 LogTag::_startuptime);
253
254 _bs = Universe::heap()->barrier_set();
255
256 // For better readability
257 const char _ = ' ';
258 const int ____ = 0;
259 const int ubcp = 1 << Template::uses_bcp_bit;
260 const int disp = 1 << Template::does_dispatch_bit;
261 const int clvm = 1 << Template::calls_vm_bit;
262 const int iswd = 1 << Template::wide_bit;
263 // interpr. templates
264 // Java spec bytecodes ubcp|disp|clvm|iswd in out generator argument
265 def(Bytecodes::_nop , ____|____|____|____, vtos, vtos, nop , _ );
266 def(Bytecodes::_aconst_null , ____|____|____|____, vtos, atos, aconst_null , _ );
267 def(Bytecodes::_iconst_m1 , ____|____|____|____, vtos, itos, iconst , -1 );
268 def(Bytecodes::_iconst_0 , ____|____|____|____, vtos, itos, iconst , 0 );
269 def(Bytecodes::_iconst_1 , ____|____|____|____, vtos, itos, iconst , 1 );
270 def(Bytecodes::_iconst_2 , ____|____|____|____, vtos, itos, iconst , 2 );
271 def(Bytecodes::_iconst_3 , ____|____|____|____, vtos, itos, iconst , 3 );
272 def(Bytecodes::_iconst_4 , ____|____|____|____, vtos, itos, iconst , 4 );
|