Skip to content

Commit e9e694f

Browse files
committed
8320275: assert(_chunk->bitmap().at(index)) failed: Bit not set at index
Reviewed-by: dlong, fparain
1 parent da1091e commit e9e694f

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
@@ -441,7 +441,6 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
441441
}
442442
}
443443

444-
if (slot & 1) slot++;
445444
return slot;
446445
}
447446

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
@@ -498,7 +498,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
498498

499499
uint int_args = 0;
500500
uint fp_args = 0;
501-
uint stk_args = 0; // inc by 2 each time
501+
uint stk_args = 0;
502502

503503
for (int i = 0; i < total_args_passed; i++) {
504504
switch (sig_bt[i]) {
@@ -510,8 +510,9 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
510510
if (int_args < Argument::n_int_register_parameters_j) {
511511
regs[i].set1(INT_ArgReg[int_args++]->as_VMReg());
512512
} else {
513+
stk_args = align_up(stk_args, 2);
513514
regs[i].set1(VMRegImpl::stack2reg(stk_args));
514-
stk_args += 2;
515+
stk_args += 1;
515516
}
516517
break;
517518
case T_VOID:
@@ -528,6 +529,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
528529
if (int_args < Argument::n_int_register_parameters_j) {
529530
regs[i].set2(INT_ArgReg[int_args++]->as_VMReg());
530531
} else {
532+
stk_args = align_up(stk_args, 2);
531533
regs[i].set2(VMRegImpl::stack2reg(stk_args));
532534
stk_args += 2;
533535
}
@@ -536,15 +538,17 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
536538
if (fp_args < Argument::n_float_register_parameters_j) {
537539
regs[i].set1(FP_ArgReg[fp_args++]->as_VMReg());
538540
} else {
541+
stk_args = align_up(stk_args, 2);
539542
regs[i].set1(VMRegImpl::stack2reg(stk_args));
540-
stk_args += 2;
543+
stk_args += 1;
541544
}
542545
break;
543546
case T_DOUBLE:
544547
assert((i + 1) < total_args_passed && sig_bt[i + 1] == T_VOID, "expecting half");
545548
if (fp_args < Argument::n_float_register_parameters_j) {
546549
regs[i].set2(FP_ArgReg[fp_args++]->as_VMReg());
547550
} else {
551+
stk_args = align_up(stk_args, 2);
548552
regs[i].set2(VMRegImpl::stack2reg(stk_args));
549553
stk_args += 2;
550554
}
@@ -555,7 +559,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
555559
}
556560
}
557561

558-
return align_up(stk_args, 2);
562+
return stk_args;
559563
}
560564

561565
// 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
@@ -3019,7 +3019,7 @@ void nmethod::print_nmethod_labels(outputStream* stream, address block_begin, bo
30193019
assert(sig_index == sizeargs, "");
30203020
}
30213021
const char* spname = "sp"; // make arch-specific?
3022-
intptr_t out_preserve = SharedRuntime::java_calling_convention(sig_bt, regs, sizeargs);
3022+
SharedRuntime::java_calling_convention(sig_bt, regs, sizeargs);
30233023
int stack_slot_offset = this->frame_size() * wordSize;
30243024
int tab1 = 14, tab2 = 24;
30253025
int sig_index = 0;

src/hotspot/share/oops/method.hpp

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

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

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

0 commit comments

Comments
 (0)