Mercurial > hg > truffle
changeset 18802:71e372cae32e
Truffle-DSL: increase maximum number of acceptAndExecute arguments to 5.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Fri, 09 Jan 2015 16:00:23 +0100 |
parents | 95249d5e794f |
children | 65234356d0c5 |
files | graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/internal/SpecializationNode.java |
diffstat | 1 files changed, 28 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/internal/SpecializationNode.java Thu Jan 08 17:59:19 2015 -0800 +++ b/graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/internal/SpecializationNode.java Fri Jan 09 16:00:23 2015 +0100 @@ -195,6 +195,10 @@ throw new UnsupportedOperationException(); } + public Object acceptAndExecute(Frame frame, Object o1, Object o2, Object o3, Object o4, Object o5) { + throw new UnsupportedOperationException(); + } + public Object acceptAndExecute(Frame frame, Object... args) { throw new UnsupportedOperationException(); } @@ -227,6 +231,10 @@ throw new UnsupportedOperationException(); } + protected SpecializationNode createNext(Frame frame, Object o1, Object o2, Object o3, Object o4, Object o5) { + throw new UnsupportedOperationException(); + } + protected SpecializationNode createNext(Frame frame, Object... args) { throw new UnsupportedOperationException(); } @@ -291,6 +299,18 @@ return insertSpecialization(nextSpecialization, new RewriteEvent4(findParentNode(), "inserts new specialization", o1, o2, o3, o4)).acceptAndExecute(frame, o1, o2, o3, o4); } + protected final Object uninitialized(Frame frame, Object o1, Object o2, Object o3, Object o4, Object o5) { + CompilerDirectives.transferToInterpreterAndInvalidate(); + SpecializationNode nextSpecialization = createNext(frame, o1, o2, o3, o4, o5); + if (nextSpecialization == null) { + nextSpecialization = createFallback(); + } + if (nextSpecialization == null) { + unsupported(frame, o1, o2, o3, o4, o5); + } + return insertSpecialization(nextSpecialization, new RewriteEventN(findParentNode(), "inserts new specialization", o1, o2, o3, o4, o5)).acceptAndExecute(frame, o1, o2, o3, o4, o5); + } + protected final Object uninitialized(Frame frame, Object... args) { CompilerDirectives.transferToInterpreterAndInvalidate(); SpecializationNode nextSpecialization = createNext(frame, args); @@ -327,6 +347,10 @@ return removeSame(new RewriteEvent4(findParentNode(), reason, o1, o2, o3, o4)).acceptAndExecute(frame, o1, o2, o3, o4); } + protected final Object remove(String reason, Frame frame, Object o1, Object o2, Object o3, Object o4, Object o5) { + return removeSame(new RewriteEventN(findParentNode(), reason, o1, o2, o3, o4, o5)).acceptAndExecute(frame, o1, o2, o3, o4, o5); + } + protected final Object remove(String reason, Frame frame, Object... args) { return removeSame(new RewriteEventN(findParentNode(), reason, args)).acceptAndExecute(frame, args); } @@ -351,6 +375,10 @@ throw new UnsupportedSpecializationException(findParentNode(), getSuppliedChildren(), o1, o2, o3, o4); } + protected Object unsupported(Frame frame, Object o1, Object o2, Object o3, Object o4, Object o5) { + throw new UnsupportedSpecializationException(findParentNode(), getSuppliedChildren(), o1, o2, o3, o4, o5); + } + protected Object unsupported(Frame frame, Object... args) { throw new UnsupportedSpecializationException(findParentNode(), getSuppliedChildren(), args); }