mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
Merge
This commit is contained in:
commit
f4f859b446
111 changed files with 2694 additions and 1212 deletions
|
@ -664,7 +664,7 @@ public final class String
|
|||
* object.
|
||||
*/
|
||||
public int length() {
|
||||
return isLatin1() ? value.length : value.length >> UTF16;
|
||||
return value.length >> coder();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -709,6 +709,13 @@ public final class AccessController {
|
|||
return context;
|
||||
}
|
||||
|
||||
/**
|
||||
* The value needs to be physically located in the frame, so that it
|
||||
* can be found by a stack walk.
|
||||
*/
|
||||
@Hidden
|
||||
private static native void ensureMaterializedForStackWalk(Object o);
|
||||
|
||||
/**
|
||||
* Sanity check that the caller context is indeed privileged.
|
||||
*
|
||||
|
@ -734,6 +741,11 @@ public final class AccessController {
|
|||
AccessControlContext context,
|
||||
Class<?> caller)
|
||||
{
|
||||
// Ensure context has a physical value in the frame
|
||||
if (context != null) {
|
||||
ensureMaterializedForStackWalk(context);
|
||||
}
|
||||
|
||||
assert isPrivileged(); // sanity check invariant
|
||||
T result = action.run();
|
||||
assert isPrivileged(); // sanity check invariant
|
||||
|
@ -742,7 +754,6 @@ public final class AccessController {
|
|||
// retrieved by getStackAccessControlContext().
|
||||
Reference.reachabilityFence(context);
|
||||
Reference.reachabilityFence(caller);
|
||||
Reference.reachabilityFence(action);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -761,6 +772,11 @@ public final class AccessController {
|
|||
Class<?> caller)
|
||||
throws Exception
|
||||
{
|
||||
// Ensure context has a physical value in the frame
|
||||
if (context != null) {
|
||||
ensureMaterializedForStackWalk(context);
|
||||
}
|
||||
|
||||
assert isPrivileged(); // sanity check invariant
|
||||
T result = action.run();
|
||||
assert isPrivileged(); // sanity check invariant
|
||||
|
@ -769,7 +785,6 @@ public final class AccessController {
|
|||
// retrieved by getStackAccessControlContext().
|
||||
Reference.reachabilityFence(context);
|
||||
Reference.reachabilityFence(caller);
|
||||
Reference.reachabilityFence(action);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue