Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Commit

Permalink
[GR-29173] Merge in tag 'jdk8u292-b05'.
Browse files Browse the repository at this point in the history
PullRequest: graal-jvmci-8/379
  • Loading branch information
marwan-hallaoui committed Mar 8, 2021
2 parents 234ae3d + 2e8b030 commit 393c7ca
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 44 deletions.
1 change: 1 addition & 0 deletions .hgtags
Original file line number Diff line number Diff line change
Expand Up @@ -1409,3 +1409,4 @@ d7c102fe9c4736bca65b25da69093d84da141e65 jdk8u292-b00
4fbe1b3f53bf38bbc326e9ec6714758c4abf0818 jdk8u292-b01
540c4d7153913e8ab6f65441d93941cc427b27bb jdk8u292-b02
306a4643e4d22f7558b4a725708cb39c82ac1cc1 jdk8u292-b03
16bc2fd11c4c62b01473221b1b6b892a63723e18 jdk8u292-b04
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -75,7 +75,7 @@ public double readDouble() {
int rl = readInt();
int h = reverseInt(rh);
int l = reverseInt(rl);
return Double.longBitsToDouble((h << 32) | ((long)l & 0x00000000FFFFFFFFL));
return Double.longBitsToDouble(((long)h << 32) | ((long)l & 0x00000000FFFFFFFFL));
}

public long readLong() {
Expand Down
4 changes: 2 additions & 2 deletions ci.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@
},

OpenJDK:: {
local jdk_version = "8u282",
local jdk_build = "03",
local jdk_version = "8u292",
local jdk_build = "05",

name+: "-openjdk",
downloads+: {
Expand Down
16 changes: 10 additions & 6 deletions src/cpu/aarch64/vm/aarch64.ad
Original file line number Diff line number Diff line change
Expand Up @@ -1824,16 +1824,20 @@ void BoxLockNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
int offset = ra_->reg2offset(in_RegMask(0).find_first_elem());
int reg = ra_->get_encode(this);

if (Assembler::operand_valid_for_add_sub_immediate(offset)) {
__ add(as_Register(reg), sp, offset);
} else {
ShouldNotReachHere();
}
// This add will handle any 24-bit signed offset. 24 bits allows an
// 8 megabyte stack frame.
__ add(as_Register(reg), sp, offset);
}

uint BoxLockNode::size(PhaseRegAlloc *ra_) const {
// BoxLockNode is not a MachNode, so we can't just call MachNode::size(ra_).
return 4;
int offset = ra_->reg2offset(in_RegMask(0).find_first_elem());

if (Assembler::operand_valid_for_add_sub_immediate(offset)) {
return NativeInstruction::instruction_size;
} else {
return 2 * NativeInstruction::instruction_size;
}
}

//=============================================================================
Expand Down
11 changes: 4 additions & 7 deletions src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2013, Red Hat Inc.
* Copyright (c) 2000, 2019, Oracle and/or its affiliates.
* Copyright (c) 2000, 2020, Oracle and/or its affiliates.
* All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -432,12 +432,9 @@ int LIR_Assembler::emit_unwind_handler() {
}

if (compilation()->env()->dtrace_method_probes()) {
__ call_Unimplemented();
#if 0
__ movptr(Address(rsp, 0), rax);
__ mov_metadata(Address(rsp, sizeof(void*)), method()->constant_encoding());
__ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit)));
#endif
__ mov(c_rarg0, rthread);
__ mov_metadata(c_rarg1, method()->constant_encoding());
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), c_rarg0, c_rarg1);
}

if (method()->is_synchronized() || compilation()->env()->dtrace_method_probes()) {
Expand Down
10 changes: 10 additions & 0 deletions src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1311,6 +1311,16 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
}
break;

case dtrace_object_alloc_id:
{ // c_rarg0: object
StubFrame f(sasm, "dtrace_object_alloc", dont_gc_arguments);
save_live_registers(sasm);

__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc), c_rarg0);

restore_live_registers(sasm);
}
break;

default:
{ StubFrame f(sasm, "unimplemented entry", dont_gc_arguments);
Expand Down
26 changes: 15 additions & 11 deletions src/cpu/aarch64/vm/vtableStubs_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {

__ lookup_virtual_method(r16, vtable_index, rmethod);

#ifndef PRODUCT
if (DebugVtables) {
Label L;
__ cbz(rmethod, L);
Expand All @@ -102,6 +103,8 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
__ stop("Vtable entry is NULL");
__ bind(L);
}
#endif // PRODUCT

// r0: receiver klass
// rmethod: Method*
// r2: receiver
Expand Down Expand Up @@ -130,6 +133,11 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
// returned by pd_code_size_limit!
const int code_length = VtableStub::pd_code_size_limit(false);
VtableStub* s = new(code_length) VtableStub(false, itable_index);
// Can be NULL if there is no free space in the code cache.
if (s == NULL) {
return NULL;
}

ResourceMark rm;
CodeBuffer cb(s->entry_point(), code_length);
MacroAssembler* masm = new MacroAssembler(&cb);
Expand All @@ -139,7 +147,7 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
__ lea(r10, ExternalAddress((address) SharedRuntime::nof_megamorphic_calls_addr()));
__ incrementw(Address(r10));
}
#endif
#endif // PRODUCT

// Entry arguments:
// rscratch2: CompiledICHolder
Expand Down Expand Up @@ -182,7 +190,7 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
// method (rmethod): Method*
// j_rarg0: receiver

#ifdef ASSERT
#ifndef PRODUCT
if (DebugVtables) {
Label L2;
__ cbz(rmethod, L2);
Expand All @@ -191,7 +199,7 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
__ stop("compiler entrypoint is null");
__ bind(L2);
}
#endif // ASSERT
#endif // PRODUCT

// rmethod: Method*
// j_rarg0: receiver
Expand All @@ -218,14 +226,10 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {


int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
int size = DebugVtables ? 216 : 0;
if (CountCompiledCalls)
size += 6 * 4;
// FIXME: vtable stubs only need 36 bytes
if (is_vtable_stub)
size += 52;
else
size += 176;
if (TraceJumps || DebugVtables || CountCompiledCalls || VerifyOops) {
return 1000;
}
int size = is_vtable_stub ? 60 : 192; // Plain + safety
return size;

// In order to tune these parameters, run the JVM with VM options
Expand Down
4 changes: 1 addition & 3 deletions src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ SurrogateLockerThread*
ConcurrentMarkThread::ConcurrentMarkThread(ConcurrentMark* cm) :
ConcurrentGCThread(),
_cm(cm),
_started(false),
_in_progress(false),
_state(Idle),
_vtime_accum(0.0),
_vtime_mark_accum(0.0) {
create_and_start();
Expand Down Expand Up @@ -341,7 +340,6 @@ void ConcurrentMarkThread::sleepBeforeNextCycle() {

if (started()) {
set_in_progress();
clear_started();
}
}

Expand Down
29 changes: 17 additions & 12 deletions src/share/vm/gc_implementation/g1/concurrentMarkThread.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,14 @@ class ConcurrentMarkThread: public ConcurrentGCThread {

private:
ConcurrentMark* _cm;
volatile bool _started;
volatile bool _in_progress;

enum State {
Idle,
Started,
InProgress
};

volatile State _state;

void sleepBeforeNextCycle();

Expand All @@ -71,23 +77,22 @@ class ConcurrentMarkThread: public ConcurrentGCThread {

ConcurrentMark* cm() { return _cm; }

void set_started() { assert(!_in_progress, "cycle in progress"); _started = true; }
void clear_started() { assert(_in_progress, "must be starting a cycle"); _started = false; }
bool started() { return _started; }

void set_in_progress() { assert(_started, "must be starting a cycle"); _in_progress = true; }
void clear_in_progress() { assert(!_started, "must not be starting a new cycle"); _in_progress = false; }
bool in_progress() { return _in_progress; }
void set_idle() { assert(_state != Started, "must not be starting a new cycle"); _state = Idle; }
bool idle() { return _state == Idle; }
void set_started() { assert(_state == Idle, "cycle in progress"); _state = Started; }
bool started() { return _state == Started; }
void set_in_progress() { assert(_state == Started, "must be starting a cycle"); _state = InProgress; }
bool in_progress() { return _state == InProgress; }

// This flag returns true from the moment a marking cycle is
// Returns true from the moment a marking cycle is
// initiated (during the initial-mark pause when started() is set)
// to the moment when the cycle completes (just after the next
// marking bitmap has been cleared and in_progress() is
// cleared). While this flag is true we will not start another cycle
// cleared). While during_cycle() is true we will not start another cycle
// so that cycles do not overlap. We cannot use just in_progress()
// as the CM thread might take some time to wake up before noticing
// that started() is set and set in_progress().
bool during_cycle() { return started() || in_progress(); }
bool during_cycle() { return !idle(); }

// shutdown
void stop();
Expand Down
2 changes: 1 addition & 1 deletion src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2413,7 +2413,7 @@ void G1CollectedHeap::increment_old_marking_cycles_completed(bool concurrent) {
// is set) so that if a waiter requests another System.gc() it doesn't
// incorrectly see that a marking cycle is still in progress.
if (concurrent) {
_cmThread->clear_in_progress();
_cmThread->set_idle();
}

// This notify_all() will ensure that a thread that called
Expand Down

0 comments on commit 393c7ca

Please sign in to comment.