src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledCode.java
changeset 58851 f1e6442241ca
parent 47216 71c04702a3d5
equal deleted inserted replaced
58850:f4290bf1cc21 58851:f1e6442241ca
     1 /*
     1 /*
     2  * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
     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.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    23 package jdk.vm.ci.hotspot;
    23 package jdk.vm.ci.hotspot;
    24 
    24 
    25 import jdk.vm.ci.code.BytecodeFrame;
    25 import jdk.vm.ci.code.BytecodeFrame;
    26 import jdk.vm.ci.code.CompiledCode;
    26 import jdk.vm.ci.code.CompiledCode;
    27 import jdk.vm.ci.code.StackSlot;
    27 import jdk.vm.ci.code.StackSlot;
       
    28 import jdk.vm.ci.code.VirtualObject;
    28 import jdk.vm.ci.code.site.DataPatch;
    29 import jdk.vm.ci.code.site.DataPatch;
    29 import jdk.vm.ci.code.site.Infopoint;
    30 import jdk.vm.ci.code.site.Infopoint;
    30 import jdk.vm.ci.code.site.Site;
    31 import jdk.vm.ci.code.site.Site;
    31 import jdk.vm.ci.meta.Assumptions.Assumption;
    32 import jdk.vm.ci.meta.Assumptions.Assumption;
       
    33 import jdk.vm.ci.meta.ResolvedJavaField;
    32 import jdk.vm.ci.meta.ResolvedJavaMethod;
    34 import jdk.vm.ci.meta.ResolvedJavaMethod;
    33 
    35 
    34 /**
    36 /**
    35  * A {@link CompiledCode} with additional HotSpot-specific information required for installing the
    37  * A {@link CompiledCode} with additional HotSpot-specific information required for installing the
    36  * code in HotSpot's code cache.
    38  * code in HotSpot's code cache.
   154             if (site instanceof Infopoint) {
   156             if (site instanceof Infopoint) {
   155                 Infopoint info = (Infopoint) site;
   157                 Infopoint info = (Infopoint) site;
   156                 if (info.debugInfo != null) {
   158                 if (info.debugInfo != null) {
   157                     BytecodeFrame frame = info.debugInfo.frame();
   159                     BytecodeFrame frame = info.debugInfo.frame();
   158                     assert frame == null || frame.validateFormat();
   160                     assert frame == null || frame.validateFormat();
       
   161                     if (info.debugInfo.getVirtualObjectMapping() != null) {
       
   162                         for (VirtualObject v : info.debugInfo.getVirtualObjectMapping()) {
       
   163                             verifyVirtualObject(v);
       
   164                         }
       
   165                     }
   159                 }
   166                 }
   160             }
   167             }
   161         }
   168         }
   162         return true;
   169         return true;
   163     }
   170     }
       
   171 
       
   172     public static void verifyVirtualObject(VirtualObject v) {
       
   173         v.verifyLayout(new VirtualObject.LayoutVerifier() {
       
   174             @Override
       
   175             public int getOffset(ResolvedJavaField field) {
       
   176                 return field.getOffset();
       
   177             }
       
   178         });
       
   179     }
   164 }
   180 }