src/share/vm/runtime/stackValueCollection.cpp

Print this page


   1 /*
   2  * Copyright (c) 2001, 2005, 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  *
  23  */
  24 
  25 # include "incls/_precompiled.incl"
  26 # include "incls/_stackValueCollection.cpp.incl"









  27 
  28 jint StackValueCollection::int_at(int slot) const {
  29   intptr_t val =  at(slot)->get_int();
  30   jint ival = *((jint*) (&val));
  31   return ival;
  32 }
  33 
  34 jlong StackValueCollection::long_at(int slot) const {
  35 #ifdef _LP64
  36   return at(slot+1)->get_int();
  37 #else
  38   union {
  39     jlong jl;
  40     jint  array[2];
  41   } value;
  42   // Interpreter stack is reversed in memory:
  43   // low memory location is in higher java local slot.
  44   value.array[0] = at(slot+1)->get_int();
  45   value.array[1] = at(slot  )->get_int();
  46   return value.jl;


   1 /*
   2  * Copyright (c) 2001, 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  *
  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 
  37 jint StackValueCollection::int_at(int slot) const {
  38   intptr_t val =  at(slot)->get_int();
  39   jint ival = *((jint*) (&val));
  40   return ival;
  41 }
  42 
  43 jlong StackValueCollection::long_at(int slot) const {
  44 #ifdef _LP64
  45   return at(slot+1)->get_int();
  46 #else
  47   union {
  48     jlong jl;
  49     jint  array[2];
  50   } value;
  51   // Interpreter stack is reversed in memory:
  52   // low memory location is in higher java local slot.
  53   value.array[0] = at(slot+1)->get_int();
  54   value.array[1] = at(slot  )->get_int();
  55   return value.jl;