mirror of
https://github.com/enso-org/enso.git
synced 2024-12-22 20:31:45 +03:00
Simplify IGV graph by trimming nodes for code paths that rarely happen (#11381)
Simplifies the IGV graph by removing nodes that shouldn't be there during "normal" execution.
This commit is contained in:
parent
4f556f2882
commit
c460342f74
@ -1,6 +1,7 @@
|
||||
package org.enso.interpreter.node.callable.dispatch;
|
||||
|
||||
import com.oracle.truffle.api.CompilerAsserts;
|
||||
import com.oracle.truffle.api.CompilerDirectives;
|
||||
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
|
||||
import com.oracle.truffle.api.TruffleFile;
|
||||
import com.oracle.truffle.api.dsl.Cached;
|
||||
@ -119,6 +120,7 @@ public abstract class InvokeFunctionNode extends BaseNode {
|
||||
if (!isPrivateCheckDisabled
|
||||
&& functionSchema.isProjectPrivate()
|
||||
&& !isInSameProject(function)) {
|
||||
CompilerDirectives.transferToInterpreter();
|
||||
throw makePrivateAccessPanic(function);
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package org.enso.interpreter.runtime.data.atom;
|
||||
import com.oracle.truffle.api.dsl.NodeFactory;
|
||||
import com.oracle.truffle.api.exception.AbstractTruffleException;
|
||||
import com.oracle.truffle.api.nodes.Node;
|
||||
import com.oracle.truffle.api.profiles.BranchProfile;
|
||||
import java.util.List;
|
||||
import org.enso.interpreter.node.callable.InvokeCallableNode;
|
||||
import org.enso.interpreter.node.callable.argument.ReadArgumentCheckNode;
|
||||
@ -20,6 +21,7 @@ import org.enso.interpreter.runtime.error.DataflowError;
|
||||
final class SuspendedFieldGetterNode extends UnboxingAtom.FieldGetterNode {
|
||||
@Node.Child private UnboxingAtom.FieldSetterNode set;
|
||||
@Node.Child private UnboxingAtom.FieldGetterNode get;
|
||||
private final BranchProfile exceptionalState = BranchProfile.create();
|
||||
|
||||
@Node.Child
|
||||
private InvokeFunctionNode invoke =
|
||||
@ -97,15 +99,17 @@ final class SuspendedFieldGetterNode extends UnboxingAtom.FieldGetterNode {
|
||||
set.execute(atom, newValue);
|
||||
return newValue;
|
||||
} catch (AbstractTruffleException ex) {
|
||||
exceptionalState.enter();
|
||||
var rethrow = DataflowError.withTrace(ex, ex);
|
||||
set.execute(atom, rethrow);
|
||||
throw ex;
|
||||
}
|
||||
} else if (value instanceof DataflowError suspended
|
||||
&& suspended.getPayload() instanceof AbstractTruffleException ex) {
|
||||
} else if (value instanceof DataflowError suspended) {
|
||||
exceptionalState.enter();
|
||||
if (suspended.getPayload() instanceof AbstractTruffleException ex) {
|
||||
throw ex;
|
||||
} else {
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -511,8 +511,16 @@ public final class ModuleScope implements EnsoObject {
|
||||
* currently registered entities
|
||||
*/
|
||||
public ModuleScope asModuleScope() {
|
||||
if (moduleScope != null) return moduleScope;
|
||||
else
|
||||
if (moduleScope != null) {
|
||||
return moduleScope;
|
||||
} else {
|
||||
CompilerDirectives.transferToInterpreterAndInvalidate();
|
||||
return createModuleScope();
|
||||
}
|
||||
}
|
||||
|
||||
@CompilerDirectives.TruffleBoundary
|
||||
private ModuleScope createModuleScope() {
|
||||
return new ModuleScope(
|
||||
module,
|
||||
associatedType,
|
||||
|
Loading…
Reference in New Issue
Block a user