Skip to content
Snippets Groups Projects
Commit b279b639 authored by Julien Lopez's avatar Julien Lopez
Browse files

Fix deprecated Truffle stuff

parent 4d25cd13
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,6 @@ import com.oracle.truffle.api.TruffleLanguage;
import qir.ast.QIRNode;
import qir.runtime.QIRContext;
import qir.util.QIRException;
/**
* QIR (Query Intermediate Language) is a language that aims to be able to encode any query from any
......@@ -19,16 +18,6 @@ public final class QIRLanguage extends TruffleLanguage<QIRContext> {
return new QIRContext(env);
}
@Override
protected Object findExportedSymbol(final QIRContext context, final String globalName, final boolean onlyExplicit) {
throw new QIRException("Unimplemented");
}
@Override
protected Object getLanguageGlobal(final QIRContext context) {
return context;
}
@Override
protected boolean isObjectOfLanguage(final Object object) {
return object instanceof QIRNode;
......
package qir.ast;
import com.oracle.truffle.api.dsl.ReportPolymorphism;
import com.oracle.truffle.api.dsl.TypeSystemReference;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.instrumentation.Instrumentable;
import com.oracle.truffle.api.instrumentation.GenerateWrapper;
import com.oracle.truffle.api.instrumentation.InstrumentableNode;
import com.oracle.truffle.api.instrumentation.ProbeNode;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.UnexpectedResultException;
import com.oracle.truffle.api.source.SourceSection;
......@@ -21,8 +24,9 @@ import qir.util.QIRException;
* A generic QIR node. Every QIR node must inherit from {@link QIRNode}.
*/
@TypeSystemReference(QIRTypes.class)
@Instrumentable(factory = QIRNodeWrapper.class)
public abstract class QIRNode extends Node {
@GenerateWrapper
@ReportPolymorphism
public abstract class QIRNode extends Node implements InstrumentableNode {
/**
* The location in the source code of the expression represented by this node.
*/
......@@ -42,6 +46,16 @@ public abstract class QIRNode extends Node {
return super.hashCode();
}
@Override
public WrapperNode createWrapper(ProbeNode probe) {
return new QIRNodeWrapper(sourceSection, this, probe);
}
@Override
public final boolean isInstrumentable() {
return sourceSection != null;
}
public abstract QIRNode executeGeneric(VirtualFrame frame);
public final QIRNumber executeNumber(VirtualFrame frame) throws UnexpectedResultException {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment