4539N/A * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. 4539N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4539N/A * This code is free software; you can redistribute it and/or modify it 4539N/A * under the terms of the GNU General Public License version 2 only, as 4539N/A * published by the Free Software Foundation. Oracle designates this 4539N/A * particular file as subject to the "Classpath" exception as provided 4539N/A * by Oracle in the LICENSE file that accompanied this code. 4539N/A * This code is distributed in the hope that it will be useful, but WITHOUT 4539N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 4539N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 4539N/A * version 2 for more details (a copy is included in the LICENSE file that 4539N/A * You should have received a copy of the GNU General Public License version 4539N/A * 2 along with this work; if not, write to the Free Software Foundation, 4539N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 4539N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 4539N/A * or visit www.oracle.com if you need additional information or have any 4539N/A * The flavor of method handle which implements a constant reference 4539N/A // Constructors and factory methods in this class *must* be package scoped or private. 4539N/A // Check for corner case: invokeinterface of Object method 4539N/A //// Implementation methods. 4539N/A // If the member needs dispatching, do so. 4539N/A // If the member needs dispatching, do so. 4539N/A // Pre-dispatch the member. 4539N/A * Create a LF which can invoke the given method. 4539N/A * Cache and share this structure among all methods with 4539N/A * the same basicType and refKind. 4539N/A // precompute the barrier-free version: // names = { argx,y,z,... new C, init method } // This is a tricky bit of code. Don't send it through the LF interpreter. // Help along bootstrapping... /** Static wrapper for DirectMethodHandle.internalMemberName. */ /** Static wrapper for DirectMethodHandle.internalMemberName. * This one also forces initialization. // No need to initialize the class on this kind of member. // These guys have lots of <clinit> DMH creation but we know // the MHs will not be used until the system is booted. // It is a system class. It is probably in the process of // being initialized, but we will help it along just to be safe. // If the previous call didn't block, this can happen. // We are executing inside <clinit>. // The coast is clear. Delete the <clinit> barrier. return true;
// the final state // Somebody may still be running defc.<clinit>. // If anybody is running defc.<clinit>, it is this thread. // Yes, we are running it; keep the barrier for now. // We are in a random thread. Block. // put it into the final state /** This subclass handles constructor references. */ /** This subclass handles non-static field references. */ // Note: We return a long because that is what Unsafe.getObject likes. // We store a plain int because it is more compact. // Note that the object's class has already been verified, // since the parameter type of the Accessor method handle // is either member.getDeclaringClass or a subclass. // This was verified in DirectMethodHandle.make. // Therefore, the only remaining check is for null. // Since this check is *not* guaranteed by Unsafe.getInt // and its siblings, we need to make an explicit one here. /** This subclass handles static field references. */ // Caching machinery for field accessors: // Enumerate the different field kinds using Wrapper, // with an extra case added for checked references. * Create a LF which can access the given field. * Cache and share this structure among all fields with * the same basicType and refKind. // precompute the barrier-free version: // What is the external type of the lambda form? // if this is for non-static access, the base pointer is stored at this index: // if this is for write access, the value to be written is stored at this index: // Each nf must be statically invocable or we get tied up in our bootstraps.