Remove LookupCompileTimeConstant()

RESOLVED FIXED in mozilla16

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: njn, Assigned: njn)

Tracking

unspecified
mozilla16
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [js:t])

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 634266 [details] [diff] [review]
patch

LookupCompileTimeConstant() is a problem for lazy bytecode.  It potentially traverses along bce->parent from the innermost BytecodeEmitter all the way to the top of the BytecodeEmitter chain.  But if we're lazily compiling an inner function we won't have the parent BytecodeEmitter around any more.

It's there just to optimize the handling of |const| variables in switches, e.g.:

  const x = "foo"
  switch (y) {
    case x: ...
    ...
  }

It's an old optimization, pre-dating the CVS-to-Mercurial transition in 2007.  And I don't think |const| is used that much on the web, is it?

bhackett said "it's antique code and if there is any need for what it's doing we can do a more effective job using TI info during mjit compilation".
Attachment #634266 - Flags: review?(bhackett1024)

Comment 1

5 years ago
I also found, in the case of huge generated JS files, that it takes like 10% of total frontend time.
Attachment #634266 - Flags: review?(bhackett1024) → review+
(Assignee)

Comment 2

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/666e228c06ab
https://hg.mozilla.org/mozilla-central/rev/666e228c06ab
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
You need to log in before you can comment on or make changes to this bug.