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 *
23 */
24
25 #include "precompiled.hpp"
26 #include "runtime/stackValueCollection.hpp"
27 #ifdef TARGET_ARCH_x86
28 # include "jniTypes_x86.hpp"
29 #endif
30 #ifdef TARGET_ARCH_sparc
31 # include "jniTypes_sparc.hpp"
32 #endif
33 #ifdef TARGET_ARCH_zero
34 # include "jniTypes_zero.hpp"
35 #endif
36 #ifdef TARGET_ARCH_arm
37 # include "jniTypes_arm.hpp"
38 #endif
39 #ifdef TARGET_ARCH_ppc
40 # include "jniTypes_ppc.hpp"
41 #endif
42
43 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
44
45 jint StackValueCollection::int_at(int slot) const {
46 intptr_t val = at(slot)->get_int();
47 jint ival = *((jint*) (&val));
48 return ival;
49 }
50
51 jlong StackValueCollection::long_at(int slot) const {
52 #ifdef _LP64
53 return at(slot+1)->get_int();
54 #else
55 union {
56 jlong jl;
57 jint array[2];
58 } value;
59 // Interpreter stack is reversed in memory:
60 // low memory location is in higher java local slot.
61 value.array[0] = at(slot+1)->get_int();
|
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 *
23 */
24
25 #include "precompiled.hpp"
26 #include "runtime/stackValueCollection.hpp"
27
28 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
29
30 jint StackValueCollection::int_at(int slot) const {
31 intptr_t val = at(slot)->get_int();
32 jint ival = *((jint*) (&val));
33 return ival;
34 }
35
36 jlong StackValueCollection::long_at(int slot) const {
37 #ifdef _LP64
38 return at(slot+1)->get_int();
39 #else
40 union {
41 jlong jl;
42 jint array[2];
43 } value;
44 // Interpreter stack is reversed in memory:
45 // low memory location is in higher java local slot.
46 value.array[0] = at(slot+1)->get_int();
|