Permalink
Show file tree
Hide file tree
3 comments
on commit
sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
8261075: Create stubRoutines.inline.hpp with SafeFetch implementation
Reviewed-by: dcubed, stuefe, stefank
- Loading branch information
1 parent
d195033
commit b955f85e03bafe8ce39677d0af06bf1ceb7e2cbb
Showing
11 changed files
with
65 additions
and
33 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
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
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,51 @@ | ||
/* | ||
* Copyright (c) 1997, 2021, 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. | ||
* | ||
*/ | ||
|
||
#ifndef SHARE_RUNTIME_SAFEFETCH_HPP | ||
#define SHARE_RUNTIME_SAFEFETCH_HPP | ||
|
||
#include "runtime/stubRoutines.hpp" | ||
|
||
// Safefetch allows to load a value from a location that's not known | ||
// to be valid. If the load causes a fault, the error value is returned. | ||
inline int SafeFetch32(int* adr, int errValue) { | ||
assert(StubRoutines::SafeFetch32_stub(), "stub not yet generated"); | ||
return StubRoutines::SafeFetch32_stub()(adr, errValue); | ||
} | ||
|
||
inline intptr_t SafeFetchN(intptr_t* adr, intptr_t errValue) { | ||
assert(StubRoutines::SafeFetchN_stub(), "stub not yet generated"); | ||
return StubRoutines::SafeFetchN_stub()(adr, errValue); | ||
} | ||
|
||
// returns true if SafeFetch32 and SafeFetchN can be used safely (stubroutines are already generated) | ||
inline bool CanUseSafeFetch32() { | ||
return StubRoutines::SafeFetch32_stub() ? true : false; | ||
} | ||
|
||
inline bool CanUseSafeFetchN() { | ||
return StubRoutines::SafeFetchN_stub() ? true : false; | ||
} | ||
|
||
#endif // SHARE_RUNTIME_SAFEFETCH_HPP |
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
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
b955f85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review
Issues
b955f85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/backport jdk11u-dev
b955f85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VladimirKempik Could not automatically backport
b955f85e
to Optional[openjdk/jdk11u-dev] due to conflicts in the following files:To manually resolve these conflicts run the following commands in your personal fork of Optional[openjdk/jdk11u-dev]:
Once you have resolved the conflicts as explained above continue with creating a pull request towards the Optional[openjdk/jdk11u-dev] with the title
Backport b955f85e03bafe8ce39677d0af06bf1ceb7e2cbb
.