зеркало из https://github.com/mozilla/gecko-dev.git
Merge.
This commit is contained in:
Коммит
227d3cd479
|
@ -242,6 +242,8 @@ js_FillPropertyCache(JSContext *cx, JSObject *obj, jsuword kshape,
|
|||
|
||||
/* If getting a value via a stub getter, we can cache the slot. */
|
||||
if (!(cs->format & JOF_SET) &&
|
||||
!((cs->format & (JOF_INCDEC | JOF_FOR)) &&
|
||||
(sprop->attrs & JSPROP_READONLY)) &&
|
||||
SPROP_HAS_STUB_GETTER(sprop) &&
|
||||
SPROP_HAS_VALID_SLOT(sprop, scope)) {
|
||||
/* Great, let's cache sprop's slot and use it on cache hit. */
|
||||
|
|
|
@ -5090,13 +5090,15 @@ TraceRecorder::test_property_cache_direct_slot(JSObject* obj, LIns* obj_ins, uin
|
|||
if (PCVAL_IS_SPROP(pcval)) {
|
||||
JSScopeProperty* sprop = PCVAL_TO_SPROP(pcval);
|
||||
|
||||
uint32 setflags = (js_CodeSpec[*cx->fp->regs->pc].format & (JOF_SET | JOF_INCDEC));
|
||||
uint32 setflags = (js_CodeSpec[*cx->fp->regs->pc].format & (JOF_SET | JOF_INCDEC | JOF_FOR));
|
||||
if (setflags && !SPROP_HAS_STUB_SETTER(sprop))
|
||||
ABORT_TRACE("non-stub setter");
|
||||
if (setflags != JOF_SET && !SPROP_HAS_STUB_GETTER(sprop))
|
||||
ABORT_TRACE("non-stub getter");
|
||||
if (!SPROP_HAS_VALID_SLOT(sprop, OBJ_SCOPE(obj)))
|
||||
ABORT_TRACE("no valid slot");
|
||||
if (setflags && (sprop->attrs & JSPROP_READONLY))
|
||||
ABORT_TRACE("writing to a readonly property");
|
||||
slot = sprop->slot;
|
||||
} else {
|
||||
if (!PCVAL_IS_SLOT(pcval))
|
||||
|
@ -6260,6 +6262,9 @@ TraceRecorder::record_SetPropHit(JSPropCacheEntry* entry, JSScopeProperty* sprop
|
|||
JSObject* obj = JSVAL_TO_OBJECT(l);
|
||||
LIns* obj_ins = get(&l);
|
||||
|
||||
if (sprop->attrs & JSPROP_READONLY)
|
||||
ABORT_TRACE("SetPropHit on readonly prop");
|
||||
|
||||
if (obj == globalObj) {
|
||||
JS_ASSERT(SPROP_HAS_VALID_SLOT(sprop, OBJ_SCOPE(obj)));
|
||||
uint32 slot = sprop->slot;
|
||||
|
@ -6797,7 +6802,7 @@ TraceRecorder::prop(JSObject* obj, LIns* obj_ins, uint32& slot, LIns*& v_ins)
|
|||
}
|
||||
|
||||
/* Insist if setting on obj being the directly addressed object. */
|
||||
uint32 setflags = (cs.format & (JOF_SET | JOF_INCDEC));
|
||||
uint32 setflags = (cs.format & (JOF_SET | JOF_INCDEC | JOF_FOR));
|
||||
LIns* dslots_ins = NULL;
|
||||
if (obj2 != obj) {
|
||||
if (setflags)
|
||||
|
@ -6820,6 +6825,8 @@ TraceRecorder::prop(JSObject* obj, LIns* obj_ins, uint32& slot, LIns*& v_ins)
|
|||
|
||||
if (setflags && !SPROP_HAS_STUB_SETTER(sprop))
|
||||
ABORT_TRACE("non-stub setter");
|
||||
if (setflags && (sprop->attrs & JSPROP_READONLY))
|
||||
ABORT_TRACE("writing to a readonly property");
|
||||
if (setflags != JOF_SET && !SPROP_HAS_STUB_GETTER(sprop)) {
|
||||
// FIXME 450335: generalize this away from regexp built-in getters.
|
||||
if (setflags == 0 &&
|
||||
|
|
Загрузка…
Ссылка в новой задаче