You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ml...@apache.org on 2008/03/20 15:26:09 UTC

svn commit: r639296 - in /harmony/standard/site: docs/subcomponents/drlvm/ xdocs/subcomponents/drlvm/

Author: mloenko
Date: Thu Mar 20 07:26:07 2008
New Revision: 639296

URL: http://svn.apache.org/viewvc?rev=639296&view=rev
Log:
more docs about verifier

Added:
    harmony/standard/site/docs/subcomponents/drlvm/verifier-files.html
    harmony/standard/site/docs/subcomponents/drlvm/verifier.html
    harmony/standard/site/docs/subcomponents/drlvm/x-verifier.html
    harmony/standard/site/xdocs/subcomponents/drlvm/verifier-files.xml
    harmony/standard/site/xdocs/subcomponents/drlvm/verifier.xml
    harmony/standard/site/xdocs/subcomponents/drlvm/x-verifier.htm
    harmony/standard/site/xdocs/subcomponents/drlvm/x-verifier.xml   (with props)
Modified:
    harmony/standard/site/docs/subcomponents/drlvm/index.html
    harmony/standard/site/xdocs/subcomponents/drlvm/index.xml

Modified: harmony/standard/site/docs/subcomponents/drlvm/index.html
URL: http://svn.apache.org/viewvc/harmony/standard/site/docs/subcomponents/drlvm/index.html?rev=639296&r1=639295&r2=639296&view=diff
==============================================================================
--- harmony/standard/site/docs/subcomponents/drlvm/index.html (original)
+++ harmony/standard/site/docs/subcomponents/drlvm/index.html Thu Mar 20 07:26:07 2008
@@ -313,10 +313,9 @@
               gives info on specifics of the current implementation. 
             </li>
             <li>
-               <a href="cp-verifier.html">Bytecode Verifier</a>
+               <a href="verifier.html">Bytecode Verifier</a>
              <br />
-              Description of the verification approach implemented in DRLVM. 
-              It also provides comparison to other possible verification algorithms.
+              Technical Details for Harmony Bytecode Verifier, including algorithm description.
             </li>
             <li>
               <a href="encoder_library.html">Encoder Library for

Added: harmony/standard/site/docs/subcomponents/drlvm/verifier-files.html
URL: http://svn.apache.org/viewvc/harmony/standard/site/docs/subcomponents/drlvm/verifier-files.html?rev=639296&view=auto
==============================================================================
--- harmony/standard/site/docs/subcomponents/drlvm/verifier-files.html (added)
+++ harmony/standard/site/docs/subcomponents/drlvm/verifier-files.html Thu Mar 20 07:26:07 2008
@@ -0,0 +1,255 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+
+<!-- start the processing -->
+    <!-- ====================================================================== -->
+    <!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
+    <!-- Main Page Section -->
+    <!-- ====================================================================== -->
+    <html>
+        <head>
+            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+
+                        
+           
+            
+            
+            
+            
+            
+            <title>Apache Harmony - Verifier directories and source files</title>
+
+                        
+                        
+        <link rel="stylesheet" type="text/css" href="../../css/site.css" media="all" />
+        <link rel="stylesheet" type="text/css" href="../../css/screen.css" media="screen" />
+        <link rel="stylesheet" type="text/css" href="../../css/print.css" media="print" />
+
+                        
+        </head>
+
+        <body>
+            <div id="pageHeader">
+            <!-- Logo -->
+                        <a id="harmonyLogo" href="http://harmony.apache.org/"><img src="../../images/harmony-logo-new.png" alt="Apache Harmony"
+          width="415" height="50" /></a>
+      
+            <!-- Advertisement -->
+            <a href="http://eu.apachecon.com">
+                <img id="advertisement"
+                     src="http://eu.apachecon.com/eu2008/images/buttons/basic_234x60.jpg"
+                     width="234" height="60"
+                     alt="ApacheCon Europe 2008" /></a>
+            </div> <!-- pageHeader -->
+
+            <div id="navigationmenu">
+                    <!-- LEFT SIDE NAVIGATION -->
+                
+    <!-- ============================================================ -->
+
+                <p class="menuItem">General</p>
+        <ul>
+                    <li class="menuItem">    <a href="../../index.html">Home</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../license.html">License</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../contribution_policy.html">Contribution Policy</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../download.cgi">Downloads</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../bundles.html">Bundles</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../faq.html">FAQ</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../sitemap.html">Sitemap</a>
+</li>
+           
+                        
+        
+        </ul>
+            <p class="menuItem">Community</p>
+        <ul>
+                    <li class="menuItem">    <a href="../../get-involved.html">Get Involved</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../contributors.html">Who we are</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../mailing.html">Mailing Lists</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="http://issues.apache.org/jira/browse/HARMONY">Bug Tracker</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../related.html">Other Projects</a>
+</li>
+           
+                        
+        
+        </ul>
+            <p class="menuItem">Development</p>
+        <ul>
+                    <li class="menuItem">    <a href="../../svn.html">Source Code</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../quickhelp_contributors.html">Getting Started</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../roadmap.html">Project Roadmap</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../issue_resolution_guideline.html">Resolution Guideline</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../performance.html">Performance</a>
+</li>
+           
+                        
+        
+        </ul>
+            <p class="menuItem">Documentation</p>
+        <ul>
+                    <li class="menuItem">    <a href="http://www.jdocs.com/harmony/5.M5/overview-summary.html">API Reference</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="http://wiki.apache.org/harmony">Wiki</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../subcomponents/drlvm/index.html">DRLVM</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../subcomponents/classlibrary/index.html">Class Library</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../subcomponents/buildtest/index.html">Build-test Framework</a>
+</li>
+           
+                        
+        
+        </ul>
+            <p class="menuItem">Foundation</p>
+        <ul>
+                    <li class="menuItem">    <a href="http://apache.org">ASF</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="http://www.apache.org/foundation/sponsorship.html ">Sponsorship</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="http://www.apache.org/foundation/thanks.html ">Thanks</a>
+</li>
+           
+                        
+        
+        </ul>
+                </div>
+
+            <!-- MAIN CONTENT -->
+            <div id="top">
+                                                        <h1>
+      <a name="Verifier directories and source files">Verifier directories and source files</a>
+    </h1>
+                        <p>
+There are three basic functionalities in the verifier lib: Java5-style verification, Java6-style verification and 
+extension for recomputing stackmaptable attribute.
+</p>
+                                <p>
+The files are located in four folders in verifier-3363:
+base/, java5/, java6/, and x_verifier/.
+base folder contains common files, other folders contain files specific for corresponding functionalities.
+</p>
+                                <p>
+base/ folder contains files with "_base" in their names, with "_x" in their names as well as other classes.
+Files with _base in their names contain base functionality Java5- and Java6-specific classes 
+defined in the java5/ and java6/ folders. These files contain functions that are exactly the same for Java5 and Java6 
+verification. 
+<br />
+Files with _x in their names contain template classes that define functions that manipulate different types of data 
+but in the same way for both Java5 and Java6 verification. Template classes extend base classes, classes in folders 
+Java5 and Java6 in their turn extend template classes.
+<br />
+Other classes define either utility functions or contain implementations for verifier's interface functions (like ver.cpp).
+</p>
+                                <p>
+x_verifier/ folder contains code necessary for computing stackmaptable attribute.
+</p>
+                <p class="backtotop"><a href="#top">Back to top</a></p>
+                
+                                            </div> <!-- top aka Main Content -->
+
+            <!-- FOOTER -->
+            <div id="pageFooter" class="special"><em>
+                Copyright &#169; 2003-2008, The Apache Software Foundation
+            </em></div>
+
+            <!-- Google analytics tracker code -->
+            <script
+                src="http://www.google-analytics.com/urchin.js"
+                type="text/javascript" />
+            <script type="text/javascript">
+              _uacct = "UA-1973333-3";
+              urchinTracker();
+            </script>
+        </body>
+    </html>
+<!-- end the processing -->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

Added: harmony/standard/site/docs/subcomponents/drlvm/verifier.html
URL: http://svn.apache.org/viewvc/harmony/standard/site/docs/subcomponents/drlvm/verifier.html?rev=639296&view=auto
==============================================================================
--- harmony/standard/site/docs/subcomponents/drlvm/verifier.html (added)
+++ harmony/standard/site/docs/subcomponents/drlvm/verifier.html Thu Mar 20 07:26:07 2008
@@ -0,0 +1,248 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+
+<!-- start the processing -->
+    <!-- ====================================================================== -->
+    <!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
+    <!-- Main Page Section -->
+    <!-- ====================================================================== -->
+    <html>
+        <head>
+            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+
+                        
+           
+            
+            
+            
+            
+            
+            <title>Apache Harmony - Technical Details for Harmony Verifier</title>
+
+                        
+                        
+        <link rel="stylesheet" type="text/css" href="../../css/site.css" media="all" />
+        <link rel="stylesheet" type="text/css" href="../../css/screen.css" media="screen" />
+        <link rel="stylesheet" type="text/css" href="../../css/print.css" media="print" />
+
+                        
+        </head>
+
+        <body>
+            <div id="pageHeader">
+            <!-- Logo -->
+                        <a id="harmonyLogo" href="http://harmony.apache.org/"><img src="../../images/harmony-logo-new.png" alt="Apache Harmony"
+          width="415" height="50" /></a>
+      
+            <!-- Advertisement -->
+            <a href="http://eu.apachecon.com">
+                <img id="advertisement"
+                     src="http://eu.apachecon.com/eu2008/images/buttons/basic_234x60.jpg"
+                     width="234" height="60"
+                     alt="ApacheCon Europe 2008" /></a>
+            </div> <!-- pageHeader -->
+
+            <div id="navigationmenu">
+                    <!-- LEFT SIDE NAVIGATION -->
+                
+    <!-- ============================================================ -->
+
+                <p class="menuItem">General</p>
+        <ul>
+                    <li class="menuItem">    <a href="../../index.html">Home</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../license.html">License</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../contribution_policy.html">Contribution Policy</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../download.cgi">Downloads</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../bundles.html">Bundles</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../faq.html">FAQ</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../sitemap.html">Sitemap</a>
+</li>
+           
+                        
+        
+        </ul>
+            <p class="menuItem">Community</p>
+        <ul>
+                    <li class="menuItem">    <a href="../../get-involved.html">Get Involved</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../contributors.html">Who we are</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../mailing.html">Mailing Lists</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="http://issues.apache.org/jira/browse/HARMONY">Bug Tracker</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../related.html">Other Projects</a>
+</li>
+           
+                        
+        
+        </ul>
+            <p class="menuItem">Development</p>
+        <ul>
+                    <li class="menuItem">    <a href="../../svn.html">Source Code</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../quickhelp_contributors.html">Getting Started</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../roadmap.html">Project Roadmap</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../issue_resolution_guideline.html">Resolution Guideline</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../performance.html">Performance</a>
+</li>
+           
+                        
+        
+        </ul>
+            <p class="menuItem">Documentation</p>
+        <ul>
+                    <li class="menuItem">    <a href="http://www.jdocs.com/harmony/5.M5/overview-summary.html">API Reference</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="http://wiki.apache.org/harmony">Wiki</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../subcomponents/drlvm/index.html">DRLVM</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../subcomponents/classlibrary/index.html">Class Library</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../subcomponents/buildtest/index.html">Build-test Framework</a>
+</li>
+           
+                        
+        
+        </ul>
+            <p class="menuItem">Foundation</p>
+        <ul>
+                    <li class="menuItem">    <a href="http://apache.org">ASF</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="http://www.apache.org/foundation/sponsorship.html ">Sponsorship</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="http://www.apache.org/foundation/thanks.html ">Thanks</a>
+</li>
+           
+                        
+        
+        </ul>
+                </div>
+
+            <!-- MAIN CONTENT -->
+            <div id="top">
+                                                        <h1>
+      <a name="Verifier Details">Verifier Details</a>
+    </h1>
+                        <li>
+       <a href="cp-verifier.html">Algorithm for Harmony Java5 Bytecode Verification</a>
+     <br />
+     Description of the verification approach implemented in DRLVM. 
+     It also provides comparison to other possible verification algorithms.
+    </li>
+                                <li>
+       <a href="x-verifier.html">Extension to the Harmony Verifier for stackmaptable calculation</a>
+     <br />
+     Description of the extension to the Harmony Verifier for stackmaptable calculation, 
+     includes high level idea of the algorithm, interface and other technical details.
+    </li>
+                                <li>
+       <a href="verifier-files.html">Verifier Directory Structure</a>
+     <br />
+     Verifier directories and source files.
+    </li>
+                <p class="backtotop"><a href="#top">Back to top</a></p>
+                
+                                            </div> <!-- top aka Main Content -->
+
+            <!-- FOOTER -->
+            <div id="pageFooter" class="special"><em>
+                Copyright &#169; 2003-2008, The Apache Software Foundation
+            </em></div>
+
+            <!-- Google analytics tracker code -->
+            <script
+                src="http://www.google-analytics.com/urchin.js"
+                type="text/javascript" />
+            <script type="text/javascript">
+              _uacct = "UA-1973333-3";
+              urchinTracker();
+            </script>
+        </body>
+    </html>
+<!-- end the processing -->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

Added: harmony/standard/site/docs/subcomponents/drlvm/x-verifier.html
URL: http://svn.apache.org/viewvc/harmony/standard/site/docs/subcomponents/drlvm/x-verifier.html?rev=639296&view=auto
==============================================================================
--- harmony/standard/site/docs/subcomponents/drlvm/x-verifier.html (added)
+++ harmony/standard/site/docs/subcomponents/drlvm/x-verifier.html Thu Mar 20 07:26:07 2008
@@ -0,0 +1,503 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+
+<!-- start the processing -->
+    <!-- ====================================================================== -->
+    <!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
+    <!-- Main Page Section -->
+    <!-- ====================================================================== -->
+    <html>
+        <head>
+            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+
+                                                    <meta name="author" value="Harmony Documentation Team">
+            <meta name="email" value="dev@harmony.apache.org">
+            
+           
+            
+            
+            
+            
+            
+            <title>Apache Harmony - Verifier</title>
+
+                        
+                        
+        <link rel="stylesheet" type="text/css" href="../../css/site.css" media="all" />
+        <link rel="stylesheet" type="text/css" href="../../css/screen.css" media="screen" />
+        <link rel="stylesheet" type="text/css" href="../../css/print.css" media="print" />
+
+                        
+        </head>
+
+        <body>
+            <div id="pageHeader">
+            <!-- Logo -->
+                        <a id="harmonyLogo" href="http://harmony.apache.org/"><img src="../../images/harmony-logo-new.png" alt="Apache Harmony"
+          width="415" height="50" /></a>
+      
+            <!-- Advertisement -->
+            <a href="http://eu.apachecon.com">
+                <img id="advertisement"
+                     src="http://eu.apachecon.com/eu2008/images/buttons/basic_234x60.jpg"
+                     width="234" height="60"
+                     alt="ApacheCon Europe 2008" /></a>
+            </div> <!-- pageHeader -->
+
+            <div id="navigationmenu">
+                    <!-- LEFT SIDE NAVIGATION -->
+                
+    <!-- ============================================================ -->
+
+                <p class="menuItem">General</p>
+        <ul>
+                    <li class="menuItem">    <a href="../../index.html">Home</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../license.html">License</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../contribution_policy.html">Contribution Policy</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../download.cgi">Downloads</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../bundles.html">Bundles</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../faq.html">FAQ</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../sitemap.html">Sitemap</a>
+</li>
+           
+                        
+        
+        </ul>
+            <p class="menuItem">Community</p>
+        <ul>
+                    <li class="menuItem">    <a href="../../get-involved.html">Get Involved</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../contributors.html">Who we are</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../mailing.html">Mailing Lists</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="http://issues.apache.org/jira/browse/HARMONY">Bug Tracker</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../related.html">Other Projects</a>
+</li>
+           
+                        
+        
+        </ul>
+            <p class="menuItem">Development</p>
+        <ul>
+                    <li class="menuItem">    <a href="../../svn.html">Source Code</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../quickhelp_contributors.html">Getting Started</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../roadmap.html">Project Roadmap</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../issue_resolution_guideline.html">Resolution Guideline</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../performance.html">Performance</a>
+</li>
+           
+                        
+        
+        </ul>
+            <p class="menuItem">Documentation</p>
+        <ul>
+                    <li class="menuItem">    <a href="http://www.jdocs.com/harmony/5.M5/overview-summary.html">API Reference</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="http://wiki.apache.org/harmony">Wiki</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../subcomponents/drlvm/index.html">DRLVM</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../subcomponents/classlibrary/index.html">Class Library</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="../../subcomponents/buildtest/index.html">Build-test Framework</a>
+</li>
+           
+                        
+        
+        </ul>
+            <p class="menuItem">Foundation</p>
+        <ul>
+                    <li class="menuItem">    <a href="http://apache.org">ASF</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="http://www.apache.org/foundation/sponsorship.html ">Sponsorship</a>
+</li>
+           
+                        
+                    <li class="menuItem">    <a href="http://www.apache.org/foundation/thanks.html ">Thanks</a>
+</li>
+           
+                        
+        
+        </ul>
+                </div>
+
+            <!-- MAIN CONTENT -->
+            <div id="top">
+                                
+                                                    <div>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements. See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License. You may obtain a copy of the License at
+  
+       http://www.apache.org/licenses/LICENSE-2.0
+  
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
+    <title>Extension to the Harmony Verifier for stackmaptable calculation</title>
+    <link rel="stylesheet" type="text/css" media="all" href="site.css" />
+</head>
+<body>
+    <h1>
+        <a id="Top" name="Top">Extension to the Harmony Verifier for stackmaptable calculation</a>
+    </h1>
+    <h1>
+        <a id="Motivation" name="Motivation"></a>Motivation
+    </h1>
+    <p>
+        Java6 introduces a new way for verifying byte code comparing to Java5. Now class files contain stackmaptable
+        attribute which was designed to help byte code verifier. Verification of class files containing stackmaptable
+        (Java6-verification) is much simpler comparing to original verification of classes not containing this attribute 
+        (we will refer to it as "Java5-verification"). This attribute is normally inserted by Java Compiler (javac). 
+    </p>
+    <p>
+        But if some byte code instrumentor makes modification of the original code then stackmaptable inserted by 
+        javac becomes invalid. Thus instrumentor should be able to fix stackmaptable and thus there should be a tool 
+        that is able to calculate a valid stackmaptable attribute.
+    </p>
+    <h1>
+        <a id="Obstacle" name="Obstacle"></a>Obstacle
+    </h1>
+    <p>
+        Briefly, stackmaptable
+        attribute contains information about types that come to each start of liner block (to each branch target). 
+        If there are several types coming to some point then stackmaptable for this point contains a type to which all the 
+        coming types are assignable to. In particular if class A, B, and C may come to some point then stackmaptable 
+        contains their common super class.
+    </p>
+    <p>
+        An obstacle here is that at compile time javac has access
+        to all the classes referenced in the class being compiled, while dynamic instrumentors might not have access to some 
+        of the referenced classes, thus it's hard to guess which class is a common super class of A, B, and C from the example 
+        above. If we knew what specifically is modified by instrumentor and how, we could modify original stackmaptable of the 
+        class, but we would like to keep flexibility of instrumentor and not limit its modifications over the code with 
+        unnecessary constraints.
+    </p>
+    <h1>
+        <a id="Assumption" name="Assumption"></a>Assumption
+    </h1>
+    <p>
+        We assume that either original class file contained valid byte code or if it does not then it's OK for instrumented 
+        class file to contain invalid stackmaptable (so that it will be rejected by the VM later). Thus we will use data from the
+        original uninstrumented class file to calculate a new stackmaptable attribute. 
+    </p>
+
+    <h1>
+        <a id="Idea" name="Idea"></a>High level Idea of the underlying algorithm
+    </h1>
+    <p>
+        To compute stackmaptable attribute verifier uses two types of information: either it needs access to all the classes 
+        referenced in the current class (this mode is like how javac calculates stackmaps) or it needs the original class 
+        (if the current class was obtained from some original valid class by instrumentation). In the latter case it calculates 
+        new stackmap basing on the data extracted from the original class file. There are no different modes: the verifier is 
+        always operates in a "mixed" mode: it uses both data extracted from the original class file (when it exists) and try to 
+        access referenced classes.
+    </p>
+    <p>
+        The main function that computes stackmap for the given method is
+    </p>
+    <pre>
+vf_Result
+vf_recompute_stackmaptable( method_handler method, uint8 **attrBytes, char **error, void *trustedPairs )
+    </pre>
+    <p>
+	Where trustedParis (which might be 0) contains list of knowingly assignable pairs. If stackmap is recomputed in an 
+        instrumentor, referenced files are not always can be accessed at the moment of instrumentation (e.g. they could go 
+        from some URL location), so the stackmap data from original (uninstrumented) class file is used instead:
+    </p>
+    <p>
+	First the original class is going to 
+    </p>
+    <pre>
+vf_verify6_class
+    </pre>
+    <p>
+	function, that makes first step of verification: it verifies integrity of the code and checks assignability of the 
+	classes available at the moment of first verification step. It creates a list of pairs that are not loaded and need to 
+	be checked later. In a normal execution there is a second verification step, where these pairs are forcedly loaded and 
+	checked (just before execution of the class).
+    </p>
+    <p>
+	When we recompute stackmaptable for an instrumented class, the second verification step is not performed. Instead we 
+	assume that original class file was valid and consider obtained pairs as "trusted" pairs: we assume that they are 
+	properly assignable. (There is no problem in this assumption: if it was not the case then our generated stackmaptable 
+	would be invalid either and the class would be rejected by VM).
+    </p>
+    <p>
+	Once we are done with the first step Java6 verification of the original class, we go to Java5 verification of the 
+	instrumented class. We also perform just the first step of verification (i.e. we don't force loading the classes), 
+	pairs of classes to be checked are stored somewhere as well, they are not mixed with our trusted pairs and they are 
+	never used later.
+    </p>
+    <p>
+	Once we are done with Java5 verification we don't destroy its temporary data, but start to work with it. So Java5 
+	verifier creates its interim stackmaps at the same points where they are necessary according to the spec (Well, it's 
+	not quite true. For optimization purposes there are places for some of which interim stackmaps are not created, so I 
+	had to implement a flag to switch this optimization off when we are at recompute stackmap mode). 
+    </p>
+    <p>
+	By design of Harmony Java5 verifier, each stackmap contains types that are incoming for the given point as well as types that 
+	are expected by the following instructions as well as list of branches where these incoming types go further to. 
+	(We propagate incoming types in one direction only: we do add incoming types to all the branch targets, but we don't 
+	add expected types to the points which have branches to the current point)
+    </p>
+    <p>
+	Then verifier looks for a "solution": i.e. set of values for each stackmap so that we may prove that 1) each incoming 
+	type is assignable to that value 2) the value is assignable to each type expected by the following instructions and 3) 
+	the value is assignable to the values (that also belong to the solution) for the branch target stackmaps.
+    </p>
+    <p>
+	Verifier may prove assignability in three ways. Class "A" is provably assignable to class "B" if either 1) we know that 
+	"B" is an interface or a super class of A (i.e. A or B is loaded) or 2) list of trusted pairs contain (A, C), where C 
+	is provably assignable to B 3) A==B
+    </p>
+    <p>
+	There are exclusions, when verifier does not prove assignability: e.g. if there is just a single incoming type for t
+	he given stackmap, then solution contains this type and it is not checked against expected types or branches.
+    </p>
+    <p>
+	To find a solution verifier does NOT apply a brute force search. Instead constraint propagation and backtracking-like 
+	algorithms are used:
+    <br/>
+	First for each node (i.e. for each type in the resulting stackmaptable) it creates a list of types that can potentially 
+	be a solution, i.e. all types X for which there exist an incoming type I that provably assignable to X. We'll call this 
+	list as "solution candidates".
+    <br/>
+	Then we reduce the list of solution candidates by removing those candidates X for which there is an expected type E so 
+	that X is not provably assignable to E. 
+    <br/>
+	The state when all solution candidate lists contain exactly one element, will be called "SOLUTION FOUND". The state 
+	when there is an empty candidate list, will be "INCONSISTENCY FOUND"
+    </p>
+
+    <h2>
+	Definition of PROPAGATION
+    </h2>
+    <p>
+	The following procedure will be called "propagation": remove all solution candidates X such that there is a branch B 
+	with its own solution candidates B_1, ..., B_N and for each B_i X is not provably assignable to B_i
+    </p>
+
+    <h2>
+	Definition of SEARCH
+    </h2>
+    <p>
+	A recursive procedure below describes the search for a solution. First we do PROPAGATION. If solution found - global 
+	stop, we are done. If inconsistency found - "roll back" to previous recursion level. (If it was the first level, then 
+	we are in trouble: the data we had was not enough to build stackmaptable attribute).
+    </p>
+    <p>
+	Then we remember all candidate lists (to return here in case we roll back from the next recursion level), chose 
+	a list where there is more than one candidate, select a candidate there, remove all other candidates and apply SEARCH 
+	(i.e. launch the next recursion level) with reduced list of candidates. If SEARCH found a solution then it's a global 
+	stop. If it found inconsistency then restore remembered state, select another candidate from the list, and launch the 
+	next recursion level again. If there are no more candidates and solution is not yet found - roll back to the previous 
+	recursion level (if it was the first level - we are in trouble again).
+    </p>
+
+
+    <h2>
+	Dealing with dead code
+    </h2>
+    <p>
+	It's not a simple task to calculate stackmaptable attribute for the beginning of dead (unreachable) block of code.
+        Despite the code dead, it's verified by Java6 verifier (required by spec) and thus it should satisfy all instructions 
+        tat follows. Moreover dead code might be in the scope of a reachable exception handler and thus may affect stackmaptable
+        in the reachable parts of the code. So to kill the problem it's easier to modify class file rather than to build 
+        stackmaptable (which is even not always possible).
+    </p>
+    <p>
+	First, we avoid the situation when the dead code is the only intersection of two different try blocks (since their 
+        handlers may have incompatible types): for each try block that starts or ends in the dead code we reduce scope to 
+        eliminate dead code from the try block (when dead code is in the middle then it's OK).
+    <br/>
+        Next, we change the code in the dead block with NOPs followed by ATHROW.
+    <br/>
+        Finally, we build stackmaptable for the beginning of the dead block: its stack contains just a single element NULL,
+        and (to make it compatible with possible exception handlers) its locals are exactly the same as locals in the 
+        stackmaptable for the first alive instruction that follows dead code.
+    </p>
+
+    <h2>
+	Handling invokevirtual/putfield/getfield instructions
+    </h2>
+    <p>
+	Sometimes verifier has to know whether a field or a method referenced in the class is declared in the super class
+        of the current class or not. This is necessary to understand which type the instruction expects. But to answer the 
+        question we have to load ether super classes of the current class or a class where referenced member is declared.
+        class_is_extending_class method from the class interface is called to figure that out.
+    </p>
+    <p>
+	In our case we can't load additional classes, but recompute stackmap functionality works correct if 
+        class_is_extending_class always returns NULL (indicating that referenced class is not a super class of 
+        the current one). To make sure that stackmap table is correct verifier chooses the least general 
+        (i.e. least close to java.lang.Object) type among several possible for the SOLUTION.
+    </p>
+
+
+    <h1>
+        <a id="Interface" name="Interface"></a>Verifier Interface
+    </h1>
+    <pre>
+// Allocates an empty verification context for a class, 
+// to be passed back to the verifier upon verification requests.
+// Memory must be disposed by calling free_verification_context 
+// (see below).
+// @param klass - class handler
+// @return a verification context for the class
+verification_context 
+allocate_verification_context(class_handler klass);
+
+// Initializes the verification context with method's information. 
+// This function must be called before instrumenting the method.
+// The resulting context should be passed back to the verifier 
+// upon verification requests
+// @param method - method handler
+// @param[in,out] context - verification context of the 
+// method's defining class
+// @return error code 
+vf_Result 
+init_verification_context_for_method(method_handler method, verification_context context);
+
+// Recomputes the StackMapTable of a method using the verification 
+// context created and initialized prior
+// to method instrumentation
+// @param[out] attrBytes - a pointer to a newly allocated StackMapTable
+// attribute. Memory must be disposed by calling free_stackmaptable
+// (see below).
+// @param method - method handler
+// @param context - class and method verification context
+// @return error code
+vf_Result recompute_stackmaptable(uint8 **attrBytes, 
+  method_handler method, verification_context context);
+
+// Frees memory allocated for a StackMapTable attribute
+void free_stackmaptable(uint8 *attrBytes);
+
+// Frees memory allocated for a verification context
+void free_verification_context (verification_context context);
+    </pre>
+
+
+</body>
+</html>
+
+
+
+</div>
+                            </div> <!-- top aka Main Content -->
+
+            <!-- FOOTER -->
+            <div id="pageFooter" class="special"><em>
+                Copyright &#169; 2003-2008, The Apache Software Foundation
+            </em></div>
+
+            <!-- Google analytics tracker code -->
+            <script
+                src="http://www.google-analytics.com/urchin.js"
+                type="text/javascript" />
+            <script type="text/javascript">
+              _uacct = "UA-1973333-3";
+              urchinTracker();
+            </script>
+        </body>
+    </html>
+<!-- end the processing -->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

Modified: harmony/standard/site/xdocs/subcomponents/drlvm/index.xml
URL: http://svn.apache.org/viewvc/harmony/standard/site/xdocs/subcomponents/drlvm/index.xml?rev=639296&r1=639295&r2=639296&view=diff
==============================================================================
--- harmony/standard/site/xdocs/subcomponents/drlvm/index.xml (original)
+++ harmony/standard/site/xdocs/subcomponents/drlvm/index.xml Thu Mar 20 07:26:07 2008
@@ -140,10 +140,9 @@
               gives info on specifics of the current implementation. 
             </li>
             <li>
-               <a href="cp-verifier.html">Bytecode Verifier</a>
+               <a href="verifier.html">Bytecode Verifier</a>
              <br />
-              Description of the verification approach implemented in DRLVM. 
-              It also provides comparison to other possible verification algorithms.
+              Technical Details for Harmony Bytecode Verifier, including algorithm description.
             </li>
             <li>
               <a href="encoder_library.html">Encoder Library for

Added: harmony/standard/site/xdocs/subcomponents/drlvm/verifier-files.xml
URL: http://svn.apache.org/viewvc/harmony/standard/site/xdocs/subcomponents/drlvm/verifier-files.xml?rev=639296&view=auto
==============================================================================
--- harmony/standard/site/xdocs/subcomponents/drlvm/verifier-files.xml (added)
+++ harmony/standard/site/xdocs/subcomponents/drlvm/verifier-files.xml Thu Mar 20 07:26:07 2008
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements. See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License. You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<document>
+
+ <properties>
+  <title>Verifier directories and source files</title>
+ </properties>
+
+<body>
+<section name="Verifier directories and source files">
+<p>
+There are three basic functionalities in the verifier lib: Java5-style verification, Java6-style verification and 
+extension for recomputing stackmaptable attribute.
+</p>
+<p>
+The files are located in four folders in verifier-3363:
+base/, java5/, java6/, and x_verifier/.
+base folder contains common files, other folders contain files specific for corresponding functionalities.
+</p>
+<p>
+base/ folder contains files with "_base" in their names, with "_x" in their names as well as other classes.
+Files with _base in their names contain base functionality Java5- and Java6-specific classes 
+defined in the java5/ and java6/ folders. These files contain functions that are exactly the same for Java5 and Java6 
+verification. 
+<br/>
+Files with _x in their names contain template classes that define functions that manipulate different types of data 
+but in the same way for both Java5 and Java6 verification. Template classes extend base classes, classes in folders 
+Java5 and Java6 in their turn extend template classes.
+<br/>
+Other classes define either utility functions or contain implementations for verifier's interface functions (like ver.cpp).
+</p>
+<p>
+x_verifier/ folder contains code necessary for computing stackmaptable attribute.
+</p>
+</section>
+
+</body>
+</document>

Added: harmony/standard/site/xdocs/subcomponents/drlvm/verifier.xml
URL: http://svn.apache.org/viewvc/harmony/standard/site/xdocs/subcomponents/drlvm/verifier.xml?rev=639296&view=auto
==============================================================================
--- harmony/standard/site/xdocs/subcomponents/drlvm/verifier.xml (added)
+++ harmony/standard/site/xdocs/subcomponents/drlvm/verifier.xml Thu Mar 20 07:26:07 2008
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements. See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License. You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<document>
+
+ <properties>
+  <title>Technical Details for Harmony Verifier</title>
+ </properties>
+
+<body>
+<section name="Verifier Details">
+
+    <li>
+       <a href="cp-verifier.html">Algorithm for Harmony Java5 Bytecode Verification</a>
+     <br />
+     Description of the verification approach implemented in DRLVM. 
+     It also provides comparison to other possible verification algorithms.
+    </li>
+
+
+    <li>
+       <a href="x-verifier.html">Extension to the Harmony Verifier for stackmaptable calculation</a>
+     <br />
+     Description of the extension to the Harmony Verifier for stackmaptable calculation, 
+     includes high level idea of the algorithm, interface and other technical details.
+    </li>
+
+
+    <li>
+       <a href="verifier-files.html">Verifier Directory Structure</a>
+     <br />
+     Verifier directories and source files.
+    </li>
+
+</section>
+
+</body>
+</document>

Added: harmony/standard/site/xdocs/subcomponents/drlvm/x-verifier.htm
URL: http://svn.apache.org/viewvc/harmony/standard/site/xdocs/subcomponents/drlvm/x-verifier.htm?rev=639296&view=auto
==============================================================================
--- harmony/standard/site/xdocs/subcomponents/drlvm/x-verifier.htm (added)
+++ harmony/standard/site/xdocs/subcomponents/drlvm/x-verifier.htm Thu Mar 20 07:26:07 2008
@@ -0,0 +1,272 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements. See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License. You may obtain a copy of the License at
+  
+       http://www.apache.org/licenses/LICENSE-2.0
+  
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
+    <title>Extension to the Harmony Verifier for stackmaptable calculation</title>
+    <link rel="stylesheet" type="text/css" media="all" href="site.css" />
+</head>
+<body>
+    <h1>
+        <a id="Top" name="Top">Extension to the Harmony Verifier for stackmaptable calculation</a>
+    </h1>
+    <h1>
+        <a id="Motivation" name="Motivation"></a>Motivation
+    </h1>
+    <p>
+        Java6 introduces a new way for verifying byte code comparing to Java5. Now class files contain stackmaptable
+        attribute which was designed to help byte code verifier. Verification of class files containing stackmaptable
+        (Java6-verification) is much simpler comparing to original verification of classes not containing this attribute 
+        (we will refer to it as "Java5-verification"). This attribute is normally inserted by Java Compiler (javac). 
+    </p>
+    <p>
+        But if some byte code instrumentor makes modification of the original code then stackmaptable inserted by 
+        javac becomes invalid. Thus instrumentor should be able to fix stackmaptable and thus there should be a tool 
+        that is able to calculate a valid stackmaptable attribute.
+    </p>
+    <h1>
+        <a id="Obstacle" name="Obstacle"></a>Obstacle
+    </h1>
+    <p>
+        Briefly, stackmaptable
+        attribute contains information about types that come to each start of liner block (to each branch target). 
+        If there are several types coming to some point then stackmaptable for this point contains a type to which all the 
+        coming types are assignable to. In particular if class A, B, and C may come to some point then stackmaptable 
+        contains their common super class.
+    </p>
+    <p>
+        An obstacle here is that at compile time javac has access
+        to all the classes referenced in the class being compiled, while dynamic instrumentors might not have access to some 
+        of the referenced classes, thus it's hard to guess which class is a common super class of A, B, and C from the example 
+        above. If we knew what specifically is modified by instrumentor and how, we could modify original stackmaptable of the 
+        class, but we would like to keep flexibility of instrumentor and not limit its modifications over the code with 
+        unnecessary constraints.
+    </p>
+    <h1>
+        <a id="Assumption" name="Assumption"></a>Assumption
+    </h1>
+    <p>
+        We assume that either original class file contained valid byte code or if it does not then it's OK for instrumented 
+        class file to contain invalid stackmaptable (so that it will be rejected by the VM later). Thus we will use data from the
+        original uninstrumented class file to calculate a new stackmaptable attribute. 
+    </p>
+
+    <h1>
+        <a id="Idea" name="Idea"></a>High level Idea of the underlying algorithm
+    </h1>
+    <p>
+        To compute stackmaptable attribute verifier uses two types of information: either it needs access to all the classes 
+        referenced in the current class (this mode is like how javac calculates stackmaps) or it needs the original class 
+        (if the current class was obtained from some original valid class by instrumentation). In the latter case it calculates 
+        new stackmap basing on the data extracted from the original class file. There are no different modes: the verifier is 
+        always operates in a "mixed" mode: it uses both data extracted from the original class file (when it exists) and try to 
+        access referenced classes.
+    </p>
+    <p>
+        The main function that computes stackmap for the given method is
+    </p>
+    <pre>
+vf_Result
+vf_recompute_stackmaptable( method_handler method, uint8 **attrBytes, char **error, void *trustedPairs )
+    </pre>
+    <p>
+	Where trustedParis (which might be 0) contains list of knowingly assignable pairs. If stackmap is recomputed in an 
+        instrumentor, referenced files are not always can be accessed at the moment of instrumentation (e.g. they could go 
+        from some URL location), so the stackmap data from original (uninstrumented) class file is used instead:
+    </p>
+    <p>
+	First the original class is going to 
+    </p>
+    <pre>
+vf_verify6_class
+    </pre>
+    <p>
+	function, that makes first step of verification: it verifies integrity of the code and checks assignability of the 
+	classes available at the moment of first verification step. It creates a list of pairs that are not loaded and need to 
+	be checked later. In a normal execution there is a second verification step, where these pairs are forcedly loaded and 
+	checked (just before execution of the class).
+    </p>
+    <p>
+	When we recompute stackmaptable for an instrumented class, the second verification step is not performed. Instead we 
+	assume that original class file was valid and consider obtained pairs as "trusted" pairs: we assume that they are 
+	properly assignable. (There is no problem in this assumption: if it was not the case then our generated stackmaptable 
+	would be invalid either and the class would be rejected by VM).
+    </p>
+    <p>
+	Once we are done with the first step Java6 verification of the original class, we go to Java5 verification of the 
+	instrumented class. We also perform just the first step of verification (i.e. we don't force loading the classes), 
+	pairs of classes to be checked are stored somewhere as well, they are not mixed with our trusted pairs and they are 
+	never used later.
+    </p>
+    <p>
+	Once we are done with Java5 verification we don't destroy its temporary data, but start to work with it. So Java5 
+	verifier creates its interim stackmaps at the same points where they are necessary according to the spec (Well, it's 
+	not quite true. For optimization purposes there are places for some of which interim stackmaps are not created, so I 
+	had to implement a flag to switch this optimization off when we are at recompute stackmap mode). 
+    </p>
+    <p>
+	By design of Harmony Java5 verifier, each stackmap contains types that are incoming for the given point as well as types that 
+	are expected by the following instructions as well as list of branches where these incoming types go further to. 
+	(We propagate incoming types in one direction only: we do add incoming types to all the branch targets, but we don't 
+	add expected types to the points which have branches to the current point)
+    </p>
+    <p>
+	Then verifier looks for a "solution": i.e. set of values for each stackmap so that we may prove that 1) each incoming 
+	type is assignable to that value 2) the value is assignable to each type expected by the following instructions and 3) 
+	the value is assignable to the values (that also belong to the solution) for the branch target stackmaps.
+    </p>
+    <p>
+	Verifier may prove assignability in three ways. Class "A" is provably assignable to class "B" if either 1) we know that 
+	"B" is an interface or a super class of A (i.e. A or B is loaded) or 2) list of trusted pairs contain (A, C), where C 
+	is provably assignable to B 3) A==B
+    </p>
+    <p>
+	There are exclusions, when verifier does not prove assignability: e.g. if there is just a single incoming type for t
+	he given stackmap, then solution contains this type and it is not checked against expected types or branches.
+    </p>
+    <p>
+	To find a solution verifier does NOT apply a brute force search. Instead constraint propagation and backtracking-like 
+	algorithms are used:
+    <br/>
+	First for each node (i.e. for each type in the resulting stackmaptable) it creates a list of types that can potentially 
+	be a solution, i.e. all types X for which there exist an incoming type I that provably assignable to X. We'll call this 
+	list as "solution candidates".
+    <br/>
+	Then we reduce the list of solution candidates by removing those candidates X for which there is an expected type E so 
+	that X is not provably assignable to E. 
+    <br/>
+	The state when all solution candidate lists contain exactly one element, will be called "SOLUTION FOUND". The state 
+	when there is an empty candidate list, will be "INCONSISTENCY FOUND"
+    </p>
+
+    <h2>
+	Definition of PROPAGATION
+    </h2>
+    <p>
+	The following procedure will be called "propagation": remove all solution candidates X such that there is a branch B 
+	with its own solution candidates B_1, ..., B_N and for each B_i X is not provably assignable to B_i
+    </p>
+
+    <h2>
+	Definition of SEARCH
+    </h2>
+    <p>
+	A recursive procedure below describes the search for a solution. First we do PROPAGATION. If solution found - global 
+	stop, we are done. If inconsistency found - "roll back" to previous recursion level. (If it was the first level, then 
+	we are in trouble: the data we had was not enough to build stackmaptable attribute).
+    </p>
+    <p>
+	Then we remember all candidate lists (to return here in case we roll back from the next recursion level), chose 
+	a list where there is more than one candidate, select a candidate there, remove all other candidates and apply SEARCH 
+	(i.e. launch the next recursion level) with reduced list of candidates. If SEARCH found a solution then it's a global 
+	stop. If it found inconsistency then restore remembered state, select another candidate from the list, and launch the 
+	next recursion level again. If there are no more candidates and solution is not yet found - roll back to the previous 
+	recursion level (if it was the first level - we are in trouble again).
+    </p>
+
+
+    <h2>
+	Dealing with dead code
+    </h2>
+    <p>
+	It's not a simple task to calculate stackmaptable attribute for the beginning of dead (unreachable) block of code.
+        Despite the code dead, it's verified by Java6 verifier (required by spec) and thus it should satisfy all instructions 
+        tat follows. Moreover dead code might be in the scope of a reachable exception handler and thus may affect stackmaptable
+        in the reachable parts of the code. So to kill the problem it's easier to modify class file rather than to build 
+        stackmaptable (which is even not always possible).
+    </p>
+    <p>
+	First, we avoid the situation when the dead code is the only intersection of two different try blocks (since their 
+        handlers may have incompatible types): for each try block that starts or ends in the dead code we reduce scope to 
+        eliminate dead code from the try block (when dead code is in the middle then it's OK).
+    <br/>
+        Next, we change the code in the dead block with NOPs followed by ATHROW.
+    <br/>
+        Finally, we build stackmaptable for the beginning of the dead block: its stack contains just a single element NULL,
+        and (to make it compatible with possible exception handlers) its locals are exactly the same as locals in the 
+        stackmaptable for the first alive instruction that follows dead code.
+    </p>
+
+    <h2>
+	Handling invokevirtual/putfield/getfield instructions
+    </h2>
+    <p>
+	Sometimes verifier has to know whether a field or a method referenced in the class is declared in the super class
+        of the current class or not. This is necessary to understand which type the instruction expects. But to answer the 
+        question we have to load ether super classes of the current class or a class where referenced member is declared.
+        class_is_extending_class method from the class interface is called to figure that out.
+    </p>
+    <p>
+	In our case we can't load additional classes, but recompute stackmap functionality works correct if 
+        class_is_extending_class always returns NULL (indicating that referenced class is not a super class of 
+        the current one). To make sure that stackmap table is correct verifier chooses the least general 
+        (i.e. least close to java.lang.Object) type among several possible for the SOLUTION.
+    </p>
+
+
+    <h1>
+        <a id="Interface" name="Interface"></a>Verifier Interface
+    </h1>
+    <pre>
+// Allocates an empty verification context for a class, 
+// to be passed back to the verifier upon verification requests.
+// Memory must be disposed by calling free_verification_context 
+// (see below).
+// @param klass - class handler
+// @return a verification context for the class
+verification_context 
+allocate_verification_context(class_handler klass);
+
+// Initializes the verification context with method's information. 
+// This function must be called before instrumenting the method.
+// The resulting context should be passed back to the verifier 
+// upon verification requests
+// @param method - method handler
+// @param[in,out] context - verification context of the 
+// method's defining class
+// @return error code 
+vf_Result 
+init_verification_context_for_method(method_handler method, verification_context context);
+
+// Recomputes the StackMapTable of a method using the verification 
+// context created and initialized prior
+// to method instrumentation
+// @param[out] attrBytes - a pointer to a newly allocated StackMapTable
+// attribute. Memory must be disposed by calling free_stackmaptable
+// (see below).
+// @param method - method handler
+// @param context - class and method verification context
+// @return error code
+vf_Result recompute_stackmaptable(uint8 **attrBytes, 
+  method_handler method, verification_context context);
+
+// Frees memory allocated for a StackMapTable attribute
+void free_stackmaptable(uint8 *attrBytes);
+
+// Frees memory allocated for a verification context
+void free_verification_context (verification_context context);
+    </pre>
+
+
+</body>
+</html>
+
+
+

Added: harmony/standard/site/xdocs/subcomponents/drlvm/x-verifier.xml
URL: http://svn.apache.org/viewvc/harmony/standard/site/xdocs/subcomponents/drlvm/x-verifier.xml?rev=639296&view=auto
==============================================================================
--- harmony/standard/site/xdocs/subcomponents/drlvm/x-verifier.xml (added)
+++ harmony/standard/site/xdocs/subcomponents/drlvm/x-verifier.xml Thu Mar 20 07:26:07 2008
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements. See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License. You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<document>
+  <properties>
+    <title>Verifier</title>
+    <author email="dev@harmony.apache.org">Harmony Documentation Team</author>
+  </properties>
+
+  <body>
+   <docinclude name="subcomponents/drlvm/x-verifier.htm"/>
+  </body>
+</document> 

Propchange: harmony/standard/site/xdocs/subcomponents/drlvm/x-verifier.xml
------------------------------------------------------------------------------
    svn:eol-style = native