Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357887 - Generated code for a new expression should be more efficient
Summary: Generated code for a new expression should be more efficient
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-15 17:30 EDT by Matt Heitz CLA
Modified: 2017-02-23 14:18 EST (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 Matt Heitz CLA 2011-09-15 17:30:06 EDT
Generate this code...

rr R1;
rr = new R1{ i = 7 };

It'll be something like this...

R1 eze$Temp1 = new R1();
{
	R1 eze$SettingTarget1 = new R1();
	eze$SettingTarget1.i = (int)((short) 7);
	org.eclipse.edt.runtime.java.egl.lang.AnyValue.ezeCopyTo(eze$SettingTarget1, eze$Temp1);
}
org.eclipse.edt.runtime.java.egl.lang.AnyValue.ezeCopyTo(eze$Temp1, rr);



Notice that we make TWO new records.  We shouldn't initialize eze$Temp1, and the last line inside the block should be "eze$Temp1 = eze$SettingTarget1;".
Comment 1 Jeff Douglas CLA 2011-09-23 12:08:25 EDT
fixed
Comment 2 Matt Heitz CLA 2011-10-04 14:33:28 EDT
I'm closing this since we no longer make two records in the statement.  We still have the problem that we're calling AnyValue.ezeCopyTo twice: as I wrote, the last line inside the block should be "eze$Temp1 = eze$SettingTarget1;".  I'll let it go for now.