try to fix annotation errors
authoryeom <yeom>
Thu, 21 Jul 2011 20:37:22 +0000 (20:37 +0000)
committeryeom <yeom>
Thu, 21 Jul 2011 20:37:22 +0000 (20:37 +0000)
Robust/src/Analysis/SSJava/FlowDownCheck.java
Robust/src/Tests/ssJava/mp3decoder/Decoder.java
Robust/src/Tests/ssJava/mp3decoder/LayerIDecoder.java
Robust/src/Tests/ssJava/mp3decoder/LayerIIDecoder.java
Robust/src/Tests/ssJava/mp3decoder/LayerIIIDecoder.java
Robust/src/Tests/ssJava/mp3decoder/SynthesisFilter.java

index 74e1c2522da7fc7d4bc5893f0da43b3b0f6e5c5f..d095bc39edbbab33f71f0f8f776c44c0764fd112 100644 (file)
@@ -920,26 +920,6 @@ public class FlowDownCheck {
 
     ClassDescriptor cd = md.getClassDesc();
 
-    // check arguments
-    Set<CompositeLocation> glbInputSet = new HashSet<CompositeLocation>();
-    for (int i = 0; i < con.numArgs(); i++) {
-      ExpressionNode en = con.getArg(i);
-      CompositeLocation argLoc =
-          checkLocationFromExpressionNode(md, nametable, en, new CompositeLocation());
-      glbInputSet.add(argLoc);
-      addLocationType(en.getType(), argLoc);
-    }
-
-    // check array initializers
-    // if ((con.getArrayInitializer() != null)) {
-    // checkLocationFromArrayInitializerNode(md, nametable,
-    // con.getArrayInitializer());
-    // }
-
-    if (glbInputSet.size() > 0) {
-      return CompositeLattice.calculateGLB(glbInputSet);
-    }
-
     CompositeLocation compLoc = new CompositeLocation();
     compLoc.addLocation(Location.createTopLocation(md));
     return compLoc;
@@ -1175,11 +1155,11 @@ public class FlowDownCheck {
       srcLocation = new CompositeLocation();
       srcLocation = checkLocationFromExpressionNode(md, nametable, an.getSrc(), srcLocation);
 
-      // System.out.println(" an= " + an.printNode(0) + " an.getSrc()=" +
-      // an.getSrc().getClass()
-      // + " at " + cd.getSourceFileName() + "::" + an.getNumLine());
-      // System.out.println("srcLocation=" + srcLocation);
-      // System.out.println("dstLocation=" + destLocation);
+       System.out.println("\n an= " + an.printNode(0) + " an.getSrc()=" +
+       an.getSrc().getClass()
+       + " at " + cd.getSourceFileName() + "::" + an.getNumLine());
+       System.out.println("srcLocation=" + srcLocation);
+       System.out.println("dstLocation=" + destLocation);
 
       if (!CompositeLattice.isGreaterThan(srcLocation, destLocation, generateErrorMessage(cd, an))) {
         throw new Error("The value flow from " + srcLocation + " to " + destLocation
index 6b8a588c92c258c1077fe8775bd7e7f2d246801f..25cea2134dbc12438f3af475f7a175bbc0ae5622 100644 (file)
@@ -27,7 +27,7 @@
  * @version 0.0.7 12/12/99\r
  * @since      0.0.5\r
  */\r
-@LATTICE("ST,OUT,FIL,DE,O,EQ,PA,INIT,DE*")\r
+@LATTICE("ST,OUT,FIL,DE<LA,O,EQ,PA,INIT,DE*")\r
 public class Decoder implements DecoderErrors\r
 {\r
        static private final Params DEFAULT_PARAMS = new Params();\r
@@ -141,21 +141,41 @@ public class Decoder implements DecoderErrors
          //                initialize(header,stream);\r
          //            }\r
 \r
-         @LOC("DELTA(TH)") int layer = header.layer();\r
+         @LOC("TH") int layer = header.layer();\r
 \r
          output.clear_buffer();\r
 \r
-         @LOC("TH,Decoder.DE") FrameDecoder decoder = retrieveDecoder(header, stream, layer);\r
-         decoder.decodeFrame();\r
+//       @LOC("DE,Decoder.DE") FrameDecoder decoder = retrieveDecoder(header, stream, layer); // return ceil=DELTA(TH)\r
+//       decoder.decodeFrame();\r
 \r
          if(layer==3){\r
-           l3decoder=(LayerIIIDecoder)decoder;\r
+           if (l3decoder==null)\r
+           {\r
+             l3decoder = new LayerIIIDecoder(stream, \r
+                 header, filter1, filter2, \r
+                 output, OutputChannels.BOTH_CHANNELS);\r
+           }                             \r
+           l3decoder.decodeFrame();\r
          }else if(layer==2){\r
-           l2decoder=(LayerIIDecoder)decoder;\r
+           if (l2decoder==null)\r
+           {\r
+             l2decoder = new LayerIIDecoder();\r
+             l2decoder.create(stream, \r
+                 header, filter1, filter2, \r
+                 output, OutputChannels.BOTH_CHANNELS);                 \r
+           }\r
+           l2decoder.decodeFrame();\r
          }else{\r
-           l1decoder=(LayerIDecoder)decoder;\r
+           if (l1decoder==null)\r
+           {\r
+             l1decoder = new LayerIDecoder();\r
+             l1decoder.create(stream, \r
+                 header, filter1, filter2, \r
+                 output, OutputChannels.BOTH_CHANNELS);                 \r
+           }\r
+           l1decoder.decodeFrame();\r
          }\r
-         \r
+\r
          output.write_buffer(1);\r
 \r
          return output;        \r
@@ -224,12 +244,12 @@ public class Decoder implements DecoderErrors
                return new DecoderException(errorcode, throwable);\r
        }\r
        \r
-       @LATTICE("DE<IN,THISLOC=IN")\r
-       @RETURNLOC("DE")\r
+       @LATTICE("IN,TH,THISLOC=TH")\r
+       @RETURNLOC("TH")\r
        protected FrameDecoder retrieveDecoder(@LOC("IN") Header header, @LOC("IN") Bitstream stream, @LOC("IN") int layer)\r
                throws DecoderException\r
        {\r
-               @LOC("DE") FrameDecoder decoder = null;\r
+//             @LOC("DE") FrameDecoder decoder = null;\r
                \r
                // REVIEW: allow channel output selection type\r
                // (LEFT, RIGHT, BOTH, DOWNMIX)\r
@@ -243,7 +263,8 @@ public class Decoder implements DecoderErrors
                                        output, OutputChannels.BOTH_CHANNELS);\r
                        }                                               \r
                        \r
-                       decoder = l3decoder;\r
+                       return l3decoder;\r
+//                     decoder = l3decoder;\r
                        break;\r
                case 2:\r
                        if (l2decoder==null)\r
@@ -253,7 +274,8 @@ public class Decoder implements DecoderErrors
                                        header, filter1, filter2, \r
                                        output, OutputChannels.BOTH_CHANNELS);                          \r
                        }\r
-                       decoder = l2decoder;\r
+              return l2decoder;\r
+//                     decoder = l2decoder;\r
                        break;\r
                case 1:\r
                        if (l1decoder==null)\r
@@ -263,16 +285,17 @@ public class Decoder implements DecoderErrors
                                        header, filter1, filter2, \r
                                        output, OutputChannels.BOTH_CHANNELS);                          \r
                        }\r
-                       decoder = l1decoder;\r
+              return l1decoder;\r
+//                     decoder = l1decoder;\r
                        break;\r
                }\r
-                                               \r
-               if (decoder==null)\r
-               {\r
-                       throw newDecoderException(UNSUPPORTED_LAYER, null);\r
-               }\r
-               \r
-               return decoder;\r
+//                                             \r
+//             if (decoder==null)\r
+//             {\r
+//                     throw newDecoderException(UNSUPPORTED_LAYER, null);\r
+//             }\r
+//             \r
+//             return decoder;\r
        }\r
        \r
         public void initialize(Header header, Bitstream stream)\r
index 3b2285b0781ef78e8e2753c58a277493e62d221b..89913a846eb7029f6abfed8212a99868d7ce419a 100644 (file)
@@ -38,7 +38,7 @@
     @LOC("H") protected SynthesisFilter                         filter2;
     @LOC("H") protected Obuffer                                buffer;
     @LOC("H") protected int                                    which_channels;
-    @LOC("H") protected int                                    mode;
+    @LOC("SH") protected int                                   mode;
        
     @LOC("SH") protected int                                   num_subbands;
     @LOC("L") protected Subband[]                              subbands;
        
        protected void readSampleData()
        {
-               @LOC("SH") boolean read_ready = false;
-               @LOC("SH") boolean write_ready = false;
-               @LOC("OUT") int mode = header.mode();
-               @LOC("SH") int i;
-               do
-               {
-                 for (i = 0; i < num_subbands; ++i)
-                       read_ready = subbands[i].read_sampledata(stream);
-                 do
-                 {
-                       for (i = 0; i < num_subbands; ++i)
-                               write_ready = subbands[i].put_next_sample(which_channels,filter1, filter2);
+       @LOC("SH") boolean read_ready = false;
+         @LOC("SH") boolean write_ready = false;
+         @LOC("OUT") int mode = header.mode();
+         @LOC("SH") int i;
+         do
+         {
+           for (i = 0; i < num_subbands; ++i)
+             read_ready = subbands[i].read_sampledata(stream); // DELTA[Loc[readSampleData.V],Loc[LayerIDecoder.L]]
+           do
+           {
+             for (i = 0; i < num_subbands; ++i)
+               write_ready = subbands[i].put_next_sample(which_channels,filter1, filter2);
+
+             filter1.calculate_pcm_samples(buffer);
+             if ((which_channels == OutputChannels.BOTH_CHANNELS) && (mode != Header.SINGLE_CHANNEL))
+               filter2.calculate_pcm_samples(buffer);
+           } while (!write_ready);
+         } while (!read_ready);
 
-                       filter1.calculate_pcm_samples(buffer);
-                       if ((which_channels == OutputChannels.BOTH_CHANNELS) && (mode != Header.SINGLE_CHANNEL))
-                       filter2.calculate_pcm_samples(buffer);
-                 } while (!write_ready);
-               } while (!read_ready);
-               
        }
 
 //     /**
index 281425049dd95ebbe1aaa3381890a267621671d6..320a8310f06b8de790c55a358b174fef00fde5af 100644 (file)
@@ -1018,7 +1018,7 @@ class LayerIIDecoder extends LayerIDecoder implements FrameDecoder
          /**
           *
           */
-          @LATTICE("OUT<V,V<SH,SH<TEMP,TEMP<TMP,TMP<THIS,THIS<IN,SH*,TEMP*,TMP*,THISLOC=THIS,GLOBALLOC=IN")
+          @LATTICE("OUT<V,V<TEMP,TEMP<SH,TEMP<TMP,TMP<THIS,THIS<IN,SH*,TEMP*,TMP*,THISLOC=THIS,GLOBALLOC=IN")
          @RETURNLOC("V")
          public boolean read_sampledata (@LOC("IN") Bitstream stream)
          {
index 8d9bb67d876d6b8a3e15d65064ff4dd036f3104d..ff6d4a165f9e63e67bda5e8880ab8b474f029513 100644 (file)
@@ -282,11 +282,9 @@ final class LayerIIIDecoder implements FrameDecoder {
     get_side_info();
 
     for (i = 0; i < nSlots; i++)
-      br.hputbuf(stream.get_bits(8)); // br < stream
-
-    // br < main_data_end
-    main_data_end = br.hsstell() >>> 3; // of previous frame  
-     
+      br.hputbuf(stream.get_bits(8)); 
+    
+    main_data_end = br.hsstell() >>> 3;      
 
     if ((flush_main = (br.hsstell() & 7)) != 0) { // flush_main < br
       br.hgetbits(8 - flush_main); // br < flush_main
index 8b152fd997868bdd6b73e06725ef74d38aa8a6d4..1a34e903345bd0f74c512dd04a6d6845e6b1ceb9 100644 (file)
@@ -463,7 +463,7 @@ final class SynthesisFilter
     new_v15 = p15;\r
     new_v13 = p15 + p7;\r
     new_v11 = p15 + p7 + p11;\r
-    new_v5 = new_v11 + p5 + p13;\r
+    new_v5 = p15 + p7 + p11 + p5 + p13;\r
     \r
 //    new_v7 = (new_v9 = p15 + p11 + p3) + p13;\r
     new_v9 = p15 + p11 + p3;\r