| 
                         我们注意到,当我们在 
 Java 6上编译我们的类时,它们始终大于Java 5. 
  
  我明白到目前为止,字节码没有改变,所以我认为Java 6编译器正在投入更多的东西.这是否需要,还是有什么办法把它关闭,仍然编译Java 6源代码? 
解决方法
 版本6 javac正在类文件中生成额外的“Stack Map”属性,以使jvm的验证更容易,更快.我怀疑这个数量太大了,你可以通过使用-target 1.5选项来生成与之前版本相同的字节码. 
  
 编辑:有关此新属性的详细信息,请参见jsr 202的4.8.4节  
  
  
  4.8.4 The StackMapTable Attribute  
  The stack map attribute is a variable-length attribute in the attributes table of a Code  attribute. The name of the attribute is StackMapTable. This attribute is used during  the process of verification by typechecking (§4.11.1).  
  A stack map attribute consists of zero or more stack map frames. Each stack map frame specifies (either explicitly or implicitly) a bytecode offset,the verification types (§4.11.1) for the local variables,and the verification types for the operand stack.  
                          (编辑:莱芜站长网) 
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! 
                     |