diff --git a/js/src/jsprobes.cpp b/js/src/jsprobes.cpp index c786e8e98e2..5a59e556718 100644 --- a/js/src/jsprobes.cpp +++ b/js/src/jsprobes.cpp @@ -217,33 +217,33 @@ Probes::JITWatcher::CollectNativeRegions(RegionVector ®ions, } void -Probes::registerMJITCode(JSContext *cx, js::mjit::JITScript *jscr, +Probes::registerMJITCode(JSContext *cx, js::mjit::JITChunk *chunk, js::mjit::JSActiveFrame *outerFrame, js::mjit::JSActiveFrame **inlineFrames, void *mainCodeAddress, size_t mainCodeSize, void *stubCodeAddress, size_t stubCodeSize) { for (JITWatcher **p = jitWatchers.begin(); p != jitWatchers.end(); ++p) - (*p)->registerMJITCode(cx, jscr, outerFrame, + (*p)->registerMJITCode(cx, chunk, outerFrame, inlineFrames, mainCodeAddress, mainCodeSize, stubCodeAddress, stubCodeSize); } void -Probes::discardMJITCode(FreeOp *fop, mjit::JITScript *jscr, JSScript *script, void* address) +Probes::discardMJITCode(FreeOp *fop, mjit::JITScript *jscr, mjit::JITChunk *chunk, void* address) { for (JITWatcher **p = jitWatchers.begin(); p != jitWatchers.end(); ++p) - (*p)->discardMJITCode(fop, jscr, script, address); + (*p)->discardMJITCode(fop, jscr, chunk, address); } void Probes::registerICCode(JSContext *cx, - mjit::JITScript *jscr, JSScript *script, jsbytecode* pc, + mjit::JITChunk *chunk, JSScript *script, jsbytecode* pc, void *start, size_t size) { for (JITWatcher **p = jitWatchers.begin(); p != jitWatchers.end(); ++p) - (*p)->registerICCode(cx, jscr, script, pc, start, size); + (*p)->registerICCode(cx, chunk, script, pc, start, size); } #endif diff --git a/js/src/jsprobes.h b/js/src/jsprobes.h index 1c44f96c7ee..c64daf4e211 100644 --- a/js/src/jsprobes.h +++ b/js/src/jsprobes.h @@ -258,17 +258,17 @@ public: mjit::JSActiveFrame *outerFrame, mjit::JSActiveFrame **inlineFrames); - virtual void registerMJITCode(JSContext *cx, js::mjit::JITScript *jscr, + virtual void registerMJITCode(JSContext *cx, js::mjit::JITChunk *chunk, mjit::JSActiveFrame *outerFrame, mjit::JSActiveFrame **inlineFrames, void *mainCodeAddress, size_t mainCodeSize, void *stubCodeAddress, size_t stubCodeSize) = 0; - virtual void discardMJITCode(FreeOp *fop, mjit::JITScript *jscr, JSScript *script, + virtual void discardMJITCode(FreeOp *fop, mjit::JITScript *jscr, mjit::JITChunk *chunk, void* address) = 0; virtual void registerICCode(JSContext *cx, - js::mjit::JITScript *jscr, JSScript *script, jsbytecode* pc, + js::mjit::JITChunk *chunk, JSScript *script, jsbytecode* pc, void *start, size_t size) = 0; #endif @@ -306,7 +306,7 @@ JITGranularityRequested(); * New method JIT code has been created */ void -registerMJITCode(JSContext *cx, js::mjit::JITScript *jscr, +registerMJITCode(JSContext *cx, js::mjit::JITChunk *chunk, mjit::JSActiveFrame *outerFrame, mjit::JSActiveFrame **inlineFrames, void *mainCodeAddress, size_t mainCodeSize, @@ -316,14 +316,14 @@ registerMJITCode(JSContext *cx, js::mjit::JITScript *jscr, * Method JIT code is about to be discarded */ void -discardMJITCode(FreeOp *fop, mjit::JITScript *jscr, JSScript *script, void* address); +discardMJITCode(FreeOp *fop, mjit::JITScript *jscr, mjit::JITChunk *chunk, void* address); /* - * IC code has been allocated within the given JITScript + * IC code has been allocated within the given JITChunk */ void registerICCode(JSContext *cx, - mjit::JITScript *jscr, JSScript *script, jsbytecode* pc, + mjit::JITChunk *chunk, JSScript *script, jsbytecode* pc, void *start, size_t size); #endif /* JS_METHODJIT */ diff --git a/js/src/methodjit/BaseCompiler.h b/js/src/methodjit/BaseCompiler.h index 24f65022da4..ad31e63fdf4 100644 --- a/js/src/methodjit/BaseCompiler.h +++ b/js/src/methodjit/BaseCompiler.h @@ -171,7 +171,7 @@ class LinkerHelper : public JSC::LinkBuffer JSC::CodeLocationLabel finalize(VMFrame &f) { masm.finalize(*this); JSC::CodeLocationLabel label = finalizeCodeAddendum(); - Probes::registerICCode(f.cx, f.jit(), f.script(), f.pc(), + Probes::registerICCode(f.cx, f.chunk(), f.script(), f.pc(), label.executableAddress(), masm.size()); return label; } diff --git a/js/src/methodjit/Compiler.cpp b/js/src/methodjit/Compiler.cpp index f9d47fdd84c..aeed084fbb7 100644 --- a/js/src/methodjit/Compiler.cpp +++ b/js/src/methodjit/Compiler.cpp @@ -1774,7 +1774,7 @@ mjit::Compiler::finishThisUp() JSC::ExecutableAllocator::makeExecutable(result, masm.size() + stubcc.size()); JSC::ExecutableAllocator::cacheFlush(result, masm.size() + stubcc.size()); - Probes::registerMJITCode(cx, jit, + Probes::registerMJITCode(cx, chunk, a, (JSActiveFrame**) inlineFrames.begin(), result, masm.size(), diff --git a/js/src/methodjit/MethodJIT.cpp b/js/src/methodjit/MethodJIT.cpp index 66162ad9d2d..49ea633e221 100644 --- a/js/src/methodjit/MethodJIT.cpp +++ b/js/src/methodjit/MethodJIT.cpp @@ -1328,7 +1328,7 @@ JITScript::destroyChunk(FreeOp *fop, unsigned chunkIndex, bool resetUses) ChunkDescriptor &desc = chunkDescriptor(chunkIndex); if (desc.chunk) { - Probes::discardMJITCode(fop, this, script, desc.chunk->code.m_code.executableAddress()); + Probes::discardMJITCode(fop, this, desc.chunk, desc.chunk->code.m_code.executableAddress()); fop->delete_(desc.chunk); desc.chunk = NULL; @@ -1484,6 +1484,8 @@ JITScript::nativeToPC(void *returnAddress, CallSite **pinline) JITChunk *chunk = findCodeChunk(returnAddress); JS_ASSERT(chunk); + JS_ASSERT(chunk->isValidCode(returnAddress)); + size_t low = 0; size_t high = chunk->nCallICs; js::mjit::ic::CallICInfo *callICs_ = chunk->callICs();