Closed
Bug 466781
Opened 16 years ago
Closed 16 years ago
TM: inconsistent (0 in d) where d is a String
Categories
(Core :: JavaScript Engine, defect, P1)
Tracking
()
VERIFIED
FIXED
People
(Reporter: jruderman, Assigned: sayrer)
References
Details
(Keywords: testcase, verified1.9.1, Whiteboard: [fixed-in-tracemonkey])
Attachments
(2 files, 4 obsolete files)
4.58 KB,
text/plain
|
Details | |
3.14 KB,
patch
|
sayrer
:
review+
|
Details | Diff | Splinter Review |
js> for each (let d in [new String('q'), new String('q'), new String('q')]) { print('' + (0 in d)); }
true
true
false
![]() |
||
Updated•16 years ago
|
Flags: blocking1.9.1?
Assignee | ||
Updated•16 years ago
|
Flags: blocking1.9.1? → blocking1.9.1+
Priority: -- → P1
Assignee | ||
Comment 1•16 years ago
|
||
WFM on tm.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → WORKSFORME
Assignee | ||
Comment 2•16 years ago
|
||
oops, no, it is still broken
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Comment 3•16 years ago
|
||
Note that these are string objects, not primitive strings. This calls into HasNamedProperty.
Assignee | ||
Comment 4•16 years ago
|
||
Look at the resolve flags being passed from the third, traced property lookup.
Looks like cx->resolveFlags is not right.
Assignee | ||
Comment 5•16 years ago
|
||
InferFlags() in jsobj.cpp doesn't seem to get the right answer on trace.
Assignee | ||
Comment 6•16 years ago
|
||
The copy of js_GetTopStackFrame in jstracer.cpp references bug 462027. Does this mean we're broken for anything calling InferFlags, and objects with custom JSResolveOps in this particular case?
Assignee | ||
Comment 7•16 years ago
|
||
OK, after talking to jorendorff, I think this depends on bug 462027, so we can side exit in case there's a resolve op that re-enters. However, it seems to me that InferFlags() needn't interfere with us in this particular case, and we can get around it by setting the resolve op.
Depends on: deepbail
Assignee | ||
Comment 8•16 years ago
|
||
I think this will work because these functions are called only from a recorded record_JSOP_IN.
Seems like this should be an improvement, but not a perfect fix without a way to bail if we hit a meddling resolve implementation.
Attachment #356028 -
Flags: review?(brendan)
Comment 9•16 years ago
|
||
This patch is missing trace-tests!
Rob, you can make the builtin fail if anything about the situation smells fishy. (Non-native object, class has a resolve hook, whatever.) Then we'll just bail out and retry from the interpreter.
I think a lot of builtins (and more all the time) are "optimistic" about doing stuff that could examine the stack, call random native code, or reenter the interpreter. The #ifdef DEBUG_jason assertion in js_GetTopStackFrame catches those cases, and I hit it a lot. That assert is going to be turned on for everyone in bug 462027 -- brace yourselves.
Assignee | ||
Comment 10•16 years ago
|
||
now with bailing and tests
Assignee: general → sayrer
Attachment #356028 -
Attachment is obsolete: true
Attachment #356087 -
Flags: review?(brendan)
Attachment #356028 -
Flags: review?(brendan)
Assignee | ||
Updated•16 years ago
|
Attachment #356087 -
Attachment is patch: true
Attachment #356087 -
Attachment mime type: application/octet-stream → text/plain
Assignee | ||
Updated•16 years ago
|
Attachment #356087 -
Attachment description: bail on unknown resolve ops, set the resolve op → bail on unknown resolve ops, set the resolve flags
Assignee | ||
Comment 11•16 years ago
|
||
Attachment #356087 -
Attachment is obsolete: true
Attachment #356087 -
Flags: review?(brendan)
Assignee | ||
Comment 12•16 years ago
|
||
Attachment #356132 -
Attachment is obsolete: true
Assignee | ||
Updated•16 years ago
|
Attachment #356133 -
Attachment is patch: true
Attachment #356133 -
Attachment mime type: application/octet-stream → text/plain
Assignee | ||
Updated•16 years ago
|
Attachment #356133 -
Flags: review?(brendan)
Updated•16 years ago
|
Attachment #356133 -
Flags: review?(brendan) → review+
Comment 13•16 years ago
|
||
Comment on attachment 356133 [details] [diff] [review]
consolidate some more code
>+static JSBool HasProperty(JSContext* cx, JSObject* obj, jsid id)
House style wants function name on its own line after qualifiers/type/mode.
> {
>+ // check whether we know how the resolve op will behave
>+ JSClass* clasp = OBJ_GET_CLASS(cx, obj);
>+ if (clasp->resolve != JS_ResolveStub && clasp != &js_StringClass)
> return JSVAL_TO_BOOLEAN(JSVAL_VOID);
>+ JSAutoResolveFlags rf(cx, JSRESOLVE_QUALIFIED);
>
No trailing whitespace please!
Prettier to put the blank line before rf's definition, not after.
r=me with nits picked.
/be
Assignee | ||
Comment 14•16 years ago
|
||
Attachment #356135 -
Flags: review+
Assignee | ||
Updated•16 years ago
|
Attachment #356133 -
Attachment is obsolete: true
Assignee | ||
Updated•16 years ago
|
Attachment #356135 -
Attachment is patch: true
Attachment #356135 -
Attachment mime type: application/octet-stream → text/plain
Assignee | ||
Updated•16 years ago
|
Whiteboard: fixed-in-tracemonkey
Assignee | ||
Comment 15•16 years ago
|
||
Comment 16•16 years ago
|
||
I'm not sure this is good enough--property lookups can also call resolve hooks for other objects up the prototype chain.
Comment 17•16 years ago
|
||
(In reply to comment #16)
> I'm not sure this is good enough--property lookups can also call resolve hooks
> for other objects up the prototype chain.
You're right, this could be an issue for XPConnect and the DOM. For the core engine it shouldn't be. Separated bug needed.
/be
Comment 18•16 years ago
|
||
Filed bug 473075.
Assignee | ||
Comment 19•16 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 16 years ago → 16 years ago
Resolution: --- → FIXED
Comment 20•16 years ago
|
||
test updated in http://hg.mozilla.org/mozilla-central/rev/7eb907886ae7
and /cvsroot/mozilla/js/tests/js1_8_1/trace/trace-test.js,v <--
trace-test.js
new revision: 1.9; previous revision: 1.8
verified 1.9.1 tracemonkey, 1.9.2.
Status: RESOLVED → VERIFIED
Flags: in-testsuite+
Flags: in-litmus-
Whiteboard: fixed-in-tracemonkey → [fixed-in-tracemonkey][needs 1.9.1 landing]
Assignee | ||
Comment 21•16 years ago
|
||
Keywords: fixed1.9.1
Assignee | ||
Updated•16 years ago
|
Whiteboard: [fixed-in-tracemonkey][needs 1.9.1 landing] → [fixed-in-tracemonkey]
You need to log in
before you can comment on or make changes to this bug.
Description
•