Closed Bug 563123 Opened 14 years ago Closed 14 years ago

use js::HashMap for JSCodeGenerator::constList

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: luke, Assigned: luke)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

Attached patch patchSplinter Review
This is good for 549143 when values don't fit in a void*.  Also it would be nice to move away from atomized doubles.
Attachment #442885 - Flags: review?(igor)
Attachment #442885 - Flags: review?(igor) → review+
Comment on attachment 442885 [details] [diff] [review]
patch

>diff --git a/js/src/jsemit.cpp b/js/src/jsemit.cpp
>@@ -1639,20 +1641,19 @@ LookupCompileTimeConstant(JSContext >+            if (JSConstMap::Ptr p = cg->constMap.lookup(atom)) {
>+                JS_ASSERT(p->value != JSVAL_HOLE);
>+                *vp = p->value;
>                 return JS_TRUE;

...

>+typedef js::HashMap<JSAtom *, jsval> JSConstMap;

> struct JSCodeGenerator : public JSTreeContext
> {

Nit: put JSConstMap typedef into JSCodeGenerator. That would lengthen somewhat the lookup statement, but that perhaps suggests to have an alternative lookup method like bool lookup(Value &)
(In reply to comment #1)
Thanks.  'JSCodeGenerator::ConstMap p = cg->constMap.lookup(atom);' still fits on one line, so, to keep the patch small, I didn't method-ize anything.

http://hg.mozilla.org/tracemonkey/rev/c6857d0b1e9f
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/c6857d0b1e9f
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: