Closed Bug 418889 Opened 17 years ago Closed 17 years ago

Instances of builtin types only referenced from the local variables can get prematurely collected

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

x86
All
defect
Not set
major

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: treilly, Assigned: treilly)

Details

Attachments

(1 file, 2 obsolete files)

(Note: Found in FP 9.0.115.0 aka MovieStar) Steps to reproduce: 1. Launch Photoshop Express on FP 9.0.115.0 2. Launch Editor 3. Select crop/rotate 4. Pick up one of the crop handles and drag crop rectangle around Actual Results: Intermittent flashing of rectangle while cropping. This is indicative of this particular sort of failure: private function f() { var p = new Point(1,1); var x:Number = p.x; var y:Number = p.y; for(var i:int=0;i<10000;i++) { new Point(0,0); } x = p.x; y = p.y; trace(x+y) } Intermittently, the traced output will be 0 because foo will have been incorrectly collected when the other allocations take place. Expected Results: No flashing. Workaround (if any): If you subclass the built in type with a user defined type and use those types instead the JIT behaves differently and this problem doesn't arise. Transferred Comments: treilly - Thu Feb 21 14:58:55 CST 2008 I updated the bug to make it clearer
Attached patch Hacky fix (obsolete) — Splinter Review
Assignee: nobody → treilly
Status: NEW → ASSIGNED
Attachment #304811 - Flags: review?(edwsmith)
Comment on attachment 304811 [details] [diff] [review] Hacky fix equivalent but less hacky/risky fix would be to add a new MIR opcode, MIR_addptr, identical to MIR_add, except without the MIR_cse flag. if we find any other places we're doing pointer math, its easy to change LIR_add to LIR_addptr
If we're gonna go that far why not just make cseMatch call extendLast use on the MIR_addptr's oprnd2? would extendLastUse(ins, ip, ip) work?
I scanned all MIR_add/sub's and this is the only instance of pointer math.
Ed says: the extra > add's in x86 cost less than the extra store/loads from higher > register pressure. > so I'll roll the MIR_addptr idea and forget about trying to make cse work.
Attachment #304811 - Attachment is obsolete: true
Attachment #304821 - Flags: review?(edwsmith)
Attachment #304811 - Flags: review?(edwsmith)
Attachment #304821 - Flags: review?(rreitmai)
Comment on attachment 304821 [details] [diff] [review] Less hacky but essentially the same fix ok,so teh ptr, is no longer getting cse'd but still, the exterior pointer may not survive past the wb call; no? Did I miss some code?
Attachment #304821 - Flags: review?(rreitmai) → review+
The real pointer will have to still be around for additional set/get slot operations b/c we aren't letting CSE happen on the derived pointer the object will be visible. Using the unoffset pointer for the WB calls is really just fixing another bug (that Apollo ran into a couple weeks ago).
Comment on attachment 304821 [details] [diff] [review] Less hacky but essentially the same fix looks good to me, clearly x-platform testing is a must.
Attachment #304821 - Flags: review?(edwsmith) → review+
Attachment #304821 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Resolved fixed engineering / work item that has been pushed. Setting status to verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: