< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DataLayout.java

Print this page


   1 /*
   2  * Copyright (c) 2011, 2019, 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  *


 155 
 156   boolean flagAt(int flagNumber) {
 157     // assert(flagNumber < flagLimit, "oob");
 158     return (flags() & (0x1 << flagNumber)) != 0;
 159   }
 160 
 161   // Low-level support for code generation.
 162   static int headerOffset() {
 163     return 0;
 164   }
 165   static int tagOffset() {
 166     return 0;
 167   }
 168   static int flagsOffset() {
 169     return 1;
 170   }
 171   static int bciOffset() {
 172     return 2;
 173   }
 174   public static int cellOffset(int index) {
 175     return (headerSizeInCells() + index) * MethodData.cellSize;
 176   }
 177   // // Return a value which, when or-ed as a byte into _flags, sets the flag.
 178   // static int flagNumberToByteConstant(int flagNumber) {
 179   //   assert(0 <= flagNumber && flagNumber < flagLimit, "oob");
 180   //   DataLayout temp; temp.setHeader(0);
 181   //   temp.setFlagAt(flagNumber);
 182   //   return temp._header._struct._flags;
 183   // }
 184   // // Return a value which, when or-ed as a word into _header, sets the flag.
 185   // static intptrT flagMaskToHeaderMask(int byteConstant) {
 186   //   DataLayout temp; temp.setHeader(0);
 187   //   temp._header._struct._flags = byteConstant;
 188   //   return temp._header._bits;
 189   // }
 190 }
   1 /*
   2  * Copyright (c) 2011, 2012, 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  *


 155 
 156   boolean flagAt(int flagNumber) {
 157     // assert(flagNumber < flagLimit, "oob");
 158     return (flags() & (0x1 << flagNumber)) != 0;
 159   }
 160 
 161   // Low-level support for code generation.
 162   static int headerOffset() {
 163     return 0;
 164   }
 165   static int tagOffset() {
 166     return 0;
 167   }
 168   static int flagsOffset() {
 169     return 1;
 170   }
 171   static int bciOffset() {
 172     return 2;
 173   }
 174   public static int cellOffset(int index) {
 175     return MethodData.cellSize + index * MethodData.cellSize;
 176   }
 177   // // Return a value which, when or-ed as a byte into _flags, sets the flag.
 178   // static int flagNumberToByteConstant(int flagNumber) {
 179   //   assert(0 <= flagNumber && flagNumber < flagLimit, "oob");
 180   //   DataLayout temp; temp.setHeader(0);
 181   //   temp.setFlagAt(flagNumber);
 182   //   return temp._header._struct._flags;
 183   // }
 184   // // Return a value which, when or-ed as a word into _header, sets the flag.
 185   // static intptrT flagMaskToHeaderMask(int byteConstant) {
 186   //   DataLayout temp; temp.setHeader(0);
 187   //   temp._header._struct._flags = byteConstant;
 188   //   return temp._header._bits;
 189   // }
 190 }
< prev index next >