assert ssjavaLoopEntrance != null;
- System.out.println("ssjavaLoopEntrance=" + ssjavaLoopEntrance);
-
// assume that ssjava loop is top-level loop in method, not nested loop
Set nestedLoop = loopFinder.nestedLoops();
for (Iterator loopIter = nestedLoop.iterator(); loopIter.hasNext();) {
LoopFinder lf = (LoopFinder) loopIter.next();
- System.out.println("lf=" + lf.loopEntrances());
- System.out.println("elements=" + lf.loopIncElements());
if (lf.loopEntrances().iterator().next().equals(ssjavaLoopEntrance)) {
ssjavaLoop = lf;
}
TypeDescriptor td = rhs.getType().dereference();
fld = getArrayField(td);
}
-
- if(fld.isFinal() && fld.isStatic()){
- // if field is final and static, no need to check
+
+ if (fld.isFinal() /* && fld.isStatic() */) {
+ // if field is final and static, no need to check
break;
}
case FKind.FlatCall: {
FlatCall fc = (FlatCall) fn;
bindHeapPathCallerArgWithCaleeParam(fc);
-
// add <hp,statement,false> in which hp is an element of
// READ_bound set
// of callee: callee has 'read' requirement!
(LinkedList<MethodDescriptor>) sortedDescriptors.clone();
// no need to analyze method having ssjava loop
- methodContainingSSJavaLoop = descriptorListToAnalyze.removeFirst();
+ // methodContainingSSJavaLoop = descriptorListToAnalyze.removeFirst();
+ methodContainingSSJavaLoop = ssjava.getMethodContainingSSJavaLoop();
// current descriptors to visit in fixed-point interprocedural analysis,
// prioritized by
TypeDescriptor td = rhs.getType().dereference();
fld = getArrayField(td);
}
-
- if(fld.isFinal() && fld.isStatic()){
- // if field is final and static, no need to check
+
+ if (fld.isFinal() /* && fld.isStatic() */) {
+ // if field is final and static, no need to check
break;
}
FlatCall fc = (FlatCall) fn;
- bindHeapPathCallerArgWithCaleeParam(fc);
+ if (fc.getThis() != null) {
+ bindHeapPathCallerArgWithCaleeParam(fc);
- // add heap path, which is an element of READ_bound set and is not
- // an
- // element of WT set, to the caller's READ set
- for (Iterator iterator = calleeUnionBoundReadSet.iterator(); iterator.hasNext();) {
- NTuple<Descriptor> read = (NTuple<Descriptor>) iterator.next();
- if (!writtenSet.contains(read)) {
- readSet.add(read);
+ // add heap path, which is an element of READ_bound set and is not
+ // an
+ // element of WT set, to the caller's READ set
+ for (Iterator iterator = calleeUnionBoundReadSet.iterator(); iterator.hasNext();) {
+ NTuple<Descriptor> read = (NTuple<Descriptor>) iterator.next();
+ if (!writtenSet.contains(read)) {
+ readSet.add(read);
+ }
}
- }
- writtenSet.removeAll(calleeUnionBoundReadSet);
+ writtenSet.removeAll(calleeUnionBoundReadSet);
- // add heap path, which is an element of OVERWRITE_bound set, to the
- // caller's WT set
- for (Iterator iterator = calleeIntersectBoundOverWriteSet.iterator(); iterator.hasNext();) {
- NTuple<Descriptor> write = (NTuple<Descriptor>) iterator.next();
- writtenSet.add(write);
+ // add heap path, which is an element of OVERWRITE_bound set, to the
+ // caller's WT set
+ for (Iterator iterator = calleeIntersectBoundOverWriteSet.iterator(); iterator.hasNext();) {
+ NTuple<Descriptor> write = (NTuple<Descriptor>) iterator.next();
+ writtenSet.add(write);
+ }
}
}
// the set of method descriptors annotated as "TRUST"
Set<MethodDescriptor> trustWorthyMDSet;
+ // points to method containing SSJAVA Loop
+ private MethodDescriptor methodContainingSSJavaLoop;
+
CallGraph callgraph;
LinearTypeCheck checker;
// if (state.SSJAVADEBUG) {
// debugPrint();
// }
- // parseLocationAnnotation();
+ parseLocationAnnotation();
// doFlowDownCheck();
- // doDefinitelyWrittenCheck();
- debugDoLoopCheck();
+ doDefinitelyWrittenCheck();
+ // debugDoLoopCheck();
}
private void debugDoLoopCheck() {
return bf;
}
+ public MethodDescriptor getMethodContainingSSJavaLoop() {
+ return methodContainingSSJavaLoop;
+ }
+
+ public void setMethodContainingSSJavaLoop(MethodDescriptor methodContainingSSJavaLoop) {
+ this.methodContainingSSJavaLoop = methodContainingSSJavaLoop;
+ }
}
// @LOC("SBT") private temporaire2[] III_scalefac_t;
@LOC("SF2")
- private temporaire2[] scalefac;
+ private final temporaire2[] scalefac;
// private III_scalefac_t scalefac;
@LOC("CH0")
private int frame_start;
// @LOC("SI1") private int part2_start;
@LOC("CH0")
- private int channels;
+ private final int channels;
@LOC("CH0")
private int first_channel;
@LOC("CH0")
nonzero[0] = nonzero[1] = 576;
- br = new BitReserve();
si = new III_side_info_t();
initialized = true;
if (!initialized) {
init(header);
}
-
+
+ // overwrites once per a loop
+ samples1 = new float[32];
+ samples2 = new float[32];
+ prevblck = new float[2][SBLIMIT * SSLIMIT];
+ si = new III_side_info_t();
+ //
+
@LOC("THIS,LayerIIIDecoder.HD1") int nSlots = header.slots();
@LOC("THIS,LayerIIIDecoder.CH0") int gr;
final class SynthesisFilter {\r
\r
@LOC("IDX")\r
- private int vidx = 1;\r
+ private int vidx;\r
@LOC("V")\r
private float[] v1;\r
@LOC("V")\r
@LOC("SAMPLE")\r
private float[] samples; // 32 new subband samples\r
@LOC("V")\r
- private int channel;\r
+ public final int channel;\r
@LOC("V")\r
- private float scalefactor;\r
+ public final float scalefactor;\r
@LOC("EQ")\r
private float[] eq;\r
\r
*/\r
public SynthesisFilter(int channelnumber, float factor, float[] eq0) {\r
\r
+ vidx = 1;\r
d16 = splitArray(d, 16);\r
\r
v1 = new float[512];\r
}\r
\r
public void input_samples(@LOC("IN") float[] s) {\r
- TERMINATE:\r
- for (@LOC("C") int i = 31; i >= 0; i--) {\r
+ TERMINATE: for (@LOC("C") int i = 31; i >= 0; i--) {\r
samples[i] = s[i] * eq[i];\r
}\r
}\r