8182487: Add Unsafe.objectFieldOffset(Class, String)

Reviewed-by: dsimms, twisti, bchristi, mgerdin, chegar, psandoz
This commit is contained in:
Claes Redestad 2017-06-22 15:53:24 +02:00
parent f72f966df1
commit 928ca49c21
21 changed files with 130 additions and 270 deletions

View file

@ -276,11 +276,9 @@ public class CallSite {
if (offset > 0) {
return offset;
}
try {
offset = TARGET_OFFSET = UNSAFE.objectFieldOffset(CallSite.class.getDeclaredField("target"));
assert(offset > 0);
return offset;
} catch (Exception ex) { throw newInternalError(ex); }
offset = TARGET_OFFSET = UNSAFE.objectFieldOffset(CallSite.class, "target");
assert(offset > 0);
return offset;
}
/*package-private*/