Optimized "delete" expressions can often be optimized further

VERIFIED FIXED in mozilla1.9alpha8

Status

()

Core
JavaScript Engine
P4
minor
VERIFIED FIXED
12 years ago
12 years ago

People

(Reporter: Jesse Ruderman, Assigned: brendan)

Tracking

(Blocks: 1 bug, {testcase, verified1.8.1})

Trunk
mozilla1.9alpha8
testcase, verified1.8.1
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [baking until 09/08])

Attachments

(1 attachment)

(Reporter)

Description

12 years ago
> function() { delete 3; }
function () { true; }

> function () { true; }
function () { }

Why isn't it optimized all the way to function () { } in the first round?
(Assignee)

Comment 1

12 years ago
(In reply to comment #0)
> Why isn't it optimized all the way to function () { } in the first round?

Constant folder doesn't handle delete rvalue, so we end up with peephole optimization, which is also independent of the useless expression eliminator. Taking, the decompiler is my red-headed stepchild.

/be
Assignee: general → brendan
OS: Mac OS X 10.4 → All
Priority: -- → P4
Hardware: Macintosh → All
Target Milestone: --- → mozilla1.9beta
(Reporter)

Updated

12 years ago
Blocks: 349611
(Assignee)

Comment 2

12 years ago
Created attachment 237085 [details] [diff] [review]
fix
Attachment #237085 - Flags: review?(mrbkap)

Updated

12 years ago
Attachment #237085 - Flags: review?(mrbkap) → review+
(Assignee)

Comment 3

12 years ago
Fixed on the trunk.

/be
Status: NEW → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
(Assignee)

Comment 4

12 years ago
Comment on attachment 237085 [details] [diff] [review]
fix 

This is a safe fix for the fuzz tester.  It's larger looking than its effects: it does not change CheckSideEffects' behavior on delete expressions except where the operand is not an "lvalue" -- in which case it makes CheckSideEffects consistent with the code generator, so that we don't end up with useless true operators that are culled on a round-trip throught the decompiler.

/be
Attachment #237085 - Flags: approval1.8.1?
Whiteboard: [baking until 09/08]

Comment 5

12 years ago
Comment on attachment 237085 [details] [diff] [review]
fix 

a=schrep for drivers.
Attachment #237085 - Flags: approval1.8.1? → approval1.8.1+
(Assignee)

Comment 6

12 years ago
Fixed on the 1.8 branch.

/be
Keywords: fixed1.8.1
Checking in regress-346915.js;
/cvsroot/mozilla/js/tests/js1_5/Regress/regress-346915.js,v  <--  regress-346915.js
initial revision: 1.1
Flags: in-testsuite+
verified fixed 1.8, 1.9 20060909 windows/mac*/linux
Status: RESOLVED → VERIFIED
Keywords: fixed1.8.1 → verified1.8.1
You need to log in before you can comment on or make changes to this bug.