< prev index next >
jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2008, 2013, 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. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2008, 2015, 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. Oracle designates this
*** 53,97 ****
static native long objectFieldOffset(MemberName self); // e.g., returns vmindex
static native long staticFieldOffset(MemberName self); // e.g., returns vmindex
static native Object staticFieldBase(MemberName self); // e.g., returns clazz
static native Object getMemberVMInfo(MemberName self); // returns {vmindex,vmtarget}
- /// MethodHandle support
-
- /** Fetch MH-related JVM parameter.
- * which=0 retrieves MethodHandlePushLimit
- * which=1 retrieves stack slot push size (in address units)
- */
- static native int getConstant(int which);
-
- static final boolean COUNT_GWT;
-
/// CallSite support
/** Tell the JVM that we need to change the target of a CallSite. */
static native void setCallSiteTargetNormal(CallSite site, MethodHandle target);
static native void setCallSiteTargetVolatile(CallSite site, MethodHandle target);
private static native void registerNatives();
static {
registerNatives();
- COUNT_GWT = getConstant(Constants.GC_COUNT_GWT) != 0;
// The JVM calls MethodHandleNatives.<clinit>. Cascade the <clinit> calls as needed:
MethodHandleImpl.initStatics();
}
! // All compile-time constants go here.
! // There is an opportunity to check them against the JVM's idea of them.
static class Constants {
Constants() { } // static only
- // MethodHandleImpl
- static final int // for getConstant
- GC_COUNT_GWT = 4,
- GC_LAMBDA_SUPPORT = 5;
! // MemberName
// The JVM uses values of -2 and above for vtable indexes.
// Field values are simple positive offsets.
// Ref: src/share/vm/oops/methodOop.hpp
// This value is negative enough to avoid such numbers,
// but not too negative.
--- 53,85 ----
static native long objectFieldOffset(MemberName self); // e.g., returns vmindex
static native long staticFieldOffset(MemberName self); // e.g., returns vmindex
static native Object staticFieldBase(MemberName self); // e.g., returns clazz
static native Object getMemberVMInfo(MemberName self); // returns {vmindex,vmtarget}
/// CallSite support
/** Tell the JVM that we need to change the target of a CallSite. */
static native void setCallSiteTargetNormal(CallSite site, MethodHandle target);
static native void setCallSiteTargetVolatile(CallSite site, MethodHandle target);
private static native void registerNatives();
static {
registerNatives();
// The JVM calls MethodHandleNatives.<clinit>. Cascade the <clinit> calls as needed:
MethodHandleImpl.initStatics();
}
! /**
! * Compile-time constants go here. This collection exists not only for
! * reference from clients, but also for ensuring the VM and JDK agree on the
! * values of these constants (see {@link #verifyConstants()}).
! */
static class Constants {
Constants() { } // static only
!
// The JVM uses values of -2 and above for vtable indexes.
// Field values are simple positive offsets.
// Ref: src/share/vm/oops/methodOop.hpp
// This value is negative enough to avoid such numbers,
// but not too negative.
< prev index next >