Bug 247612

Summary: [compiler] Compiler could avoid allocating field bindings for receiver type change
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 Keywords: performance
Version: 3.4   
Target Milestone: 3.5 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
In progress state
none
More advanced patch
none
Improved patch
none
Improved patch 2
none
Improved patch 3
none
Proposed patch
none
Better patch none

Description Philipe Mulet CLA 2008-09-17 04:58:54 EDT
Build 3.5M2

Follow-up of bug 247292, for field specific scenario.

This issue has existed since day 1. The code generation relies on a field
binding to tell its constant pool declaring class. This forces the compiler to
instantiate a new binding each time the receiver type must be used instead of
the target field declaring class.
Comment 1 Philipe Mulet CLA 2008-09-17 05:02:03 EDT
Once this is under control: SourceTypeBinding#RECEIVER_TYPE_EMUL should be discarded and SourceTypeBinding#MAX_SYNTHETICS reduced by one.
Comment 2 Philipe Mulet CLA 2008-09-17 06:20:33 EDT
Also should discard corresponding #codegenBinding slots
Comment 3 Philipe Mulet CLA 2008-09-19 06:34:41 EDT
Will also take care of issue raised in bug 128563#c10 given the new support (see InnerEmulationTest#test157)
Comment 4 Philipe Mulet CLA 2008-09-19 10:31:44 EDT
Created attachment 113015 [details]
In progress state

non functional patch
Comment 5 Philipe Mulet CLA 2008-09-24 08:37:23 EDT
Created attachment 113351 [details]
More advanced patch
Comment 6 Philipe Mulet CLA 2008-09-24 13:11:37 EDT
Created attachment 113390 [details]
Improved patch
Comment 7 Philipe Mulet CLA 2008-09-25 03:47:11 EDT
Created attachment 113439 [details]
Improved patch 2
Comment 8 Philipe Mulet CLA 2008-09-25 10:58:02 EDT
Created attachment 113465 [details]
Improved patch 3

still having issues in eval support
Comment 9 Philipe Mulet CLA 2008-09-25 13:05:07 EDT
Created attachment 113490 [details]
Proposed patch
Comment 10 Philipe Mulet CLA 2008-09-25 17:22:05 EDT
Created attachment 113530 [details]
Better patch

Final version, also takes care of #fieldStore(...)
Comment 11 Philipe Mulet CLA 2008-09-26 06:40:01 EDT
Note to verifiers: it will be hard to assess this bug, since it is a rewrite of an existing functionality. Need to check source code, for the absence of SourceTypeBinding.getUpdateFieldBinding(...) to check we are no longer constructing these bindings.

Numbers from a performance run should also demonstrate the win.

Released for 3.5M3
Comment 12 Philipe Mulet CLA 2008-09-30 09:32:04 EDT
re: comment 3
Issue got forked into bug 249107
Comment 13 Kent Johnson CLA 2008-10-28 13:08:11 EDT
Verified for 3.5M3 using I20081026-2000 build.