src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp

Print this page


   1 /*
   2  * Copyright (c) 2002, 2008, 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 // Platform specific for C++ based Interpreter
  26 #define LOTS_OF_REGS    /* Lets interpreter use plenty of registers */
  27 
  28 private:
  29 
  30     // save the bottom of the stack after frame manager setup. For ease of restoration after return
  31     // from recursive interpreter call
  32     intptr_t*  _frame_bottom;             /* saved bottom of frame manager frame */
  33     intptr_t* _last_Java_pc;              /* pc to return to in frame manager */
  34     interpreterState _self_link;          /*  Previous interpreter state  */ /* sometimes points to self??? */
  35     double    _native_fresult;            /* save result of native calls that might return floats */
  36     intptr_t  _native_lresult;            /* save result of native calls that might return handle/longs */
  37 public:
  38 
  39     static void pd_layout_interpreterState(interpreterState istate, address last_Java_pc, intptr_t* last_Java_fp);
  40 
  41 
  42 #define SET_LAST_JAVA_FRAME()
  43 
  44 #define RESET_LAST_JAVA_FRAME() THREAD->frame_anchor()->set_flags(0);


  80 #define LOCALS_ADDR(offset)    ((address)locals[-(offset)])
  81 #define LOCALS_INT(offset)     (*((jint*)&locals[-(offset)]))
  82 #define LOCALS_FLOAT(offset)   (*((jfloat*)&locals[-(offset)]))
  83 #define LOCALS_OBJECT(offset)  ((oop)locals[-(offset)])
  84 #define LOCALS_DOUBLE(offset)  (((VMJavaVal64*)&locals[-((offset) + 1)])->d)
  85 #define LOCALS_LONG(offset)    (((VMJavaVal64*)&locals[-((offset) + 1)])->l)
  86 #define LOCALS_LONG_AT(offset) (((address)&locals[-((offset) + 1)]))
  87 #define LOCALS_DOUBLE_AT(offset) (((address)&locals[-((offset) + 1)]))
  88 
  89 #define SET_LOCALS_SLOT(value, offset)    (*(intptr_t*)&locals[-(offset)] = *(intptr_t *)(value))
  90 #define SET_LOCALS_ADDR(value, offset)    (*((address *)&locals[-(offset)]) = (value))
  91 #define SET_LOCALS_INT(value, offset)     (*((jint *)&locals[-(offset)]) = (value))
  92 #define SET_LOCALS_FLOAT(value, offset)   (*((jfloat *)&locals[-(offset)]) = (value))
  93 #define SET_LOCALS_OBJECT(value, offset)  (*((oop *)&locals[-(offset)]) = (value))
  94 #define SET_LOCALS_DOUBLE(value, offset)  (((VMJavaVal64*)&locals[-((offset)+1)])->d = (value))
  95 #define SET_LOCALS_LONG(value, offset)    (((VMJavaVal64*)&locals[-((offset)+1)])->l = (value))
  96 #define SET_LOCALS_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = \
  97                                                   ((VMJavaVal64*)(addr))->d)
  98 #define SET_LOCALS_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = \
  99                                                 ((VMJavaVal64*)(addr))->l)


   1 /*
   2  * Copyright (c) 2002, 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 #ifndef CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_HPP
  26 #define CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_HPP
  27 
  28 // Platform specific for C++ based Interpreter
  29 #define LOTS_OF_REGS    /* Lets interpreter use plenty of registers */
  30 
  31 private:
  32 
  33     // save the bottom of the stack after frame manager setup. For ease of restoration after return
  34     // from recursive interpreter call
  35     intptr_t*  _frame_bottom;             /* saved bottom of frame manager frame */
  36     intptr_t* _last_Java_pc;              /* pc to return to in frame manager */
  37     interpreterState _self_link;          /*  Previous interpreter state  */ /* sometimes points to self??? */
  38     double    _native_fresult;            /* save result of native calls that might return floats */
  39     intptr_t  _native_lresult;            /* save result of native calls that might return handle/longs */
  40 public:
  41 
  42     static void pd_layout_interpreterState(interpreterState istate, address last_Java_pc, intptr_t* last_Java_fp);
  43 
  44 
  45 #define SET_LAST_JAVA_FRAME()
  46 
  47 #define RESET_LAST_JAVA_FRAME() THREAD->frame_anchor()->set_flags(0);


  83 #define LOCALS_ADDR(offset)    ((address)locals[-(offset)])
  84 #define LOCALS_INT(offset)     (*((jint*)&locals[-(offset)]))
  85 #define LOCALS_FLOAT(offset)   (*((jfloat*)&locals[-(offset)]))
  86 #define LOCALS_OBJECT(offset)  ((oop)locals[-(offset)])
  87 #define LOCALS_DOUBLE(offset)  (((VMJavaVal64*)&locals[-((offset) + 1)])->d)
  88 #define LOCALS_LONG(offset)    (((VMJavaVal64*)&locals[-((offset) + 1)])->l)
  89 #define LOCALS_LONG_AT(offset) (((address)&locals[-((offset) + 1)]))
  90 #define LOCALS_DOUBLE_AT(offset) (((address)&locals[-((offset) + 1)]))
  91 
  92 #define SET_LOCALS_SLOT(value, offset)    (*(intptr_t*)&locals[-(offset)] = *(intptr_t *)(value))
  93 #define SET_LOCALS_ADDR(value, offset)    (*((address *)&locals[-(offset)]) = (value))
  94 #define SET_LOCALS_INT(value, offset)     (*((jint *)&locals[-(offset)]) = (value))
  95 #define SET_LOCALS_FLOAT(value, offset)   (*((jfloat *)&locals[-(offset)]) = (value))
  96 #define SET_LOCALS_OBJECT(value, offset)  (*((oop *)&locals[-(offset)]) = (value))
  97 #define SET_LOCALS_DOUBLE(value, offset)  (((VMJavaVal64*)&locals[-((offset)+1)])->d = (value))
  98 #define SET_LOCALS_LONG(value, offset)    (((VMJavaVal64*)&locals[-((offset)+1)])->l = (value))
  99 #define SET_LOCALS_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = \
 100                                                   ((VMJavaVal64*)(addr))->d)
 101 #define SET_LOCALS_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = \
 102                                                 ((VMJavaVal64*)(addr))->l)
 103 
 104 #endif // CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_HPP