Bug 102728 - [compiler] Reduce the stack depth demands of extended string concatenation ASTs
Summary: [compiler] Reduce the stack depth demands of extended string concatenation ASTs
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M1   Edit
Assignee: Maxime Daniel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 131718 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-07-05 09:37 EDT by Olivier Thomann CLA
Modified: 2006-08-08 01:29 EDT (History)
0 users

See Also:


Attachments
Suggested fix plus test cases (64.64 KB, patch)
2006-06-26 06:17 EDT, Maxime Daniel CLA
no flags Details | Diff
TARGET_321 compatible patch (66.65 KB, patch)
2006-06-27 05:17 EDT, Maxime Daniel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2005-07-05 09:37:46 EDT
The addition of an N-ary operator could be a good improvement to prevent deep
recursion.
It could also simplify the code of the extended string literal. In this case we
would preserve every part of the string literal concatenation and this would be
an improvement for the ast conversion.
 
Once this operator is in place, we should revisit bug 97220. A bit could be set
on the string literal to prevent the warning from being generated and therefore
it could simplify the filtering of those warnings depending on the context.
Comment 1 Olivier Thomann CLA 2006-03-24 20:50:40 EST
*** Bug 131718 has been marked as a duplicate of this bug. ***
Comment 2 Philipe Mulet CLA 2006-04-05 07:50:34 EDT
tagged with 'greatbug' to convey information from dup bug.

BTW, javac is failing as we do, due to deep recursion in algorithm.
Also, a workaround is to pump up the size of the execution stack to accomodate such scenario using the command line argument: "-Xss"


Comment 3 Philipe Mulet CLA 2006-04-18 07:09:27 EDT
The "greatbug" keyword needs to be justified as commented in bug 131718. In absence of any further explanation it isn't great any longer.
Will soon timeout.
Comment 4 Philipe Mulet CLA 2006-05-29 10:35:49 EDT
Timeout: Removed keyword 
Comment 5 Maxime Daniel CLA 2006-06-26 06:17:36 EDT
Created attachment 45289 [details]
Suggested fix plus test cases

The design point is to insert a CombinedBinaryExpression once in a while into deep String concatenations, CombinedBinaryExpression being a BinaryExpression which knows about intermediate nodes of its left branch, and which implements in a non recursive manner the most sensitive algorithms of BinaryExpression. See details into CombinedBinaryExpression and Parser.
Patch currently under test.
Comment 6 Maxime Daniel CLA 2006-06-26 10:41:52 EDT
Changing the title to better reflect what was finally agreed upon. 
Comment 7 Maxime Daniel CLA 2006-06-26 10:48:42 EDT
Released for 3.3 M1

The current implementation manages to compile smoothly string concatenations that result into method bodies multiple times larger than the current code size limit for method bodies.
The design could be generalized to other operators if needed.

Verifier please look at XLargeTest#10 and following.

Opening a separate bug to track the code formatter behavior in extreme cases.
Comment 8 Maxime Daniel CLA 2006-06-27 05:17:19 EDT
Created attachment 45372 [details]
TARGET_321 compatible patch

Also improves homogeneity checking and tests suite.
Comment 9 Olivier Thomann CLA 2006-07-17 14:06:14 EDT
Added org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests.test625 to handle the code formatter side of this issue.
Changes in org.eclipse.jdt.internal.formatter.BinaryExpressionFragmentBuilder
and org.eclipse.jdt.internal.formatter.CodeFormatterVisitor.
Fixed and released in HEAD.
Comment 10 Olivier Thomann CLA 2006-07-19 15:27:17 EDT
Maxime,

Be sure to also release the fix for bug 151118 if you backport to 3.2.1.
Comment 11 Frederic Fusier CLA 2006-08-07 12:03:54 EDT
Verified for 3.3 M1 using build I20060807-0010.