Closed
Bug 976596
Opened 11 years ago
Closed 11 years ago
Block-scoped variables indexing refactor
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla30
People
(Reporter: wingo, Assigned: wingo)
Details
Attachments
(1 file)
|
18.94 KB,
patch
|
luke
:
review+
|
Details | Diff | Splinter Review |
This is a followup to bug 962599 comment 26, to refactor some namings in block scope objects.
| Assignee | ||
Comment 1•11 years ago
|
||
| Assignee | ||
Updated•11 years ago
|
Assignee: nobody → wingo
| Assignee | ||
Updated•11 years ago
|
Attachment #8381463 -
Flags: review?(luke)
Comment 2•11 years ago
|
||
Comment on attachment 8381463 [details] [diff] [review]
Block-scoped variables indexing refactor
Review of attachment 8381463 [details] [diff] [review]:
-----------------------------------------------------------------
Great!
::: js/src/vm/ScopeObject.h
@@ +410,1 @@
> return propertyCount();
I was just looking at this and I was astounded to see that propertyCount() is O(n)! Could you add a
// TODO: propertyCount() is O(n), use O(1) lastProperty()->slot() instead
here? (Even worse, numVariables() is used in loop conditions, making the loops O(n^2)!)
Attachment #8381463 -
Flags: review?(luke) → review+
| Assignee | ||
Comment 3•11 years ago
|
||
(In reply to Luke Wagner [:luke] from comment #2)
> I was just looking at this and I was astounded to see that propertyCount()
> is O(n)!
Yuck! Good catch. Added the comment.
| Assignee | ||
Comment 4•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in
before you can comment on or make changes to this bug.
Description
•