hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java
author rschatz
Wed, 03 Feb 2016 12:16:44 +0100
changeset 35823 59a847ec6ee3
parent 35582 c32a0cc19877
child 36209 8db2a78cbc29
permissions -rw-r--r--
8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285 Reviewed-by: twisti
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
     1
/*
35582
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35148
diff changeset
     2
 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
     4
 *
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
     7
 * published by the Free Software Foundation.
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
     8
 *
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    13
 * accompanied this code).
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    14
 *
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    18
 *
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    21
 * questions.
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    22
 */
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    23
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    24
/**
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    25
 * @test
35148
5cfafc99d791 8143072: [JVMCI] Port JVMCI to AArch64
twisti
parents: 34511
diff changeset
    26
 * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64")
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    27
 * @compile CodeInstallerTest.java
34175
5737d346238e 8142387: Various JVMCI tests fail on unexpected exception
twisti
parents: 34153
diff changeset
    28
 * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.jvmci.errors.TestInvalidCompilationResult
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    29
 */
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    30
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    31
package compiler.jvmci.errors;
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    32
35823
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
    33
import jdk.vm.ci.code.StackSlot;
35582
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35148
diff changeset
    34
import jdk.vm.ci.code.site.ConstantReference;
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35148
diff changeset
    35
import jdk.vm.ci.code.site.DataPatch;
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35148
diff changeset
    36
import jdk.vm.ci.code.site.DataSectionReference;
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35148
diff changeset
    37
import jdk.vm.ci.code.site.Infopoint;
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35148
diff changeset
    38
import jdk.vm.ci.code.site.InfopointReason;
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35148
diff changeset
    39
import jdk.vm.ci.code.site.Mark;
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35148
diff changeset
    40
import jdk.vm.ci.code.site.Reference;
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35148
diff changeset
    41
import jdk.vm.ci.code.site.Site;
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    42
import jdk.vm.ci.common.JVMCIError;
35582
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35148
diff changeset
    43
import jdk.vm.ci.hotspot.HotSpotCompiledCode.Comment;
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    44
import jdk.vm.ci.hotspot.HotSpotConstant;
35582
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35148
diff changeset
    45
import jdk.vm.ci.meta.Assumptions.Assumption;
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    46
import jdk.vm.ci.meta.VMConstant;
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    47
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    48
import org.junit.Test;
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    49
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    50
/**
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    51
 * Tests for errors in the code installer.
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    52
 */
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    53
public class TestInvalidCompilationResult extends CodeInstallerTest {
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    54
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    55
    private static class InvalidAssumption extends Assumption {
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    56
    }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    57
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    58
    private static class InvalidVMConstant implements VMConstant {
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    59
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    60
        public boolean isDefaultForKind() {
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    61
            return false;
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    62
        }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    63
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    64
        public String toValueString() {
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    65
            return null;
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    66
        }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    67
    }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    68
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    69
    private static class InvalidReference extends Reference {
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    70
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    71
        @Override
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    72
        public int hashCode() {
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    73
            return 0;
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    74
        }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    75
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    76
        @Override
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    77
        public boolean equals(Object obj) {
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    78
            return false;
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    79
        }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    80
    }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    81
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    82
    @Test(expected = JVMCIError.class)
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    83
    public void testInvalidAssumption() {
35823
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
    84
        installEmptyCode(new Site[0], new Assumption[]{new InvalidAssumption()}, new Comment[0], 16, new DataPatch[0], null);
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    85
    }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    86
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    87
    @Test(expected = JVMCIError.class)
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    88
    public void testInvalidAlignment() {
35823
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
    89
        installEmptyCode(new Site[0], new Assumption[0], new Comment[0], 7, new DataPatch[0], null);
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    90
    }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    91
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    92
    @Test(expected = NullPointerException.class)
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    93
    public void testNullDataPatchInDataSection() {
35823
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
    94
        installEmptyCode(new Site[0], new Assumption[0], new Comment[0], 16, new DataPatch[]{null}, null);
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    95
    }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    96
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    97
    @Test(expected = NullPointerException.class)
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
    98
    public void testNullReferenceInDataSection() {
35823
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
    99
        installEmptyCode(new Site[0], new Assumption[0], new Comment[0], 16, new DataPatch[]{new DataPatch(0, null)}, null);
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   100
    }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   101
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   102
    @Test(expected = JVMCIError.class)
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   103
    public void testInvalidDataSectionReference() {
35582
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35148
diff changeset
   104
        DataSectionReference ref = new DataSectionReference();
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35148
diff changeset
   105
        ref.setOffset(0);
35823
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
   106
        installEmptyCode(new Site[0], new Assumption[0], new Comment[0], 16, new DataPatch[]{new DataPatch(0, ref)}, null);
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   107
    }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   108
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   109
    @Test(expected = JVMCIError.class)
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   110
    public void testInvalidNarrowMethodInDataSection() {
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   111
        HotSpotConstant c = (HotSpotConstant) dummyMethod.getEncoding();
35582
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35148
diff changeset
   112
        ConstantReference ref = new ConstantReference((VMConstant) c.compress());
35823
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
   113
        installEmptyCode(new Site[0], new Assumption[0], new Comment[0], 16, new DataPatch[]{new DataPatch(0, ref)}, null);
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   114
    }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   115
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   116
    @Test(expected = NullPointerException.class)
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   117
    public void testNullConstantInDataSection() {
35582
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35148
diff changeset
   118
        ConstantReference ref = new ConstantReference(null);
35823
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
   119
        installEmptyCode(new Site[0], new Assumption[0], new Comment[0], 16, new DataPatch[]{new DataPatch(0, ref)}, null);
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   120
    }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   121
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   122
    @Test(expected = JVMCIError.class)
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   123
    public void testInvalidConstantInDataSection() {
35582
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35148
diff changeset
   124
        ConstantReference ref = new ConstantReference(new InvalidVMConstant());
35823
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
   125
        installEmptyCode(new Site[0], new Assumption[0], new Comment[0], 16, new DataPatch[]{new DataPatch(0, ref)}, null);
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   126
    }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   127
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   128
    @Test(expected = NullPointerException.class)
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   129
    public void testNullReferenceInCode() {
35823
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
   130
        installEmptyCode(new Site[]{new DataPatch(0, null)}, new Assumption[0], new Comment[0], 16, new DataPatch[0], null);
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   131
    }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   132
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   133
    @Test(expected = NullPointerException.class)
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   134
    public void testNullConstantInCode() {
35582
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35148
diff changeset
   135
        ConstantReference ref = new ConstantReference(null);
35823
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
   136
        installEmptyCode(new Site[]{new DataPatch(0, ref)}, new Assumption[0], new Comment[0], 16, new DataPatch[0], null);
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   137
    }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   138
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   139
    @Test(expected = JVMCIError.class)
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   140
    public void testInvalidConstantInCode() {
35582
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35148
diff changeset
   141
        ConstantReference ref = new ConstantReference(new InvalidVMConstant());
35823
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
   142
        installEmptyCode(new Site[]{new DataPatch(0, ref)}, new Assumption[0], new Comment[0], 16, new DataPatch[0], null);
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   143
    }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   144
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   145
    @Test(expected = JVMCIError.class)
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   146
    public void testInvalidReference() {
35582
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35148
diff changeset
   147
        InvalidReference ref = new InvalidReference();
35823
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
   148
        installEmptyCode(new Site[]{new DataPatch(0, ref)}, new Assumption[0], new Comment[0], 16, new DataPatch[0], null);
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   149
    }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   150
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   151
    @Test(expected = JVMCIError.class)
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   152
    public void testOutOfBoundsDataSectionReference() {
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   153
        DataSectionReference ref = new DataSectionReference();
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   154
        ref.setOffset(0x1000);
35823
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
   155
        installEmptyCode(new Site[]{new DataPatch(0, ref)}, new Assumption[0], new Comment[0], 16, new DataPatch[0], null);
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   156
    }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   157
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   158
    @Test(expected = JVMCIError.class)
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   159
    public void testInvalidMark() {
35823
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
   160
        installEmptyCode(new Site[]{new Mark(0, new Object())}, new Assumption[0], new Comment[0], 16, new DataPatch[0], null);
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   161
    }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   162
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   163
    @Test(expected = JVMCIError.class)
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   164
    public void testInvalidMarkInt() {
35823
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
   165
        installEmptyCode(new Site[]{new Mark(0, -1)}, new Assumption[0], new Comment[0], 16, new DataPatch[0], null);
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   166
    }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   167
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   168
    @Test(expected = NullPointerException.class)
35582
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35148
diff changeset
   169
    public void testNullSite() {
35823
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
   170
        installEmptyCode(new Site[]{null}, new Assumption[0], new Comment[0], 16, new DataPatch[0], null);
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   171
    }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   172
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   173
    @Test(expected = JVMCIError.class)
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   174
    public void testInfopointMissingDebugInfo() {
35582
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35148
diff changeset
   175
        Infopoint info = new Infopoint(0, null, InfopointReason.METHOD_START);
35823
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
   176
        installEmptyCode(new Site[]{info}, new Assumption[0], new Comment[0], 16, new DataPatch[0], null);
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   177
    }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   178
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   179
    @Test(expected = JVMCIError.class)
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   180
    public void testSafepointMissingDebugInfo() {
35582
c32a0cc19877 8147599: [JVMCI] simplify code installation interface
rschatz
parents: 35148
diff changeset
   181
        Infopoint info = new Infopoint(0, null, InfopointReason.SAFEPOINT);
35823
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
   182
        StackSlot deoptRescueSlot = StackSlot.get(null, 0, true);
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
   183
        installEmptyCode(new Site[]{info}, new Assumption[0], new Comment[0], 16, new DataPatch[0], deoptRescueSlot);
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
   184
    }
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
   185
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
   186
    @Test(expected = JVMCIError.class)
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
   187
    public void testInvalidDeoptRescueSlot() {
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
   188
        StackSlot deoptRescueSlot = StackSlot.get(null, -1, false);
59a847ec6ee3 8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents: 35582
diff changeset
   189
        installEmptyCode(new Site[]{}, new Assumption[0], new Comment[0], 16, new DataPatch[0], deoptRescueSlot);
34153
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   190
    }
cbcfa2a6fe0b 8139589: [JVMCI] throw exceptions in faulty code installation operations
twisti
parents:
diff changeset
   191
}