[vmkit-commits] [vmkit] r147051 - /vmkit/trunk/lib/j3/Compiler/JavaJIT.cpp

Will Dietz wdietz2 at illinois.edu
Wed Dec 21 06:11:39 PST 2011


Author: wdietz2
Date: Wed Dec 21 08:11:39 2011
New Revision: 147051

URL: http://llvm.org/viewvc/llvm-project?rev=147051&view=rev
Log:
Drop requirement that operand stack be empty after processing a method.

I can't find any mention of this in the VM spec, and this assertion causes both
jython and clojure to fail.

Modified:
    vmkit/trunk/lib/j3/Compiler/JavaJIT.cpp

Modified: vmkit/trunk/lib/j3/Compiler/JavaJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/Compiler/JavaJIT.cpp?rev=147051&r1=147050&r2=147051&view=diff
==============================================================================
--- vmkit/trunk/lib/j3/Compiler/JavaJIT.cpp (original)
+++ vmkit/trunk/lib/j3/Compiler/JavaJIT.cpp Wed Dec 21 08:11:39 2011
@@ -1151,7 +1151,12 @@
   reader.cursor = start;
   compileOpcodes(reader, codeLen);
   
-  assert(stack.size() == 0 && "Stack not empty after compiling bytecode");
+  // This isn't a real requirement, although javac-produced bytcode does
+  // seem to adhere to it.  However jython and similar (clojure, etc) don't
+  // always create bytecode that matches this, and AFAICT rejecting the
+  // code is incorrect.
+  //assert(stack.size() == 0 && "Stack not empty after compiling bytecode");
+
   // Fix a javac(?) bug where a method only throws an exception and does
   // not return.
   pred_iterator PI = pred_begin(endBlock);





More information about the vmkit-commits mailing list