зеркало из https://github.com/mozilla/gecko-dev.git
Fix AssertValidPropertyCacheHit when called from JIT stubs, bug 717251. r=dvander
This commit is contained in:
Родитель
89654fa96e
Коммит
6cb3572422
|
@ -83,6 +83,7 @@
|
||||||
#include "jsinferinlines.h"
|
#include "jsinferinlines.h"
|
||||||
#include "jsinterpinlines.h"
|
#include "jsinterpinlines.h"
|
||||||
#include "jsobjinlines.h"
|
#include "jsobjinlines.h"
|
||||||
|
#include "jsopcodeinlines.h"
|
||||||
#include "jsprobes.h"
|
#include "jsprobes.h"
|
||||||
#include "jspropertycacheinlines.h"
|
#include "jspropertycacheinlines.h"
|
||||||
#include "jsscopeinlines.h"
|
#include "jsscopeinlines.h"
|
||||||
|
@ -1265,21 +1266,20 @@ js::AssertValidPropertyCacheHit(JSContext *cx,
|
||||||
JSObject *start, JSObject *found,
|
JSObject *start, JSObject *found,
|
||||||
PropertyCacheEntry *entry)
|
PropertyCacheEntry *entry)
|
||||||
{
|
{
|
||||||
JSScript *script = cx->fp()->script();
|
jsbytecode *pc;
|
||||||
FrameRegs& regs = cx->regs();
|
cx->stack.currentScript(&pc);
|
||||||
|
|
||||||
uint32_t sample = cx->runtime->gcNumber;
|
uint32_t sample = cx->runtime->gcNumber;
|
||||||
PropertyCacheEntry savedEntry = *entry;
|
PropertyCacheEntry savedEntry = *entry;
|
||||||
|
|
||||||
PropertyName *name;
|
PropertyName *name = GetNameFromBytecode(cx, pc, JSOp(*pc), js_CodeSpec[*pc]);
|
||||||
GET_NAME_FROM_BYTECODE(script, regs.pc, 0, name);
|
|
||||||
|
|
||||||
JSObject *obj, *pobj;
|
JSObject *obj, *pobj;
|
||||||
JSProperty *prop;
|
JSProperty *prop;
|
||||||
JSBool ok;
|
JSBool ok;
|
||||||
|
|
||||||
if (JOF_OPMODE(*regs.pc) == JOF_NAME) {
|
if (JOF_OPMODE(*pc) == JOF_NAME) {
|
||||||
bool global = js_CodeSpec[*regs.pc].format & JOF_GNAME;
|
bool global = js_CodeSpec[*pc].format & JOF_GNAME;
|
||||||
ok = FindProperty(cx, name, global, &obj, &pobj, &prop);
|
ok = FindProperty(cx, name, global, &obj, &pobj, &prop);
|
||||||
} else {
|
} else {
|
||||||
obj = start;
|
obj = start;
|
||||||
|
|
|
@ -42,6 +42,24 @@
|
||||||
|
|
||||||
namespace js {
|
namespace js {
|
||||||
|
|
||||||
|
static inline PropertyName *
|
||||||
|
GetNameFromBytecode(JSContext *cx, jsbytecode *pc, JSOp op, const JSCodeSpec &cs)
|
||||||
|
{
|
||||||
|
if (op == JSOP_LENGTH)
|
||||||
|
return cx->runtime->atomState.lengthAtom;
|
||||||
|
|
||||||
|
// The method JIT's implementation of instanceof contains an internal lookup
|
||||||
|
// of the prototype property.
|
||||||
|
if (op == JSOP_INSTANCEOF)
|
||||||
|
return cx->runtime->atomState.classPrototypeAtom;
|
||||||
|
|
||||||
|
JSScript *script = cx->stack.currentScript();
|
||||||
|
ptrdiff_t pcoff = (JOF_TYPE(cs.format) == JOF_SLOTATOM) ? SLOTNO_LEN : 0;
|
||||||
|
PropertyName *name;
|
||||||
|
GET_NAME_FROM_BYTECODE(script, pc, pcoff, name);
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
class BytecodeRange {
|
class BytecodeRange {
|
||||||
public:
|
public:
|
||||||
BytecodeRange(JSScript *script)
|
BytecodeRange(JSScript *script)
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
#include "jscntxt.h"
|
#include "jscntxt.h"
|
||||||
#include "jsnum.h"
|
#include "jsnum.h"
|
||||||
#include "jsobjinlines.h"
|
#include "jsobjinlines.h"
|
||||||
|
#include "jsopcodeinlines.h"
|
||||||
#include "jspropertycacheinlines.h"
|
#include "jspropertycacheinlines.h"
|
||||||
|
|
||||||
using namespace js;
|
using namespace js;
|
||||||
|
@ -158,24 +159,6 @@ PropertyCache::fill(JSContext *cx, JSObject *obj, uintN scopeIndex, JSObject *po
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline PropertyName *
|
|
||||||
GetNameFromBytecode(JSContext *cx, jsbytecode *pc, JSOp op, const JSCodeSpec &cs)
|
|
||||||
{
|
|
||||||
if (op == JSOP_LENGTH)
|
|
||||||
return cx->runtime->atomState.lengthAtom;
|
|
||||||
|
|
||||||
// The method JIT's implementation of instanceof contains an internal lookup
|
|
||||||
// of the prototype property.
|
|
||||||
if (op == JSOP_INSTANCEOF)
|
|
||||||
return cx->runtime->atomState.classPrototypeAtom;
|
|
||||||
|
|
||||||
JSScript *script = cx->stack.currentScript();
|
|
||||||
ptrdiff_t pcoff = (JOF_TYPE(cs.format) == JOF_SLOTATOM) ? SLOTNO_LEN : 0;
|
|
||||||
PropertyName *name;
|
|
||||||
GET_NAME_FROM_BYTECODE(script, pc, pcoff, name);
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
PropertyName *
|
PropertyName *
|
||||||
PropertyCache::fullTest(JSContext *cx, jsbytecode *pc, JSObject **objp, JSObject **pobjp,
|
PropertyCache::fullTest(JSContext *cx, jsbytecode *pc, JSObject **objp, JSObject **pobjp,
|
||||||
PropertyCacheEntry *entry)
|
PropertyCacheEntry *entry)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче