Bug 36620 - Possibility of inlining getter and setter
Summary: Possibility of inlining getter and setter
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows NT
: P3 enhancement (vote)
Target Milestone: 3.0 M1   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-17 06:51 EDT by JN Meunier CLA
Modified: 2003-06-02 06:12 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description JN Meunier CLA 2003-04-17 06:51:31 EDT
It would be great to be able to inline getter and/or setter. Why not adding a
dialog box containing 2 checkboxes (one for getter, one for setter) asking if to
inline.
Comment 1 Philipe Mulet CLA 2003-04-17 07:18:44 EDT
I assume you mean when generating code ? Inlining getters and setters is a 
standard VM-JIT optimization, once the entire application code is made 
available at runtime, and actual receiver runtime types are available (as 
opposed to compile-time declared ones). When compiling though, this is a risky 
game, since some getter/setter may get redefined somewhere else in a subclass, 
defeating all previous optimizations.

Performing these optimizations at compile-time isn't safe.
Comment 2 Adam Kiezun CLA 2003-04-17 07:35:15 EDT
no, i guess he meant ui :-)
Comment 3 Philipe Mulet CLA 2003-04-17 10:06:32 EDT
from reporter:

Ok. You are right. I didn't know it was a VM-JIT optimization. So does 
this mean that you never need to put the keywork "final" in the 
signature of a getter/setter, and that any VM is sufficiently clever to 
know if it can be inlined or not ?
Comment 4 Philipe Mulet CLA 2003-04-17 10:07:32 EDT
In theory, yes with a good JIT.