1 /* |
1 /* |
2 * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2014, 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. |
27 import jdk.vm.ci.meta.Constant; |
27 import jdk.vm.ci.meta.Constant; |
28 import jdk.vm.ci.meta.VMConstant; |
28 import jdk.vm.ci.meta.VMConstant; |
29 |
29 |
30 final class HotSpotMetaspaceConstantImpl implements HotSpotMetaspaceConstant, VMConstant { |
30 final class HotSpotMetaspaceConstantImpl implements HotSpotMetaspaceConstant, VMConstant { |
31 |
31 |
32 static HotSpotMetaspaceConstantImpl forMetaspaceObject(MetaspaceWrapperObject metaspaceObject, boolean compressed) { |
32 static HotSpotMetaspaceConstantImpl forMetaspaceObject(MetaspaceObject metaspaceObject, boolean compressed) { |
33 return new HotSpotMetaspaceConstantImpl(metaspaceObject, compressed); |
33 return new HotSpotMetaspaceConstantImpl(metaspaceObject, compressed); |
34 } |
34 } |
35 |
35 |
36 static MetaspaceWrapperObject getMetaspaceObject(Constant constant) { |
36 static MetaspaceObject getMetaspaceObject(Constant constant) { |
37 return ((HotSpotMetaspaceConstantImpl) constant).metaspaceObject; |
37 return ((HotSpotMetaspaceConstantImpl) constant).metaspaceObject; |
38 } |
38 } |
39 |
39 |
40 private final MetaspaceWrapperObject metaspaceObject; |
40 private final MetaspaceObject metaspaceObject; |
41 private final boolean compressed; |
41 private final boolean compressed; |
42 |
42 |
43 private HotSpotMetaspaceConstantImpl(MetaspaceWrapperObject metaspaceObject, boolean compressed) { |
43 private HotSpotMetaspaceConstantImpl(MetaspaceObject metaspaceObject, boolean compressed) { |
44 this.metaspaceObject = metaspaceObject; |
44 this.metaspaceObject = metaspaceObject; |
45 this.compressed = compressed; |
45 this.compressed = compressed; |
46 } |
46 } |
47 |
47 |
48 @Override |
48 @Override |