Closed Bug 570662 Opened 13 years ago Closed 12 years ago
TM: eagerly call this
Object hook and cache result in global objects
This patch does less than we could do, but I ran into a few complications. Also, its not entirely clear this is safe. If this works, we can rip out JSFRAME_CALCULATED_THIS and remove fp->thisv, but that patch is pretty involved, so lets do this one by one.
Assignee: general → gal
Things that worry me: thisObject hook runs when the global object is made, not when accessing .this, so stack and scope chain might look different. Also, invalidation? Or is this always safe? With our cross compartment wrappers this should be safe for sure. Right now not so sure.
Note the code around this comment: /* Now that the frame has been pushed, we can call the thisObject hook. */ Thats basically exactly what worries me.
Blake noticed that if you call thisObject from JS_SetGlobalObject, it will call JS_GetScopeChain and get back a wrong answer (likely NULL). So we wait until the first time you need it.
Comment on attachment 454096 [details] [diff] [review] v2 mrbkap says it's ok
Attachment #454096 - Flags: review?(mrbkap) → review+
Also requires this follow-up fix: http://hg.mozilla.org/tracemonkey/rev/f454bf6a0693
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.