Skip to content

Commit 677556d

Browse files
committed
8320275: assert(_chunk->bitmap().at(index)) failed: Bit not set at index
8323595: is_aligned(p, alignof(OopT))) assertion fails in Jetty without compressed OOPs Reviewed-by: phh Backport-of: e9e694f4ef7b080d7fe1ad5b2f2daa2fccd0456e
1 parent 8ac4313 commit 677556d

17 files changed

+72
-43
lines changed

src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
310310

311311
uint int_args = 0;
312312
uint fp_args = 0;
313-
uint stk_args = 0; // inc by 2 each time
313+
uint stk_args = 0;
314314

315315
for (int i = 0; i < total_args_passed; i++) {
316316
switch (sig_bt[i]) {
@@ -322,8 +322,9 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
322322
if (int_args < Argument::n_int_register_parameters_j) {
323323
regs[i].set1(INT_ArgReg[int_args++]->as_VMReg());
324324
} else {
325+
stk_args = align_up(stk_args, 2);
325326
regs[i].set1(VMRegImpl::stack2reg(stk_args));
326-
stk_args += 2;
327+
stk_args += 1;
327328
}
328329
break;
329330
case T_VOID:
@@ -340,6 +341,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
340341
if (int_args < Argument::n_int_register_parameters_j) {
341342
regs[i].set2(INT_ArgReg[int_args++]->as_VMReg());
342343
} else {
344+
stk_args = align_up(stk_args, 2);
343345
regs[i].set2(VMRegImpl::stack2reg(stk_args));
344346
stk_args += 2;
345347
}
@@ -348,15 +350,17 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
348350
if (fp_args < Argument::n_float_register_parameters_j) {
349351
regs[i].set1(FP_ArgReg[fp_args++]->as_VMReg());
350352
} else {
353+
stk_args = align_up(stk_args, 2);
351354
regs[i].set1(VMRegImpl::stack2reg(stk_args));
352-
stk_args += 2;
355+
stk_args += 1;
353356
}
354357
break;
355358
case T_DOUBLE:
356359
assert((i + 1) < total_args_passed && sig_bt[i + 1] == T_VOID, "expecting half");
357360
if (fp_args < Argument::n_float_register_parameters_j) {
358361
regs[i].set2(FP_ArgReg[fp_args++]->as_VMReg());
359362
} else {
363+
stk_args = align_up(stk_args, 2);
360364
regs[i].set2(VMRegImpl::stack2reg(stk_args));
361365
stk_args += 2;
362366
}
@@ -367,7 +371,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
367371
}
368372
}
369373

370-
return align_up(stk_args, 2);
374+
return stk_args;
371375
}
372376

373377
// Patch the callers callsite with entry to compiled code if it exists.

src/hotspot/cpu/arm/sharedRuntime_arm.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,6 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
444444
}
445445
}
446446

447-
if (slot & 1) slot++;
448447
return slot;
449448
}
450449

src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
734734
ShouldNotReachHere();
735735
}
736736
}
737-
return align_up(stk, 2);
737+
return stk;
738738
}
739739

740740
#if defined(COMPILER1) || defined(COMPILER2)

src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
266266

267267
uint int_args = 0;
268268
uint fp_args = 0;
269-
uint stk_args = 0; // inc by 2 each time
269+
uint stk_args = 0;
270270

271271
for (int i = 0; i < total_args_passed; i++) {
272272
switch (sig_bt[i]) {
@@ -278,8 +278,9 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
278278
if (int_args < Argument::n_int_register_parameters_j) {
279279
regs[i].set1(INT_ArgReg[int_args++]->as_VMReg());
280280
} else {
281+
stk_args = align_up(stk_args, 2);
281282
regs[i].set1(VMRegImpl::stack2reg(stk_args));
282-
stk_args += 2;
283+
stk_args += 1;
283284
}
284285
break;
285286
case T_VOID:
@@ -295,6 +296,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
295296
if (int_args < Argument::n_int_register_parameters_j) {
296297
regs[i].set2(INT_ArgReg[int_args++]->as_VMReg());
297298
} else {
299+
stk_args = align_up(stk_args, 2);
298300
regs[i].set2(VMRegImpl::stack2reg(stk_args));
299301
stk_args += 2;
300302
}
@@ -303,15 +305,17 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
303305
if (fp_args < Argument::n_float_register_parameters_j) {
304306
regs[i].set1(FP_ArgReg[fp_args++]->as_VMReg());
305307
} else {
308+
stk_args = align_up(stk_args, 2);
306309
regs[i].set1(VMRegImpl::stack2reg(stk_args));
307-
stk_args += 2;
310+
stk_args += 1;
308311
}
309312
break;
310313
case T_DOUBLE:
311314
assert((i + 1) < total_args_passed && sig_bt[i + 1] == T_VOID, "expecting half");
312315
if (fp_args < Argument::n_float_register_parameters_j) {
313316
regs[i].set2(FP_ArgReg[fp_args++]->as_VMReg());
314317
} else {
318+
stk_args = align_up(stk_args, 2);
315319
regs[i].set2(VMRegImpl::stack2reg(stk_args));
316320
stk_args += 2;
317321
}
@@ -321,7 +325,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
321325
}
322326
}
323327

324-
return align_up(stk_args, 2);
328+
return stk_args;
325329
}
326330

327331
// Patch the callers callsite with entry to compiled code if it exists.

src/hotspot/cpu/s390/sharedRuntime_s390.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
755755
ShouldNotReachHere();
756756
}
757757
}
758-
return align_up(stk, 2);
758+
return stk;
759759
}
760760

761761
int SharedRuntime::c_calling_convention(const BasicType *sig_bt,

src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
528528
}
529529
}
530530

531-
// return value can be odd number of VMRegImpl stack slots make multiple of 2
532-
return align_up(stack, 2);
531+
return stack;
533532
}
534533

535534
// Patch the callers callsite with entry to compiled code if it exists.

src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
497497

498498
uint int_args = 0;
499499
uint fp_args = 0;
500-
uint stk_args = 0; // inc by 2 each time
500+
uint stk_args = 0;
501501

502502
for (int i = 0; i < total_args_passed; i++) {
503503
switch (sig_bt[i]) {
@@ -509,8 +509,9 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
509509
if (int_args < Argument::n_int_register_parameters_j) {
510510
regs[i].set1(INT_ArgReg[int_args++]->as_VMReg());
511511
} else {
512+
stk_args = align_up(stk_args, 2);
512513
regs[i].set1(VMRegImpl::stack2reg(stk_args));
513-
stk_args += 2;
514+
stk_args += 1;
514515
}
515516
break;
516517
case T_VOID:
@@ -527,6 +528,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
527528
if (int_args < Argument::n_int_register_parameters_j) {
528529
regs[i].set2(INT_ArgReg[int_args++]->as_VMReg());
529530
} else {
531+
stk_args = align_up(stk_args, 2);
530532
regs[i].set2(VMRegImpl::stack2reg(stk_args));
531533
stk_args += 2;
532534
}
@@ -535,15 +537,17 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
535537
if (fp_args < Argument::n_float_register_parameters_j) {
536538
regs[i].set1(FP_ArgReg[fp_args++]->as_VMReg());
537539
} else {
540+
stk_args = align_up(stk_args, 2);
538541
regs[i].set1(VMRegImpl::stack2reg(stk_args));
539-
stk_args += 2;
542+
stk_args += 1;
540543
}
541544
break;
542545
case T_DOUBLE:
543546
assert((i + 1) < total_args_passed && sig_bt[i + 1] == T_VOID, "expecting half");
544547
if (fp_args < Argument::n_float_register_parameters_j) {
545548
regs[i].set2(FP_ArgReg[fp_args++]->as_VMReg());
546549
} else {
550+
stk_args = align_up(stk_args, 2);
547551
regs[i].set2(VMRegImpl::stack2reg(stk_args));
548552
stk_args += 2;
549553
}
@@ -554,7 +558,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
554558
}
555559
}
556560

557-
return align_up(stk_args, 2);
561+
return stk_args;
558562
}
559563

560564
// Patch the callers callsite with entry to compiled code if it exists.

src/hotspot/share/c1/c1_FrameMap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ CallingConvention* FrameMap::java_calling_convention(const BasicTypeArray* signa
7272
}
7373
}
7474

75-
intptr_t out_preserve = SharedRuntime::java_calling_convention(sig_bt, regs, sizeargs);
75+
intptr_t out_preserve = align_up(SharedRuntime::java_calling_convention(sig_bt, regs, sizeargs), 2);
7676
LIR_OprList* args = new LIR_OprList(signature->length());
7777
for (i = 0; i < sizeargs;) {
7878
BasicType t = sig_bt[i];

src/hotspot/share/code/nmethod.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3059,7 +3059,7 @@ void nmethod::print_nmethod_labels(outputStream* stream, address block_begin, bo
30593059
assert(sig_index == sizeargs, "");
30603060
}
30613061
const char* spname = "sp"; // make arch-specific?
3062-
intptr_t out_preserve = SharedRuntime::java_calling_convention(sig_bt, regs, sizeargs);
3062+
SharedRuntime::java_calling_convention(sig_bt, regs, sizeargs);
30633063
int stack_slot_offset = this->frame_size() * wordSize;
30643064
int tab1 = 14, tab2 = 24;
30653065
int sig_index = 0;

src/hotspot/share/oops/method.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,8 @@ class Method : public Metadata {
444444
void remove_unshareable_flags() NOT_CDS_RETURN;
445445

446446
// the number of argument reg slots that the compiled method uses on the stack.
447-
int num_stack_arg_slots() const { return constMethod()->num_stack_arg_slots(); }
447+
int num_stack_arg_slots(bool rounded = true) const {
448+
return rounded ? align_up(constMethod()->num_stack_arg_slots(), 2) : constMethod()->num_stack_arg_slots(); }
448449

449450
virtual void metaspace_pointers_do(MetaspaceClosure* iter);
450451
virtual MetaspaceObj::Type type() const { return MethodType; }

0 commit comments

Comments
 (0)