Closed Bug 558144 Opened 14 years ago Closed 14 years ago

un-macroize OBJ_SCOPE, OBJ_SHAPE, LOCKED_OBJ_SET_SLOT, LOCKED_OBJ_GET_SLOT

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
... with
JSScope *JSObject::scope()
uint32 JSObject::shape()
jsval JSObject::lockedGetSlot(uintN slot);
void JSObject::lockedSetSlot(uintN slot, jsval value);
Attachment #437917 - Flags: review?(jwalden+bmo)
Comment on attachment 437917 [details] [diff] [review]
patch

>diff --git a/js/src/jslock.h b/js/src/jslock.h

> #define JS_SET_OBJ_INFO(obj_, file_, line_)                                   \
>-    JS_SET_SCOPE_INFO(OBJ_SCOPE(obj_), file_, line_)
>+    JS_SET_SCOPE_INFO(obj_->scope(), file_, line_)

(obj_)->scope()


>-#define JS_LOCK_OBJ(cx,obj)       (CX_OWNS_SCOPE_TITLE(cx, OBJ_SCOPE(obj))    \
>+#define JS_LOCK_OBJ(cx,obj)       (CX_OWNS_SCOPE_TITLE(cx, obj->scope())      \
>                                    ? (void)0                                  \
>                                    : (js_LockObj(cx, obj),                    \
>                                       JS_SET_OBJ_INFO(obj,__FILE__,__LINE__)))
>-#define JS_UNLOCK_OBJ(cx,obj)     (CX_OWNS_SCOPE_TITLE(cx, OBJ_SCOPE(obj))    \
>+#define JS_UNLOCK_OBJ(cx,obj)     (CX_OWNS_SCOPE_TITLE(cx, obj->scope())      \
>                                    ? (void)0 : js_UnlockObj(cx, obj))

Hmm, this has the same -- pre-existing -- problem.  JS_BEGIN_MACRO/JS_END_MACRO plus a temporary to fix in each of these?


>-#define CX_OWNS_OBJECT_TITLE(cx,obj) CX_OWNS_SCOPE_TITLE(cx, OBJ_SCOPE(obj))
>+#define CX_OWNS_OBJECT_TITLE(cx,obj) CX_OWNS_SCOPE_TITLE(cx, obj->scope())

(obj)->scope()
Attachment #437917 - Flags: review?(jwalden+bmo) → review+
Nice catches, thanks!
http://hg.mozilla.org/tracemonkey/rev/3989d32b13fc
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/3989d32b13fc
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: