1.1 --- a/src/share/vm/utilities/accessFlags.hpp Wed Apr 08 00:12:59 2009 -0700 1.2 +++ b/src/share/vm/utilities/accessFlags.hpp Wed Apr 08 10:56:49 2009 -0700 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. 1.6 + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -47,6 +47,8 @@ 1.11 JVM_ACC_IS_OLD = 0x00010000, // RedefineClasses() has replaced this method 1.12 JVM_ACC_IS_OBSOLETE = 0x00020000, // RedefineClasses() has made method obsolete 1.13 JVM_ACC_IS_PREFIXED_NATIVE = 0x00040000, // JVMTI has prefixed this native method 1.14 + JVM_MH_INVOKE_BITS // = 0x10001100 // MethodHandle.invoke quasi-native 1.15 + = (JVM_ACC_NATIVE | JVM_ACC_SYNTHETIC | JVM_ACC_MONITOR_MATCH), 1.16 1.17 // klassOop flags 1.18 JVM_ACC_HAS_MIRANDA_METHODS = 0x10000000, // True if this class has miranda methods in it's vtable 1.19 @@ -72,6 +74,7 @@ 1.20 1.21 // flags accepted by set_field_flags() 1.22 JVM_ACC_FIELD_FLAGS = 0x00008000 | JVM_ACC_WRITTEN_FLAGS 1.23 + 1.24 }; 1.25 1.26 1.27 @@ -114,6 +117,15 @@ 1.28 bool is_obsolete () const { return (_flags & JVM_ACC_IS_OBSOLETE ) != 0; } 1.29 bool is_prefixed_native () const { return (_flags & JVM_ACC_IS_PREFIXED_NATIVE ) != 0; } 1.30 1.31 + // JSR 292: A method of the form MethodHandle.invoke(A...)R method is 1.32 + // neither bytecoded nor a JNI native, but rather a fast call through 1.33 + // a lightweight method handle object. Because it is not bytecoded, 1.34 + // it has the native bit set, but the monitor-match bit is also set 1.35 + // to distinguish it from a JNI native (which never has the match bit set). 1.36 + // The synthetic bit is also present, because such a method is never 1.37 + // explicitly defined in Java code. 1.38 + bool is_method_handle_invoke () const { return (_flags & JVM_MH_INVOKE_BITS) == JVM_MH_INVOKE_BITS; } 1.39 + 1.40 // klassOop flags 1.41 bool has_miranda_methods () const { return (_flags & JVM_ACC_HAS_MIRANDA_METHODS ) != 0; } 1.42 bool has_vanilla_constructor () const { return (_flags & JVM_ACC_HAS_VANILLA_CONSTRUCTOR) != 0; } 1.43 @@ -199,6 +211,14 @@ 1.44 jshort as_short() { return (jshort)_flags; } 1.45 jint as_int() { return _flags; } 1.46 1.47 + inline friend AccessFlags accessFlags_from(jint flags); 1.48 + 1.49 // Printing/debugging 1.50 void print_on(outputStream* st) const PRODUCT_RETURN; 1.51 }; 1.52 + 1.53 +inline AccessFlags accessFlags_from(jint flags) { 1.54 + AccessFlags af; 1.55 + af._flags = flags; 1.56 + return af; 1.57 +}