Skip to content

Commit e7e90c8

Browse files
author
Sergey Nazarkin
committedOct 16, 2024
Merge tag 'jdk8u432-b06'
2 parents 4d111a7 + 618917e commit e7e90c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2678
-193
lines changed
 

‎hotspot/src/share/vm/c1/c1_Canonicalizer.cpp

+10-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -303,24 +303,20 @@ void Canonicalizer::do_ShiftOp (ShiftOp* x) {
303303
}
304304
if (t2->is_constant()) {
305305
if (t->tag() == intTag) {
306-
int value = t->as_IntConstant()->value();
307-
int shift = t2->as_IntConstant()->value() & 31;
308-
jint mask = ~(~0 << (32 - shift));
309-
if (shift == 0) mask = ~0;
306+
jint value = t->as_IntConstant()->value();
307+
jint shift = t2->as_IntConstant()->value();
310308
switch (x->op()) {
311-
case Bytecodes::_ishl: set_constant(value << shift); return;
312-
case Bytecodes::_ishr: set_constant(value >> shift); return;
313-
case Bytecodes::_iushr: set_constant((value >> shift) & mask); return;
309+
case Bytecodes::_ishl: set_constant(java_shift_left(value, shift)); return;
310+
case Bytecodes::_ishr: set_constant(java_shift_right(value, shift)); return;
311+
case Bytecodes::_iushr: set_constant(java_shift_right_unsigned(value, shift)); return;
314312
}
315313
} else if (t->tag() == longTag) {
316314
jlong value = t->as_LongConstant()->value();
317-
int shift = t2->as_IntConstant()->value() & 63;
318-
jlong mask = ~(~jlong_cast(0) << (64 - shift));
319-
if (shift == 0) mask = ~jlong_cast(0);
315+
jint shift = t2->as_IntConstant()->value();
320316
switch (x->op()) {
321-
case Bytecodes::_lshl: set_constant(value << shift); return;
322-
case Bytecodes::_lshr: set_constant(value >> shift); return;
323-
case Bytecodes::_lushr: set_constant((value >> shift) & mask); return;
317+
case Bytecodes::_lshl: set_constant(java_shift_left(value, shift)); return;
318+
case Bytecodes::_lshr: set_constant(java_shift_right(value, shift)); return;
319+
case Bytecodes::_lushr: set_constant(java_shift_right_unsigned(value, shift)); return;
324320
}
325321
}
326322
}

‎hotspot/src/share/vm/opto/doCall.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,8 @@ void Parse::catch_inline_exceptions(SafePointNode* ex_map) {
892892
tty->print_cr(" Catching every inline exception bci:%d -> handler_bci:%d", bci(), handler_bci);
893893
}
894894
#endif
895+
// If this is a backwards branch in the bytecodes, add safepoint
896+
maybe_add_safepoint(handler_bci);
895897
merge_exception(handler_bci); // jump to handler
896898
return; // No more handling to be done here!
897899
}
@@ -925,6 +927,8 @@ void Parse::catch_inline_exceptions(SafePointNode* ex_map) {
925927
tty->cr();
926928
}
927929
#endif
930+
// If this is a backwards branch in the bytecodes, add safepoint
931+
maybe_add_safepoint(handler_bci);
928932
merge_exception(handler_bci);
929933
}
930934
set_control(not_subtype_ctrl);

0 commit comments

Comments
 (0)
Please sign in to comment.