src/cpu/x86/vm/bytecodeInterpreter_x86.hpp

Print this page


   1 /*
   2  * Copyright (c) 2002, 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 
  27 private:
  28 
  29     interpreterState _self_link;          /*  Previous interpreter state  */ /* sometimes points to self??? */
  30     address   _result_handler;            /* temp for saving native result handler */
  31     intptr_t* _sender_sp;                 /* sender's sp before stack (locals) extension */
  32 
  33     address   _extra_junk1;               /* temp to save on recompiles */
  34     address   _extra_junk2;               /* temp to save on recompiles */
  35     address   _extra_junk3;               /* temp to save on recompiles */
  36     // address dummy_for_native2;         /* a native frame result handler would be here... */
  37     // address dummy_for_native1;         /* native result type stored here in a interpreter native frame */
  38     address   _extra_junk4;               /* temp to save on recompiles */
  39     address   _extra_junk5;               /* temp to save on recompiles */
  40     address   _extra_junk6;               /* temp to save on recompiles */
  41 public:
  42                                                          // we have an interpreter frame...
  43 inline intptr_t* sender_sp() {
  44   return _sender_sp;


  91 #define LOCALS_ADDR(offset)    ((address)locals[-(offset)])
  92 #define LOCALS_INT(offset)     ((jint)(locals[-(offset)]))
  93 #define LOCALS_FLOAT(offset)   (*((jfloat*)&locals[-(offset)]))
  94 #define LOCALS_OBJECT(offset)  ((oop)locals[-(offset)])
  95 #define LOCALS_DOUBLE(offset)  (((VMJavaVal64*)&locals[-((offset) + 1)])->d)
  96 #define LOCALS_LONG(offset)    (((VMJavaVal64*)&locals[-((offset) + 1)])->l)
  97 #define LOCALS_LONG_AT(offset) (((address)&locals[-((offset) + 1)]))
  98 #define LOCALS_DOUBLE_AT(offset) (((address)&locals[-((offset) + 1)]))
  99 
 100 #define SET_LOCALS_SLOT(value, offset)    (*(intptr_t*)&locals[-(offset)] = *(intptr_t *)(value))
 101 #define SET_LOCALS_ADDR(value, offset)    (*((address *)&locals[-(offset)]) = (value))
 102 #define SET_LOCALS_INT(value, offset)     (*((jint *)&locals[-(offset)]) = (value))
 103 #define SET_LOCALS_FLOAT(value, offset)   (*((jfloat *)&locals[-(offset)]) = (value))
 104 #define SET_LOCALS_OBJECT(value, offset)  (*((oop *)&locals[-(offset)]) = (value))
 105 #define SET_LOCALS_DOUBLE(value, offset)  (((VMJavaVal64*)&locals[-((offset)+1)])->d = (value))
 106 #define SET_LOCALS_LONG(value, offset)    (((VMJavaVal64*)&locals[-((offset)+1)])->l = (value))
 107 #define SET_LOCALS_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = \
 108                                                   ((VMJavaVal64*)(addr))->d)
 109 #define SET_LOCALS_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = \
 110                                                 ((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_X86_VM_BYTECODEINTERPRETER_X86_HPP
  26 #define CPU_X86_VM_BYTECODEINTERPRETER_X86_HPP
  27 
  28 // Platform specific for C++ based Interpreter
  29 
  30 private:
  31 
  32     interpreterState _self_link;          /*  Previous interpreter state  */ /* sometimes points to self??? */
  33     address   _result_handler;            /* temp for saving native result handler */
  34     intptr_t* _sender_sp;                 /* sender's sp before stack (locals) extension */
  35 
  36     address   _extra_junk1;               /* temp to save on recompiles */
  37     address   _extra_junk2;               /* temp to save on recompiles */
  38     address   _extra_junk3;               /* temp to save on recompiles */
  39     // address dummy_for_native2;         /* a native frame result handler would be here... */
  40     // address dummy_for_native1;         /* native result type stored here in a interpreter native frame */
  41     address   _extra_junk4;               /* temp to save on recompiles */
  42     address   _extra_junk5;               /* temp to save on recompiles */
  43     address   _extra_junk6;               /* temp to save on recompiles */
  44 public:
  45                                                          // we have an interpreter frame...
  46 inline intptr_t* sender_sp() {
  47   return _sender_sp;


  94 #define LOCALS_ADDR(offset)    ((address)locals[-(offset)])
  95 #define LOCALS_INT(offset)     ((jint)(locals[-(offset)]))
  96 #define LOCALS_FLOAT(offset)   (*((jfloat*)&locals[-(offset)]))
  97 #define LOCALS_OBJECT(offset)  ((oop)locals[-(offset)])
  98 #define LOCALS_DOUBLE(offset)  (((VMJavaVal64*)&locals[-((offset) + 1)])->d)
  99 #define LOCALS_LONG(offset)    (((VMJavaVal64*)&locals[-((offset) + 1)])->l)
 100 #define LOCALS_LONG_AT(offset) (((address)&locals[-((offset) + 1)]))
 101 #define LOCALS_DOUBLE_AT(offset) (((address)&locals[-((offset) + 1)]))
 102 
 103 #define SET_LOCALS_SLOT(value, offset)    (*(intptr_t*)&locals[-(offset)] = *(intptr_t *)(value))
 104 #define SET_LOCALS_ADDR(value, offset)    (*((address *)&locals[-(offset)]) = (value))
 105 #define SET_LOCALS_INT(value, offset)     (*((jint *)&locals[-(offset)]) = (value))
 106 #define SET_LOCALS_FLOAT(value, offset)   (*((jfloat *)&locals[-(offset)]) = (value))
 107 #define SET_LOCALS_OBJECT(value, offset)  (*((oop *)&locals[-(offset)]) = (value))
 108 #define SET_LOCALS_DOUBLE(value, offset)  (((VMJavaVal64*)&locals[-((offset)+1)])->d = (value))
 109 #define SET_LOCALS_LONG(value, offset)    (((VMJavaVal64*)&locals[-((offset)+1)])->l = (value))
 110 #define SET_LOCALS_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = \
 111                                                   ((VMJavaVal64*)(addr))->d)
 112 #define SET_LOCALS_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = \
 113                                                 ((VMJavaVal64*)(addr))->l)
 114 
 115 #endif // CPU_X86_VM_BYTECODEINTERPRETER_X86_HPP