-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Backport] 8291555: Implement alternative fast-locking scheme
Summary: Implement new fast-locking with option UseAltFastLocking, also according to JDK-8308107 Test Plan: CICD Reviewed-by: kuaiwei, yulei, ddh Issue: #679
- Loading branch information
Showing
44 changed files
with
1,948 additions
and
548 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Copyright (c) 2020, 2022 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 | ||
* under the terms of the GNU General Public License version 2 only, as | ||
* published by the Free Software Foundation. | ||
* | ||
* This code is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* version 2 for more details (a copy is included in the LICENSE file that | ||
* accompanied this code). | ||
* | ||
* You should have received a copy of the GNU General Public License version | ||
* 2 along with this work; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
* | ||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
* or visit www.oracle.com if you need additional information or have any | ||
* questions. | ||
* | ||
*/ | ||
|
||
#include "precompiled.hpp" | ||
#include "opto/c2_MacroAssembler.hpp" | ||
#include "opto/c2_CodeStubs.hpp" | ||
#include "runtime/objectMonitor.hpp" | ||
#include "runtime/sharedRuntime.hpp" | ||
#include "runtime/stubRoutines.hpp" | ||
|
||
#define __ masm. | ||
|
||
int C2HandleAnonOMOwnerStub::max_size() const { | ||
// Max size of stub has been determined by testing with 0, in which case | ||
// C2CodeStubList::emit() will throw an assertion and report the actual size that | ||
// is needed. | ||
return 24; | ||
} | ||
|
||
void C2HandleAnonOMOwnerStub::emit(C2_MacroAssembler& masm) { | ||
__ bind(entry()); | ||
Register mon = monitor(); | ||
Register t = tmp(); | ||
assert(t != noreg, "need tmp register"); | ||
|
||
// Fix owner to be the current thread. | ||
__ str(rthread, Address(mon, ObjectMonitor::owner_offset_in_bytes())); | ||
|
||
// Pop owner object from lock-stack. | ||
__ ldrw(t, Address(rthread, JavaThread::lock_stack_top_offset())); | ||
__ subw(t, t, oopSize); | ||
#ifdef ASSERT | ||
__ str(zr, Address(rthread, t)); | ||
#endif | ||
__ strw(t, Address(rthread, JavaThread::lock_stack_top_offset())); | ||
|
||
__ b(continuation()); | ||
} | ||
|
||
#undef __ |
Oops, something went wrong.