1 /*
   2  * Copyright (c) 2014, 2017, 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 package jdk.vm.ci.hotspot;
  24 
  25 import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
  26 
  27 import jdk.vm.ci.code.TargetDescription;
  28 
  29 public class HotSpotMetaData {
  30     private byte[] pcDescBytes;
  31     private byte[] scopesDescBytes;
  32     private byte[] relocBytes;
  33     private byte[] exceptionBytes;
  34     private byte[] implicitExceptionBytes;
  35     private byte[] oopMaps;
  36     private Object[] metadata;
  37 
  38     public HotSpotMetaData(TargetDescription target, HotSpotCompiledCode compiledMethod) {
  39         // Assign the fields default values...
  40         pcDescBytes = new byte[0];
  41         scopesDescBytes = new byte[0];
  42         relocBytes = new byte[0];
  43         exceptionBytes = new byte[0];
  44         oopMaps = new byte[0];
  45         metadata = new String[0];
  46         // ...some of them will be overwritten by the VM:
  47         runtime().getCompilerToVM().getMetadata(target, compiledMethod, this);
  48     }
  49 
  50     public byte[] pcDescBytes() {
  51         return pcDescBytes;
  52     }
  53 
  54     public byte[] scopesDescBytes() {
  55         return scopesDescBytes;
  56     }
  57 
  58     public byte[] relocBytes() {
  59         return relocBytes;
  60     }
  61 
  62     public byte[] exceptionBytes() {
  63         return exceptionBytes;
  64     }
  65 
  66     public byte[] implicitExceptionBytes() {
  67         return implicitExceptionBytes;
  68     }
  69 
  70     public byte[] oopMaps() {
  71         return oopMaps;
  72     }
  73 
  74     public Object[] metadataEntries() {
  75         return metadata;
  76     }
  77 }