Bug 204040 - Class literal code generation must be improved for cldc target
Summary: Class literal code generation must be improved for cldc target
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M3   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-19 17:23 EDT by Olivier Thomann CLA
Modified: 2007-10-30 11:08 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2007-09-19 17:23:05 EDT
The code generation for the class literal access should be extracted in a synthetic method. This would prevent a potential verification failure. The actual code generation doesn't flush properly the stack when entering in the catch block.
This is visible with the cldc code since it requires stack maps to be generated.
Comment 1 Olivier Thomann CLA 2007-09-20 14:07:55 EDT
Released in HEAD.
Update existing regression tests.
No need for a synthetic method. The fix was to improve the generation of the stack map frames.
Comment 2 Jerome Lanneluc CLA 2007-10-30 07:06:14 EDT
I'm not sure how to verify this bug: what code was changed ? what tests were updated ?
Comment 3 Olivier Thomann CLA 2007-10-30 10:30:09 EDT
Regression test added in org.eclipse.jdt.core.tests.compiler.regression.Compliance_CLDC#test002
Comment 4 Olivier Thomann CLA 2007-10-30 10:54:52 EDT
An IBM VM 1.6 is required to verify the test case since the Sun VM doesn't detect the verify error.
Comment 5 Jerome Lanneluc CLA 2007-10-30 11:08:03 EDT
To reproduce:
1. Start 3.4M2 on a new workspace
2. Create a Java project with CLDC1.1 as the Generated .class files compatibilty
3. Add the following class:
public class X {
	public static void main(String[] args) {
			System.out.print(X.class != null);
			System.out.print(String.class != null);
			System.out.print(Object.class != null);
			System.out.print(X.class != null);
	}
}
4. Run this class with an IBM 1.6 VM with the following argument: -Xverify:nofallback
Observe: You get the following exception:
Exception in thread "main" java.lang.VerifyError: JVMVRFY012 stack shape inconsistent; class=X, method=main([Ljava/lang/String;)V, pc=10
	at java.lang.J9VMInternals.verifyImpl(Native Method)
	at java.lang.J9VMInternals.verify(J9VMInternals.java:66)
	at java.lang.J9VMInternals.initialize(J9VMInternals.java:127)

The verify error doesn't occur with 3.4M3.

Verified for 3.4M3 using I20071029-0010