Closed
Bug 486106
Opened 17 years ago
Closed 17 years ago
LookupResult from jsapi.cpp does not support fast arrays
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: igor, Assigned: igor)
References
Details
(Keywords: fixed1.9.1, regression, Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file, 1 obsolete file)
|
2.85 KB,
patch
|
igor
:
review+
|
Details | Diff | Splinter Review |
LookupResult, http://hg.mozilla.org/tracemonkey/file/d16703358efc/js/src/jsapi.cpp#l3224 , contains the following code:
if (OBJ_IS_NATIVE(obj2)) {
/* Peek at the native property's slot value, without doing a Get. */
sprop = (JSScopeProperty *)prop;
rval = SPROP_HAS_VALID_SLOT(sprop, OBJ_SCOPE(obj2))
? LOCKED_OBJ_GET_SLOT(obj2, sprop->slot)
: JSVAL_TRUE;
} else {
/* XXX bad API: no way to return "defined but value unknown" */
rval = JSVAL_TRUE;
}
Due to this OBJ_IS_NATIVE(obj2) check the code ignores fast arrays. It means hat any JS API that uses this helper function would return JS_TRUE instead of the real element in the array.
I nominate this for 1.9.0 so the fix could be included in JS1.8 release.
The bug was reported in http://groups.google.com/group/mozilla.dev.tech.js-engine/msg/1cbef3c6613572d1 .
Flags: wanted1.9.0.x?
Flags: blocking1.9.1?
| Assignee | ||
Comment 1•17 years ago
|
||
The patch makes sure that from the point of various JS*Lookup API a fast array behaves as an ordinary native object to restore API compatibility.
Attachment #370221 -
Flags: review?(shaver)
Updated•17 years ago
|
Flags: wanted1.9.1+
Flags: blocking1.9.1?
Flags: blocking1.9.1-
Comment 2•17 years ago
|
||
Comment on attachment 370221 [details] [diff] [review]
v1
>+/*
>+ * Utility to access the value from the id returned by array_lookupProperty.
>+ */
>+jsval
>+js_GetDenseArrayPropertyValue(JSObject *obj, JSProperty *prop);
Wants to be called "ElementValue" I think, since it only works on int-indexed properties. Looks good otherwise.
Attachment #370221 -
Flags: review?(shaver) → review+
| Assignee | ||
Comment 3•17 years ago
|
||
I removed 1.9.0 nomination as patches for JS1.8 would go to a separated branch.
Flags: wanted1.9.0.x?
| Assignee | ||
Comment 4•17 years ago
|
||
I the new version of the patch I renamed js_GetDenseArrayPropertyValue to js_GetDenseArrayElementValue.
Attachment #370221 -
Attachment is obsolete: true
Attachment #370250 -
Flags: review+
| Assignee | ||
Comment 5•17 years ago
|
||
landed to TM - http://hg.mozilla.org/tracemonkey/rev/51374b541888
Whiteboard: fixed-in-tracemonkey
Comment 6•17 years ago
|
||
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Comment 7•17 years ago
|
||
Keywords: fixed1.9.1
You need to log in
before you can comment on or make changes to this bug.
Description
•