Skip to content

Commit e49178a

Browse files
committed
Merge branch 'master' into 8212107-vmthread
2 parents 218eefc + fdce055 commit e49178a

File tree

33 files changed

+1143
-516
lines changed

33 files changed

+1143
-516
lines changed

make/autoconf/flags-cflags.m4

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
134134
135135
WARNINGS_ENABLE_ALL="-W3"
136136
DISABLED_WARNINGS="4800"
137+
if test "x$TOOLCHAIN_VERSION" = x2017; then
138+
# VS2017 incorrectly triggers this warning for constexpr
139+
DISABLED_WARNINGS+=" 4307"
140+
fi
137141
;;
138142
139143
gcc)

make/devkit/Tools.gmk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ else
125125
endif
126126

127127
GCC := http://ftp.gnu.org/pub/gnu/gcc/$(gcc_ver)/$(gcc_ver).tar.xz
128-
BINUTILS := http://ftp.gnu.org/pub/gnu/binutils/$(binutils_ver).tar.xz
128+
BINUTILS := http://ftp.gnu.org/pub/gnu/binutils/$(binutils_ver).tar.gz
129129
CCACHE := https://github.com/ccache/ccache/releases/download/v$(ccache_ver)/ccache-$(ccache_ver).tar.xz
130130
MPFR := https://www.mpfr.org/${mpfr_ver}/${mpfr_ver}.tar.bz2
131131
GMP := http://ftp.gnu.org/pub/gnu/gmp/${gmp_ver}.tar.bz2

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,27 +1004,22 @@ void MacroAssembler::lookup_interface_method(Register recv_klass,
10041004
// }
10051005
Label search, found_method;
10061006

1007-
for (int peel = 1; peel >= 0; peel--) {
1008-
ldr(method_result, Address(scan_temp, itableOffsetEntry::interface_offset_in_bytes()));
1009-
cmp(intf_klass, method_result);
1010-
1011-
if (peel) {
1012-
br(Assembler::EQ, found_method);
1013-
} else {
1014-
br(Assembler::NE, search);
1015-
// (invert the test to fall through to found_method...)
1016-
}
1017-
1018-
if (!peel) break;
1019-
1020-
bind(search);
1021-
1022-
// Check that the previous entry is non-null. A null entry means that
1023-
// the receiver class doesn't implement the interface, and wasn't the
1024-
// same as when the caller was compiled.
1025-
cbz(method_result, L_no_such_interface);
1007+
ldr(method_result, Address(scan_temp, itableOffsetEntry::interface_offset_in_bytes()));
1008+
cmp(intf_klass, method_result);
1009+
br(Assembler::EQ, found_method);
1010+
bind(search);
1011+
// Check that the previous entry is non-null. A null entry means that
1012+
// the receiver class doesn't implement the interface, and wasn't the
1013+
// same as when the caller was compiled.
1014+
cbz(method_result, L_no_such_interface);
1015+
if (itableOffsetEntry::interface_offset_in_bytes() != 0) {
10261016
add(scan_temp, scan_temp, scan_step);
1017+
ldr(method_result, Address(scan_temp, itableOffsetEntry::interface_offset_in_bytes()));
1018+
} else {
1019+
ldr(method_result, Address(pre(scan_temp, scan_step)));
10271020
}
1021+
cmp(intf_klass, method_result);
1022+
br(Assembler::NE, search);
10281023

10291024
bind(found_method);
10301025

src/hotspot/cpu/arm/globalDefinitions_arm.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,4 @@ const bool HaveVFP = true;
5555
#define AD_MD_HPP "adfiles/ad_arm_32.hpp"
5656
#define C1_LIRGENERATOR_MD_HPP "c1_LIRGenerator_arm.hpp"
5757

58-
#ifdef TARGET_COMPILER_gcc
59-
#ifdef ARM32
60-
#undef BREAKPOINT
61-
#define BREAKPOINT __asm__ volatile ("bkpt")
62-
#endif
63-
#endif
64-
6558
#endif // CPU_ARM_GLOBALDEFINITIONS_ARM_HPP

src/hotspot/share/gc/g1/g1ParScanThreadState.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@
3636
#include "oops/access.inline.hpp"
3737
#include "oops/oop.inline.hpp"
3838
#include "runtime/prefetch.inline.hpp"
39+
#include "utilities/globalDefinitions.hpp"
40+
#include "utilities/macros.hpp"
41+
42+
// In fastdebug builds the code size can get out of hand, potentially
43+
// tripping over compiler limits (which may be bugs, but nevertheless
44+
// need to be taken into consideration). A side benefit of limiting
45+
// inlining is that we get more call frames that might aid debugging.
46+
// And the fastdebug compile time for this file is much reduced.
47+
// Explicit NOINLINE to block ATTRIBUTE_FLATTENing.
48+
#define MAYBE_INLINE_EVACUATION NOT_DEBUG(inline) DEBUG_ONLY(NOINLINE)
3949

4050
G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h,
4151
G1RedirtyCardsQueueSet* rdcqs,
@@ -155,7 +165,9 @@ void G1ParScanThreadState::verify_task(ScannerTask task) const {
155165
}
156166
#endif // ASSERT
157167

158-
template <class T> void G1ParScanThreadState::do_oop_evac(T* p) {
168+
template <class T>
169+
MAYBE_INLINE_EVACUATION
170+
void G1ParScanThreadState::do_oop_evac(T* p) {
159171
// Reference should not be NULL here as such are never pushed to the task queue.
160172
oop obj = RawAccess<IS_NOT_NULL>::oop_load(p);
161173

@@ -194,6 +206,7 @@ template <class T> void G1ParScanThreadState::do_oop_evac(T* p) {
194206
}
195207
}
196208

209+
MAYBE_INLINE_EVACUATION
197210
void G1ParScanThreadState::do_partial_array(PartialArrayScanTask task) {
198211
oop from_obj = task.to_source_array();
199212

@@ -243,6 +256,7 @@ void G1ParScanThreadState::do_partial_array(PartialArrayScanTask task) {
243256
to_obj_array->oop_iterate_range(&_scanner, start, end);
244257
}
245258

259+
MAYBE_INLINE_EVACUATION
246260
void G1ParScanThreadState::dispatch_task(ScannerTask task) {
247261
verify_task(task);
248262
if (task.is_narrow_oop_ptr()) {
@@ -388,6 +402,7 @@ void G1ParScanThreadState::undo_allocation(G1HeapRegionAttr dest_attr,
388402

389403
// Private inline function, for direct internal use and providing the
390404
// implementation of the public not-inline function.
405+
MAYBE_INLINE_EVACUATION
391406
oop G1ParScanThreadState::do_copy_to_survivor_space(G1HeapRegionAttr const region_attr,
392407
oop const old,
393408
markWord const old_mark) {

src/hotspot/share/gc/g1/g1ParScanThreadState.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class G1ParScanThreadState : public CHeapObj<mtGC> {
156156
size_t flush(size_t* surviving_young_words);
157157

158158
private:
159-
inline void do_partial_array(PartialArrayScanTask task);
159+
void do_partial_array(PartialArrayScanTask task);
160160

161161
HeapWord* allocate_copy_slow(G1HeapRegionAttr* dest_attr,
162162
oop old,
@@ -169,14 +169,14 @@ class G1ParScanThreadState : public CHeapObj<mtGC> {
169169
size_t word_sz,
170170
uint node_index);
171171

172-
inline oop do_copy_to_survivor_space(G1HeapRegionAttr region_attr,
173-
oop obj,
174-
markWord old_mark);
172+
oop do_copy_to_survivor_space(G1HeapRegionAttr region_attr,
173+
oop obj,
174+
markWord old_mark);
175175

176176
// This method is applied to the fields of the objects that have just been copied.
177-
template <class T> inline void do_oop_evac(T* p);
177+
template <class T> void do_oop_evac(T* p);
178178

179-
inline void dispatch_task(ScannerTask task);
179+
void dispatch_task(ScannerTask task);
180180

181181
// Tries to allocate word_sz in the PLAB of the next "generation" after trying to
182182
// allocate into dest. Previous_plab_refill_failed indicates whether previous

src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ oop ShenandoahBarrierSet::load_reference_barrier_native_impl(oop obj, T* load_ad
204204
}
205205

206206
oop fwd = load_reference_barrier_not_null(obj);
207-
if (load_addr != NULL && fwd != obj) {
207+
if (ShenandoahSelfFixing && load_addr != NULL && fwd != obj) {
208208
// Since we are here and we know the load address, update the reference.
209209
ShenandoahHeap::cas_oop(fwd, load_addr, obj);
210210
}

src/hotspot/share/opto/addnode.cpp

Lines changed: 45 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -743,41 +743,47 @@ Node* OrINode::Identity(PhaseGVN* phase) {
743743
return AddNode::Identity(phase);
744744
}
745745

746-
Node *OrINode::Ideal(PhaseGVN *phase, bool can_reshape) {
746+
// Find shift value for Integer or Long OR.
747+
Node* rotate_shift(PhaseGVN* phase, Node* lshift, Node* rshift, int mask) {
748+
// val << norm_con_shift | val >> ({32|64} - norm_con_shift) => rotate_left val, norm_con_shift
749+
const TypeInt* lshift_t = phase->type(lshift)->isa_int();
750+
const TypeInt* rshift_t = phase->type(rshift)->isa_int();
751+
if (lshift_t != NULL && lshift_t->is_con() &&
752+
rshift_t != NULL && rshift_t->is_con() &&
753+
((lshift_t->get_con() & mask) == ((mask + 1) - (rshift_t->get_con() & mask)))) {
754+
return phase->intcon(lshift_t->get_con() & mask);
755+
}
756+
// val << var_shift | val >> ({0|32|64} - var_shift) => rotate_left val, var_shift
757+
if (rshift->Opcode() == Op_SubI && rshift->in(2) == lshift && rshift->in(1)->is_Con()){
758+
const TypeInt* shift_t = phase->type(rshift->in(1))->isa_int();
759+
if (shift_t != NULL && shift_t->is_con() &&
760+
(shift_t->get_con() == 0 || shift_t->get_con() == (mask + 1))) {
761+
return lshift;
762+
}
763+
}
764+
return NULL;
765+
}
766+
767+
Node* OrINode::Ideal(PhaseGVN* phase, bool can_reshape) {
747768
int lopcode = in(1)->Opcode();
748769
int ropcode = in(2)->Opcode();
749770
if (Matcher::match_rule_supported(Op_RotateLeft) &&
750771
lopcode == Op_LShiftI && ropcode == Op_URShiftI && in(1)->in(1) == in(2)->in(1)) {
751-
Node *lshift = in(1)->in(2);
752-
Node *rshift = in(2)->in(2);
753-
// val << norm_con_shift | val >> (32 - norm_con_shift) => rotate_left val , norm_con_shift
754-
if (lshift->is_Con() && rshift->is_Con() &&
755-
((lshift->get_int() & 0x1F) == (32 - (rshift->get_int() & 0x1F)))) {
756-
return new RotateLeftNode(in(1)->in(1),
757-
phase->intcon(lshift->get_int() & 0x1F), TypeInt::INT);
758-
}
759-
// val << var_shift | val >> (0/32 - var_shift) => rotate_left val , var_shift
760-
if (rshift->Opcode() == Op_SubI && rshift->in(2) == lshift &&
761-
rshift->in(1)->is_Con() &&
762-
(rshift->in(1)->get_int() == 0 || rshift->in(1)->get_int() == 32)) {
763-
return new RotateLeftNode(in(1)->in(1), lshift, TypeInt::INT);
772+
Node* lshift = in(1)->in(2);
773+
Node* rshift = in(2)->in(2);
774+
Node* shift = rotate_shift(phase, lshift, rshift, 0x1F);
775+
if (shift != NULL) {
776+
return new RotateLeftNode(in(1)->in(1), shift, TypeInt::INT);
764777
}
778+
return NULL;
765779
}
766780
if (Matcher::match_rule_supported(Op_RotateRight) &&
767781
lopcode == Op_URShiftI && ropcode == Op_LShiftI && in(1)->in(1) == in(2)->in(1)) {
768782
Node *rshift = in(1)->in(2);
769783
Node *lshift = in(2)->in(2);
770-
// val >> norm_con_shift | val << (32 - norm_con_shift) => rotate_right val , norm_con_shift
771-
if (rshift->is_Con() && lshift->is_Con() &&
772-
((rshift->get_int() & 0x1F) == (32 - (lshift->get_int() & 0x1F)))) {
773-
return new RotateRightNode(in(1)->in(1),
774-
phase->intcon(rshift->get_int() & 0x1F), TypeInt::INT);
775-
}
776-
// val >> var_shift | val << (0/32 - var_shift) => rotate_right val , var_shift
777-
if (lshift->Opcode() == Op_SubI && lshift->in(2) == rshift &&
778-
lshift->in(1)->is_Con() &&
779-
(lshift->in(1)->get_int() == 0 || lshift->in(1)->get_int() == 32)) {
780-
return new RotateRightNode(in(1)->in(1), rshift, TypeInt::INT);
784+
Node* shift = rotate_shift(phase, rshift, lshift, 0x1F);
785+
if (shift != NULL) {
786+
return new RotateRightNode(in(1)->in(1), shift, TypeInt::INT);
781787
}
782788
}
783789
return NULL;
@@ -824,42 +830,27 @@ Node* OrLNode::Identity(PhaseGVN* phase) {
824830
return AddNode::Identity(phase);
825831
}
826832

827-
Node *OrLNode::Ideal(PhaseGVN *phase, bool can_reshape) {
833+
Node* OrLNode::Ideal(PhaseGVN* phase, bool can_reshape) {
828834
int lopcode = in(1)->Opcode();
829835
int ropcode = in(2)->Opcode();
830836
if (Matcher::match_rule_supported(Op_RotateLeft) &&
831837
lopcode == Op_LShiftL && ropcode == Op_URShiftL && in(1)->in(1) == in(2)->in(1)) {
832-
Node *lshift = in(1)->in(2);
833-
Node *rshift = in(2)->in(2);
834-
// val << norm_con_shift | val >> (64 - norm_con_shift) => rotate_left val , norm_con_shift
835-
if (lshift->is_Con() && rshift->is_Con() &&
836-
((lshift->get_int() & 0x3F) == (64 - (rshift->get_int() & 0x3F)))) {
837-
return new RotateLeftNode(in(1)->in(1),
838-
phase->intcon(lshift->get_int() & 0x3F), TypeLong::LONG);
839-
}
840-
// val << var_shift | val >> (0/64 - var_shift) => rotate_left val , var_shift
841-
if (rshift->Opcode() == Op_SubI && rshift->in(2) == lshift &&
842-
rshift->in(1)->is_Con() &&
843-
(rshift->in(1)->get_int() == 0 || rshift->in(1)->get_int() == 64)) {
844-
return new RotateLeftNode(in(1)->in(1), lshift, TypeLong::LONG);
845-
}
838+
Node* lshift = in(1)->in(2);
839+
Node* rshift = in(2)->in(2);
840+
Node* shift = rotate_shift(phase, lshift, rshift, 0x3F);
841+
if (shift != NULL) {
842+
return new RotateLeftNode(in(1)->in(1), shift, TypeLong::LONG);
843+
}
844+
return NULL;
846845
}
847846
if (Matcher::match_rule_supported(Op_RotateRight) &&
848847
lopcode == Op_URShiftL && ropcode == Op_LShiftL && in(1)->in(1) == in(2)->in(1)) {
849-
Node *rshift = in(1)->in(2);
850-
Node *lshift = in(2)->in(2);
851-
// val >> norm_con_shift | val << (64 - norm_con_shift) => rotate_right val , norm_con_shift
852-
if (rshift->is_Con() && lshift->is_Con() &&
853-
((rshift->get_int() & 0x3F) == (64 - (lshift->get_int() & 0x3F)))) {
854-
return new RotateRightNode(in(1)->in(1),
855-
phase->intcon(rshift->get_int() & 0x3F), TypeLong::LONG);
856-
}
857-
// val >> var_shift | val << (0/64 - var_shift) => rotate_right val , var_shift
858-
if (lshift->Opcode() == Op_SubI && lshift->in(2) == rshift &&
859-
lshift->in(1)->is_Con() &&
860-
(lshift->in(1)->get_int() == 0 || lshift->in(1)->get_int() == 64)) {
861-
return new RotateRightNode(in(1)->in(1), rshift, TypeLong::LONG);
862-
}
848+
Node* rshift = in(1)->in(2);
849+
Node* lshift = in(2)->in(2);
850+
Node* shift = rotate_shift(phase, rshift, lshift, 0x3F);
851+
if (shift != NULL) {
852+
return new RotateRightNode(in(1)->in(1), shift, TypeLong::LONG);
853+
}
863854
}
864855
return NULL;
865856
}

0 commit comments

Comments
 (0)