com.sun.squawk.pragma
Class AllowInlinedPragma
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.sun.squawk.pragma.PragmaException
com.sun.squawk.pragma.AllowInlinedPragma
- Direct Known Subclasses:
- ForceInlinedPragma
public class AllowInlinedPragma
- extends PragmaException
Allow a method declared to throw this exception to be inlined. This is like ForceInlinedPragma,
except that if an AllowInlinedPragma method is too large to inline, it won't be. This is good for
debug code that is conditionally compiled.
For a virtual method, this allows inlining EVEN IF THE RECEIVER MIGHT BE NULL.
For example:
void foo() { return; }
void bar(Foo aFoo) { aFoo.foo(); }
Normal inlining rules prohibit inlining foo() into bar, because it eliminates the implicit null check that invokevirtual does.
But if foo() is declared to throw AllowInlinedPragma, then it may be inlined Method size limits may still prevent the method from being inlined.
For a static method, this allows inlining EVEN IF THE CLASS HAS A STATIC INITIALIZER.
Inlining will skip calling the static initializer. Any getstatic, putstatic, or invokestatic bytecodes within the inlined method will still
cause the static initializer to be called if needed.
- See Also:
NativePragma
,
ForceInlinedPragma
"For updated information see the Java FRC site"