|
@@ -32,6 +32,7 @@ import org.elasticsearch.painless.MethodWriter;
|
|
|
import org.elasticsearch.painless.ScriptClassInfo;
|
|
import org.elasticsearch.painless.ScriptClassInfo;
|
|
|
import org.elasticsearch.painless.SimpleChecksAdapter;
|
|
import org.elasticsearch.painless.SimpleChecksAdapter;
|
|
|
import org.elasticsearch.painless.WriterConstants;
|
|
import org.elasticsearch.painless.WriterConstants;
|
|
|
|
|
+import org.elasticsearch.painless.node.SFunction.FunctionReserved;
|
|
|
import org.objectweb.asm.ClassVisitor;
|
|
import org.objectweb.asm.ClassVisitor;
|
|
|
import org.objectweb.asm.ClassWriter;
|
|
import org.objectweb.asm.ClassWriter;
|
|
|
import org.objectweb.asm.Label;
|
|
import org.objectweb.asm.Label;
|
|
@@ -89,6 +90,8 @@ public final class SSource extends AStatement {
|
|
|
*/
|
|
*/
|
|
|
public interface Reserved {
|
|
public interface Reserved {
|
|
|
void markUsedVariable(String name);
|
|
void markUsedVariable(String name);
|
|
|
|
|
+ Set<String> getUsedVariables();
|
|
|
|
|
+ void addUsedVariables(FunctionReserved reserved);
|
|
|
|
|
|
|
|
void setMaxLoopCounter(int max);
|
|
void setMaxLoopCounter(int max);
|
|
|
int getMaxLoopCounter();
|
|
int getMaxLoopCounter();
|
|
@@ -103,6 +106,16 @@ public final class SSource extends AStatement {
|
|
|
usedVariables.add(name);
|
|
usedVariables.add(name);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Set<String> getUsedVariables() {
|
|
|
|
|
+ return unmodifiableSet(usedVariables);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void addUsedVariables(FunctionReserved reserved) {
|
|
|
|
|
+ usedVariables.addAll(reserved.getUsedVariables());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void setMaxLoopCounter(int max) {
|
|
public void setMaxLoopCounter(int max) {
|
|
|
maxLoopCounter = max;
|
|
maxLoopCounter = max;
|
|
@@ -112,10 +125,6 @@ public final class SSource extends AStatement {
|
|
|
public int getMaxLoopCounter() {
|
|
public int getMaxLoopCounter() {
|
|
|
return maxLoopCounter;
|
|
return maxLoopCounter;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- public Set<String> getUsedVariables() {
|
|
|
|
|
- return unmodifiableSet(usedVariables);
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private final ScriptClassInfo scriptClassInfo;
|
|
private final ScriptClassInfo scriptClassInfo;
|