hotspot/test/compiler/stable/StableConfiguration.java
author bharadwaj
Tue, 05 Apr 2016 20:32:54 +0000
changeset 37295 e00dfcc21fa1
parent 36616 5172e3dd60f2
child 40059 c2304140ed64
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25641
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
     1
/*
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
     2
 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
     4
 *
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    10
 *
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    15
 * accompanied this code).
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    16
 *
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    20
 *
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    23
 * questions.
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    24
 */
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 30859
diff changeset
    25
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 30859
diff changeset
    26
package compiler.stable;
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 30859
diff changeset
    27
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 30859
diff changeset
    28
import sun.hotspot.WhiteBox;
25641
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    29
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    30
import java.lang.reflect.Method;
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    31
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    32
public class StableConfiguration {
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    33
    static final WhiteBox WB = WhiteBox.getWhiteBox();
36508
5f9eee6b383b 8142968: Module System implementation
alanb
parents: 30859
diff changeset
    34
    public static final boolean isStableEnabled;
25641
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    35
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    36
    static {
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    37
        Boolean value = WB.getBooleanVMFlag("FoldStableValues");
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    38
        isStableEnabled = (value == null ? false : value);
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    39
        System.out.println("@Stable:         " + (isStableEnabled ? "enabled" : "disabled"));
30859
76147e537436 8081669: aarch64: JTreg TestStable tests failing
enevill
parents: 25641
diff changeset
    40
    }
25641
d99065e4572b 8043546: C1 optimizes @Stable instance fields with default values
vlivanov
parents:
diff changeset
    41
}