mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Fix bug 602574 - Assertion failure: constOffset != 0 in JSScript::NewScript() on 64-bit platforms. r=gal@uci.edu
This commit is contained in:
parent
15dee18d2a
commit
c190047dbc
@ -296,44 +296,14 @@ struct JSScript {
|
||||
js::mjit::JITScript *jitNormal; /* Extra JIT info for normal scripts */
|
||||
js::mjit::JITScript *jitCtor; /* Extra JIT info for constructors */
|
||||
|
||||
void **nmapNormal;
|
||||
void **nmapCtor;
|
||||
|
||||
bool hasJITCode() {
|
||||
return jitNormal || jitCtor;
|
||||
}
|
||||
|
||||
void setNativeMap(bool constructing, void **map) {
|
||||
if (constructing)
|
||||
nmapCtor = map;
|
||||
else
|
||||
nmapNormal = map;
|
||||
}
|
||||
|
||||
void **maybeNativeMap(bool constructing) {
|
||||
return constructing ? nmapCtor : nmapNormal;
|
||||
}
|
||||
|
||||
void **nativeMap(bool constructing) {
|
||||
void **nmap = maybeNativeMap(constructing);
|
||||
JS_ASSERT(nmap);
|
||||
return nmap;
|
||||
}
|
||||
|
||||
void *maybeNativeCodeForPC(bool constructing, jsbytecode *pc) {
|
||||
void **nmap = maybeNativeMap(constructing);
|
||||
if (!nmap)
|
||||
return NULL;
|
||||
JS_ASSERT(pc >= code && pc < code + length);
|
||||
return nmap[pc - code];
|
||||
}
|
||||
|
||||
void *nativeCodeForPC(bool constructing, jsbytecode *pc) {
|
||||
void **nmap = nativeMap(constructing);
|
||||
JS_ASSERT(pc >= code && pc < code + length);
|
||||
JS_ASSERT(nmap[pc - code]);
|
||||
return nmap[pc - code];
|
||||
}
|
||||
// These methods are implemented in MethodJIT.h.
|
||||
inline void **nativeMap(bool constructing);
|
||||
inline void *maybeNativeCodeForPC(bool constructing, jsbytecode *pc);
|
||||
inline void *nativeCodeForPC(bool constructing, jsbytecode *pc);
|
||||
|
||||
js::mjit::JITScript *getJIT(bool constructing) {
|
||||
return constructing ? jitCtor : jitNormal;
|
||||
|
@ -590,7 +590,7 @@ mjit::Compiler::finishThisUp(JITScript **jitp)
|
||||
|
||||
JS_ASSERT(size_t(cursor - (uint8*)jit) == totalBytes);
|
||||
|
||||
script->setNativeMap(isConstructing, nmap);
|
||||
jit->nmap = nmap;
|
||||
*jitp = jit;
|
||||
|
||||
return Compile_Okay;
|
||||
|
@ -835,7 +835,6 @@ mjit::ReleaseScriptCode(JSContext *cx, JSScript *script)
|
||||
script->jitArityCheckNormal = NULL;
|
||||
cx->free(script->jitNormal);
|
||||
script->jitNormal = NULL;
|
||||
script->nmapNormal = NULL;
|
||||
}
|
||||
|
||||
if (script->jitCtor) {
|
||||
@ -843,7 +842,6 @@ mjit::ReleaseScriptCode(JSContext *cx, JSScript *script)
|
||||
script->jitArityCheckCtor = NULL;
|
||||
cx->free(script->jitCtor);
|
||||
script->jitCtor = NULL;
|
||||
script->nmapCtor = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -187,6 +187,7 @@ struct CallSite;
|
||||
struct JITScript {
|
||||
typedef JSC::MacroAssemblerCodeRef CodeRef;
|
||||
CodeRef code; /* pool & code addresses */
|
||||
void **nmap; /* pc -> JIT code map, sparse */
|
||||
|
||||
js::mjit::CallSite *callSites;
|
||||
uint32 nCallSites;
|
||||
@ -268,6 +269,31 @@ struct CallSite
|
||||
|
||||
} /* namespace js */
|
||||
|
||||
inline void *
|
||||
JSScript::maybeNativeCodeForPC(bool constructing, jsbytecode *pc)
|
||||
{
|
||||
js::mjit::JITScript *jit = getJIT(constructing);
|
||||
if (!jit)
|
||||
return NULL;
|
||||
JS_ASSERT(pc >= code && pc < code + length);
|
||||
return jit->nmap[pc - code];
|
||||
}
|
||||
|
||||
inline void **
|
||||
JSScript::nativeMap(bool constructing)
|
||||
{
|
||||
return getJIT(constructing)->nmap;
|
||||
}
|
||||
|
||||
inline void *
|
||||
JSScript::nativeCodeForPC(bool constructing, jsbytecode *pc)
|
||||
{
|
||||
void **nmap = nativeMap(constructing);
|
||||
JS_ASSERT(pc >= code && pc < code + length);
|
||||
JS_ASSERT(nmap[pc - code]);
|
||||
return nmap[pc - code];
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
extern "C" void *JaegerThrowpoline(js::VMFrame *vmFrame);
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user