[ 
https://jira.terracotta.org/jira//browse/CDV-286?page=comments#action_21222 ] 
            
Eugene Kuleshov commented on CDV-286:
-------------------------------------

The exception says it. There is a loaded feature in "LocalVariablesSorter" that 
allows to incrementally update stackmap frames, to allow to avoid full 
recalculation. So, ClassReader.accept() calls that receive any subclass of 
LocalVariable sorter need EXPAND_FRAMES flag. 

However to make it work, all the chained visitors should also support 
incremental stackmap updates (which is not always simple task and it would 
require special attention).

If we can't support incremental updates, then we'll need to turn on 
COMPUTE_FRAMES on ClassWriters. But then we'll need special class resolver 
(ClassWriter.getCommonSuperClass() need to be overwritten) that would resolve 
classes without classloading. That all will slowdown transformation quite a 
bit. 

There is an alternative way. Since JVM would fall back to old bytecode verifier 
and there is no other bytecode additions in Java 6, we can downgrade Java 6 
bytecode to Java 5 and strip all frame information from transformed classes 
using ClassReader.SKIP_FRAMES flag. This option will buy us time until Java 7.


> Issues with Java 6 bytecode
> ---------------------------
>
>                 Key: CDV-286
>                 URL: https://jira.terracotta.org/jira//browse/CDV-286
>             Project: Community Development
>          Issue Type: Bug
>          Components: DSO:L1
>    Affects Versions: 2.3
>            Reporter: Eugene Kuleshov
>         Assigned To: Eugene Kuleshov
>
> We saw some failure when instrumenting bytecode compiled with -target 1.6:
> java.lang.IllegalStateException: ClassReader.accept() should be called with 
> EXPAND_FRAMES flag
>   at 
> com.tc.asm.commons.LocalVariablesSorter.visitFrame(LocalVariablesSorter.java:169)
>          
>   at com.tc.asm.ClassReader.accept(ClassReader.java:1159)
>   at com.tc.asm.ClassReader.accept(ClassReader.java:394)
>   at 
> com.tc.object.bytecode.hook.impl.DefaultWeavingStrategy.transform(DefaultWeavingStrategy.java:269)
>         
>   at 
> com.tc.object.bytecode.hook.impl.DSOContextImpl.preProcess(DSOContextImpl.java:137)
>   at 
> com.tc.object.bytecode.hook.impl.ClassProcessorHelper.defineClass0Pre(ClassProcessorHelper.java:416)
>   at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>   at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>   at java.net.URLClassLoader.access$100(URLClassLoader.java:56)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://jira.terracotta.org/jira//secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
tc-dev mailing list
[email protected]
http://lists.terracotta.org/mailman/listinfo/tc-dev

Reply via email to