Closed Bug 669786 Opened 14 years ago Closed 14 years ago

JSCodeGenerator::upvarMap should be a js::Vector

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla8

People

(Reporter: cdleary, Assigned: cdleary)

References

Details

(Whiteboard: [fixed-in-tracemonkey])

Attachments

(1 file)

Spotted this when I was working on another bug.
Attachment #544371 - Flags: review?(nnethercote)
Comment on attachment 544371 [details] [diff] [review] upvarMap as vector. Review of attachment 544371 [details] [diff] [review]: ----------------------------------------------------------------- This seems fine, but the point is unclear. I guess it's good to replace an ad-hoc array type with js::Vector? But there's still several other JSUpvarArrays around; getting rid of all of them would be a bigger win. ::: js/src/jsemit.cpp @@ +2341,5 @@ > + size_t lexdepCount = cg->roLexdeps->count(); > + > + JS_ASSERT_IF(!upvarMap.empty(), lexdepCount == upvarMap.length()); > + if (upvarMap.empty()) > + upvarMap.appendN(UpvarCookie(), lexdepCount); Probably better to use infallibleAppendN(), it makes the precondition clearer.
Attachment #544371 - Flags: review?(nnethercote) → review+
(In reply to comment #1) > This seems fine, but the point is unclear. I guess it's good to replace an > ad-hoc array type with js::Vector? But there's still several other > JSUpvarArrays around; getting rid of all of them would be a bigger win. The other ones are uses of the type embedded in JSScript, and we hate increasing the size of JSScript for memory footprint reasons. Second comment is good -- it's actually fallible and I forgot to check! It's just a lazy vector capacity initialization like in the original.
Depends on: 670772
Whiteboard: fixed-in-tracemonkey → [fixed-in-tracemonkey] [inbound]
Backed out of m-i as part of a mass backout.
Whiteboard: [fixed-in-tracemonkey] [inbound] → [fixed-in-tracemonkey]
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: