Bug 247292 - [compiler] Compiler should avoid allocating method bindings for receiver type change
Summary: [compiler] Compiler should avoid allocating method bindings for receiver type...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.5 M3   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2008-09-15 09:55 EDT by Philipe Mulet CLA
Modified: 2009-05-07 03:32 EDT (History)
0 users

See Also:


Attachments
Proposed patch for 3.5 (57.15 KB, patch)
2008-09-15 09:57 EDT, Philipe Mulet CLA
no flags Details | Diff
Better patch (68.19 KB, patch)
2008-09-15 13:26 EDT, Philipe Mulet CLA
no flags Details | Diff
Better patch /2 (68.05 KB, patch)
2008-09-15 17:19 EDT, Philipe Mulet CLA
no flags Details | Diff
Better patch /3 (224.54 KB, patch)
2008-09-16 09:08 EDT, Philipe Mulet CLA
no flags Details | Diff
Better patch /4 (228.27 KB, patch)
2008-09-16 18:04 EDT, Philipe Mulet CLA
no flags Details | Diff
Additional patch for (2) (25.41 KB, patch)
2008-09-17 07:11 EDT, Philipe Mulet CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2008-09-15 09:55:02 EDT
Build 3.5.M1

This issue has existed since day 1. The code generation relies on a method 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 method declaring class.

1. This could be achieved by passing an extra argument to codeStream.invoke*(..) indicating the constantPool declaring class to use.

2. In the longer run, #codegenBinding slots may be discarded.

3. Same optimization could be applied to field bindings
Comment 1 Philipe Mulet CLA 2008-09-15 09:57:27 EDT
Created attachment 112545 [details]
Proposed patch for 3.5

it also contains fix for bug 128563
Comment 2 Philipe Mulet CLA 2008-09-15 10:00:37 EDT
Patch only covers (1)
Comment 3 Philipe Mulet CLA 2008-09-15 13:26:59 EDT
Created attachment 112568 [details]
Better patch
Comment 4 Philipe Mulet CLA 2008-09-15 17:19:31 EDT
Created attachment 112600 [details]
Better patch /2
Comment 5 Philipe Mulet CLA 2008-09-16 09:08:44 EDT
Created attachment 112663 [details]
Better patch /3

also removed ForeachStatement need for iterator() method binding creation
Comment 6 Philipe Mulet CLA 2008-09-16 18:04:35 EDT
Created attachment 112713 [details]
Better patch /4
Comment 7 Philipe Mulet CLA 2008-09-17 04:59:44 EDT
Forked (3) in separate bug 247612
Comment 8 Philipe Mulet CLA 2008-09-17 07:11:49 EDT
Created attachment 112752 [details]
Additional patch for (2)
Comment 9 Philipe Mulet CLA 2008-09-17 07:12:24 EDT
Released for 3.5M3.
Fixed
Comment 10 Philipe Mulet CLA 2008-09-26 06:40:35 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.getUpdateMethodBinding(...) to check we are no longer constructing these bindings.

Numbers from a performance run should also demonstrate the win.
Comment 11 Kent Johnson CLA 2008-10-28 13:06:28 EDT
Verified for 3.5M3 using I20081026-2000 build.