Mercurial > hg > truffle
changeset 16432:78cbe3d93bc1
truffle compiler: be a bit more aggressive on cutting exceptions/errors
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Wed, 09 Jul 2014 09:31:21 +0200 |
parents | 99fa6bd5d27b |
children | 3691fe88967e |
files | graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCacheImpl.java |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCacheImpl.java Wed Jul 09 09:28:08 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCacheImpl.java Wed Jul 09 09:31:21 2014 +0200 @@ -67,7 +67,7 @@ private final ResolvedJavaType stringBuilderClass; private final ResolvedJavaType runtimeExceptionClass; - private final ResolvedJavaType assertionErrorClass; + private final ResolvedJavaType errorClass; private final ResolvedJavaType controlFlowExceptionClass; private final ResolvedJavaMethod callBoundaryMethod; @@ -81,7 +81,7 @@ this.stringBuilderClass = providers.getMetaAccess().lookupJavaType(StringBuilder.class); this.runtimeExceptionClass = providers.getMetaAccess().lookupJavaType(RuntimeException.class); - this.assertionErrorClass = providers.getMetaAccess().lookupJavaType(AssertionError.class); + this.errorClass = providers.getMetaAccess().lookupJavaType(Error.class); this.controlFlowExceptionClass = providers.getMetaAccess().lookupJavaType(ControlFlowException.class); try { @@ -192,7 +192,7 @@ if (macroSubstitution != null) { InliningUtil.inlineMacroNode(methodCallTargetNode.invoke(), methodCallTargetNode.targetMethod(), macroSubstitution); } else { - tryCutOffRuntimeExceptions(methodCallTargetNode); + tryCutOffRuntimeExceptionsAndErrors(methodCallTargetNode); } } } @@ -257,12 +257,12 @@ InliningUtil.inline(invoke, inlineGraph, true, null); } - private boolean tryCutOffRuntimeExceptions(MethodCallTargetNode methodCallTargetNode) { + private boolean tryCutOffRuntimeExceptionsAndErrors(MethodCallTargetNode methodCallTargetNode) { if (methodCallTargetNode.targetMethod().isConstructor()) { ResolvedJavaType declaringClass = methodCallTargetNode.targetMethod().getDeclaringClass(); ResolvedJavaType exceptionType = Objects.requireNonNull(StampTool.typeOrNull(methodCallTargetNode.receiver().stamp())); - boolean removeAllocation = runtimeExceptionClass.isAssignableFrom(declaringClass) || assertionErrorClass.isAssignableFrom(declaringClass); + boolean removeAllocation = runtimeExceptionClass.isAssignableFrom(declaringClass) || errorClass.isAssignableFrom(declaringClass); boolean isControlFlowException = controlFlowExceptionClass.isAssignableFrom(exceptionType); if (removeAllocation && !isControlFlowException) { DeoptimizeNode deoptNode = methodCallTargetNode.graph().add(new DeoptimizeNode(DeoptimizationAction.InvalidateRecompile, DeoptimizationReason.UnreachedCode));