Closed Bug 417981 Opened 17 years ago Closed 17 years ago

PROPERTY_CACHE_TEST called with non-native objects

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9beta4

People

(Reporter: shaver, Assigned: brendan)

References

Details

Attachments

(2 files)

JSOP_CALLPROP calls PROPERTY_CACHE_TEST without verifying that the object in question is native, and with the arrays patch in bug 322889 the object often is not. JSOP_NAME, JSOP_BINDNAME, and JSOP_CALLNAME do the same; if we're sure that fp->scopeChain can only be a native object then we should assert it, otherwise they need to defend as well. (JSOP_SET{NAME,PROP} defend by checking ops->setProperty vs js_SetProperty before the open-coded "JS_PROPERTY_CACHE_TEST". JSOP_GETPROP and JSOP_GETPROPX check getProperty instead.) The semantics of PROPERTY_CACHE_TEST don't seem to permit an easy internal check, so I guess we'll need to add such a test to each of the callers.
Yes, callers must test. My bad -- but hmm, wouldn't we want array.method() to win from property cache (esp. the polymorphic L1 fast hit -- "pchit" -- case)? Should Array.prototype be a slow array (i.e., native)? /be
Assignee: general → brendan
Flags: blocking1.9+
OS: Mac OS X → All
Priority: -- → P1
Hardware: PC → All
Target Milestone: --- → mozilla1.9beta4
Happily, Array.prototype is always a slow array, because the non-index names of the methods force it to be.
Status: NEW → ASSIGNED
diff -w version of same next. /be
Attachment #303960 - Flags: review?(shaver)
Looks OK to me, testing it out now. I don't see that this will cause us to get propcache love for array methods, but that sounds like prime follow-on fodder to me
Comment on attachment 303960 [details] [diff] [review] native guards for P_C_T, plus more efficient else clauses Tests out well too, r=shaver.
Attachment #303960 - Flags: review?(shaver) → review+
Blocks: 418239
Filed bug 418239 on not hitting the propcache for native prototypes of non-native objects.
No longer blocks: 418239
Depends on: 418239
Fixed: js/src/jsinterp.c 3.431 js/src/jsinterp.h 3.75 Thanks for the followup bug, I'll take that now. /be
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Flags: in-testsuite-
Flags: in-litmus-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: