1 /*
2 * Copyright (c) 2008, 2010, 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 *
120 if (cur_slot == arg_slot)
121 return T_OBJECT;
122 }
123 for (SignatureStream ss(m->signature()); !ss.is_done(); ss.next()) {
124 BasicType bt = ss.type();
125 cur_slot -= type2size[bt];
126 if (cur_slot <= arg_slot) {
127 if (cur_slot == arg_slot)
128 arg_type = bt;
129 break;
130 }
131 }
132 }
133 if (arg_type == T_ARRAY)
134 arg_type = T_OBJECT;
135 return arg_type;
136 }
137
138
139 void MethodHandleChain::lose(const char* msg, TRAPS) {
140 assert(false, "lose");
141 _lose_message = msg;
142 if (!THREAD->is_Java_thread() || ((JavaThread*)THREAD)->thread_state() != _thread_in_vm) {
143 // throw a preallocated exception
144 THROW_OOP(Universe::virtual_machine_error_instance());
145 }
146 THROW_MSG(vmSymbols::java_lang_InternalError(), msg);
147 }
148
149
150 // -----------------------------------------------------------------------------
151 // MethodHandleWalker
152
153 Bytecodes::Code MethodHandleWalker::conversion_code(BasicType src, BasicType dest) {
154 if (is_subword_type(src)) {
155 src = T_INT; // all subword src types act like int
156 }
157 if (src == dest) {
158 return Bytecodes::_nop;
159 }
160
|
1 /*
2 * Copyright (c) 2008, 2011, 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 *
120 if (cur_slot == arg_slot)
121 return T_OBJECT;
122 }
123 for (SignatureStream ss(m->signature()); !ss.is_done(); ss.next()) {
124 BasicType bt = ss.type();
125 cur_slot -= type2size[bt];
126 if (cur_slot <= arg_slot) {
127 if (cur_slot == arg_slot)
128 arg_type = bt;
129 break;
130 }
131 }
132 }
133 if (arg_type == T_ARRAY)
134 arg_type = T_OBJECT;
135 return arg_type;
136 }
137
138
139 void MethodHandleChain::lose(const char* msg, TRAPS) {
140 _lose_message = msg;
141 if (!THREAD->is_Java_thread() || ((JavaThread*)THREAD)->thread_state() != _thread_in_vm) {
142 // throw a preallocated exception
143 THROW_OOP(Universe::virtual_machine_error_instance());
144 }
145 THROW_MSG(vmSymbols::java_lang_InternalError(), msg);
146 }
147
148
149 // -----------------------------------------------------------------------------
150 // MethodHandleWalker
151
152 Bytecodes::Code MethodHandleWalker::conversion_code(BasicType src, BasicType dest) {
153 if (is_subword_type(src)) {
154 src = T_INT; // all subword src types act like int
155 }
156 if (src == dest) {
157 return Bytecodes::_nop;
158 }
159
|