@@ -85,9 +85,12 @@ public boolean equals(Object obj) {
85
85
}
86
86
}
87
87
88
+ // DataSectionAlignment value matches the alignment sizeof(jdouble) of the CodeBuffer::SECT_CONSTS code section
89
+ static final int validDataSectionAlignment = 8 ;
90
+
88
91
@ Test (expected = JVMCIError .class )
89
92
public void testInvalidAssumption () {
90
- installEmptyCode (new Site [0 ], new Assumption []{new InvalidAssumption ()}, new Comment [0 ], 16 , new DataPatch [0 ], null );
93
+ installEmptyCode (new Site [0 ], new Assumption []{new InvalidAssumption ()}, new Comment [0 ], validDataSectionAlignment , new DataPatch [0 ], null );
91
94
}
92
95
93
96
@ Test (expected = JVMCIError .class )
@@ -97,101 +100,101 @@ public void testInvalidAlignment() {
97
100
98
101
@ Test (expected = NullPointerException .class )
99
102
public void testNullDataPatchInDataSection () {
100
- installEmptyCode (new Site [0 ], new Assumption [0 ], new Comment [0 ], 16 , new DataPatch []{null }, null );
103
+ installEmptyCode (new Site [0 ], new Assumption [0 ], new Comment [0 ], validDataSectionAlignment , new DataPatch []{null }, null );
101
104
}
102
105
103
106
@ Test (expected = NullPointerException .class )
104
107
public void testNullReferenceInDataSection () {
105
- installEmptyCode (new Site [0 ], new Assumption [0 ], new Comment [0 ], 16 , new DataPatch []{new DataPatch (0 , null )}, null );
108
+ installEmptyCode (new Site [0 ], new Assumption [0 ], new Comment [0 ], validDataSectionAlignment , new DataPatch []{new DataPatch (0 , null )}, null );
106
109
}
107
110
108
111
@ Test (expected = JVMCIError .class )
109
112
public void testInvalidDataSectionReference () {
110
113
DataSectionReference ref = new DataSectionReference ();
111
114
ref .setOffset (0 );
112
- installEmptyCode (new Site [0 ], new Assumption [0 ], new Comment [0 ], 16 , new DataPatch []{new DataPatch (0 , ref )}, null );
115
+ installEmptyCode (new Site [0 ], new Assumption [0 ], new Comment [0 ], validDataSectionAlignment , new DataPatch []{new DataPatch (0 , ref )}, null );
113
116
}
114
117
115
118
@ Test (expected = JVMCIError .class )
116
119
public void testInvalidNarrowMethodInDataSection () {
117
120
HotSpotConstant c = (HotSpotConstant ) dummyMethod .getEncoding ();
118
121
ConstantReference ref = new ConstantReference ((VMConstant ) c .compress ());
119
- installEmptyCode (new Site [0 ], new Assumption [0 ], new Comment [0 ], 16 , new DataPatch []{new DataPatch (0 , ref )}, null );
122
+ installEmptyCode (new Site [0 ], new Assumption [0 ], new Comment [0 ], validDataSectionAlignment , new DataPatch []{new DataPatch (0 , ref )}, null );
120
123
}
121
124
122
125
@ Test (expected = NullPointerException .class )
123
126
public void testNullConstantInDataSection () {
124
127
ConstantReference ref = new ConstantReference (null );
125
- installEmptyCode (new Site [0 ], new Assumption [0 ], new Comment [0 ], 16 , new DataPatch []{new DataPatch (0 , ref )}, null );
128
+ installEmptyCode (new Site [0 ], new Assumption [0 ], new Comment [0 ], validDataSectionAlignment , new DataPatch []{new DataPatch (0 , ref )}, null );
126
129
}
127
130
128
131
@ Test (expected = JVMCIError .class )
129
132
public void testInvalidConstantInDataSection () {
130
133
ConstantReference ref = new ConstantReference (new InvalidVMConstant ());
131
- installEmptyCode (new Site [0 ], new Assumption [0 ], new Comment [0 ], 16 , new DataPatch []{new DataPatch (0 , ref )}, null );
134
+ installEmptyCode (new Site [0 ], new Assumption [0 ], new Comment [0 ], validDataSectionAlignment , new DataPatch []{new DataPatch (0 , ref )}, null );
132
135
}
133
136
134
137
@ Test (expected = NullPointerException .class )
135
138
public void testNullReferenceInCode () {
136
- installEmptyCode (new Site []{new DataPatch (0 , null )}, new Assumption [0 ], new Comment [0 ], 16 , new DataPatch [0 ], null );
139
+ installEmptyCode (new Site []{new DataPatch (0 , null )}, new Assumption [0 ], new Comment [0 ], validDataSectionAlignment , new DataPatch [0 ], null );
137
140
}
138
141
139
142
@ Test (expected = NullPointerException .class )
140
143
public void testNullConstantInCode () {
141
144
ConstantReference ref = new ConstantReference (null );
142
- installEmptyCode (new Site []{new DataPatch (0 , ref )}, new Assumption [0 ], new Comment [0 ], 16 , new DataPatch [0 ], null );
145
+ installEmptyCode (new Site []{new DataPatch (0 , ref )}, new Assumption [0 ], new Comment [0 ], validDataSectionAlignment , new DataPatch [0 ], null );
143
146
}
144
147
145
148
@ Test (expected = JVMCIError .class )
146
149
public void testInvalidConstantInCode () {
147
150
ConstantReference ref = new ConstantReference (new InvalidVMConstant ());
148
- installEmptyCode (new Site []{new DataPatch (0 , ref )}, new Assumption [0 ], new Comment [0 ], 16 , new DataPatch [0 ], null );
151
+ installEmptyCode (new Site []{new DataPatch (0 , ref )}, new Assumption [0 ], new Comment [0 ], validDataSectionAlignment , new DataPatch [0 ], null );
149
152
}
150
153
151
154
@ Test (expected = JVMCIError .class )
152
155
public void testInvalidReference () {
153
156
InvalidReference ref = new InvalidReference ();
154
- installEmptyCode (new Site []{new DataPatch (0 , ref )}, new Assumption [0 ], new Comment [0 ], 16 , new DataPatch [0 ], null );
157
+ installEmptyCode (new Site []{new DataPatch (0 , ref )}, new Assumption [0 ], new Comment [0 ], validDataSectionAlignment , new DataPatch [0 ], null );
155
158
}
156
159
157
160
@ Test (expected = JVMCIError .class )
158
161
public void testOutOfBoundsDataSectionReference () {
159
162
DataSectionReference ref = new DataSectionReference ();
160
163
ref .setOffset (0x1000 );
161
- installEmptyCode (new Site []{new DataPatch (0 , ref )}, new Assumption [0 ], new Comment [0 ], 16 , new DataPatch [0 ], null );
164
+ installEmptyCode (new Site []{new DataPatch (0 , ref )}, new Assumption [0 ], new Comment [0 ], validDataSectionAlignment , new DataPatch [0 ], null );
162
165
}
163
166
164
167
@ Test (expected = JVMCIError .class )
165
168
public void testInvalidMark () {
166
- installEmptyCode (new Site []{new Mark (0 , new Object ())}, new Assumption [0 ], new Comment [0 ], 16 , new DataPatch [0 ], null );
169
+ installEmptyCode (new Site []{new Mark (0 , new Object ())}, new Assumption [0 ], new Comment [0 ], validDataSectionAlignment , new DataPatch [0 ], null );
167
170
}
168
171
169
172
@ Test (expected = JVMCIError .class )
170
173
public void testInvalidMarkInt () {
171
- installEmptyCode (new Site []{new Mark (0 , -1 )}, new Assumption [0 ], new Comment [0 ], 16 , new DataPatch [0 ], null );
174
+ installEmptyCode (new Site []{new Mark (0 , -1 )}, new Assumption [0 ], new Comment [0 ], validDataSectionAlignment , new DataPatch [0 ], null );
172
175
}
173
176
174
177
@ Test (expected = NullPointerException .class )
175
178
public void testNullSite () {
176
- installEmptyCode (new Site []{null }, new Assumption [0 ], new Comment [0 ], 16 , new DataPatch [0 ], null );
179
+ installEmptyCode (new Site []{null }, new Assumption [0 ], new Comment [0 ], validDataSectionAlignment , new DataPatch [0 ], null );
177
180
}
178
181
179
182
@ Test (expected = JVMCIError .class )
180
183
public void testInfopointMissingDebugInfo () {
181
184
Infopoint info = new Infopoint (0 , null , InfopointReason .METHOD_START );
182
- installEmptyCode (new Site []{info }, new Assumption [0 ], new Comment [0 ], 16 , new DataPatch [0 ], null );
185
+ installEmptyCode (new Site []{info }, new Assumption [0 ], new Comment [0 ], validDataSectionAlignment , new DataPatch [0 ], null );
183
186
}
184
187
185
188
@ Test (expected = JVMCIError .class )
186
189
public void testSafepointMissingDebugInfo () {
187
190
Infopoint info = new Infopoint (0 , null , InfopointReason .SAFEPOINT );
188
191
StackSlot deoptRescueSlot = StackSlot .get (null , 0 , true );
189
- installEmptyCode (new Site []{info }, new Assumption [0 ], new Comment [0 ], 16 , new DataPatch [0 ], deoptRescueSlot );
192
+ installEmptyCode (new Site []{info }, new Assumption [0 ], new Comment [0 ], validDataSectionAlignment , new DataPatch [0 ], deoptRescueSlot );
190
193
}
191
194
192
195
@ Test (expected = JVMCIError .class )
193
196
public void testInvalidDeoptRescueSlot () {
194
197
StackSlot deoptRescueSlot = StackSlot .get (null , -1 , false );
195
- installEmptyCode (new Site []{}, new Assumption [0 ], new Comment [0 ], 16 , new DataPatch [0 ], deoptRescueSlot );
198
+ installEmptyCode (new Site []{}, new Assumption [0 ], new Comment [0 ], validDataSectionAlignment , new DataPatch [0 ], deoptRescueSlot );
196
199
}
197
200
}
0 commit comments