Mercurial > hg > graal-compiler
changeset 14068:73f5ddd8414d
clean up snippet-related assertion in GraphBuilderPhase
author | Lukas Stadler <lukas.stadler@oracle.com> |
---|---|
date | Wed, 05 Mar 2014 17:53:38 +0100 |
parents | 655a4fd5038b |
children | 2f37b0e442fe |
files | graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Wed Mar 05 14:01:21 2014 +0100 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Wed Mar 05 17:53:38 2014 +0100 @@ -820,10 +820,12 @@ eagerResolvingForSnippets(cpi, opcode); JavaMethod result = constantPool.lookupMethod(cpi, opcode); /* - * assert !graphBuilderConfig.unresolvedIsError() || ((result instanceof - * ResolvedJavaMethod) && ((ResolvedJavaMethod) - * result).getDeclaringClass().isInitialized()) : result; + * In general, one cannot assume that the declaring class being initialized is useful, + * since the actual concrete receiver may be a different class (except for static + * calls). Also, interfaces are initialized only under special circumstances, so that + * this assertion would often fail for interface calls. */ + assert !graphBuilderConfig.unresolvedIsError() || (result instanceof ResolvedJavaMethod && (opcode != INVOKESTATIC || ((ResolvedJavaMethod) result).getDeclaringClass().isInitialized())); return result; }