mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 951666 - Rename IonCode to JitCode. r=njn
This commit is contained in:
parent
fc00e92909
commit
af0c1097a4
@ -108,7 +108,7 @@ struct ZoneStatsPod
|
||||
macro(Other, NotLiveGCThing, unusedGCThings) \
|
||||
macro(Other, IsLiveGCThing, lazyScriptsGCHeap) \
|
||||
macro(Other, NotLiveGCThing, lazyScriptsMallocHeap) \
|
||||
macro(Other, IsLiveGCThing, ionCodesGCHeap) \
|
||||
macro(Other, IsLiveGCThing, jitCodesGCHeap) \
|
||||
macro(Other, IsLiveGCThing, typeObjectsGCHeap) \
|
||||
macro(Other, NotLiveGCThing, typeObjectsMallocHeap) \
|
||||
macro(Other, NotLiveGCThing, typePool) \
|
||||
|
@ -73,8 +73,8 @@ enum AllocKind {
|
||||
FINALIZE_SHORT_STRING,
|
||||
FINALIZE_STRING,
|
||||
FINALIZE_EXTERNAL_STRING,
|
||||
FINALIZE_IONCODE,
|
||||
FINALIZE_LAST = FINALIZE_IONCODE
|
||||
FINALIZE_JITCODE,
|
||||
FINALIZE_LAST = FINALIZE_JITCODE
|
||||
};
|
||||
|
||||
static const unsigned FINALIZE_LIMIT = FINALIZE_LAST + 1;
|
||||
|
@ -90,7 +90,7 @@ static void MarkChildren(JSTracer *trc, LazyScript *lazy);
|
||||
static void MarkChildren(JSTracer *trc, Shape *shape);
|
||||
static void MarkChildren(JSTracer *trc, BaseShape *base);
|
||||
static void MarkChildren(JSTracer *trc, types::TypeObject *type);
|
||||
static void MarkChildren(JSTracer *trc, jit::IonCode *code);
|
||||
static void MarkChildren(JSTracer *trc, jit::JitCode *code);
|
||||
|
||||
} /* namespace gc */
|
||||
} /* namespace js */
|
||||
@ -372,7 +372,7 @@ Is##base##AboutToBeFinalized(BarrieredPtr<type> *thingp)
|
||||
|
||||
DeclMarkerImpl(BaseShape, BaseShape)
|
||||
DeclMarkerImpl(BaseShape, UnownedBaseShape)
|
||||
DeclMarkerImpl(IonCode, jit::IonCode)
|
||||
DeclMarkerImpl(JitCode, jit::JitCode)
|
||||
DeclMarkerImpl(Object, ArgumentsObject)
|
||||
DeclMarkerImpl(Object, ArrayBufferObject)
|
||||
DeclMarkerImpl(Object, ArrayBufferViewObject)
|
||||
@ -426,8 +426,8 @@ gc::MarkKind(JSTracer *trc, void **thingp, JSGCTraceKind kind)
|
||||
case JSTRACE_TYPE_OBJECT:
|
||||
MarkInternal(trc, reinterpret_cast<types::TypeObject **>(thingp));
|
||||
break;
|
||||
case JSTRACE_IONCODE:
|
||||
MarkInternal(trc, reinterpret_cast<jit::IonCode **>(thingp));
|
||||
case JSTRACE_JITCODE:
|
||||
MarkInternal(trc, reinterpret_cast<jit::JitCode **>(thingp));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -849,13 +849,13 @@ PushMarkStack(GCMarker *gcmarker, Shape *thing)
|
||||
}
|
||||
|
||||
static void
|
||||
PushMarkStack(GCMarker *gcmarker, jit::IonCode *thing)
|
||||
PushMarkStack(GCMarker *gcmarker, jit::JitCode *thing)
|
||||
{
|
||||
JS_COMPARTMENT_ASSERT(gcmarker->runtime, thing);
|
||||
JS_ASSERT(!IsInsideNursery(gcmarker->runtime, thing));
|
||||
|
||||
if (thing->markIfUnmarked(gcmarker->getMarkColor()))
|
||||
gcmarker->pushIonCode(thing);
|
||||
gcmarker->pushJitCode(thing);
|
||||
}
|
||||
|
||||
static inline void
|
||||
@ -1174,7 +1174,7 @@ gc::MarkChildren(JSTracer *trc, types::TypeObject *type)
|
||||
}
|
||||
|
||||
static void
|
||||
gc::MarkChildren(JSTracer *trc, jit::IonCode *code)
|
||||
gc::MarkChildren(JSTracer *trc, jit::JitCode *code)
|
||||
{
|
||||
#ifdef JS_ION
|
||||
code->trace(trc);
|
||||
@ -1221,8 +1221,8 @@ gc::PushArena(GCMarker *gcmarker, ArenaHeader *aheader)
|
||||
PushArenaTyped<js::types::TypeObject>(gcmarker, aheader);
|
||||
break;
|
||||
|
||||
case JSTRACE_IONCODE:
|
||||
PushArenaTyped<js::jit::IonCode>(gcmarker, aheader);
|
||||
case JSTRACE_JITCODE:
|
||||
PushArenaTyped<js::jit::JitCode>(gcmarker, aheader);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1347,8 +1347,8 @@ GCMarker::processMarkStackOther(uintptr_t tag, uintptr_t addr)
|
||||
pushValueArray(obj, vp, end);
|
||||
else
|
||||
pushObject(obj);
|
||||
} else if (tag == IonCodeTag) {
|
||||
MarkChildren(this, reinterpret_cast<jit::IonCode *>(addr));
|
||||
} else if (tag == JitCodeTag) {
|
||||
MarkChildren(this, reinterpret_cast<jit::JitCode *>(addr));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1535,8 +1535,8 @@ js::TraceChildren(JSTracer *trc, void *thing, JSGCTraceKind kind)
|
||||
MarkChildren(trc, static_cast<Shape *>(thing));
|
||||
break;
|
||||
|
||||
case JSTRACE_IONCODE:
|
||||
MarkChildren(trc, (js::jit::IonCode *)thing);
|
||||
case JSTRACE_JITCODE:
|
||||
MarkChildren(trc, (js::jit::JitCode *)thing);
|
||||
break;
|
||||
|
||||
case JSTRACE_BASE_SHAPE:
|
||||
|
@ -29,7 +29,7 @@ class UnownedBaseShape;
|
||||
template<class, typename> class HeapPtr;
|
||||
|
||||
namespace jit {
|
||||
class IonCode;
|
||||
class JitCode;
|
||||
class IonScript;
|
||||
class VMFunction;
|
||||
}
|
||||
@ -93,7 +93,7 @@ bool Is##base##AboutToBeFinalized(BarrieredPtr<type> *thingp);
|
||||
|
||||
DeclMarker(BaseShape, BaseShape)
|
||||
DeclMarker(BaseShape, UnownedBaseShape)
|
||||
DeclMarker(IonCode, jit::IonCode)
|
||||
DeclMarker(JitCode, jit::JitCode)
|
||||
DeclMarker(Object, ArgumentsObject)
|
||||
DeclMarker(Object, ArrayBufferObject)
|
||||
DeclMarker(Object, ArrayBufferViewObject)
|
||||
@ -277,9 +277,9 @@ Mark(JSTracer *trc, BarrieredPtrScript *o, const char *name)
|
||||
}
|
||||
|
||||
inline void
|
||||
Mark(JSTracer *trc, HeapPtr<jit::IonCode> *code, const char *name)
|
||||
Mark(JSTracer *trc, HeapPtr<jit::JitCode> *code, const char *name)
|
||||
{
|
||||
MarkIonCode(trc, code, name);
|
||||
MarkJitCode(trc, code, name);
|
||||
}
|
||||
|
||||
/* For use by WeakMap's HashKeyRef instantiation. */
|
||||
@ -349,16 +349,16 @@ inline bool
|
||||
IsAboutToBeFinalized(const js::jit::VMFunction **vmfunc)
|
||||
{
|
||||
/*
|
||||
* Preserves entries in the WeakCache<VMFunction, IonCode>
|
||||
* iff the IonCode has been marked.
|
||||
* Preserves entries in the WeakCache<VMFunction, JitCode>
|
||||
* iff the JitCode has been marked.
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool
|
||||
IsAboutToBeFinalized(ReadBarriered<js::jit::IonCode> code)
|
||||
IsAboutToBeFinalized(ReadBarriered<js::jit::JitCode> code)
|
||||
{
|
||||
return IsIonCodeAboutToBeFinalized(code.unsafeGet());
|
||||
return IsJitCodeAboutToBeFinalized(code.unsafeGet());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -58,7 +58,7 @@ MarkExactStackRoot(JSTracer *trc, Rooted<void*> *rooter, ThingRootKind kind)
|
||||
case THING_ROOT_BASE_SHAPE: MarkBaseShapeRoot(trc, (BaseShape **)addr, "exact-baseshape"); break;
|
||||
case THING_ROOT_TYPE: MarkTypeRoot(trc, (types::Type *)addr, "exact-type"); break;
|
||||
case THING_ROOT_TYPE_OBJECT: MarkTypeObjectRoot(trc, (types::TypeObject **)addr, "exact-typeobject"); break;
|
||||
case THING_ROOT_ION_CODE: MarkIonCodeRoot(trc, (jit::IonCode **)addr, "exact-ioncode"); break;
|
||||
case THING_ROOT_JIT_CODE: MarkJitCodeRoot(trc, (jit::JitCode **)addr, "exact-jitcode"); break;
|
||||
case THING_ROOT_VALUE: MarkValueRoot(trc, (Value *)addr, "exact-value"); break;
|
||||
case THING_ROOT_ID: MarkIdRoot(trc, (jsid *)addr, "exact-id"); break;
|
||||
case THING_ROOT_PROPERTY_ID: MarkIdRoot(trc, &((js::PropertyId *)addr)->asId(), "exact-propertyid"); break;
|
||||
|
@ -305,7 +305,7 @@ static const PhaseInfo phases[] = {
|
||||
{ PHASE_SWEEP_STRING, "Sweep String", PHASE_SWEEP },
|
||||
{ PHASE_SWEEP_SCRIPT, "Sweep Script", PHASE_SWEEP },
|
||||
{ PHASE_SWEEP_SHAPE, "Sweep Shape", PHASE_SWEEP },
|
||||
{ PHASE_SWEEP_IONCODE, "Sweep Ion code", PHASE_SWEEP },
|
||||
{ PHASE_SWEEP_JITCODE, "Sweep JIT code", PHASE_SWEEP },
|
||||
{ PHASE_FINALIZE_END, "Finalize End Callback", PHASE_SWEEP },
|
||||
{ PHASE_DESTROY, "Deallocate", PHASE_SWEEP },
|
||||
{ PHASE_GC_END, "End Callback", PHASE_NO_PARENT },
|
||||
|
@ -57,7 +57,7 @@ enum Phase {
|
||||
PHASE_SWEEP_STRING,
|
||||
PHASE_SWEEP_SCRIPT,
|
||||
PHASE_SWEEP_SHAPE,
|
||||
PHASE_SWEEP_IONCODE,
|
||||
PHASE_SWEEP_JITCODE,
|
||||
PHASE_FINALIZE_END,
|
||||
PHASE_DESTROY,
|
||||
PHASE_GC_END,
|
||||
|
@ -73,8 +73,8 @@ StoreBuffer::WholeCellEdges::mark(JSTracer *trc)
|
||||
return;
|
||||
}
|
||||
#ifdef JS_ION
|
||||
JS_ASSERT(kind == JSTRACE_IONCODE);
|
||||
static_cast<jit::IonCode *>(tenured)->trace(trc);
|
||||
JS_ASSERT(kind == JSTRACE_JITCODE);
|
||||
static_cast<jit::JitCode *>(tenured)->trace(trc);
|
||||
#else
|
||||
MOZ_ASSUME_UNREACHABLE("Only objects can be in the wholeCellBuffer if IonMonkey is disabled.");
|
||||
#endif
|
||||
|
@ -153,8 +153,8 @@ JS_GetTraceThingInfo(char *buf, size_t bufsize, JSTracer *trc, void *thing,
|
||||
name = "lazyscript";
|
||||
break;
|
||||
|
||||
case JSTRACE_IONCODE:
|
||||
name = "ioncode";
|
||||
case JSTRACE_JITCODE:
|
||||
name = "jitcode";
|
||||
break;
|
||||
|
||||
case JSTRACE_SHAPE:
|
||||
@ -229,7 +229,7 @@ JS_GetTraceThingInfo(char *buf, size_t bufsize, JSTracer *trc, void *thing,
|
||||
}
|
||||
|
||||
case JSTRACE_LAZY_SCRIPT:
|
||||
case JSTRACE_IONCODE:
|
||||
case JSTRACE_JITCODE:
|
||||
case JSTRACE_SHAPE:
|
||||
case JSTRACE_BASE_SHAPE:
|
||||
case JSTRACE_TYPE_OBJECT:
|
||||
|
@ -79,7 +79,7 @@ namespace JS {
|
||||
* - Scripts are also compartment-local and cannot be shared. A script points to
|
||||
* its compartment.
|
||||
*
|
||||
* - Type objects and IonCode objects belong to a compartment and cannot be
|
||||
* - Type objects and JitCode objects belong to a compartment and cannot be
|
||||
* shared. However, there is no mechanism to obtain their compartments.
|
||||
*
|
||||
* A zone remains alive as long as any GC things in the zone are alive. A
|
||||
|
@ -1736,7 +1736,7 @@ class MOZ_STACK_CLASS ModuleCompiler
|
||||
if (!module_->allocateAndCopyCode(cx_, masm_))
|
||||
return false;
|
||||
|
||||
// c.f. IonCode::copyFrom
|
||||
// c.f. JitCode::copyFrom
|
||||
JS_ASSERT(masm_.jumpRelocationTableBytes() == 0);
|
||||
JS_ASSERT(masm_.dataRelocationTableBytes() == 0);
|
||||
JS_ASSERT(masm_.preBarrierTableBytes() == 0);
|
||||
@ -5332,7 +5332,7 @@ GenerateCode(ModuleCompiler &m, ModuleCompiler::Func &func, MIRGenerator &mir, L
|
||||
if (!m.maybeReportCompileTime(func))
|
||||
return false;
|
||||
|
||||
// Unlike regular IonMonkey which links and generates a new IonCode for
|
||||
// Unlike regular IonMonkey which links and generates a new JitCode for
|
||||
// every function, we accumulate all the functions in the module in a
|
||||
// single MacroAssembler and link at end. Linking asm.js doesn't require a
|
||||
// CodeGenerator so we can destroy it now.
|
||||
|
@ -108,7 +108,7 @@ BaselineCompiler::compile()
|
||||
return Method_Error;
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<CanGC>(cx, JSC::BASELINE_CODE);
|
||||
JitCode *code = linker.newCode<CanGC>(cx, JSC::BASELINE_CODE);
|
||||
if (!code)
|
||||
return Method_Error;
|
||||
|
||||
@ -690,7 +690,7 @@ BaselineCompiler::emitDebugTrap()
|
||||
bool enabled = script->stepModeEnabled() || script->hasBreakpointsAt(pc);
|
||||
|
||||
// Emit patchable call to debug trap handler.
|
||||
IonCode *handler = cx->runtime()->jitRuntime()->debugTrapHandler(cx);
|
||||
JitCode *handler = cx->runtime()->jitRuntime()->debugTrapHandler(cx);
|
||||
mozilla::DebugOnly<CodeOffsetLabel> offset = masm.toggledCall(handler, enabled);
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -149,16 +149,16 @@ ICStubIterator::unlink(JSContext *cx)
|
||||
void
|
||||
ICStub::markCode(JSTracer *trc, const char *name)
|
||||
{
|
||||
IonCode *stubIonCode = ionCode();
|
||||
MarkIonCodeUnbarriered(trc, &stubIonCode, name);
|
||||
JitCode *stubJitCode = jitCode();
|
||||
MarkJitCodeUnbarriered(trc, &stubJitCode, name);
|
||||
}
|
||||
|
||||
void
|
||||
ICStub::updateCode(IonCode *code)
|
||||
ICStub::updateCode(JitCode *code)
|
||||
{
|
||||
// Write barrier on the old code.
|
||||
#ifdef JSGC_INCREMENTAL
|
||||
IonCode::writeBarrierPre(ionCode());
|
||||
JitCode::writeBarrierPre(jitCode());
|
||||
#endif
|
||||
stubCode_ = code->raw();
|
||||
}
|
||||
@ -166,7 +166,7 @@ ICStub::updateCode(IonCode *code)
|
||||
/* static */ void
|
||||
ICStub::trace(JSTracer *trc)
|
||||
{
|
||||
markCode(trc, "baseline-stub-ioncode");
|
||||
markCode(trc, "baseline-stub-jitcode");
|
||||
|
||||
// If the stub is a monitored fallback stub, then mark the monitor ICs hanging
|
||||
// off of that stub. We don't need to worry about the regular monitored stubs,
|
||||
@ -497,7 +497,7 @@ void
|
||||
ICTypeMonitor_Fallback::resetMonitorStubChain(Zone *zone)
|
||||
{
|
||||
if (zone->needsBarrier()) {
|
||||
// We are removing edges from monitored stubs to gcthings (IonCode).
|
||||
// We are removing edges from monitored stubs to gcthings (JitCode).
|
||||
// Perform one final trace of all monitor stubs for incremental GC,
|
||||
// as it must know about those edges.
|
||||
for (ICStub *s = firstMonitorStub_; !s->isTypeMonitor_Fallback(); s = s->next())
|
||||
@ -524,7 +524,7 @@ ICTypeMonitor_Fallback::resetMonitorStubChain(Zone *zone)
|
||||
}
|
||||
}
|
||||
|
||||
ICMonitoredStub::ICMonitoredStub(Kind kind, IonCode *stubCode, ICStub *firstMonitorStub)
|
||||
ICMonitoredStub::ICMonitoredStub(Kind kind, JitCode *stubCode, ICStub *firstMonitorStub)
|
||||
: ICStub(kind, ICStub::Monitored, stubCode),
|
||||
firstMonitorStub_(firstMonitorStub)
|
||||
{
|
||||
@ -568,14 +568,14 @@ ICUpdatedStub::initUpdatingChain(JSContext *cx, ICStubSpace *space)
|
||||
return true;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
ICStubCompiler::getStubCode()
|
||||
{
|
||||
JitCompartment *comp = cx->compartment()->jitCompartment();
|
||||
|
||||
// Check for existing cached stubcode.
|
||||
uint32_t stubKey = getKey();
|
||||
IonCode *stubCode = comp->getStubCode(stubKey);
|
||||
JitCode *stubCode = comp->getStubCode(stubKey);
|
||||
if (stubCode)
|
||||
return stubCode;
|
||||
|
||||
@ -589,7 +589,7 @@ ICStubCompiler::getStubCode()
|
||||
if (!generateStubCode(masm))
|
||||
return nullptr;
|
||||
Linker linker(masm);
|
||||
Rooted<IonCode *> newStubCode(cx, linker.newCode<CanGC>(cx, JSC::BASELINE_CODE));
|
||||
Rooted<JitCode *> newStubCode(cx, linker.newCode<CanGC>(cx, JSC::BASELINE_CODE));
|
||||
if (!newStubCode)
|
||||
return nullptr;
|
||||
|
||||
@ -608,7 +608,7 @@ ICStubCompiler::getStubCode()
|
||||
JS_ASSERT(entersStubFrame_ == ICStub::CanMakeCalls(kind));
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(newStubCode, "BaselineIC");
|
||||
writePerfSpewerJitCodeProfile(newStubCode, "BaselineIC");
|
||||
#endif
|
||||
|
||||
return newStubCode;
|
||||
@ -617,7 +617,7 @@ ICStubCompiler::getStubCode()
|
||||
bool
|
||||
ICStubCompiler::tailCallVM(const VMFunction &fun, MacroAssembler &masm)
|
||||
{
|
||||
IonCode *code = cx->runtime()->jitRuntime()->getVMWrapper(fun);
|
||||
JitCode *code = cx->runtime()->jitRuntime()->getVMWrapper(fun);
|
||||
if (!code)
|
||||
return false;
|
||||
|
||||
@ -629,7 +629,7 @@ ICStubCompiler::tailCallVM(const VMFunction &fun, MacroAssembler &masm)
|
||||
bool
|
||||
ICStubCompiler::callVM(const VMFunction &fun, MacroAssembler &masm)
|
||||
{
|
||||
IonCode *code = cx->runtime()->jitRuntime()->getVMWrapper(fun);
|
||||
JitCode *code = cx->runtime()->jitRuntime()->getVMWrapper(fun);
|
||||
if (!code)
|
||||
return false;
|
||||
|
||||
@ -640,7 +640,7 @@ ICStubCompiler::callVM(const VMFunction &fun, MacroAssembler &masm)
|
||||
bool
|
||||
ICStubCompiler::callTypeUpdateIC(MacroAssembler &masm, uint32_t objectOffset)
|
||||
{
|
||||
IonCode *code = cx->runtime()->jitRuntime()->getVMWrapper(DoTypeUpdateFallbackInfo);
|
||||
JitCode *code = cx->runtime()->jitRuntime()->getVMWrapper(DoTypeUpdateFallbackInfo);
|
||||
if (!code)
|
||||
return false;
|
||||
|
||||
@ -986,7 +986,7 @@ ICUseCount_Fallback::Compiler::generateStubCode(MacroAssembler &masm)
|
||||
|
||||
leaveStubFrame(masm);
|
||||
|
||||
// If no IonCode was found, then skip just exit the IC.
|
||||
// If no JitCode was found, then skip just exit the IC.
|
||||
masm.branchPtr(Assembler::Equal, R0.scratchReg(), ImmPtr(nullptr), &noCompiledCode);
|
||||
}
|
||||
|
||||
@ -4143,11 +4143,11 @@ ICGetElemNativeCompiler::emitCallScripted(MacroAssembler &masm, Register objReg)
|
||||
// Call the arguments rectifier.
|
||||
JS_ASSERT(ArgumentsRectifierReg != code);
|
||||
|
||||
IonCode *argumentsRectifier =
|
||||
JitCode *argumentsRectifier =
|
||||
cx->runtime()->jitRuntime()->getArgumentsRectifier(SequentialExecution);
|
||||
|
||||
masm.movePtr(ImmGCPtr(argumentsRectifier), code);
|
||||
masm.loadPtr(Address(code, IonCode::offsetOfCode()), code);
|
||||
masm.loadPtr(Address(code, JitCode::offsetOfCode()), code);
|
||||
masm.mov(ImmWord(0), ArgumentsRectifierReg);
|
||||
}
|
||||
|
||||
@ -6412,7 +6412,7 @@ ICGetProp_Fallback::Compiler::generateStubCode(MacroAssembler &masm)
|
||||
}
|
||||
|
||||
bool
|
||||
ICGetProp_Fallback::Compiler::postGenerateStubCode(MacroAssembler &masm, Handle<IonCode *> code)
|
||||
ICGetProp_Fallback::Compiler::postGenerateStubCode(MacroAssembler &masm, Handle<JitCode *> code)
|
||||
{
|
||||
CodeOffsetLabel offset(returnOffset_);
|
||||
offset.fixup(&masm);
|
||||
@ -6699,11 +6699,11 @@ ICGetProp_CallScripted::Compiler::generateStubCode(MacroAssembler &masm)
|
||||
// Call the arguments rectifier.
|
||||
JS_ASSERT(ArgumentsRectifierReg != code);
|
||||
|
||||
IonCode *argumentsRectifier =
|
||||
JitCode *argumentsRectifier =
|
||||
cx->runtime()->jitRuntime()->getArgumentsRectifier(SequentialExecution);
|
||||
|
||||
masm.movePtr(ImmGCPtr(argumentsRectifier), code);
|
||||
masm.loadPtr(Address(code, IonCode::offsetOfCode()), code);
|
||||
masm.loadPtr(Address(code, JitCode::offsetOfCode()), code);
|
||||
masm.mov(ImmWord(0), ArgumentsRectifierReg);
|
||||
}
|
||||
|
||||
@ -7333,7 +7333,7 @@ ICSetProp_Fallback::Compiler::generateStubCode(MacroAssembler &masm)
|
||||
}
|
||||
|
||||
bool
|
||||
ICSetProp_Fallback::Compiler::postGenerateStubCode(MacroAssembler &masm, Handle<IonCode *> code)
|
||||
ICSetProp_Fallback::Compiler::postGenerateStubCode(MacroAssembler &masm, Handle<JitCode *> code)
|
||||
{
|
||||
CodeOffsetLabel offset(returnOffset_);
|
||||
offset.fixup(&masm);
|
||||
@ -7608,11 +7608,11 @@ ICSetProp_CallScripted::Compiler::generateStubCode(MacroAssembler &masm)
|
||||
// Call the arguments rectifier.
|
||||
JS_ASSERT(ArgumentsRectifierReg != code);
|
||||
|
||||
IonCode *argumentsRectifier =
|
||||
JitCode *argumentsRectifier =
|
||||
cx->runtime()->jitRuntime()->getArgumentsRectifier(SequentialExecution);
|
||||
|
||||
masm.movePtr(ImmGCPtr(argumentsRectifier), code);
|
||||
masm.loadPtr(Address(code, IonCode::offsetOfCode()), code);
|
||||
masm.loadPtr(Address(code, JitCode::offsetOfCode()), code);
|
||||
masm.mov(ImmWord(1), ArgumentsRectifierReg);
|
||||
}
|
||||
|
||||
@ -8384,7 +8384,7 @@ ICCall_Fallback::Compiler::generateStubCode(MacroAssembler &masm)
|
||||
}
|
||||
|
||||
bool
|
||||
ICCall_Fallback::Compiler::postGenerateStubCode(MacroAssembler &masm, Handle<IonCode *> code)
|
||||
ICCall_Fallback::Compiler::postGenerateStubCode(MacroAssembler &masm, Handle<JitCode *> code)
|
||||
{
|
||||
CodeOffsetLabel offset(returnOffset_);
|
||||
offset.fixup(&masm);
|
||||
@ -8440,7 +8440,7 @@ ICCallScriptedCompiler::generateStubCode(MacroAssembler &masm)
|
||||
masm.loadPtr(Address(callee, JSFunction::offsetOfNativeOrScript()), callee);
|
||||
}
|
||||
|
||||
// Load the start of the target IonCode.
|
||||
// Load the start of the target JitCode.
|
||||
Register code;
|
||||
if (!isConstructing_) {
|
||||
code = regs.takeAny();
|
||||
@ -8556,11 +8556,11 @@ ICCallScriptedCompiler::generateStubCode(MacroAssembler &masm)
|
||||
JS_ASSERT(ArgumentsRectifierReg != code);
|
||||
JS_ASSERT(ArgumentsRectifierReg != argcReg);
|
||||
|
||||
IonCode *argumentsRectifier =
|
||||
JitCode *argumentsRectifier =
|
||||
cx->runtime()->jitRuntime()->getArgumentsRectifier(SequentialExecution);
|
||||
|
||||
masm.movePtr(ImmGCPtr(argumentsRectifier), code);
|
||||
masm.loadPtr(Address(code, IonCode::offsetOfCode()), code);
|
||||
masm.loadPtr(Address(code, JitCode::offsetOfCode()), code);
|
||||
masm.mov(argcReg, ArgumentsRectifierReg);
|
||||
}
|
||||
|
||||
@ -8817,11 +8817,11 @@ ICCall_ScriptedApplyArray::Compiler::generateStubCode(MacroAssembler &masm)
|
||||
JS_ASSERT(ArgumentsRectifierReg != target);
|
||||
JS_ASSERT(ArgumentsRectifierReg != argcReg);
|
||||
|
||||
IonCode *argumentsRectifier =
|
||||
JitCode *argumentsRectifier =
|
||||
cx->runtime()->jitRuntime()->getArgumentsRectifier(SequentialExecution);
|
||||
|
||||
masm.movePtr(ImmGCPtr(argumentsRectifier), target);
|
||||
masm.loadPtr(Address(target, IonCode::offsetOfCode()), target);
|
||||
masm.loadPtr(Address(target, JitCode::offsetOfCode()), target);
|
||||
masm.mov(argcReg, ArgumentsRectifierReg);
|
||||
}
|
||||
masm.bind(&noUnderflow);
|
||||
@ -8928,11 +8928,11 @@ ICCall_ScriptedApplyArguments::Compiler::generateStubCode(MacroAssembler &masm)
|
||||
JS_ASSERT(ArgumentsRectifierReg != target);
|
||||
JS_ASSERT(ArgumentsRectifierReg != argcReg);
|
||||
|
||||
IonCode *argumentsRectifier =
|
||||
JitCode *argumentsRectifier =
|
||||
cx->runtime()->jitRuntime()->getArgumentsRectifier(SequentialExecution);
|
||||
|
||||
masm.movePtr(ImmGCPtr(argumentsRectifier), target);
|
||||
masm.loadPtr(Address(target, IonCode::offsetOfCode()), target);
|
||||
masm.loadPtr(Address(target, JitCode::offsetOfCode()), target);
|
||||
masm.mov(argcReg, ArgumentsRectifierReg);
|
||||
}
|
||||
masm.bind(&noUnderflow);
|
||||
@ -9038,7 +9038,7 @@ ICTableSwitch::Compiler::generateStubCode(MacroAssembler &masm)
|
||||
ICStub *
|
||||
ICTableSwitch::Compiler::getStub(ICStubSpace *space)
|
||||
{
|
||||
IonCode *code = getStubCode();
|
||||
JitCode *code = getStubCode();
|
||||
if (!code)
|
||||
return nullptr;
|
||||
|
||||
@ -9547,34 +9547,34 @@ ICRetSub_Resume::Compiler::generateStubCode(MacroAssembler &masm)
|
||||
return true;
|
||||
}
|
||||
|
||||
ICProfiler_PushFunction::ICProfiler_PushFunction(IonCode *stubCode, const char *str,
|
||||
ICProfiler_PushFunction::ICProfiler_PushFunction(JitCode *stubCode, const char *str,
|
||||
HandleScript script)
|
||||
: ICStub(ICStub::Profiler_PushFunction, stubCode),
|
||||
str_(str),
|
||||
script_(script)
|
||||
{ }
|
||||
|
||||
ICTypeMonitor_SingleObject::ICTypeMonitor_SingleObject(IonCode *stubCode, HandleObject obj)
|
||||
ICTypeMonitor_SingleObject::ICTypeMonitor_SingleObject(JitCode *stubCode, HandleObject obj)
|
||||
: ICStub(TypeMonitor_SingleObject, stubCode),
|
||||
obj_(obj)
|
||||
{ }
|
||||
|
||||
ICTypeMonitor_TypeObject::ICTypeMonitor_TypeObject(IonCode *stubCode, HandleTypeObject type)
|
||||
ICTypeMonitor_TypeObject::ICTypeMonitor_TypeObject(JitCode *stubCode, HandleTypeObject type)
|
||||
: ICStub(TypeMonitor_TypeObject, stubCode),
|
||||
type_(type)
|
||||
{ }
|
||||
|
||||
ICTypeUpdate_SingleObject::ICTypeUpdate_SingleObject(IonCode *stubCode, HandleObject obj)
|
||||
ICTypeUpdate_SingleObject::ICTypeUpdate_SingleObject(JitCode *stubCode, HandleObject obj)
|
||||
: ICStub(TypeUpdate_SingleObject, stubCode),
|
||||
obj_(obj)
|
||||
{ }
|
||||
|
||||
ICTypeUpdate_TypeObject::ICTypeUpdate_TypeObject(IonCode *stubCode, HandleTypeObject type)
|
||||
ICTypeUpdate_TypeObject::ICTypeUpdate_TypeObject(JitCode *stubCode, HandleTypeObject type)
|
||||
: ICStub(TypeUpdate_TypeObject, stubCode),
|
||||
type_(type)
|
||||
{ }
|
||||
|
||||
ICGetElemNativeStub::ICGetElemNativeStub(ICStub::Kind kind, IonCode *stubCode,
|
||||
ICGetElemNativeStub::ICGetElemNativeStub(ICStub::Kind kind, JitCode *stubCode,
|
||||
ICStub *firstMonitorStub,
|
||||
HandleShape shape, HandlePropertyName name,
|
||||
AccessType acctype, bool needsAtomize)
|
||||
@ -9590,7 +9590,7 @@ ICGetElemNativeStub::~ICGetElemNativeStub()
|
||||
{ }
|
||||
|
||||
ICGetElemNativeGetterStub::ICGetElemNativeGetterStub(
|
||||
ICStub::Kind kind, IonCode *stubCode, ICStub *firstMonitorStub,
|
||||
ICStub::Kind kind, JitCode *stubCode, ICStub *firstMonitorStub,
|
||||
HandleShape shape, HandlePropertyName name, AccessType acctype,
|
||||
bool needsAtomize, HandleFunction getter, uint32_t pcOffset)
|
||||
: ICGetElemNativeStub(kind, stubCode, firstMonitorStub, shape, name, acctype, needsAtomize),
|
||||
@ -9603,7 +9603,7 @@ ICGetElemNativeGetterStub::ICGetElemNativeGetterStub(
|
||||
}
|
||||
|
||||
ICGetElem_NativePrototypeSlot::ICGetElem_NativePrototypeSlot(
|
||||
IonCode *stubCode, ICStub *firstMonitorStub,
|
||||
JitCode *stubCode, ICStub *firstMonitorStub,
|
||||
HandleShape shape, HandlePropertyName name,
|
||||
AccessType acctype, bool needsAtomize, uint32_t offset,
|
||||
HandleObject holder, HandleShape holderShape)
|
||||
@ -9614,7 +9614,7 @@ ICGetElem_NativePrototypeSlot::ICGetElem_NativePrototypeSlot(
|
||||
{ }
|
||||
|
||||
ICGetElemNativePrototypeCallStub::ICGetElemNativePrototypeCallStub(
|
||||
ICStub::Kind kind, IonCode *stubCode, ICStub *firstMonitorStub,
|
||||
ICStub::Kind kind, JitCode *stubCode, ICStub *firstMonitorStub,
|
||||
HandleShape shape, HandlePropertyName name,
|
||||
AccessType acctype, bool needsAtomize, HandleFunction getter,
|
||||
uint32_t pcOffset, HandleObject holder, HandleShape holderShape)
|
||||
@ -9624,12 +9624,12 @@ ICGetElemNativePrototypeCallStub::ICGetElemNativePrototypeCallStub(
|
||||
holderShape_(holderShape)
|
||||
{}
|
||||
|
||||
ICGetElem_Dense::ICGetElem_Dense(IonCode *stubCode, ICStub *firstMonitorStub, HandleShape shape)
|
||||
ICGetElem_Dense::ICGetElem_Dense(JitCode *stubCode, ICStub *firstMonitorStub, HandleShape shape)
|
||||
: ICMonitoredStub(GetElem_Dense, stubCode, firstMonitorStub),
|
||||
shape_(shape)
|
||||
{ }
|
||||
|
||||
ICGetElem_TypedArray::ICGetElem_TypedArray(IonCode *stubCode, HandleShape shape, uint32_t type)
|
||||
ICGetElem_TypedArray::ICGetElem_TypedArray(JitCode *stubCode, HandleShape shape, uint32_t type)
|
||||
: ICStub(GetElem_TypedArray, stubCode),
|
||||
shape_(shape)
|
||||
{
|
||||
@ -9637,13 +9637,13 @@ ICGetElem_TypedArray::ICGetElem_TypedArray(IonCode *stubCode, HandleShape shape,
|
||||
JS_ASSERT(extra_ == type);
|
||||
}
|
||||
|
||||
ICSetElem_Dense::ICSetElem_Dense(IonCode *stubCode, HandleShape shape, HandleTypeObject type)
|
||||
ICSetElem_Dense::ICSetElem_Dense(JitCode *stubCode, HandleShape shape, HandleTypeObject type)
|
||||
: ICUpdatedStub(SetElem_Dense, stubCode),
|
||||
shape_(shape),
|
||||
type_(type)
|
||||
{ }
|
||||
|
||||
ICSetElem_DenseAdd::ICSetElem_DenseAdd(IonCode *stubCode, types::TypeObject *type,
|
||||
ICSetElem_DenseAdd::ICSetElem_DenseAdd(JitCode *stubCode, types::TypeObject *type,
|
||||
size_t protoChainDepth)
|
||||
: ICUpdatedStub(SetElem_DenseAdd, stubCode),
|
||||
type_(type)
|
||||
@ -9659,11 +9659,11 @@ ICSetElemDenseAddCompiler::getStubSpecific(ICStubSpace *space, const AutoShapeVe
|
||||
RootedTypeObject objType(cx, obj_->getType(cx));
|
||||
if (!objType)
|
||||
return nullptr;
|
||||
Rooted<IonCode *> stubCode(cx, getStubCode());
|
||||
Rooted<JitCode *> stubCode(cx, getStubCode());
|
||||
return ICSetElem_DenseAddImpl<ProtoChainDepth>::New(space, stubCode, objType, shapes);
|
||||
}
|
||||
|
||||
ICSetElem_TypedArray::ICSetElem_TypedArray(IonCode *stubCode, HandleShape shape, uint32_t type,
|
||||
ICSetElem_TypedArray::ICSetElem_TypedArray(JitCode *stubCode, HandleShape shape, uint32_t type,
|
||||
bool expectOutOfBounds)
|
||||
: ICStub(SetElem_TypedArray, stubCode),
|
||||
shape_(shape)
|
||||
@ -9673,7 +9673,7 @@ ICSetElem_TypedArray::ICSetElem_TypedArray(IonCode *stubCode, HandleShape shape,
|
||||
extra_ |= (static_cast<uint16_t>(expectOutOfBounds) << 8);
|
||||
}
|
||||
|
||||
ICGetName_Global::ICGetName_Global(IonCode *stubCode, ICStub *firstMonitorStub, HandleShape shape,
|
||||
ICGetName_Global::ICGetName_Global(JitCode *stubCode, ICStub *firstMonitorStub, HandleShape shape,
|
||||
uint32_t slot)
|
||||
: ICMonitoredStub(GetName_Global, stubCode, firstMonitorStub),
|
||||
shape_(shape),
|
||||
@ -9681,7 +9681,7 @@ ICGetName_Global::ICGetName_Global(IonCode *stubCode, ICStub *firstMonitorStub,
|
||||
{ }
|
||||
|
||||
template <size_t NumHops>
|
||||
ICGetName_Scope<NumHops>::ICGetName_Scope(IonCode *stubCode, ICStub *firstMonitorStub,
|
||||
ICGetName_Scope<NumHops>::ICGetName_Scope(JitCode *stubCode, ICStub *firstMonitorStub,
|
||||
AutoShapeVector *shapes, uint32_t offset)
|
||||
: ICMonitoredStub(GetStubKind(), stubCode, firstMonitorStub),
|
||||
offset_(offset)
|
||||
@ -9692,7 +9692,7 @@ ICGetName_Scope<NumHops>::ICGetName_Scope(IonCode *stubCode, ICStub *firstMonito
|
||||
shapes_[i].init((*shapes)[i]);
|
||||
}
|
||||
|
||||
ICGetIntrinsic_Constant::ICGetIntrinsic_Constant(IonCode *stubCode, HandleValue value)
|
||||
ICGetIntrinsic_Constant::ICGetIntrinsic_Constant(JitCode *stubCode, HandleValue value)
|
||||
: ICStub(GetIntrinsic_Constant, stubCode),
|
||||
value_(value)
|
||||
{ }
|
||||
@ -9700,14 +9700,14 @@ ICGetIntrinsic_Constant::ICGetIntrinsic_Constant(IonCode *stubCode, HandleValue
|
||||
ICGetIntrinsic_Constant::~ICGetIntrinsic_Constant()
|
||||
{ }
|
||||
|
||||
ICGetProp_Primitive::ICGetProp_Primitive(IonCode *stubCode, ICStub *firstMonitorStub,
|
||||
ICGetProp_Primitive::ICGetProp_Primitive(JitCode *stubCode, ICStub *firstMonitorStub,
|
||||
HandleShape protoShape, uint32_t offset)
|
||||
: ICMonitoredStub(GetProp_Primitive, stubCode, firstMonitorStub),
|
||||
protoShape_(protoShape),
|
||||
offset_(offset)
|
||||
{ }
|
||||
|
||||
ICGetPropNativeStub::ICGetPropNativeStub(ICStub::Kind kind, IonCode *stubCode,
|
||||
ICGetPropNativeStub::ICGetPropNativeStub(ICStub::Kind kind, JitCode *stubCode,
|
||||
ICStub *firstMonitorStub,
|
||||
HandleShape shape, uint32_t offset)
|
||||
: ICMonitoredStub(kind, stubCode, firstMonitorStub),
|
||||
@ -9715,7 +9715,7 @@ ICGetPropNativeStub::ICGetPropNativeStub(ICStub::Kind kind, IonCode *stubCode,
|
||||
offset_(offset)
|
||||
{ }
|
||||
|
||||
ICGetProp_NativePrototype::ICGetProp_NativePrototype(IonCode *stubCode, ICStub *firstMonitorStub,
|
||||
ICGetProp_NativePrototype::ICGetProp_NativePrototype(JitCode *stubCode, ICStub *firstMonitorStub,
|
||||
HandleShape shape, uint32_t offset,
|
||||
HandleObject holder, HandleShape holderShape)
|
||||
: ICGetPropNativeStub(GetProp_NativePrototype, stubCode, firstMonitorStub, shape, offset),
|
||||
@ -9723,7 +9723,7 @@ ICGetProp_NativePrototype::ICGetProp_NativePrototype(IonCode *stubCode, ICStub *
|
||||
holderShape_(holderShape)
|
||||
{ }
|
||||
|
||||
ICGetPropCallGetter::ICGetPropCallGetter(Kind kind, IonCode *stubCode, ICStub *firstMonitorStub,
|
||||
ICGetPropCallGetter::ICGetPropCallGetter(Kind kind, JitCode *stubCode, ICStub *firstMonitorStub,
|
||||
HandleShape shape, HandleObject holder,
|
||||
HandleShape holderShape,
|
||||
HandleFunction getter, uint32_t pcOffset)
|
||||
@ -9737,7 +9737,7 @@ ICGetPropCallGetter::ICGetPropCallGetter(Kind kind, IonCode *stubCode, ICStub *f
|
||||
JS_ASSERT(kind == ICStub::GetProp_CallScripted || kind == ICStub::GetProp_CallNative);
|
||||
}
|
||||
|
||||
ICSetProp_Native::ICSetProp_Native(IonCode *stubCode, HandleTypeObject type, HandleShape shape,
|
||||
ICSetProp_Native::ICSetProp_Native(JitCode *stubCode, HandleTypeObject type, HandleShape shape,
|
||||
uint32_t offset)
|
||||
: ICUpdatedStub(SetProp_Native, stubCode),
|
||||
type_(type),
|
||||
@ -9759,7 +9759,7 @@ ICSetProp_Native::Compiler::getStub(ICStubSpace *space)
|
||||
return stub;
|
||||
}
|
||||
|
||||
ICSetProp_NativeAdd::ICSetProp_NativeAdd(IonCode *stubCode, HandleTypeObject type,
|
||||
ICSetProp_NativeAdd::ICSetProp_NativeAdd(JitCode *stubCode, HandleTypeObject type,
|
||||
size_t protoChainDepth,
|
||||
HandleShape newShape,
|
||||
uint32_t offset)
|
||||
@ -9773,7 +9773,7 @@ ICSetProp_NativeAdd::ICSetProp_NativeAdd(IonCode *stubCode, HandleTypeObject typ
|
||||
}
|
||||
|
||||
template <size_t ProtoChainDepth>
|
||||
ICSetProp_NativeAddImpl<ProtoChainDepth>::ICSetProp_NativeAddImpl(IonCode *stubCode,
|
||||
ICSetProp_NativeAddImpl<ProtoChainDepth>::ICSetProp_NativeAddImpl(JitCode *stubCode,
|
||||
HandleTypeObject type,
|
||||
const AutoShapeVector *shapes,
|
||||
HandleShape newShape,
|
||||
@ -9800,7 +9800,7 @@ ICSetPropNativeAddCompiler::ICSetPropNativeAddCompiler(JSContext *cx, HandleObje
|
||||
JS_ASSERT(protoChainDepth_ <= ICSetProp_NativeAdd::MAX_PROTO_CHAIN_DEPTH);
|
||||
}
|
||||
|
||||
ICSetPropCallSetter::ICSetPropCallSetter(Kind kind, IonCode *stubCode, HandleShape shape,
|
||||
ICSetPropCallSetter::ICSetPropCallSetter(Kind kind, JitCode *stubCode, HandleShape shape,
|
||||
HandleObject holder, HandleShape holderShape,
|
||||
HandleFunction setter, uint32_t pcOffset)
|
||||
: ICStub(kind, stubCode),
|
||||
@ -9813,7 +9813,7 @@ ICSetPropCallSetter::ICSetPropCallSetter(Kind kind, IonCode *stubCode, HandleSha
|
||||
JS_ASSERT(kind == ICStub::SetProp_CallScripted || kind == ICStub::SetProp_CallNative);
|
||||
}
|
||||
|
||||
ICCall_Scripted::ICCall_Scripted(IonCode *stubCode, ICStub *firstMonitorStub,
|
||||
ICCall_Scripted::ICCall_Scripted(JitCode *stubCode, ICStub *firstMonitorStub,
|
||||
HandleScript calleeScript, HandleObject templateObject,
|
||||
uint32_t pcOffset)
|
||||
: ICMonitoredStub(ICStub::Call_Scripted, stubCode, firstMonitorStub),
|
||||
@ -9822,7 +9822,7 @@ ICCall_Scripted::ICCall_Scripted(IonCode *stubCode, ICStub *firstMonitorStub,
|
||||
pcOffset_(pcOffset)
|
||||
{ }
|
||||
|
||||
ICCall_Native::ICCall_Native(IonCode *stubCode, ICStub *firstMonitorStub,
|
||||
ICCall_Native::ICCall_Native(JitCode *stubCode, ICStub *firstMonitorStub,
|
||||
HandleFunction callee, HandleObject templateObject,
|
||||
uint32_t pcOffset)
|
||||
: ICMonitoredStub(ICStub::Call_Native, stubCode, firstMonitorStub),
|
||||
@ -9831,7 +9831,7 @@ ICCall_Native::ICCall_Native(IonCode *stubCode, ICStub *firstMonitorStub,
|
||||
pcOffset_(pcOffset)
|
||||
{ }
|
||||
|
||||
ICGetPropCallDOMProxyNativeStub::ICGetPropCallDOMProxyNativeStub(Kind kind, IonCode *stubCode,
|
||||
ICGetPropCallDOMProxyNativeStub::ICGetPropCallDOMProxyNativeStub(Kind kind, JitCode *stubCode,
|
||||
ICStub *firstMonitorStub,
|
||||
HandleShape shape,
|
||||
BaseProxyHandler *proxyHandler,
|
||||
@ -9869,7 +9869,7 @@ ICGetPropCallDOMProxyNativeCompiler::ICGetPropCallDOMProxyNativeCompiler(JSConte
|
||||
JS_ASSERT(proxy_->handler()->family() == GetDOMProxyHandlerFamily());
|
||||
}
|
||||
|
||||
ICGetProp_DOMProxyShadowed::ICGetProp_DOMProxyShadowed(IonCode *stubCode,
|
||||
ICGetProp_DOMProxyShadowed::ICGetProp_DOMProxyShadowed(JitCode *stubCode,
|
||||
ICStub *firstMonitorStub,
|
||||
HandleShape shape,
|
||||
BaseProxyHandler *proxyHandler,
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -99,7 +99,7 @@ EnterBaseline(JSContext *cx, EnterJitData &data)
|
||||
JS_ASSERT(jit::IsBaselineEnabled(cx));
|
||||
JS_ASSERT_IF(data.osrFrame, CheckFrame(data.osrFrame));
|
||||
|
||||
EnterIonCode enter = cx->runtime()->jitRuntime()->enterBaseline();
|
||||
EnterJitCode enter = cx->runtime()->jitRuntime()->enterBaseline();
|
||||
|
||||
// Caller must construct |this| before invoking the Ion function.
|
||||
JS_ASSERT_IF(data.constructing, data.maxArgv[0].isObject());
|
||||
@ -410,7 +410,7 @@ BaselineScript::New(JSContext *cx, uint32_t prologueOffset,
|
||||
void
|
||||
BaselineScript::trace(JSTracer *trc)
|
||||
{
|
||||
MarkIonCode(trc, &method_, "baseline-method");
|
||||
MarkJitCode(trc, &method_, "baseline-method");
|
||||
if (templateScope_)
|
||||
MarkObject(trc, &templateScope_, "baseline-template-scope");
|
||||
|
||||
@ -900,7 +900,7 @@ void
|
||||
jit::JitCompartment::toggleBaselineStubBarriers(bool enabled)
|
||||
{
|
||||
for (ICStubCodeMap::Enum e(*stubCodes_); !e.empty(); e.popFront()) {
|
||||
IonCode *code = *e.front().value().unsafeGet();
|
||||
JitCode *code = *e.front().value().unsafeGet();
|
||||
code->togglePreBarriers(enabled);
|
||||
}
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ struct BaselineScript
|
||||
|
||||
private:
|
||||
// Code pointer containing the actual method.
|
||||
HeapPtr<IonCode> method_;
|
||||
HeapPtr<JitCode> method_;
|
||||
|
||||
// For heavyweight scripts, template objects to use for the call object and
|
||||
// decl env object (linked via the call object's enclosing scope).
|
||||
@ -232,10 +232,10 @@ struct BaselineScript
|
||||
return &fallbackStubSpace_;
|
||||
}
|
||||
|
||||
IonCode *method() const {
|
||||
JitCode *method() const {
|
||||
return method_;
|
||||
}
|
||||
void setMethod(IonCode *code) {
|
||||
void setMethod(JitCode *code) {
|
||||
JS_ASSERT(!method_);
|
||||
method_ = code;
|
||||
}
|
||||
|
@ -1933,7 +1933,7 @@ CodeGenerator::visitCallGeneric(LCallGeneric *call)
|
||||
JS_ASSERT(!call->hasSingleTarget());
|
||||
|
||||
// Generate an ArgumentsRectifier.
|
||||
IonCode *argumentsRectifier = gen->jitRuntime()->getArgumentsRectifier(executionMode);
|
||||
JitCode *argumentsRectifier = gen->jitRuntime()->getArgumentsRectifier(executionMode);
|
||||
|
||||
masm.checkStackAlignment();
|
||||
|
||||
@ -1975,7 +1975,7 @@ CodeGenerator::visitCallGeneric(LCallGeneric *call)
|
||||
{
|
||||
JS_ASSERT(ArgumentsRectifierReg != objreg);
|
||||
masm.movePtr(ImmGCPtr(argumentsRectifier), objreg); // Necessary for GC marking.
|
||||
masm.loadPtr(Address(objreg, IonCode::offsetOfCode()), objreg);
|
||||
masm.loadPtr(Address(objreg, JitCode::offsetOfCode()), objreg);
|
||||
masm.move32(Imm32(call->numStackArgs()), ArgumentsRectifierReg);
|
||||
}
|
||||
|
||||
@ -2313,11 +2313,11 @@ CodeGenerator::visitApplyArgsGeneric(LApplyArgsGeneric *apply)
|
||||
masm.bind(&underflow);
|
||||
|
||||
// Hardcode the address of the argumentsRectifier code.
|
||||
IonCode *argumentsRectifier = gen->jitRuntime()->getArgumentsRectifier(executionMode);
|
||||
JitCode *argumentsRectifier = gen->jitRuntime()->getArgumentsRectifier(executionMode);
|
||||
|
||||
JS_ASSERT(ArgumentsRectifierReg != objreg);
|
||||
masm.movePtr(ImmGCPtr(argumentsRectifier), objreg); // Necessary for GC marking.
|
||||
masm.loadPtr(Address(objreg, IonCode::offsetOfCode()), objreg);
|
||||
masm.loadPtr(Address(objreg, JitCode::offsetOfCode()), objreg);
|
||||
masm.movePtr(argcreg, ArgumentsRectifierReg);
|
||||
}
|
||||
|
||||
@ -4574,7 +4574,7 @@ CodeGenerator::emitConcat(LInstruction *lir, Register lhs, Register rhs, Registe
|
||||
return false;
|
||||
|
||||
ExecutionMode mode = gen->info().executionMode();
|
||||
IonCode *stringConcatStub = gen->compartment->jitCompartment()->stringConcatStub(mode);
|
||||
JitCode *stringConcatStub = gen->compartment->jitCompartment()->stringConcatStub(mode);
|
||||
masm.call(stringConcatStub);
|
||||
masm.branchTestPtr(Assembler::Zero, output, output, ool->entry());
|
||||
|
||||
@ -4647,7 +4647,7 @@ CopyStringChars(MacroAssembler &masm, Register to, Register from, Register len,
|
||||
masm.j(Assembler::NonZero, &start);
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitCompartment::generateStringConcatStub(JSContext *cx, ExecutionMode mode)
|
||||
{
|
||||
MacroAssembler masm(cx);
|
||||
@ -4791,10 +4791,10 @@ JitCompartment::generateStringConcatStub(JSContext *cx, ExecutionMode mode)
|
||||
masm.ret();
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<CanGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<CanGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "StringConcatStub");
|
||||
writePerfSpewerJitCodeProfile(code, "StringConcatStub");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
@ -6029,7 +6029,7 @@ CodeGenerator::link(JSContext *cx, types::CompilerConstraintList *constraints)
|
||||
// use the normal executable allocator so that we cannot segv during
|
||||
// execution off the main thread.
|
||||
Linker linker(masm);
|
||||
IonCode *code = (executionMode == SequentialExecution)
|
||||
JitCode *code = (executionMode == SequentialExecution)
|
||||
? linker.newCodeForIonScript(cx)
|
||||
: linker.newCode<CanGC>(cx, JSC::ION_CODE);
|
||||
if (!code) {
|
||||
|
@ -52,8 +52,8 @@ using namespace js::jit;
|
||||
|
||||
using mozilla::Maybe;
|
||||
|
||||
// Assert that IonCode is gc::Cell aligned.
|
||||
JS_STATIC_ASSERT(sizeof(IonCode) % gc::CellSize == 0);
|
||||
// Assert that JitCode is gc::Cell aligned.
|
||||
JS_STATIC_ASSERT(sizeof(JitCode) % gc::CellSize == 0);
|
||||
|
||||
#ifdef JS_THREADSAFE
|
||||
static bool IonTLSInitialized = false;
|
||||
@ -240,7 +240,7 @@ JitRuntime::initialize(JSContext *cx)
|
||||
FrameSizeClass class_ = FrameSizeClass::FromClass(id);
|
||||
if (class_ == FrameSizeClass::ClassLimit())
|
||||
break;
|
||||
bailoutTables_.infallibleAppend((IonCode *)nullptr);
|
||||
bailoutTables_.infallibleAppend((JitCode *)nullptr);
|
||||
bailoutTables_[id] = generateBailoutTable(cx, id);
|
||||
if (!bailoutTables_[id])
|
||||
return false;
|
||||
@ -298,7 +298,7 @@ JitRuntime::initialize(JSContext *cx)
|
||||
return true;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::debugTrapHandler(JSContext *cx)
|
||||
{
|
||||
if (!debugTrapHandler_) {
|
||||
@ -553,9 +553,9 @@ JitRuntime::Mark(JSTracer *trc)
|
||||
{
|
||||
JS_ASSERT(!trc->runtime->isHeapMinorCollecting());
|
||||
Zone *zone = trc->runtime->atomsCompartment()->zone();
|
||||
for (gc::CellIterUnderGC i(zone, gc::FINALIZE_IONCODE); !i.done(); i.next()) {
|
||||
IonCode *code = i.get<IonCode>();
|
||||
MarkIonCodeRoot(trc, &code, "wrapper");
|
||||
for (gc::CellIterUnderGC i(zone, gc::FINALIZE_JITCODE); !i.done(); i.next()) {
|
||||
JitCode *code = i.get<JitCode>();
|
||||
MarkJitCodeRoot(trc, &code, "wrapper");
|
||||
}
|
||||
}
|
||||
|
||||
@ -587,21 +587,21 @@ JitCompartment::sweep(FreeOp *fop)
|
||||
if (!stubCodes_->lookup(static_cast<uint32_t>(ICStub::SetProp_Fallback)))
|
||||
baselineSetPropReturnAddr_ = nullptr;
|
||||
|
||||
if (stringConcatStub_ && !IsIonCodeMarked(stringConcatStub_.unsafeGet()))
|
||||
if (stringConcatStub_ && !IsJitCodeMarked(stringConcatStub_.unsafeGet()))
|
||||
stringConcatStub_ = nullptr;
|
||||
|
||||
if (parallelStringConcatStub_ && !IsIonCodeMarked(parallelStringConcatStub_.unsafeGet()))
|
||||
if (parallelStringConcatStub_ && !IsJitCodeMarked(parallelStringConcatStub_.unsafeGet()))
|
||||
parallelStringConcatStub_ = nullptr;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::getBailoutTable(const FrameSizeClass &frameClass) const
|
||||
{
|
||||
JS_ASSERT(frameClass != FrameSizeClass::None());
|
||||
return bailoutTables_[frameClass.classId()];
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::getVMWrapper(const VMFunction &f) const
|
||||
{
|
||||
JS_ASSERT(functionWrappers_);
|
||||
@ -613,33 +613,33 @@ JitRuntime::getVMWrapper(const VMFunction &f) const
|
||||
}
|
||||
|
||||
template <AllowGC allowGC>
|
||||
IonCode *
|
||||
IonCode::New(JSContext *cx, uint8_t *code, uint32_t bufferSize, JSC::ExecutablePool *pool)
|
||||
JitCode *
|
||||
JitCode::New(JSContext *cx, uint8_t *code, uint32_t bufferSize, JSC::ExecutablePool *pool)
|
||||
{
|
||||
IonCode *codeObj = gc::NewGCThing<IonCode, allowGC>(cx, gc::FINALIZE_IONCODE, sizeof(IonCode), gc::DefaultHeap);
|
||||
JitCode *codeObj = gc::NewGCThing<JitCode, allowGC>(cx, gc::FINALIZE_JITCODE, sizeof(JitCode), gc::DefaultHeap);
|
||||
if (!codeObj) {
|
||||
pool->release();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
new (codeObj) IonCode(code, bufferSize, pool);
|
||||
new (codeObj) JitCode(code, bufferSize, pool);
|
||||
return codeObj;
|
||||
}
|
||||
|
||||
template
|
||||
IonCode *
|
||||
IonCode::New<CanGC>(JSContext *cx, uint8_t *code, uint32_t bufferSize, JSC::ExecutablePool *pool);
|
||||
JitCode *
|
||||
JitCode::New<CanGC>(JSContext *cx, uint8_t *code, uint32_t bufferSize, JSC::ExecutablePool *pool);
|
||||
|
||||
template
|
||||
IonCode *
|
||||
IonCode::New<NoGC>(JSContext *cx, uint8_t *code, uint32_t bufferSize, JSC::ExecutablePool *pool);
|
||||
JitCode *
|
||||
JitCode::New<NoGC>(JSContext *cx, uint8_t *code, uint32_t bufferSize, JSC::ExecutablePool *pool);
|
||||
|
||||
void
|
||||
IonCode::copyFrom(MacroAssembler &masm)
|
||||
JitCode::copyFrom(MacroAssembler &masm)
|
||||
{
|
||||
// Store the IonCode pointer right before the code buffer, so we can
|
||||
// Store the JitCode pointer right before the code buffer, so we can
|
||||
// recover the gcthing from relocation tables.
|
||||
*(IonCode **)(code_ - sizeof(IonCode *)) = this;
|
||||
*(JitCode **)(code_ - sizeof(JitCode *)) = this;
|
||||
insnSize_ = masm.instructionsSize();
|
||||
masm.executableCopy(code_);
|
||||
|
||||
@ -656,7 +656,7 @@ IonCode::copyFrom(MacroAssembler &masm)
|
||||
}
|
||||
|
||||
void
|
||||
IonCode::trace(JSTracer *trc)
|
||||
JitCode::trace(JSTracer *trc)
|
||||
{
|
||||
// Note that we cannot mark invalidated scripts, since we've basically
|
||||
// corrupted the code stream by injecting bailouts.
|
||||
@ -676,7 +676,7 @@ IonCode::trace(JSTracer *trc)
|
||||
}
|
||||
|
||||
void
|
||||
IonCode::finalize(FreeOp *fop)
|
||||
JitCode::finalize(FreeOp *fop)
|
||||
{
|
||||
// Make sure this can't race with an interrupting thread, which may try
|
||||
// to read the contents of the pool we are releasing references in.
|
||||
@ -702,7 +702,7 @@ IonCode::finalize(FreeOp *fop)
|
||||
}
|
||||
|
||||
void
|
||||
IonCode::togglePreBarriers(bool enabled)
|
||||
JitCode::togglePreBarriers(bool enabled)
|
||||
{
|
||||
uint8_t *start = code_ + preBarrierTableOffset();
|
||||
CompactBufferReader reader(start, start + preBarrierTableBytes_);
|
||||
@ -860,10 +860,10 @@ void
|
||||
IonScript::trace(JSTracer *trc)
|
||||
{
|
||||
if (method_)
|
||||
MarkIonCode(trc, &method_, "method");
|
||||
MarkJitCode(trc, &method_, "method");
|
||||
|
||||
if (deoptTable_)
|
||||
MarkIonCode(trc, &deoptTable_, "deoptimizationTable");
|
||||
MarkJitCode(trc, &deoptTable_, "deoptimizationTable");
|
||||
|
||||
for (size_t i = 0; i < numConstants(); i++)
|
||||
gc::MarkValue(trc, &getConstant(i), "constant");
|
||||
@ -918,7 +918,7 @@ IonScript::copyCallTargetEntries(JSScript **callTargets)
|
||||
}
|
||||
|
||||
void
|
||||
IonScript::copyPatchableBackedges(JSContext *cx, IonCode *code,
|
||||
IonScript::copyPatchableBackedges(JSContext *cx, JitCode *code,
|
||||
PatchableBackedgeInfo *backedges)
|
||||
{
|
||||
for (size_t i = 0; i < backedgeEntries_; i++) {
|
||||
@ -2226,7 +2226,7 @@ EnterIon(JSContext *cx, EnterJitData &data)
|
||||
JS_ASSERT(jit::IsIonEnabled(cx));
|
||||
JS_ASSERT(!data.osrFrame);
|
||||
|
||||
EnterIonCode enter = cx->runtime()->jitRuntime()->enterIon();
|
||||
EnterJitCode enter = cx->runtime()->jitRuntime()->enterIon();
|
||||
|
||||
// Caller must construct |this| before invoking the Ion function.
|
||||
JS_ASSERT_IF(data.constructing, data.maxArgv[0].isObject());
|
||||
@ -2335,7 +2335,7 @@ jit::FastInvoke(JSContext *cx, HandleFunction fun, CallArgs &args)
|
||||
JS_CHECK_RECURSION(cx, return IonExec_Error);
|
||||
|
||||
IonScript *ion = fun->nonLazyScript()->ionScript();
|
||||
IonCode *code = ion->method();
|
||||
JitCode *code = ion->method();
|
||||
void *jitcode = code->raw();
|
||||
|
||||
JS_ASSERT(jit::IsIonEnabled(cx));
|
||||
@ -2343,7 +2343,7 @@ jit::FastInvoke(JSContext *cx, HandleFunction fun, CallArgs &args)
|
||||
|
||||
JitActivation activation(cx, /* firstFrameIsConstructing = */false);
|
||||
|
||||
EnterIonCode enter = cx->runtime()->jitRuntime()->enterIon();
|
||||
EnterJitCode enter = cx->runtime()->jitRuntime()->enterIon();
|
||||
void *calleeToken = CalleeToToken(fun);
|
||||
|
||||
RootedValue result(cx, Int32Value(args.length()));
|
||||
@ -2458,13 +2458,13 @@ InvalidateActivation(FreeOp *fop, uint8_t *ionTop, bool invalidateAll)
|
||||
ionScript->incref();
|
||||
|
||||
const SafepointIndex *si = ionScript->getSafepointIndex(it.returnAddressToFp());
|
||||
IonCode *ionCode = ionScript->method();
|
||||
JitCode *ionCode = ionScript->method();
|
||||
|
||||
JS::Zone *zone = script->zone();
|
||||
if (zone->needsBarrier()) {
|
||||
// We're about to remove edges from the JSScript to gcthings
|
||||
// embedded in the IonCode. Perform one final trace of the
|
||||
// IonCode for the incremental GC, as it must know about
|
||||
// embedded in the JitCode. Perform one final trace of the
|
||||
// JitCode for the incremental GC, as it must know about
|
||||
// those edges.
|
||||
ionCode->trace(zone->barrierTracer());
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ using mozilla::DebugOnly;
|
||||
using mozilla::tl::FloorLog2;
|
||||
|
||||
void
|
||||
CodeLocationJump::repoint(IonCode *code, MacroAssembler *masm)
|
||||
CodeLocationJump::repoint(JitCode *code, MacroAssembler *masm)
|
||||
{
|
||||
JS_ASSERT(state_ == Relative);
|
||||
size_t new_off = (size_t)raw_;
|
||||
@ -59,7 +59,7 @@ CodeLocationJump::repoint(IonCode *code, MacroAssembler *masm)
|
||||
}
|
||||
|
||||
void
|
||||
CodeLocationLabel::repoint(IonCode *code, MacroAssembler *masm)
|
||||
CodeLocationLabel::repoint(JitCode *code, MacroAssembler *masm)
|
||||
{
|
||||
JS_ASSERT(state_ == Relative);
|
||||
size_t new_off = (size_t)raw_;
|
||||
@ -103,7 +103,7 @@ IonCache::CacheName(IonCache::Kind kind)
|
||||
}
|
||||
|
||||
IonCache::LinkStatus
|
||||
IonCache::linkCode(JSContext *cx, MacroAssembler &masm, IonScript *ion, IonCode **code)
|
||||
IonCache::linkCode(JSContext *cx, MacroAssembler &masm, IonScript *ion, JitCode **code)
|
||||
{
|
||||
Linker linker(masm);
|
||||
*code = linker.newCode<CanGC>(cx, JSC::ION_CODE);
|
||||
@ -180,10 +180,10 @@ class IonCache::StubAttacher
|
||||
stubCodePatchOffset_()
|
||||
{ }
|
||||
|
||||
// Value used instead of the IonCode self-reference of generated
|
||||
// Value used instead of the JitCode self-reference of generated
|
||||
// stubs. This value is needed for marking calls made inside stubs. This
|
||||
// value would be replaced by the attachStub function after the allocation
|
||||
// of the IonCode. The self-reference is used to keep the stub path alive
|
||||
// of the JitCode. The self-reference is used to keep the stub path alive
|
||||
// even if the IonScript is invalidated or if the IC is flushed.
|
||||
static const ImmPtr STUB_ADDR;
|
||||
|
||||
@ -221,9 +221,9 @@ class IonCache::StubAttacher
|
||||
}
|
||||
|
||||
void pushStubCodePointer(MacroAssembler &masm) {
|
||||
// Push the IonCode pointer for the stub we're generating.
|
||||
// Push the JitCode pointer for the stub we're generating.
|
||||
// WARNING:
|
||||
// WARNING: If IonCode ever becomes relocatable, the following code is incorrect.
|
||||
// WARNING: If JitCode ever becomes relocatable, the following code is incorrect.
|
||||
// WARNING: Note that we're not marking the pointer being pushed as an ImmGCPtr.
|
||||
// WARNING: This location will be patched with the pointer of the generated stub,
|
||||
// WARNING: such as it can be marked when a call is made with this stub. Be aware
|
||||
@ -236,13 +236,13 @@ class IonCache::StubAttacher
|
||||
hasStubCodePatchOffset_ = true;
|
||||
}
|
||||
|
||||
void patchRejoinJump(MacroAssembler &masm, IonCode *code) {
|
||||
void patchRejoinJump(MacroAssembler &masm, JitCode *code) {
|
||||
rejoinOffset_.fixup(&masm);
|
||||
CodeLocationJump rejoinJump(code, rejoinOffset_);
|
||||
PatchJump(rejoinJump, rejoinLabel_);
|
||||
}
|
||||
|
||||
void patchStubCodePointer(MacroAssembler &masm, IonCode *code) {
|
||||
void patchStubCodePointer(MacroAssembler &masm, JitCode *code) {
|
||||
if (hasStubCodePatchOffset_) {
|
||||
stubCodePatchOffset_.fixup(&masm);
|
||||
Assembler::patchDataWithValueCheck(CodeLocationLabel(code, stubCodePatchOffset_),
|
||||
@ -250,7 +250,7 @@ class IonCache::StubAttacher
|
||||
}
|
||||
}
|
||||
|
||||
virtual void patchNextStubJump(MacroAssembler &masm, IonCode *code) = 0;
|
||||
virtual void patchNextStubJump(MacroAssembler &masm, JitCode *code) = 0;
|
||||
};
|
||||
|
||||
const ImmPtr IonCache::StubAttacher::STUB_ADDR = ImmPtr((void*)0xdeadc0de);
|
||||
@ -266,7 +266,7 @@ class RepatchIonCache::RepatchStubAppender : public IonCache::StubAttacher
|
||||
{
|
||||
}
|
||||
|
||||
void patchNextStubJump(MacroAssembler &masm, IonCode *code) {
|
||||
void patchNextStubJump(MacroAssembler &masm, JitCode *code) {
|
||||
// Patch the previous nextStubJump of the last stub, or the jump from the
|
||||
// codeGen, to jump into the newly allocated code.
|
||||
PatchJump(cache_.lastJump_, CodeLocationLabel(code));
|
||||
@ -308,7 +308,7 @@ RepatchIonCache::bindInitialJump(MacroAssembler &masm, AddCacheState &addState)
|
||||
}
|
||||
|
||||
void
|
||||
RepatchIonCache::updateBaseAddress(IonCode *code, MacroAssembler &masm)
|
||||
RepatchIonCache::updateBaseAddress(JitCode *code, MacroAssembler &masm)
|
||||
{
|
||||
IonCache::updateBaseAddress(code, masm);
|
||||
initialJump_.repoint(code, &masm);
|
||||
@ -326,7 +326,7 @@ class DispatchIonCache::DispatchStubPrepender : public IonCache::StubAttacher
|
||||
{
|
||||
}
|
||||
|
||||
void patchNextStubJump(MacroAssembler &masm, IonCode *code) {
|
||||
void patchNextStubJump(MacroAssembler &masm, JitCode *code) {
|
||||
JS_ASSERT(hasNextStubOffset_);
|
||||
|
||||
// Jump to the previous entry in the stub dispatch table. We
|
||||
@ -365,7 +365,7 @@ DispatchIonCache::bindInitialJump(MacroAssembler &masm, AddCacheState &addState)
|
||||
}
|
||||
|
||||
void
|
||||
DispatchIonCache::updateBaseAddress(IonCode *code, MacroAssembler &masm)
|
||||
DispatchIonCache::updateBaseAddress(JitCode *code, MacroAssembler &masm)
|
||||
{
|
||||
// The address of firstStub_ should be pointer aligned.
|
||||
JS_ASSERT(uintptr_t(&firstStub_) % sizeof(uintptr_t) == 0);
|
||||
@ -380,7 +380,7 @@ DispatchIonCache::updateBaseAddress(IonCode *code, MacroAssembler &masm)
|
||||
}
|
||||
|
||||
void
|
||||
IonCache::attachStub(MacroAssembler &masm, StubAttacher &attacher, Handle<IonCode *> code)
|
||||
IonCache::attachStub(MacroAssembler &masm, StubAttacher &attacher, Handle<JitCode *> code)
|
||||
{
|
||||
JS_ASSERT(canAttachStub());
|
||||
incrementStubCount();
|
||||
@ -401,7 +401,7 @@ bool
|
||||
IonCache::linkAndAttachStub(JSContext *cx, MacroAssembler &masm, StubAttacher &attacher,
|
||||
IonScript *ion, const char *attachKind)
|
||||
{
|
||||
Rooted<IonCode *> code(cx);
|
||||
Rooted<JitCode *> code(cx);
|
||||
LinkStatus status = linkCode(cx, masm, ion, code.address());
|
||||
if (status != LINK_GOOD)
|
||||
return status != LINK_ERROR;
|
||||
@ -418,14 +418,14 @@ IonCache::linkAndAttachStub(JSContext *cx, MacroAssembler &masm, StubAttacher &a
|
||||
}
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "IonCache");
|
||||
writePerfSpewerJitCodeProfile(code, "IonCache");
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
IonCache::updateBaseAddress(IonCode *code, MacroAssembler &masm)
|
||||
IonCache::updateBaseAddress(JitCode *code, MacroAssembler &masm)
|
||||
{
|
||||
fallbackLabel_.repoint(code, &masm);
|
||||
}
|
||||
|
@ -201,7 +201,7 @@ class IonCache
|
||||
|
||||
virtual void emitInitialJump(MacroAssembler &masm, AddCacheState &addState) = 0;
|
||||
virtual void bindInitialJump(MacroAssembler &masm, AddCacheState &addState) = 0;
|
||||
virtual void updateBaseAddress(IonCode *code, MacroAssembler &masm);
|
||||
virtual void updateBaseAddress(JitCode *code, MacroAssembler &masm);
|
||||
|
||||
// Initialize the AddCacheState depending on the kind of cache, like
|
||||
// setting a scratch register. Defaults to doing nothing.
|
||||
@ -230,10 +230,10 @@ class IonCache
|
||||
// monitoring/allocation caused an invalidation of the running ion script,
|
||||
// this function returns CACHE_FLUSHED. In case of allocation issue this
|
||||
// function returns LINK_ERROR.
|
||||
LinkStatus linkCode(JSContext *cx, MacroAssembler &masm, IonScript *ion, IonCode **code);
|
||||
LinkStatus linkCode(JSContext *cx, MacroAssembler &masm, IonScript *ion, JitCode **code);
|
||||
// Fixup variables and update jumps in the list of stubs. Increment the
|
||||
// number of attached stubs accordingly.
|
||||
void attachStub(MacroAssembler &masm, StubAttacher &attacher, Handle<IonCode *> code);
|
||||
void attachStub(MacroAssembler &masm, StubAttacher &attacher, Handle<JitCode *> code);
|
||||
|
||||
// Combine both linkStub and attachStub into one function. In addition, it
|
||||
// produces a spew augmented with the attachKind string.
|
||||
@ -380,7 +380,7 @@ class RepatchIonCache : public IonCache
|
||||
void bindInitialJump(MacroAssembler &masm, AddCacheState &addState);
|
||||
|
||||
// Update the labels once the code is finalized.
|
||||
void updateBaseAddress(IonCode *code, MacroAssembler &masm);
|
||||
void updateBaseAddress(JitCode *code, MacroAssembler &masm);
|
||||
};
|
||||
|
||||
//
|
||||
@ -478,7 +478,7 @@ class DispatchIonCache : public IonCache
|
||||
void bindInitialJump(MacroAssembler &masm, AddCacheState &addState);
|
||||
|
||||
// Fix up the first stub pointer once the code is finalized.
|
||||
void updateBaseAddress(IonCode *code, MacroAssembler &masm);
|
||||
void updateBaseAddress(JitCode *code, MacroAssembler &masm);
|
||||
};
|
||||
|
||||
// Define the cache kind and pre-declare data structures used for calling inline
|
||||
|
@ -39,7 +39,7 @@ class MacroAssembler;
|
||||
class CodeOffsetLabel;
|
||||
class PatchableBackedge;
|
||||
|
||||
class IonCode : public gc::BarrieredCell<IonCode>
|
||||
class JitCode : public gc::BarrieredCell<JitCode>
|
||||
{
|
||||
protected:
|
||||
uint8_t *code_;
|
||||
@ -54,15 +54,15 @@ class IonCode : public gc::BarrieredCell<IonCode>
|
||||
// This is necessary to prevent GC tracing.
|
||||
|
||||
#if JS_BITS_PER_WORD == 32
|
||||
// Ensure IonCode is gc::Cell aligned.
|
||||
// Ensure JitCode is gc::Cell aligned.
|
||||
uint32_t padding_;
|
||||
#endif
|
||||
|
||||
IonCode()
|
||||
JitCode()
|
||||
: code_(nullptr),
|
||||
pool_(nullptr)
|
||||
{ }
|
||||
IonCode(uint8_t *code, uint32_t bufferSize, JSC::ExecutablePool *pool)
|
||||
JitCode(uint8_t *code, uint32_t bufferSize, JSC::ExecutablePool *pool)
|
||||
: code_(code),
|
||||
pool_(pool),
|
||||
bufferSize_(bufferSize),
|
||||
@ -102,7 +102,7 @@ class IonCode : public gc::BarrieredCell<IonCode>
|
||||
|
||||
void togglePreBarriers(bool enabled);
|
||||
|
||||
// If this IonCode object has been, effectively, corrupted due to
|
||||
// If this JitCode object has been, effectively, corrupted due to
|
||||
// invalidation patching, then we have to remember this so we don't try and
|
||||
// trace relocation entries that may now be corrupt.
|
||||
bool invalidated() const {
|
||||
@ -115,28 +115,28 @@ class IonCode : public gc::BarrieredCell<IonCode>
|
||||
|
||||
void copyFrom(MacroAssembler &masm);
|
||||
|
||||
static IonCode *FromExecutable(uint8_t *buffer) {
|
||||
IonCode *code = *(IonCode **)(buffer - sizeof(IonCode *));
|
||||
static JitCode *FromExecutable(uint8_t *buffer) {
|
||||
JitCode *code = *(JitCode **)(buffer - sizeof(JitCode *));
|
||||
JS_ASSERT(code->raw() == buffer);
|
||||
return code;
|
||||
}
|
||||
|
||||
static size_t offsetOfCode() {
|
||||
return offsetof(IonCode, code_);
|
||||
return offsetof(JitCode, code_);
|
||||
}
|
||||
|
||||
uint8_t *jumpRelocTable() {
|
||||
return code_ + jumpRelocTableOffset();
|
||||
}
|
||||
|
||||
// Allocates a new IonCode object which will be managed by the GC. If no
|
||||
// Allocates a new JitCode object which will be managed by the GC. If no
|
||||
// object can be allocated, nullptr is returned. On failure, |pool| is
|
||||
// automatically released, so the code may be freed.
|
||||
template <AllowGC allowGC>
|
||||
static IonCode *New(JSContext *cx, uint8_t *code, uint32_t bufferSize, JSC::ExecutablePool *pool);
|
||||
static JitCode *New(JSContext *cx, uint8_t *code, uint32_t bufferSize, JSC::ExecutablePool *pool);
|
||||
|
||||
public:
|
||||
static inline ThingRootKind rootKind() { return THING_ROOT_ION_CODE; }
|
||||
static inline ThingRootKind rootKind() { return THING_ROOT_JIT_CODE; }
|
||||
};
|
||||
|
||||
class SnapshotWriter;
|
||||
@ -165,10 +165,10 @@ struct IonScript
|
||||
{
|
||||
private:
|
||||
// Code pointer containing the actual method.
|
||||
EncapsulatedPtr<IonCode> method_;
|
||||
EncapsulatedPtr<JitCode> method_;
|
||||
|
||||
// Deoptimization table used by this method.
|
||||
EncapsulatedPtr<IonCode> deoptTable_;
|
||||
EncapsulatedPtr<JitCode> deoptTable_;
|
||||
|
||||
// Entrypoint for OSR, or nullptr.
|
||||
jsbytecode *osrPc_;
|
||||
@ -357,14 +357,14 @@ struct IonScript
|
||||
}
|
||||
|
||||
public:
|
||||
IonCode *method() const {
|
||||
JitCode *method() const {
|
||||
return method_;
|
||||
}
|
||||
void setMethod(IonCode *code) {
|
||||
void setMethod(JitCode *code) {
|
||||
JS_ASSERT(!invalidated());
|
||||
method_ = code;
|
||||
}
|
||||
void setDeoptTable(IonCode *code) {
|
||||
void setDeoptTable(JitCode *code) {
|
||||
deoptTable_ = code;
|
||||
}
|
||||
void setOsrPc(jsbytecode *osrPc) {
|
||||
@ -512,7 +512,7 @@ struct IonScript
|
||||
void copyCacheEntries(const uint32_t *caches, MacroAssembler &masm);
|
||||
void copySafepoints(const SafepointWriter *writer);
|
||||
void copyCallTargetEntries(JSScript **callTargets);
|
||||
void copyPatchableBackedges(JSContext *cx, IonCode *code,
|
||||
void copyPatchableBackedges(JSContext *cx, JitCode *code,
|
||||
PatchableBackedgeInfo *backedges);
|
||||
|
||||
bool invalidated() const {
|
||||
|
@ -162,7 +162,7 @@ IonFrameIterator::isNative() const
|
||||
{
|
||||
if (type_ != IonFrame_Exit || isFakeExitFrame())
|
||||
return false;
|
||||
return exitFrame()->footer()->ionCode() == nullptr;
|
||||
return exitFrame()->footer()->jitCode() == nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -170,7 +170,7 @@ IonFrameIterator::isOOLNative() const
|
||||
{
|
||||
if (type_ != IonFrame_Exit)
|
||||
return false;
|
||||
return exitFrame()->footer()->ionCode() == ION_FRAME_OOL_NATIVE;
|
||||
return exitFrame()->footer()->jitCode() == ION_FRAME_OOL_NATIVE;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -178,7 +178,7 @@ IonFrameIterator::isOOLPropertyOp() const
|
||||
{
|
||||
if (type_ != IonFrame_Exit)
|
||||
return false;
|
||||
return exitFrame()->footer()->ionCode() == ION_FRAME_OOL_PROPERTY_OP;
|
||||
return exitFrame()->footer()->jitCode() == ION_FRAME_OOL_PROPERTY_OP;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -186,7 +186,7 @@ IonFrameIterator::isOOLProxy() const
|
||||
{
|
||||
if (type_ != IonFrame_Exit)
|
||||
return false;
|
||||
return exitFrame()->footer()->ionCode() == ION_FRAME_OOL_PROXY;
|
||||
return exitFrame()->footer()->jitCode() == ION_FRAME_OOL_PROXY;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -974,9 +974,9 @@ MarkJitExitFrame(JSTracer *trc, const IonFrameIterator &frame)
|
||||
// Mark the code of the code handling the exit path. This is needed because
|
||||
// invalidated script are no longer marked because data are erased by the
|
||||
// invalidation and relocation data are no longer reliable. So the VM
|
||||
// wrapper or the invalidation code may be GC if no IonCode keep reference
|
||||
// wrapper or the invalidation code may be GC if no JitCode keep reference
|
||||
// on them.
|
||||
JS_ASSERT(uintptr_t(footer->ionCode()) != uintptr_t(-1));
|
||||
JS_ASSERT(uintptr_t(footer->jitCode()) != uintptr_t(-1));
|
||||
|
||||
// This correspond to the case where we have build a fake exit frame in
|
||||
// CodeGenerator.cpp which handle the case of a native function call. We
|
||||
@ -991,7 +991,7 @@ MarkJitExitFrame(JSTracer *trc, const IonFrameIterator &frame)
|
||||
|
||||
if (frame.isOOLNative()) {
|
||||
IonOOLNativeExitFrameLayout *oolnative = frame.exitFrame()->oolNativeExit();
|
||||
gc::MarkIonCodeRoot(trc, oolnative->stubCode(), "ion-ool-native-code");
|
||||
gc::MarkJitCodeRoot(trc, oolnative->stubCode(), "ion-ool-native-code");
|
||||
gc::MarkValueRoot(trc, oolnative->vp(), "iol-ool-native-vp");
|
||||
size_t len = oolnative->argc() + 1;
|
||||
gc::MarkValueRootRange(trc, len, oolnative->thisp(), "ion-ool-native-thisargs");
|
||||
@ -1000,7 +1000,7 @@ MarkJitExitFrame(JSTracer *trc, const IonFrameIterator &frame)
|
||||
|
||||
if (frame.isOOLPropertyOp()) {
|
||||
IonOOLPropertyOpExitFrameLayout *oolgetter = frame.exitFrame()->oolPropertyOpExit();
|
||||
gc::MarkIonCodeRoot(trc, oolgetter->stubCode(), "ion-ool-property-op-code");
|
||||
gc::MarkJitCodeRoot(trc, oolgetter->stubCode(), "ion-ool-property-op-code");
|
||||
gc::MarkValueRoot(trc, oolgetter->vp(), "ion-ool-property-op-vp");
|
||||
gc::MarkIdRoot(trc, oolgetter->id(), "ion-ool-property-op-id");
|
||||
gc::MarkObjectRoot(trc, oolgetter->obj(), "ion-ool-property-op-obj");
|
||||
@ -1009,7 +1009,7 @@ MarkJitExitFrame(JSTracer *trc, const IonFrameIterator &frame)
|
||||
|
||||
if (frame.isOOLProxy()) {
|
||||
IonOOLProxyExitFrameLayout *oolproxy = frame.exitFrame()->oolProxyExit();
|
||||
gc::MarkIonCodeRoot(trc, oolproxy->stubCode(), "ion-ool-proxy-code");
|
||||
gc::MarkJitCodeRoot(trc, oolproxy->stubCode(), "ion-ool-proxy-code");
|
||||
gc::MarkValueRoot(trc, oolproxy->vp(), "ion-ool-proxy-vp");
|
||||
gc::MarkIdRoot(trc, oolproxy->id(), "ion-ool-proxy-id");
|
||||
gc::MarkObjectRoot(trc, oolproxy->proxy(), "ion-ool-proxy-proxy");
|
||||
@ -1032,7 +1032,7 @@ MarkJitExitFrame(JSTracer *trc, const IonFrameIterator &frame)
|
||||
return;
|
||||
}
|
||||
|
||||
MarkIonCodeRoot(trc, footer->addressOfIonCode(), "ion-exit-code");
|
||||
MarkJitCodeRoot(trc, footer->addressOfJitCode(), "ion-exit-code");
|
||||
|
||||
const VMFunction *f = footer->function();
|
||||
if (f == nullptr)
|
||||
|
@ -295,12 +295,12 @@ GetTopIonJSScript(uint8_t *ionTop, void **returnAddrOut, ExecutionMode mode)
|
||||
return iter.script();
|
||||
}
|
||||
|
||||
static IonCode *const ION_FRAME_DOMGETTER = (IonCode *)0x1;
|
||||
static IonCode *const ION_FRAME_DOMSETTER = (IonCode *)0x2;
|
||||
static IonCode *const ION_FRAME_DOMMETHOD = (IonCode *)0x3;
|
||||
static IonCode *const ION_FRAME_OOL_NATIVE = (IonCode *)0x4;
|
||||
static IonCode *const ION_FRAME_OOL_PROPERTY_OP = (IonCode *)0x5;
|
||||
static IonCode *const ION_FRAME_OOL_PROXY = (IonCode *)0x6;
|
||||
static JitCode *const ION_FRAME_DOMGETTER = (JitCode *)0x1;
|
||||
static JitCode *const ION_FRAME_DOMSETTER = (JitCode *)0x2;
|
||||
static JitCode *const ION_FRAME_DOMMETHOD = (JitCode *)0x3;
|
||||
static JitCode *const ION_FRAME_OOL_NATIVE = (JitCode *)0x4;
|
||||
static JitCode *const ION_FRAME_OOL_PROPERTY_OP = (JitCode *)0x5;
|
||||
static JitCode *const ION_FRAME_OOL_PROXY = (JitCode *)0x6;
|
||||
|
||||
// Layout of the frame prefix. This assumes the stack architecture grows down.
|
||||
// If this is ever not the case, we'll have to refactor.
|
||||
@ -425,17 +425,17 @@ class IonUnwoundRectifierFrameLayout : public IonRectifierFrameLayout
|
||||
class IonExitFooterFrame
|
||||
{
|
||||
const VMFunction *function_;
|
||||
IonCode *ionCode_;
|
||||
JitCode *jitCode_;
|
||||
|
||||
public:
|
||||
static inline size_t Size() {
|
||||
return sizeof(IonExitFooterFrame);
|
||||
}
|
||||
inline IonCode *ionCode() const {
|
||||
return ionCode_;
|
||||
inline JitCode *jitCode() const {
|
||||
return jitCode_;
|
||||
}
|
||||
inline IonCode **addressOfIonCode() {
|
||||
return &ionCode_;
|
||||
inline JitCode **addressOfJitCode() {
|
||||
return &jitCode_;
|
||||
}
|
||||
inline const VMFunction *function() const {
|
||||
return function_;
|
||||
@ -478,7 +478,7 @@ class IonExitFrameLayout : public IonCommonFrameLayout
|
||||
// each wrapper are pushed before the exit frame. This correspond exactly
|
||||
// to the value of the argBase register of the generateVMWrapper function.
|
||||
inline uint8_t *argBase() {
|
||||
JS_ASSERT(footer()->ionCode() != nullptr);
|
||||
JS_ASSERT(footer()->jitCode() != nullptr);
|
||||
return top();
|
||||
}
|
||||
|
||||
@ -486,19 +486,19 @@ class IonExitFrameLayout : public IonCommonFrameLayout
|
||||
return footer()->function() != nullptr;
|
||||
}
|
||||
inline bool isNativeExit() {
|
||||
return footer()->ionCode() == nullptr;
|
||||
return footer()->jitCode() == nullptr;
|
||||
}
|
||||
inline bool isOOLNativeExit() {
|
||||
return footer()->ionCode() == ION_FRAME_OOL_NATIVE;
|
||||
return footer()->jitCode() == ION_FRAME_OOL_NATIVE;
|
||||
}
|
||||
inline bool isOOLPropertyOpExit() {
|
||||
return footer()->ionCode() == ION_FRAME_OOL_PROPERTY_OP;
|
||||
return footer()->jitCode() == ION_FRAME_OOL_PROPERTY_OP;
|
||||
}
|
||||
inline bool isOOLProxyExit() {
|
||||
return footer()->ionCode() == ION_FRAME_OOL_PROXY;
|
||||
return footer()->jitCode() == ION_FRAME_OOL_PROXY;
|
||||
}
|
||||
inline bool isDomExit() {
|
||||
IonCode *code = footer()->ionCode();
|
||||
JitCode *code = footer()->jitCode();
|
||||
return
|
||||
code == ION_FRAME_DOMGETTER ||
|
||||
code == ION_FRAME_DOMSETTER ||
|
||||
@ -564,8 +564,8 @@ class IonOOLNativeExitFrameLayout
|
||||
IonExitFooterFrame footer_;
|
||||
IonExitFrameLayout exit_;
|
||||
|
||||
// pointer to root the stub's IonCode
|
||||
IonCode *stubCode_;
|
||||
// pointer to root the stub's JitCode
|
||||
JitCode *stubCode_;
|
||||
|
||||
uintptr_t argc_;
|
||||
|
||||
@ -588,7 +588,7 @@ class IonOOLNativeExitFrameLayout
|
||||
return offsetof(IonOOLNativeExitFrameLayout, loCalleeResult_);
|
||||
}
|
||||
|
||||
inline IonCode **stubCode() {
|
||||
inline JitCode **stubCode() {
|
||||
return &stubCode_;
|
||||
}
|
||||
inline Value *vp() {
|
||||
@ -619,8 +619,8 @@ class IonOOLPropertyOpExitFrameLayout
|
||||
uint32_t vp0_;
|
||||
uint32_t vp1_;
|
||||
|
||||
// pointer to root the stub's IonCode
|
||||
IonCode *stubCode_;
|
||||
// pointer to root the stub's JitCode
|
||||
JitCode *stubCode_;
|
||||
|
||||
public:
|
||||
static inline size_t Size() {
|
||||
@ -631,7 +631,7 @@ class IonOOLPropertyOpExitFrameLayout
|
||||
return offsetof(IonOOLPropertyOpExitFrameLayout, vp0_);
|
||||
}
|
||||
|
||||
inline IonCode **stubCode() {
|
||||
inline JitCode **stubCode() {
|
||||
return &stubCode_;
|
||||
}
|
||||
inline Value *vp() {
|
||||
@ -669,8 +669,8 @@ class IonOOLProxyExitFrameLayout
|
||||
uint32_t vp0_;
|
||||
uint32_t vp1_;
|
||||
|
||||
// pointer to root the stub's IonCode
|
||||
IonCode *stubCode_;
|
||||
// pointer to root the stub's JitCode
|
||||
JitCode *stubCode_;
|
||||
|
||||
public:
|
||||
static inline size_t Size() {
|
||||
@ -681,7 +681,7 @@ class IonOOLProxyExitFrameLayout
|
||||
return offsetof(IonOOLProxyExitFrameLayout, vp0_);
|
||||
}
|
||||
|
||||
inline IonCode **stubCode() {
|
||||
inline JitCode **stubCode() {
|
||||
return &stubCode_;
|
||||
}
|
||||
inline Value *vp() {
|
||||
@ -725,7 +725,7 @@ class IonDOMExitFrameLayout
|
||||
return &thisObj;
|
||||
}
|
||||
inline bool isMethodFrame() {
|
||||
return footer_.ionCode() == ION_FRAME_DOMMETHOD;
|
||||
return footer_.jitCode() == ION_FRAME_DOMMETHOD;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -23,13 +23,13 @@ class Linker
|
||||
{
|
||||
MacroAssembler &masm;
|
||||
|
||||
IonCode *fail(JSContext *cx) {
|
||||
JitCode *fail(JSContext *cx) {
|
||||
js_ReportOutOfMemory(cx);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <AllowGC allowGC>
|
||||
IonCode *newCode(JSContext *cx, JSC::ExecutableAllocator *execAlloc, JSC::CodeKind kind) {
|
||||
JitCode *newCode(JSContext *cx, JSC::ExecutableAllocator *execAlloc, JSC::CodeKind kind) {
|
||||
JS_ASSERT(kind == JSC::ION_CODE ||
|
||||
kind == JSC::BASELINE_CODE ||
|
||||
kind == JSC::OTHER_CODE);
|
||||
@ -40,7 +40,7 @@ class Linker
|
||||
return fail(cx);
|
||||
|
||||
JSC::ExecutablePool *pool;
|
||||
size_t bytesNeeded = masm.bytesNeeded() + sizeof(IonCode *) + CodeAlignment;
|
||||
size_t bytesNeeded = masm.bytesNeeded() + sizeof(JitCode *) + CodeAlignment;
|
||||
if (bytesNeeded >= MAX_BUFFER_SIZE)
|
||||
return fail(cx);
|
||||
|
||||
@ -48,13 +48,13 @@ class Linker
|
||||
if (!result)
|
||||
return fail(cx);
|
||||
|
||||
// The IonCode pointer will be stored right before the code buffer.
|
||||
uint8_t *codeStart = result + sizeof(IonCode *);
|
||||
// The JitCode pointer will be stored right before the code buffer.
|
||||
uint8_t *codeStart = result + sizeof(JitCode *);
|
||||
|
||||
// Bump the code up to a nice alignment.
|
||||
codeStart = (uint8_t *)AlignBytes((uintptr_t)codeStart, CodeAlignment);
|
||||
uint32_t headerSize = codeStart - result;
|
||||
IonCode *code = IonCode::New<allowGC>(cx, codeStart,
|
||||
JitCode *code = JitCode::New<allowGC>(cx, codeStart,
|
||||
bytesNeeded - headerSize, pool);
|
||||
if (!code)
|
||||
return nullptr;
|
||||
@ -77,11 +77,11 @@ class Linker
|
||||
}
|
||||
|
||||
template <AllowGC allowGC>
|
||||
IonCode *newCode(JSContext *cx, JSC::CodeKind kind) {
|
||||
JitCode *newCode(JSContext *cx, JSC::CodeKind kind) {
|
||||
return newCode<allowGC>(cx, cx->compartment()->jitCompartment()->execAlloc(), kind);
|
||||
}
|
||||
|
||||
IonCode *newCodeForIonScript(JSContext *cx) {
|
||||
JitCode *newCodeForIonScript(JSContext *cx) {
|
||||
#ifdef JS_CPU_ARM
|
||||
// ARM does not yet use implicit interrupt checks, see bug 864220.
|
||||
return newCode<CanGC>(cx, JSC::ION_CODE);
|
||||
|
@ -1046,7 +1046,7 @@ MacroAssembler::loadBaselineOrIonRaw(Register script, Register dest, ExecutionMo
|
||||
if (failure)
|
||||
branchPtr(Assembler::BelowOrEqual, dest, ImmPtr(ION_COMPILING_SCRIPT), failure);
|
||||
loadPtr(Address(dest, IonScript::offsetOfMethod()), dest);
|
||||
loadPtr(Address(dest, IonCode::offsetOfCode()), dest);
|
||||
loadPtr(Address(dest, JitCode::offsetOfCode()), dest);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1075,7 +1075,7 @@ MacroAssembler::loadBaselineOrIonNoArgCheck(Register script, Register dest, Exec
|
||||
load32(Address(script, IonScript::offsetOfSkipArgCheckEntryOffset()), offset);
|
||||
|
||||
loadPtr(Address(dest, IonScript::offsetOfMethod()), dest);
|
||||
loadPtr(Address(dest, IonCode::offsetOfCode()), dest);
|
||||
loadPtr(Address(dest, JitCode::offsetOfCode()), dest);
|
||||
addPtr(offset, dest);
|
||||
|
||||
Pop(offset);
|
||||
@ -1134,7 +1134,7 @@ MacroAssembler::enterParallelExitFrameAndLoadSlice(const VMFunction *f, Register
|
||||
|
||||
void
|
||||
MacroAssembler::enterFakeParallelExitFrame(Register slice, Register scratch,
|
||||
IonCode *codeVal)
|
||||
JitCode *codeVal)
|
||||
{
|
||||
// Load the PerThreadData from from the slice.
|
||||
loadPtr(Address(slice, offsetof(ForkJoinSlice, perThreadData)), scratch);
|
||||
@ -1164,7 +1164,7 @@ MacroAssembler::enterExitFrameAndLoadContext(const VMFunction *f, Register cxReg
|
||||
void
|
||||
MacroAssembler::enterFakeExitFrame(Register cxReg, Register scratch,
|
||||
ExecutionMode executionMode,
|
||||
IonCode *codeVal)
|
||||
JitCode *codeVal)
|
||||
{
|
||||
switch (executionMode) {
|
||||
case SequentialExecution:
|
||||
|
@ -637,7 +637,7 @@ class MacroAssembler : public MacroAssemblerSpecific
|
||||
computeEffectiveAddress(address, PreBarrierReg);
|
||||
|
||||
const JitRuntime *rt = GetIonContext()->runtime->jitRuntime();
|
||||
IonCode *preBarrier = (type == MIRType_Shape)
|
||||
JitCode *preBarrier = (type == MIRType_Shape)
|
||||
? rt->shapePreBarrier()
|
||||
: rt->valuePreBarrier();
|
||||
|
||||
@ -797,9 +797,9 @@ class MacroAssembler : public MacroAssemblerSpecific
|
||||
// abort. Branches to fail in that case.
|
||||
void checkInterruptFlagsPar(const Register &tempReg, Label *fail);
|
||||
|
||||
// If the IonCode that created this assembler needs to transition into the VM,
|
||||
// we want to store the IonCode on the stack in order to mark it during a GC.
|
||||
// This is a reference to a patch location where the IonCode* will be written.
|
||||
// If the JitCode that created this assembler needs to transition into the VM,
|
||||
// we want to store the JitCode on the stack in order to mark it during a GC.
|
||||
// This is a reference to a patch location where the JitCode* will be written.
|
||||
private:
|
||||
CodeOffsetLabel exitCodePatch_;
|
||||
|
||||
@ -811,7 +811,7 @@ class MacroAssembler : public MacroAssemblerSpecific
|
||||
// Push VMFunction pointer, to mark arguments.
|
||||
Push(ImmPtr(f));
|
||||
}
|
||||
void enterFakeExitFrame(IonCode *codeVal = nullptr) {
|
||||
void enterFakeExitFrame(JitCode *codeVal = nullptr) {
|
||||
linkExitFrame();
|
||||
Push(ImmPtr(codeVal));
|
||||
Push(ImmPtr(nullptr));
|
||||
@ -827,11 +827,11 @@ class MacroAssembler : public MacroAssemblerSpecific
|
||||
ExecutionMode executionMode);
|
||||
|
||||
void enterFakeParallelExitFrame(Register slice, Register scratch,
|
||||
IonCode *codeVal = nullptr);
|
||||
JitCode *codeVal = nullptr);
|
||||
|
||||
void enterFakeExitFrame(Register cxReg, Register scratch,
|
||||
ExecutionMode executionMode,
|
||||
IonCode *codeVal = nullptr);
|
||||
JitCode *codeVal = nullptr);
|
||||
|
||||
void leaveExitFrame() {
|
||||
freeStack(IonExitFooterFrame::Size());
|
||||
@ -841,11 +841,11 @@ class MacroAssembler : public MacroAssemblerSpecific
|
||||
return exitCodePatch_.offset() != 0;
|
||||
}
|
||||
|
||||
void link(IonCode *code) {
|
||||
void link(JitCode *code) {
|
||||
JS_ASSERT(!oom());
|
||||
// If this code can transition to C++ code and witness a GC, then we need to store
|
||||
// the IonCode onto the stack in order to GC it correctly. exitCodePatch should
|
||||
// be unset if the code never needed to push its IonCode*.
|
||||
// the JitCode onto the stack in order to GC it correctly. exitCodePatch should
|
||||
// be unset if the code never needed to push its JitCode*.
|
||||
if (hasEnteredExitFrame()) {
|
||||
patchDataWithValueCheck(CodeLocationLabel(code, exitCodePatch_),
|
||||
ImmPtr(code),
|
||||
@ -886,7 +886,7 @@ class MacroAssembler : public MacroAssemblerSpecific
|
||||
}
|
||||
|
||||
// see above comment for what is returned
|
||||
uint32_t callWithExitFrame(IonCode *target) {
|
||||
uint32_t callWithExitFrame(JitCode *target) {
|
||||
leaveSPSFrame();
|
||||
MacroAssemblerSpecific::callWithExitFrame(target);
|
||||
uint32_t ret = currentOffset();
|
||||
@ -895,7 +895,7 @@ class MacroAssembler : public MacroAssemblerSpecific
|
||||
}
|
||||
|
||||
// see above comment for what is returned
|
||||
uint32_t callWithExitFrame(IonCode *target, Register dynStack) {
|
||||
uint32_t callWithExitFrame(JitCode *target, Register dynStack) {
|
||||
leaveSPSFrame();
|
||||
MacroAssemblerSpecific::callWithExitFrame(target, dynStack);
|
||||
uint32_t ret = currentOffset();
|
||||
|
@ -53,7 +53,7 @@ struct EnterJitData
|
||||
bool constructing;
|
||||
};
|
||||
|
||||
typedef void (*EnterIonCode)(void *code, unsigned argc, Value *argv, StackFrame *fp,
|
||||
typedef void (*EnterJitCode)(void *code, unsigned argc, Value *argv, StackFrame *fp,
|
||||
CalleeToken calleeToken, JSObject *scopeChain,
|
||||
size_t numStackValues, Value *vp);
|
||||
|
||||
@ -156,43 +156,43 @@ class JitRuntime
|
||||
JSC::ExecutableAllocator *ionAlloc_;
|
||||
|
||||
// Shared post-exception-handler tail
|
||||
IonCode *exceptionTail_;
|
||||
JitCode *exceptionTail_;
|
||||
|
||||
// Shared post-bailout-handler tail.
|
||||
IonCode *bailoutTail_;
|
||||
JitCode *bailoutTail_;
|
||||
|
||||
// Trampoline for entering JIT code. Contains OSR prologue.
|
||||
IonCode *enterJIT_;
|
||||
JitCode *enterJIT_;
|
||||
|
||||
// Trampoline for entering baseline JIT code.
|
||||
IonCode *enterBaselineJIT_;
|
||||
JitCode *enterBaselineJIT_;
|
||||
|
||||
// Vector mapping frame class sizes to bailout tables.
|
||||
Vector<IonCode*, 4, SystemAllocPolicy> bailoutTables_;
|
||||
Vector<JitCode*, 4, SystemAllocPolicy> bailoutTables_;
|
||||
|
||||
// Generic bailout table; used if the bailout table overflows.
|
||||
IonCode *bailoutHandler_;
|
||||
JitCode *bailoutHandler_;
|
||||
|
||||
// Argument-rectifying thunk, in the case of insufficient arguments passed
|
||||
// to a function call site.
|
||||
IonCode *argumentsRectifier_;
|
||||
JitCode *argumentsRectifier_;
|
||||
void *argumentsRectifierReturnAddr_;
|
||||
|
||||
// Arguments-rectifying thunk which loads |parallelIon| instead of |ion|.
|
||||
IonCode *parallelArgumentsRectifier_;
|
||||
JitCode *parallelArgumentsRectifier_;
|
||||
|
||||
// Thunk that invalides an (Ion compiled) caller on the Ion stack.
|
||||
IonCode *invalidator_;
|
||||
JitCode *invalidator_;
|
||||
|
||||
// Thunk that calls the GC pre barrier.
|
||||
IonCode *valuePreBarrier_;
|
||||
IonCode *shapePreBarrier_;
|
||||
JitCode *valuePreBarrier_;
|
||||
JitCode *shapePreBarrier_;
|
||||
|
||||
// Thunk used by the debugger for breakpoint and step mode.
|
||||
IonCode *debugTrapHandler_;
|
||||
JitCode *debugTrapHandler_;
|
||||
|
||||
// Map VMFunction addresses to the IonCode of the wrapper.
|
||||
typedef WeakCache<const VMFunction *, IonCode *> VMWrapperMap;
|
||||
// Map VMFunction addresses to the JitCode of the wrapper.
|
||||
typedef WeakCache<const VMFunction *, JitCode *> VMWrapperMap;
|
||||
VMWrapperMap *functionWrappers_;
|
||||
|
||||
// Buffer for OSR from baseline to Ion. To avoid holding on to this for
|
||||
@ -212,16 +212,16 @@ class JitRuntime
|
||||
InlineList<PatchableBackedge> backedgeList_;
|
||||
|
||||
private:
|
||||
IonCode *generateExceptionTailStub(JSContext *cx);
|
||||
IonCode *generateBailoutTailStub(JSContext *cx);
|
||||
IonCode *generateEnterJIT(JSContext *cx, EnterJitType type);
|
||||
IonCode *generateArgumentsRectifier(JSContext *cx, ExecutionMode mode, void **returnAddrOut);
|
||||
IonCode *generateBailoutTable(JSContext *cx, uint32_t frameClass);
|
||||
IonCode *generateBailoutHandler(JSContext *cx);
|
||||
IonCode *generateInvalidator(JSContext *cx);
|
||||
IonCode *generatePreBarrier(JSContext *cx, MIRType type);
|
||||
IonCode *generateDebugTrapHandler(JSContext *cx);
|
||||
IonCode *generateVMWrapper(JSContext *cx, const VMFunction &f);
|
||||
JitCode *generateExceptionTailStub(JSContext *cx);
|
||||
JitCode *generateBailoutTailStub(JSContext *cx);
|
||||
JitCode *generateEnterJIT(JSContext *cx, EnterJitType type);
|
||||
JitCode *generateArgumentsRectifier(JSContext *cx, ExecutionMode mode, void **returnAddrOut);
|
||||
JitCode *generateBailoutTable(JSContext *cx, uint32_t frameClass);
|
||||
JitCode *generateBailoutHandler(JSContext *cx);
|
||||
JitCode *generateInvalidator(JSContext *cx);
|
||||
JitCode *generatePreBarrier(JSContext *cx, MIRType type);
|
||||
JitCode *generateDebugTrapHandler(JSContext *cx);
|
||||
JitCode *generateVMWrapper(JSContext *cx, const VMFunction &f);
|
||||
|
||||
JSC::ExecutableAllocator *createIonAlloc(JSContext *cx);
|
||||
|
||||
@ -275,24 +275,24 @@ class JitRuntime
|
||||
|
||||
bool handleAccessViolation(JSRuntime *rt, void *faultingAddress);
|
||||
|
||||
IonCode *getVMWrapper(const VMFunction &f) const;
|
||||
IonCode *debugTrapHandler(JSContext *cx);
|
||||
JitCode *getVMWrapper(const VMFunction &f) const;
|
||||
JitCode *debugTrapHandler(JSContext *cx);
|
||||
|
||||
IonCode *getGenericBailoutHandler() const {
|
||||
JitCode *getGenericBailoutHandler() const {
|
||||
return bailoutHandler_;
|
||||
}
|
||||
|
||||
IonCode *getExceptionTail() const {
|
||||
JitCode *getExceptionTail() const {
|
||||
return exceptionTail_;
|
||||
}
|
||||
|
||||
IonCode *getBailoutTail() const {
|
||||
JitCode *getBailoutTail() const {
|
||||
return bailoutTail_;
|
||||
}
|
||||
|
||||
IonCode *getBailoutTable(const FrameSizeClass &frameClass) const;
|
||||
JitCode *getBailoutTable(const FrameSizeClass &frameClass) const;
|
||||
|
||||
IonCode *getArgumentsRectifier(ExecutionMode mode) const {
|
||||
JitCode *getArgumentsRectifier(ExecutionMode mode) const {
|
||||
switch (mode) {
|
||||
case SequentialExecution: return argumentsRectifier_;
|
||||
case ParallelExecution: return parallelArgumentsRectifier_;
|
||||
@ -304,23 +304,23 @@ class JitRuntime
|
||||
return argumentsRectifierReturnAddr_;
|
||||
}
|
||||
|
||||
IonCode *getInvalidationThunk() const {
|
||||
JitCode *getInvalidationThunk() const {
|
||||
return invalidator_;
|
||||
}
|
||||
|
||||
EnterIonCode enterIon() const {
|
||||
return enterJIT_->as<EnterIonCode>();
|
||||
EnterJitCode enterIon() const {
|
||||
return enterJIT_->as<EnterJitCode>();
|
||||
}
|
||||
|
||||
EnterIonCode enterBaseline() const {
|
||||
return enterBaselineJIT_->as<EnterIonCode>();
|
||||
EnterJitCode enterBaseline() const {
|
||||
return enterBaselineJIT_->as<EnterJitCode>();
|
||||
}
|
||||
|
||||
IonCode *valuePreBarrier() const {
|
||||
JitCode *valuePreBarrier() const {
|
||||
return valuePreBarrier_;
|
||||
}
|
||||
|
||||
IonCode *shapePreBarrier() const {
|
||||
JitCode *shapePreBarrier() const {
|
||||
return shapePreBarrier_;
|
||||
}
|
||||
};
|
||||
@ -339,7 +339,7 @@ class JitCompartment
|
||||
OffThreadCompilationVector finishedOffThreadCompilations_;
|
||||
|
||||
// Map ICStub keys to ICStub shared code objects.
|
||||
typedef WeakValueCache<uint32_t, ReadBarriered<IonCode> > ICStubCodeMap;
|
||||
typedef WeakValueCache<uint32_t, ReadBarriered<JitCode> > ICStubCodeMap;
|
||||
ICStubCodeMap *stubCodes_;
|
||||
|
||||
// Keep track of offset into various baseline stubs' code at return
|
||||
@ -355,23 +355,23 @@ class JitCompartment
|
||||
// stored in JitRuntime because masm.newGCString bakes in zone-specific
|
||||
// pointers. This has to be a weak pointer to avoid keeping the whole
|
||||
// compartment alive.
|
||||
ReadBarriered<IonCode> stringConcatStub_;
|
||||
ReadBarriered<IonCode> parallelStringConcatStub_;
|
||||
ReadBarriered<JitCode> stringConcatStub_;
|
||||
ReadBarriered<JitCode> parallelStringConcatStub_;
|
||||
|
||||
IonCode *generateStringConcatStub(JSContext *cx, ExecutionMode mode);
|
||||
JitCode *generateStringConcatStub(JSContext *cx, ExecutionMode mode);
|
||||
|
||||
public:
|
||||
OffThreadCompilationVector &finishedOffThreadCompilations() {
|
||||
return finishedOffThreadCompilations_;
|
||||
}
|
||||
|
||||
IonCode *getStubCode(uint32_t key) {
|
||||
JitCode *getStubCode(uint32_t key) {
|
||||
ICStubCodeMap::AddPtr p = stubCodes_->lookupForAdd(key);
|
||||
if (p)
|
||||
return p->value();
|
||||
return nullptr;
|
||||
}
|
||||
bool putStubCode(uint32_t key, Handle<IonCode *> stubCode) {
|
||||
bool putStubCode(uint32_t key, Handle<JitCode *> stubCode) {
|
||||
// Make sure to do a lookupForAdd(key) and then insert into that slot, because
|
||||
// that way if stubCode gets moved due to a GC caused by lookupForAdd, then
|
||||
// we still write the correct pointer.
|
||||
@ -424,7 +424,7 @@ class JitCompartment
|
||||
return rt->execAlloc_;
|
||||
}
|
||||
|
||||
IonCode *stringConcatStub(ExecutionMode mode) const {
|
||||
JitCode *stringConcatStub(ExecutionMode mode) const {
|
||||
switch (mode) {
|
||||
case SequentialExecution: return stringConcatStub_;
|
||||
case ParallelExecution: return parallelStringConcatStub_;
|
||||
|
@ -201,7 +201,7 @@ PerfSpewer::noteEndInlineCode(MacroAssembler &masm)
|
||||
|
||||
void
|
||||
PerfSpewer::writeProfile(JSScript *script,
|
||||
IonCode *code,
|
||||
JitCode *code,
|
||||
MacroAssembler &masm)
|
||||
{
|
||||
if (PerfFuncEnabled()) {
|
||||
@ -289,7 +289,7 @@ PerfSpewer::writeProfile(JSScript *script,
|
||||
}
|
||||
|
||||
void
|
||||
js::jit::writePerfSpewerBaselineProfile(JSScript *script, IonCode *code)
|
||||
js::jit::writePerfSpewerBaselineProfile(JSScript *script, JitCode *code)
|
||||
{
|
||||
if (!PerfEnabled())
|
||||
return;
|
||||
@ -308,7 +308,7 @@ js::jit::writePerfSpewerBaselineProfile(JSScript *script, IonCode *code)
|
||||
}
|
||||
|
||||
void
|
||||
js::jit::writePerfSpewerIonCodeProfile(IonCode *code, const char *msg)
|
||||
js::jit::writePerfSpewerJitCodeProfile(JitCode *code, const char *msg)
|
||||
{
|
||||
if (!code || !PerfEnabled())
|
||||
return;
|
||||
|
@ -70,11 +70,11 @@ class PerfSpewer
|
||||
bool endBasicBlock(MacroAssembler &masm);
|
||||
bool noteEndInlineCode(MacroAssembler &masm);
|
||||
|
||||
void writeProfile(JSScript *script, IonCode *code, MacroAssembler &masm);
|
||||
void writeProfile(JSScript *script, JitCode *code, MacroAssembler &masm);
|
||||
};
|
||||
|
||||
void writePerfSpewerBaselineProfile(JSScript *script, IonCode *code);
|
||||
void writePerfSpewerIonCodeProfile(IonCode *code, const char *msg);
|
||||
void writePerfSpewerBaselineProfile(JSScript *script, JitCode *code);
|
||||
void writePerfSpewerJitCodeProfile(JitCode *code, const char *msg);
|
||||
|
||||
class AsmJSPerfSpewer : public PerfSpewer
|
||||
{
|
||||
|
@ -591,7 +591,7 @@ Assembler::actualIndex(uint32_t idx_) const
|
||||
}
|
||||
|
||||
uint8_t *
|
||||
Assembler::PatchableJumpAddress(IonCode *code, uint32_t pe_)
|
||||
Assembler::PatchableJumpAddress(JitCode *code, uint32_t pe_)
|
||||
{
|
||||
return code->raw() + pe_;
|
||||
}
|
||||
@ -767,21 +767,21 @@ Assembler::getPtr32Target(Iter *start, Register *dest, RelocStyle *style)
|
||||
MOZ_ASSUME_UNREACHABLE("unsupported relocation");
|
||||
}
|
||||
|
||||
static IonCode *
|
||||
static JitCode *
|
||||
CodeFromJump(InstructionIterator *jump)
|
||||
{
|
||||
uint8_t *target = (uint8_t *)Assembler::getCF32Target(jump);
|
||||
return IonCode::FromExecutable(target);
|
||||
return JitCode::FromExecutable(target);
|
||||
}
|
||||
|
||||
void
|
||||
Assembler::TraceJumpRelocations(JSTracer *trc, IonCode *code, CompactBufferReader &reader)
|
||||
Assembler::TraceJumpRelocations(JSTracer *trc, JitCode *code, CompactBufferReader &reader)
|
||||
{
|
||||
RelocationIterator iter(reader);
|
||||
while (iter.read()) {
|
||||
InstructionIterator institer((Instruction *) (code->raw() + iter.offset()));
|
||||
IonCode *child = CodeFromJump(&institer);
|
||||
MarkIonCodeUnbarriered(trc, &child, "rel32");
|
||||
JitCode *child = CodeFromJump(&institer);
|
||||
MarkJitCodeUnbarriered(trc, &child, "rel32");
|
||||
}
|
||||
}
|
||||
|
||||
@ -812,7 +812,7 @@ TraceDataRelocations(JSTracer *trc, ARMBuffer *buffer,
|
||||
|
||||
}
|
||||
void
|
||||
Assembler::TraceDataRelocations(JSTracer *trc, IonCode *code, CompactBufferReader &reader)
|
||||
Assembler::TraceDataRelocations(JSTracer *trc, JitCode *code, CompactBufferReader &reader)
|
||||
{
|
||||
::TraceDataRelocations(trc, code->raw(), reader);
|
||||
}
|
||||
@ -843,10 +843,10 @@ Assembler::trace(JSTracer *trc)
|
||||
{
|
||||
for (size_t i = 0; i < jumps_.length(); i++) {
|
||||
RelativePatch &rp = jumps_[i];
|
||||
if (rp.kind == Relocation::IONCODE) {
|
||||
IonCode *code = IonCode::FromExecutable((uint8_t*)rp.target);
|
||||
MarkIonCodeUnbarriered(trc, &code, "masmrel32");
|
||||
JS_ASSERT(code == IonCode::FromExecutable((uint8_t*)rp.target));
|
||||
if (rp.kind == Relocation::JITCODE) {
|
||||
JitCode *code = JitCode::FromExecutable((uint8_t*)rp.target);
|
||||
MarkJitCodeUnbarriered(trc, &code, "masmrel32");
|
||||
JS_ASSERT(code == JitCode::FromExecutable((uint8_t*)rp.target));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1226,7 +1226,7 @@ class Assembler
|
||||
void resetCounter();
|
||||
uint32_t actualOffset(uint32_t) const;
|
||||
uint32_t actualIndex(uint32_t) const;
|
||||
static uint8_t *PatchableJumpAddress(IonCode *code, uint32_t index);
|
||||
static uint8_t *PatchableJumpAddress(JitCode *code, uint32_t index);
|
||||
BufferOffset actualOffset(BufferOffset) const;
|
||||
protected:
|
||||
|
||||
@ -1650,13 +1650,13 @@ class Assembler
|
||||
void as_bkpt();
|
||||
|
||||
public:
|
||||
static void TraceJumpRelocations(JSTracer *trc, IonCode *code, CompactBufferReader &reader);
|
||||
static void TraceDataRelocations(JSTracer *trc, IonCode *code, CompactBufferReader &reader);
|
||||
static void TraceJumpRelocations(JSTracer *trc, JitCode *code, CompactBufferReader &reader);
|
||||
static void TraceDataRelocations(JSTracer *trc, JitCode *code, CompactBufferReader &reader);
|
||||
|
||||
protected:
|
||||
void addPendingJump(BufferOffset src, ImmPtr target, Relocation::Kind kind) {
|
||||
enoughMemory_ &= jumps_.append(RelativePatch(src, target.value, kind));
|
||||
if (kind == Relocation::IONCODE)
|
||||
if (kind == Relocation::JITCODE)
|
||||
writeRelocation(src);
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ BailoutEnvironment::BailoutEnvironment(JitCompartment *ion, void **sp)
|
||||
frame_ = &sp_[sizeof(BailoutStack) / sizeof(void *)];
|
||||
|
||||
// Compute the bailout ID.
|
||||
IonCode *code = ion->getBailoutTable(bailout_->frameClass());
|
||||
JitCode *code = ion->getBailoutTable(bailout_->frameClass());
|
||||
uintptr_t tableOffset = bailout_->tableOffset();
|
||||
uintptr_t tableStart = reinterpret_cast<uintptr_t>(code->raw());
|
||||
|
||||
@ -133,7 +133,7 @@ IonBailoutIterator::IonBailoutIterator(const JitActivationIterator &activations,
|
||||
// Compute the snapshot offset from the bailout ID.
|
||||
JitActivation *activation = activations.activation()->asJit();
|
||||
JSRuntime *rt = activation->compartment()->runtimeFromMainThread();
|
||||
IonCode *code = rt->jitRuntime()->getBailoutTable(bailout->frameClass());
|
||||
JitCode *code = rt->jitRuntime()->getBailoutTable(bailout->frameClass());
|
||||
uintptr_t tableOffset = bailout->tableOffset();
|
||||
uintptr_t tableStart = reinterpret_cast<uintptr_t>(code->raw());
|
||||
|
||||
|
@ -80,7 +80,7 @@ EmitChangeICReturnAddress(MacroAssembler &masm, Register reg)
|
||||
}
|
||||
|
||||
inline void
|
||||
EmitTailCallVM(IonCode *target, MacroAssembler &masm, uint32_t argSize)
|
||||
EmitTailCallVM(JitCode *target, MacroAssembler &masm, uint32_t argSize)
|
||||
{
|
||||
// We assume during this that R0 and R1 have been pushed, and that R2 is
|
||||
// unused.
|
||||
@ -119,7 +119,7 @@ EmitCreateStubFrameDescriptor(MacroAssembler &masm, Register reg)
|
||||
}
|
||||
|
||||
inline void
|
||||
EmitCallVM(IonCode *target, MacroAssembler &masm)
|
||||
EmitCallVM(JitCode *target, MacroAssembler &masm)
|
||||
{
|
||||
EmitCreateStubFrameDescriptor(masm, r0);
|
||||
masm.push(r0);
|
||||
@ -226,7 +226,7 @@ EmitUnstowICValues(MacroAssembler &masm, int values, bool discard = false)
|
||||
}
|
||||
|
||||
inline void
|
||||
EmitCallTypeUpdateIC(MacroAssembler &masm, IonCode *code, uint32_t objectOffset)
|
||||
EmitCallTypeUpdateIC(MacroAssembler &masm, JitCode *code, uint32_t objectOffset)
|
||||
{
|
||||
JS_ASSERT(R2 == ValueOperand(r1, r0));
|
||||
|
||||
|
@ -157,7 +157,7 @@ CodeGeneratorARM::generateOutOfLineCode()
|
||||
// Push the frame size, so the handler can recover the IonScript.
|
||||
masm.ma_mov(Imm32(frameSize()), lr);
|
||||
|
||||
IonCode *handler = gen->jitRuntime()->getGenericBailoutHandler();
|
||||
JitCode *handler = gen->jitRuntime()->getGenericBailoutHandler();
|
||||
masm.branch(handler);
|
||||
}
|
||||
|
||||
@ -1900,7 +1900,7 @@ CodeGeneratorARM::generateInvalidateEpilogue()
|
||||
|
||||
// Push the Ion script onto the stack (when we determine what that pointer is).
|
||||
invalidateEpilogueData_ = masm.pushWithPatch(ImmWord(uintptr_t(-1)));
|
||||
IonCode *thunk = gen->jitRuntime()->getInvalidationThunk();
|
||||
JitCode *thunk = gen->jitRuntime()->getInvalidationThunk();
|
||||
|
||||
masm.branch(thunk);
|
||||
|
||||
|
@ -1754,12 +1754,12 @@ MacroAssemblerARMCompat::buildOOLFakeExitFrame(void *fakeReturnAddr)
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssemblerARMCompat::callWithExitFrame(IonCode *target)
|
||||
MacroAssemblerARMCompat::callWithExitFrame(JitCode *target)
|
||||
{
|
||||
uint32_t descriptor = MakeFrameDescriptor(framePushed(), IonFrame_OptimizedJS);
|
||||
Push(Imm32(descriptor)); // descriptor
|
||||
|
||||
addPendingJump(m_buffer.nextOffset(), ImmPtr(target->raw()), Relocation::IONCODE);
|
||||
addPendingJump(m_buffer.nextOffset(), ImmPtr(target->raw()), Relocation::JITCODE);
|
||||
RelocStyle rs;
|
||||
if (hasMOVWT())
|
||||
rs = L_MOVWT;
|
||||
@ -1771,13 +1771,13 @@ MacroAssemblerARMCompat::callWithExitFrame(IonCode *target)
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssemblerARMCompat::callWithExitFrame(IonCode *target, Register dynStack)
|
||||
MacroAssemblerARMCompat::callWithExitFrame(JitCode *target, Register dynStack)
|
||||
{
|
||||
ma_add(Imm32(framePushed()), dynStack);
|
||||
makeFrameDescriptor(dynStack, IonFrame_OptimizedJS);
|
||||
Push(dynStack); // descriptor
|
||||
|
||||
addPendingJump(m_buffer.nextOffset(), ImmPtr(target->raw()), Relocation::IONCODE);
|
||||
addPendingJump(m_buffer.nextOffset(), ImmPtr(target->raw()), Relocation::JITCODE);
|
||||
RelocStyle rs;
|
||||
if (hasMOVWT())
|
||||
rs = L_MOVWT;
|
||||
@ -3767,7 +3767,7 @@ MacroAssemblerARMCompat::handleFailureWithHandler(void *handler)
|
||||
passABIArg(r0);
|
||||
callWithABI(handler);
|
||||
|
||||
IonCode *excTail = GetIonContext()->runtime->jitRuntime()->getExceptionTail();
|
||||
JitCode *excTail = GetIonContext()->runtime->jitRuntime()->getExceptionTail();
|
||||
branch(excTail);
|
||||
}
|
||||
|
||||
@ -3980,11 +3980,11 @@ MacroAssemblerARMCompat::toggledJump(Label *label)
|
||||
}
|
||||
|
||||
CodeOffsetLabel
|
||||
MacroAssemblerARMCompat::toggledCall(IonCode *target, bool enabled)
|
||||
MacroAssemblerARMCompat::toggledCall(JitCode *target, bool enabled)
|
||||
{
|
||||
BufferOffset bo = nextOffset();
|
||||
CodeOffsetLabel offset(bo.getOffset());
|
||||
addPendingJump(bo, ImmPtr(target->raw()), Relocation::IONCODE);
|
||||
addPendingJump(bo, ImmPtr(target->raw()), Relocation::JITCODE);
|
||||
ma_movPatchable(ImmPtr(target->raw()), ScratchRegister, Always, hasMOVWT() ? L_MOVWT : L_LDR);
|
||||
if (enabled)
|
||||
ma_blx(ScratchRegister);
|
||||
|
@ -546,9 +546,9 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM
|
||||
movePtr(imm, CallReg);
|
||||
call(CallReg);
|
||||
}
|
||||
void call(IonCode *c) {
|
||||
void call(JitCode *c) {
|
||||
BufferOffset bo = m_buffer.nextOffset();
|
||||
addPendingJump(bo, ImmPtr(c->raw()), Relocation::IONCODE);
|
||||
addPendingJump(bo, ImmPtr(c->raw()), Relocation::JITCODE);
|
||||
RelocStyle rs;
|
||||
if (hasMOVWT())
|
||||
rs = L_MOVWT;
|
||||
@ -558,9 +558,9 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM
|
||||
ma_movPatchable(ImmPtr(c->raw()), ScratchRegister, Always, rs);
|
||||
ma_callIonHalfPush(ScratchRegister);
|
||||
}
|
||||
void branch(IonCode *c) {
|
||||
void branch(JitCode *c) {
|
||||
BufferOffset bo = m_buffer.nextOffset();
|
||||
addPendingJump(bo, ImmPtr(c->raw()), Relocation::IONCODE);
|
||||
addPendingJump(bo, ImmPtr(c->raw()), Relocation::JITCODE);
|
||||
RelocStyle rs;
|
||||
if (hasMOVWT())
|
||||
rs = L_MOVWT;
|
||||
@ -634,7 +634,7 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM
|
||||
|
||||
// Emit a BLX or NOP instruction. ToggleCall can be used to patch
|
||||
// this instruction.
|
||||
CodeOffsetLabel toggledCall(IonCode *target, bool enabled);
|
||||
CodeOffsetLabel toggledCall(JitCode *target, bool enabled);
|
||||
|
||||
static size_t ToggledCallSize() {
|
||||
if (hasMOVWT())
|
||||
@ -1202,8 +1202,8 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM
|
||||
// non-function. Returns offset to be passed to markSafepointAt().
|
||||
bool buildFakeExitFrame(const Register &scratch, uint32_t *offset);
|
||||
|
||||
void callWithExitFrame(IonCode *target);
|
||||
void callWithExitFrame(IonCode *target, Register dynStack);
|
||||
void callWithExitFrame(JitCode *target);
|
||||
void callWithExitFrame(JitCode *target, Register dynStack);
|
||||
|
||||
// Makes an Ion call using the only two methods that it is sane for
|
||||
// indep code to make a call
|
||||
|
@ -103,7 +103,7 @@ struct EnterJITStack
|
||||
* calleeToken, JSObject *scopeChain, Value *vp)
|
||||
* ...using standard EABI calling convention
|
||||
*/
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateEnterJIT(JSContext *cx, EnterJitType type)
|
||||
{
|
||||
const Address slot_token(sp, offsetof(EnterJITStack, token));
|
||||
@ -339,16 +339,16 @@ JitRuntime::generateEnterJIT(JSContext *cx, EnterJitType type)
|
||||
GenerateReturn(masm, true);
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "EnterJIT");
|
||||
writePerfSpewerJitCodeProfile(code, "EnterJIT");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateInvalidator(JSContext *cx)
|
||||
{
|
||||
// See large comment in x86's JitRuntime::generateInvalidator.
|
||||
@ -396,21 +396,21 @@ JitRuntime::generateInvalidator(JSContext *cx)
|
||||
masm.ma_add(sp, r1, sp);
|
||||
|
||||
// Jump to shared bailout tail. The BailoutInfo pointer has to be in r2.
|
||||
IonCode *bailoutTail = cx->runtime()->jitRuntime()->getBailoutTail();
|
||||
JitCode *bailoutTail = cx->runtime()->jitRuntime()->getBailoutTail();
|
||||
masm.branch(bailoutTail);
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
IonSpew(IonSpew_Invalidate, " invalidation thunk created at %p", (void *) code->raw());
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "Invalidator");
|
||||
writePerfSpewerJitCodeProfile(code, "Invalidator");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateArgumentsRectifier(JSContext *cx, ExecutionMode mode, void **returnAddrOut)
|
||||
{
|
||||
MacroAssembler masm(cx);
|
||||
@ -502,7 +502,7 @@ JitRuntime::generateArgumentsRectifier(JSContext *cx, ExecutionMode mode, void *
|
||||
|
||||
masm.ret();
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
CodeOffsetLabel returnLabel(returnOffset);
|
||||
returnLabel.fixup(&masm);
|
||||
@ -510,7 +510,7 @@ JitRuntime::generateArgumentsRectifier(JSContext *cx, ExecutionMode mode, void *
|
||||
*returnAddrOut = (void *) (code->raw() + returnLabel.offset());
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "ArgumentsRectifier");
|
||||
writePerfSpewerJitCodeProfile(code, "ArgumentsRectifier");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
@ -609,11 +609,11 @@ GenerateBailoutThunk(JSContext *cx, MacroAssembler &masm, uint32_t frameClass)
|
||||
}
|
||||
|
||||
// Jump to shared bailout tail. The BailoutInfo pointer has to be in r2.
|
||||
IonCode *bailoutTail = cx->runtime()->jitRuntime()->getBailoutTail();
|
||||
JitCode *bailoutTail = cx->runtime()->jitRuntime()->getBailoutTail();
|
||||
masm.branch(bailoutTail);
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateBailoutTable(JSContext *cx, uint32_t frameClass)
|
||||
{
|
||||
MacroAssembler masm(cx);
|
||||
@ -626,32 +626,32 @@ JitRuntime::generateBailoutTable(JSContext *cx, uint32_t frameClass)
|
||||
GenerateBailoutThunk(cx, masm, frameClass);
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "BailoutTable");
|
||||
writePerfSpewerJitCodeProfile(code, "BailoutTable");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateBailoutHandler(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm(cx);
|
||||
GenerateBailoutThunk(cx, masm, NO_FRAME_SIZE_CLASS_ID);
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "BailoutHandler");
|
||||
writePerfSpewerJitCodeProfile(code, "BailoutHandler");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateVMWrapper(JSContext *cx, const VMFunction &f)
|
||||
{
|
||||
JS_ASSERT(functionWrappers_);
|
||||
@ -813,7 +813,7 @@ JitRuntime::generateVMWrapper(JSContext *cx, const VMFunction &f)
|
||||
f.extraValuesToPop * sizeof(Value)));
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *wrapper = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *wrapper = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
if (!wrapper)
|
||||
return nullptr;
|
||||
|
||||
@ -823,13 +823,13 @@ JitRuntime::generateVMWrapper(JSContext *cx, const VMFunction &f)
|
||||
return nullptr;
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(wrapper, "VMWrapper");
|
||||
writePerfSpewerJitCodeProfile(wrapper, "VMWrapper");
|
||||
#endif
|
||||
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generatePreBarrier(JSContext *cx, MIRType type)
|
||||
{
|
||||
MacroAssembler masm(cx);
|
||||
@ -861,10 +861,10 @@ JitRuntime::generatePreBarrier(JSContext *cx, MIRType type)
|
||||
masm.ret();
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "PreBarrier");
|
||||
writePerfSpewerJitCodeProfile(code, "PreBarrier");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
@ -873,7 +873,7 @@ JitRuntime::generatePreBarrier(JSContext *cx, MIRType type)
|
||||
typedef bool (*HandleDebugTrapFn)(JSContext *, BaselineFrame *, uint8_t *, bool *);
|
||||
static const VMFunction HandleDebugTrapInfo = FunctionInfo<HandleDebugTrapFn>(HandleDebugTrap);
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateDebugTrapHandler(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
@ -891,7 +891,7 @@ JitRuntime::generateDebugTrapHandler(JSContext *cx)
|
||||
masm.movePtr(ImmPtr(nullptr), BaselineStubReg);
|
||||
EmitEnterStubFrame(masm, scratch2);
|
||||
|
||||
IonCode *code = cx->runtime()->jitRuntime()->getVMWrapper(HandleDebugTrapInfo);
|
||||
JitCode *code = cx->runtime()->jitRuntime()->getVMWrapper(HandleDebugTrapInfo);
|
||||
if (!code)
|
||||
return nullptr;
|
||||
|
||||
@ -916,16 +916,16 @@ JitRuntime::generateDebugTrapHandler(JSContext *cx)
|
||||
masm.ret();
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *codeDbg = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *codeDbg = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(codeDbg, "DebugTrapHandler");
|
||||
writePerfSpewerJitCodeProfile(codeDbg, "DebugTrapHandler");
|
||||
#endif
|
||||
|
||||
return codeDbg;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateExceptionTailStub(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
@ -933,16 +933,16 @@ JitRuntime::generateExceptionTailStub(JSContext *cx)
|
||||
masm.handleFailureWithHandlerTail();
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "ExceptionTailStub");
|
||||
writePerfSpewerJitCodeProfile(code, "ExceptionTailStub");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateBailoutTailStub(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
@ -950,10 +950,10 @@ JitRuntime::generateBailoutTailStub(JSContext *cx)
|
||||
masm.generateBailoutTail(r1, r2);
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "BailoutTailStub");
|
||||
writePerfSpewerJitCodeProfile(code, "BailoutTailStub");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
|
@ -275,9 +275,9 @@ class Relocation {
|
||||
// buffer is relocated and the reference is relative.
|
||||
HARDCODED,
|
||||
|
||||
// The target is the start of an IonCode buffer, which must be traced
|
||||
// The target is the start of a JitCode buffer, which must be traced
|
||||
// during garbage collection. Relocations and patching may be needed.
|
||||
IONCODE
|
||||
JITCODE
|
||||
};
|
||||
};
|
||||
|
||||
@ -466,7 +466,7 @@ class CodeLabel
|
||||
}
|
||||
};
|
||||
|
||||
// Location of a jump or label in a generated IonCode block, relative to the
|
||||
// Location of a jump or label in a generated JitCode block, relative to the
|
||||
// start of the block.
|
||||
|
||||
class CodeOffsetJump
|
||||
@ -515,9 +515,9 @@ class CodeOffsetLabel
|
||||
|
||||
};
|
||||
|
||||
// Absolute location of a jump or a label in some generated IonCode block.
|
||||
// Absolute location of a jump or a label in some generated JitCode block.
|
||||
// Can also encode a CodeOffset{Jump,Label}, such that the offset is initially
|
||||
// set and the absolute location later filled in after the final IonCode is
|
||||
// set and the absolute location later filled in after the final JitCode is
|
||||
// allocated.
|
||||
|
||||
class CodeLocationJump
|
||||
@ -556,7 +556,7 @@ class CodeLocationJump
|
||||
jumpTableEntry_ = (uint8_t *) 0xdeadab1e;
|
||||
#endif
|
||||
}
|
||||
CodeLocationJump(IonCode *code, CodeOffsetJump base) {
|
||||
CodeLocationJump(JitCode *code, CodeOffsetJump base) {
|
||||
*this = base;
|
||||
repoint(code);
|
||||
}
|
||||
@ -569,7 +569,7 @@ class CodeLocationJump
|
||||
#endif
|
||||
}
|
||||
|
||||
void repoint(IonCode *code, MacroAssembler* masm = nullptr);
|
||||
void repoint(JitCode *code, MacroAssembler* masm = nullptr);
|
||||
|
||||
uint8_t *raw() const {
|
||||
JS_ASSERT(state_ == Absolute);
|
||||
@ -617,11 +617,11 @@ class CodeLocationLabel
|
||||
raw_ = nullptr;
|
||||
setUninitialized();
|
||||
}
|
||||
CodeLocationLabel(IonCode *code, CodeOffsetLabel base) {
|
||||
CodeLocationLabel(JitCode *code, CodeOffsetLabel base) {
|
||||
*this = base;
|
||||
repoint(code);
|
||||
}
|
||||
CodeLocationLabel(IonCode *code) {
|
||||
CodeLocationLabel(JitCode *code) {
|
||||
raw_ = code->raw();
|
||||
setAbsolute();
|
||||
}
|
||||
@ -638,7 +638,7 @@ class CodeLocationLabel
|
||||
return raw_ - other.raw_;
|
||||
}
|
||||
|
||||
void repoint(IonCode *code, MacroAssembler *masm = nullptr);
|
||||
void repoint(JitCode *code, MacroAssembler *masm = nullptr);
|
||||
|
||||
#ifdef DEBUG
|
||||
bool isSet() const {
|
||||
|
@ -66,7 +66,7 @@ TraceDataRelocations(JSTracer *trc, uint8_t *buffer, CompactBufferReader &reader
|
||||
|
||||
|
||||
void
|
||||
AssemblerX86Shared::TraceDataRelocations(JSTracer *trc, IonCode *code, CompactBufferReader &reader)
|
||||
AssemblerX86Shared::TraceDataRelocations(JSTracer *trc, JitCode *code, CompactBufferReader &reader)
|
||||
{
|
||||
::TraceDataRelocations(trc, code->raw(), reader);
|
||||
}
|
||||
@ -76,10 +76,10 @@ AssemblerX86Shared::trace(JSTracer *trc)
|
||||
{
|
||||
for (size_t i = 0; i < jumps_.length(); i++) {
|
||||
RelativePatch &rp = jumps_[i];
|
||||
if (rp.kind == Relocation::IONCODE) {
|
||||
IonCode *code = IonCode::FromExecutable((uint8_t *)rp.target);
|
||||
MarkIonCodeUnbarriered(trc, &code, "masmrel32");
|
||||
JS_ASSERT(code == IonCode::FromExecutable((uint8_t *)rp.target));
|
||||
if (rp.kind == Relocation::JITCODE) {
|
||||
JitCode *code = JitCode::FromExecutable((uint8_t *)rp.target);
|
||||
MarkJitCodeUnbarriered(trc, &code, "masmrel32");
|
||||
JS_ASSERT(code == JitCode::FromExecutable((uint8_t *)rp.target));
|
||||
}
|
||||
}
|
||||
if (dataRelocations_.length()) {
|
||||
|
@ -260,7 +260,7 @@ class AssemblerX86Shared
|
||||
return static_cast<Condition>(cond & ~DoubleConditionBits);
|
||||
}
|
||||
|
||||
static void TraceDataRelocations(JSTracer *trc, IonCode *code, CompactBufferReader &reader);
|
||||
static void TraceDataRelocations(JSTracer *trc, JitCode *code, CompactBufferReader &reader);
|
||||
|
||||
// MacroAssemblers hold onto gcthings, so they are traced by the GC.
|
||||
void trace(JSTracer *trc);
|
||||
|
@ -34,7 +34,7 @@ BaselineCompilerShared::BaselineCompilerShared(JSContext *cx, TempAllocator &all
|
||||
bool
|
||||
BaselineCompilerShared::callVM(const VMFunction &fun, CallVMPhase phase)
|
||||
{
|
||||
IonCode *code = cx->runtime()->jitRuntime()->getVMWrapper(fun);
|
||||
JitCode *code = cx->runtime()->jitRuntime()->getVMWrapper(fun);
|
||||
if (!code)
|
||||
return false;
|
||||
|
||||
|
@ -661,7 +661,7 @@ CodeGeneratorShared::callVM(const VMFunction &fun, LInstruction *ins, const Regi
|
||||
#endif
|
||||
|
||||
// Get the wrapper of the VM function.
|
||||
IonCode *wrapper = gen->jitRuntime()->getVMWrapper(fun);
|
||||
JitCode *wrapper = gen->jitRuntime()->getVMWrapper(fun);
|
||||
if (!wrapper)
|
||||
return false;
|
||||
|
||||
|
@ -61,7 +61,7 @@ class CodeGeneratorShared : public LInstructionVisitor
|
||||
LIRGraph &graph;
|
||||
LBlock *current;
|
||||
SnapshotWriter snapshots_;
|
||||
IonCode *deoptTable_;
|
||||
JitCode *deoptTable_;
|
||||
#ifdef DEBUG
|
||||
uint32_t pushedArgs_;
|
||||
#endif
|
||||
|
@ -326,8 +326,8 @@ CodeGeneratorX86Shared::generateOutOfLineCode()
|
||||
// Push the frame size, so the handler can recover the IonScript.
|
||||
masm.push(Imm32(frameSize()));
|
||||
|
||||
IonCode *handler = gen->jitRuntime()->getGenericBailoutHandler();
|
||||
masm.jmp(ImmPtr(handler->raw()), Relocation::IONCODE);
|
||||
JitCode *handler = gen->jitRuntime()->getGenericBailoutHandler();
|
||||
masm.jmp(ImmPtr(handler->raw()), Relocation::JITCODE);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -1763,7 +1763,7 @@ CodeGeneratorX86Shared::generateInvalidateEpilogue()
|
||||
|
||||
// Push the Ion script onto the stack (when we determine what that pointer is).
|
||||
invalidateEpilogueData_ = masm.pushWithPatch(ImmWord(uintptr_t(-1)));
|
||||
IonCode *thunk = gen->jitRuntime()->getInvalidationThunk();
|
||||
JitCode *thunk = gen->jitRuntime()->getInvalidationThunk();
|
||||
|
||||
masm.call(thunk);
|
||||
|
||||
|
@ -644,7 +644,7 @@ class MacroAssemblerX86Shared : public Assembler
|
||||
return addCodeLabel(cl);
|
||||
}
|
||||
|
||||
void callWithExitFrame(IonCode *target) {
|
||||
void callWithExitFrame(JitCode *target) {
|
||||
uint32_t descriptor = MakeFrameDescriptor(framePushed(), IonFrame_OptimizedJS);
|
||||
Push(Imm32(descriptor));
|
||||
call(target);
|
||||
|
@ -89,7 +89,7 @@ Assembler::writeRelocation(JmpSrc src, Relocation::Kind reloc)
|
||||
// patch later.
|
||||
jumpRelocations_.writeFixedUint32_t(0);
|
||||
}
|
||||
if (reloc == Relocation::IONCODE) {
|
||||
if (reloc == Relocation::JITCODE) {
|
||||
jumpRelocations_.writeUnsigned(src.offset());
|
||||
jumpRelocations_.writeUnsigned(jumps_.length());
|
||||
}
|
||||
@ -102,7 +102,7 @@ Assembler::addPendingJump(JmpSrc src, ImmPtr target, Relocation::Kind reloc)
|
||||
|
||||
// Emit reloc before modifying the jump table, since it computes a 0-based
|
||||
// index. This jump is not patchable at runtime.
|
||||
if (reloc == Relocation::IONCODE)
|
||||
if (reloc == Relocation::JITCODE)
|
||||
writeRelocation(src, reloc);
|
||||
enoughMemory_ &= jumps_.append(RelativePatch(src.offset(), target.value, reloc));
|
||||
}
|
||||
@ -121,7 +121,7 @@ Assembler::addPatchableJump(JmpSrc src, Relocation::Kind reloc)
|
||||
|
||||
/* static */
|
||||
uint8_t *
|
||||
Assembler::PatchableJumpAddress(IonCode *code, size_t index)
|
||||
Assembler::PatchableJumpAddress(JitCode *code, size_t index)
|
||||
{
|
||||
// The assembler stashed the offset into the code of the fragments used
|
||||
// for far jumps at the start of the relocation table.
|
||||
@ -151,7 +151,7 @@ Assembler::finish()
|
||||
extendedJumpTable_ = masm.size();
|
||||
|
||||
// Now that we know the offset to the jump table, squirrel it into the
|
||||
// jump relocation buffer if any IonCode references exist and must be
|
||||
// jump relocation buffer if any JitCode references exist and must be
|
||||
// tracked for GC.
|
||||
JS_ASSERT_IF(jumpRelocations_.length(), jumpRelocations_.length() >= sizeof(uint32_t));
|
||||
if (jumpRelocations_.length())
|
||||
@ -237,8 +237,8 @@ class RelocationIterator
|
||||
}
|
||||
};
|
||||
|
||||
IonCode *
|
||||
Assembler::CodeFromJump(IonCode *code, uint8_t *jump)
|
||||
JitCode *
|
||||
Assembler::CodeFromJump(JitCode *code, uint8_t *jump)
|
||||
{
|
||||
uint8_t *target = (uint8_t *)JSC::X86Assembler::getRel32Target(jump);
|
||||
if (target >= code->raw() && target < code->raw() + code->instructionsSize()) {
|
||||
@ -249,16 +249,16 @@ Assembler::CodeFromJump(IonCode *code, uint8_t *jump)
|
||||
target = (uint8_t *)JSC::X86Assembler::getPointer(target + SizeOfExtendedJump);
|
||||
}
|
||||
|
||||
return IonCode::FromExecutable(target);
|
||||
return JitCode::FromExecutable(target);
|
||||
}
|
||||
|
||||
void
|
||||
Assembler::TraceJumpRelocations(JSTracer *trc, IonCode *code, CompactBufferReader &reader)
|
||||
Assembler::TraceJumpRelocations(JSTracer *trc, JitCode *code, CompactBufferReader &reader)
|
||||
{
|
||||
RelocationIterator iter(reader);
|
||||
while (iter.read()) {
|
||||
IonCode *child = CodeFromJump(code, code->raw() + iter.offset());
|
||||
MarkIonCodeUnbarriered(trc, &child, "rel32");
|
||||
JitCode *child = CodeFromJump(code, code->raw() + iter.offset());
|
||||
MarkJitCodeUnbarriered(trc, &child, "rel32");
|
||||
JS_ASSERT(child == CodeFromJump(code, code->raw() + iter.offset()));
|
||||
}
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ class Assembler : public AssemblerX86Shared
|
||||
|
||||
uint32_t extendedJumpTable_;
|
||||
|
||||
static IonCode *CodeFromJump(IonCode *code, uint8_t *jump);
|
||||
static JitCode *CodeFromJump(JitCode *code, uint8_t *jump);
|
||||
|
||||
private:
|
||||
void writeRelocation(JmpSrc src, Relocation::Kind reloc);
|
||||
@ -224,7 +224,7 @@ class Assembler : public AssemblerX86Shared
|
||||
using AssemblerX86Shared::push;
|
||||
using AssemblerX86Shared::pop;
|
||||
|
||||
static uint8_t *PatchableJumpAddress(IonCode *code, size_t index);
|
||||
static uint8_t *PatchableJumpAddress(JitCode *code, size_t index);
|
||||
static void PatchJumpEntry(uint8_t *entry, uint8_t *target);
|
||||
|
||||
Assembler()
|
||||
@ -232,7 +232,7 @@ class Assembler : public AssemblerX86Shared
|
||||
{
|
||||
}
|
||||
|
||||
static void TraceJumpRelocations(JSTracer *trc, IonCode *code, CompactBufferReader &reader);
|
||||
static void TraceJumpRelocations(JSTracer *trc, JitCode *code, CompactBufferReader &reader);
|
||||
|
||||
// The buffer is about to be linked, make sure any constant pools or excess
|
||||
// bookkeeping has been flushed to the instruction stream.
|
||||
@ -634,23 +634,23 @@ class Assembler : public AssemblerX86Shared
|
||||
addPendingJump(src, target, reloc);
|
||||
}
|
||||
|
||||
void jmp(IonCode *target) {
|
||||
jmp(ImmPtr(target->raw()), Relocation::IONCODE);
|
||||
void jmp(JitCode *target) {
|
||||
jmp(ImmPtr(target->raw()), Relocation::JITCODE);
|
||||
}
|
||||
void j(Condition cond, IonCode *target) {
|
||||
j(cond, ImmPtr(target->raw()), Relocation::IONCODE);
|
||||
void j(Condition cond, JitCode *target) {
|
||||
j(cond, ImmPtr(target->raw()), Relocation::JITCODE);
|
||||
}
|
||||
void call(IonCode *target) {
|
||||
void call(JitCode *target) {
|
||||
JmpSrc src = masm.call();
|
||||
addPendingJump(src, ImmPtr(target->raw()), Relocation::IONCODE);
|
||||
addPendingJump(src, ImmPtr(target->raw()), Relocation::JITCODE);
|
||||
}
|
||||
|
||||
// Emit a CALL or CMP (nop) instruction. ToggleCall can be used to patch
|
||||
// this instruction.
|
||||
CodeOffsetLabel toggledCall(IonCode *target, bool enabled) {
|
||||
CodeOffsetLabel toggledCall(JitCode *target, bool enabled) {
|
||||
CodeOffsetLabel offset(size());
|
||||
JmpSrc src = enabled ? masm.call() : masm.cmp_eax();
|
||||
addPendingJump(src, ImmPtr(target->raw()), Relocation::IONCODE);
|
||||
addPendingJump(src, ImmPtr(target->raw()), Relocation::JITCODE);
|
||||
JS_ASSERT(size() - offset.offset() == ToggledCallSize());
|
||||
return offset;
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ EmitChangeICReturnAddress(MacroAssembler &masm, Register reg)
|
||||
}
|
||||
|
||||
inline void
|
||||
EmitTailCallVM(IonCode *target, MacroAssembler &masm, uint32_t argSize)
|
||||
EmitTailCallVM(JitCode *target, MacroAssembler &masm, uint32_t argSize)
|
||||
{
|
||||
// We an assume during this that R0 and R1 have been pushed.
|
||||
masm.movq(BaselineFrameReg, ScratchReg);
|
||||
@ -103,7 +103,7 @@ EmitCreateStubFrameDescriptor(MacroAssembler &masm, Register reg)
|
||||
}
|
||||
|
||||
inline void
|
||||
EmitCallVM(IonCode *target, MacroAssembler &masm)
|
||||
EmitCallVM(JitCode *target, MacroAssembler &masm)
|
||||
{
|
||||
EmitCreateStubFrameDescriptor(masm, ScratchReg);
|
||||
masm.push(ScratchReg);
|
||||
@ -216,7 +216,7 @@ EmitUnstowICValues(MacroAssembler &masm, int values, bool discard = false)
|
||||
}
|
||||
|
||||
inline void
|
||||
EmitCallTypeUpdateIC(MacroAssembler &masm, IonCode *code, uint32_t objectOffset)
|
||||
EmitCallTypeUpdateIC(MacroAssembler &masm, JitCode *code, uint32_t objectOffset)
|
||||
{
|
||||
// R0 contains the value that needs to be typechecked.
|
||||
// The object we're updating is a boxed Value on the stack, at offset
|
||||
|
@ -300,7 +300,7 @@ MacroAssemblerX64::handleFailureWithHandler(void *handler)
|
||||
passABIArg(rax);
|
||||
callWithABI(handler);
|
||||
|
||||
IonCode *excTail = GetIonContext()->runtime->jitRuntime()->getExceptionTail();
|
||||
JitCode *excTail = GetIonContext()->runtime->jitRuntime()->getExceptionTail();
|
||||
jmp(excTail);
|
||||
}
|
||||
|
||||
|
@ -1222,7 +1222,7 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared
|
||||
AbsoluteAddress(GetIonContext()->runtime->addressOfIonTop()));
|
||||
}
|
||||
|
||||
void callWithExitFrame(IonCode *target, Register dynStack) {
|
||||
void callWithExitFrame(JitCode *target, Register dynStack) {
|
||||
addPtr(Imm32(framePushed()), dynStack);
|
||||
makeFrameDescriptor(dynStack, IonFrame_OptimizedJS);
|
||||
Push(dynStack);
|
||||
|
@ -29,7 +29,7 @@ static const RegisterSet AllRegs =
|
||||
* Value *vp)
|
||||
* ...using standard x64 fastcall calling convention
|
||||
*/
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateEnterJIT(JSContext *cx, EnterJitType type)
|
||||
{
|
||||
MacroAssembler masm(cx);
|
||||
@ -292,16 +292,16 @@ JitRuntime::generateEnterJIT(JSContext *cx, EnterJitType type)
|
||||
masm.ret();
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "EnterJIT");
|
||||
writePerfSpewerJitCodeProfile(code, "EnterJIT");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateInvalidator(JSContext *cx)
|
||||
{
|
||||
AutoIonContextAlloc aica(cx);
|
||||
@ -337,20 +337,20 @@ JitRuntime::generateInvalidator(JSContext *cx)
|
||||
masm.lea(Operand(rsp, rbx, TimesOne, sizeof(InvalidationBailoutStack)), rsp);
|
||||
|
||||
// Jump to shared bailout tail. The BailoutInfo pointer has to be in r9.
|
||||
IonCode *bailoutTail = cx->runtime()->jitRuntime()->getBailoutTail();
|
||||
JitCode *bailoutTail = cx->runtime()->jitRuntime()->getBailoutTail();
|
||||
masm.jmp(bailoutTail);
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "Invalidator");
|
||||
writePerfSpewerJitCodeProfile(code, "Invalidator");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateArgumentsRectifier(JSContext *cx, ExecutionMode mode, void **returnAddrOut)
|
||||
{
|
||||
// Do not erase the frame pointer in this function.
|
||||
@ -425,10 +425,10 @@ JitRuntime::generateArgumentsRectifier(JSContext *cx, ExecutionMode mode, void *
|
||||
masm.ret();
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "ArgumentsRectifier");
|
||||
writePerfSpewerJitCodeProfile(code, "ArgumentsRectifier");
|
||||
#endif
|
||||
|
||||
CodeOffsetLabel returnLabel(returnOffset);
|
||||
@ -473,17 +473,17 @@ GenerateBailoutThunk(JSContext *cx, MacroAssembler &masm, uint32_t frameClass)
|
||||
masm.lea(Operand(rsp, rcx, TimesOne, sizeof(void *)), rsp);
|
||||
|
||||
// Jump to shared bailout tail. The BailoutInfo pointer has to be in r9.
|
||||
IonCode *bailoutTail = cx->runtime()->jitRuntime()->getBailoutTail();
|
||||
JitCode *bailoutTail = cx->runtime()->jitRuntime()->getBailoutTail();
|
||||
masm.jmp(bailoutTail);
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateBailoutTable(JSContext *cx, uint32_t frameClass)
|
||||
{
|
||||
MOZ_ASSUME_UNREACHABLE("x64 does not use bailout tables");
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateBailoutHandler(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
@ -491,16 +491,16 @@ JitRuntime::generateBailoutHandler(JSContext *cx)
|
||||
GenerateBailoutThunk(cx, masm, NO_FRAME_SIZE_CLASS_ID);
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "BailoutHandler");
|
||||
writePerfSpewerJitCodeProfile(code, "BailoutHandler");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateVMWrapper(JSContext *cx, const VMFunction &f)
|
||||
{
|
||||
JS_ASSERT(!StackKeptAligned);
|
||||
@ -668,12 +668,12 @@ JitRuntime::generateVMWrapper(JSContext *cx, const VMFunction &f)
|
||||
f.extraValuesToPop * sizeof(Value)));
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *wrapper = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *wrapper = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
if (!wrapper)
|
||||
return nullptr;
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(wrapper, "VMWrapper");
|
||||
writePerfSpewerJitCodeProfile(wrapper, "VMWrapper");
|
||||
#endif
|
||||
|
||||
// linker.newCode may trigger a GC and sweep functionWrappers_ so we have to
|
||||
@ -684,7 +684,7 @@ JitRuntime::generateVMWrapper(JSContext *cx, const VMFunction &f)
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generatePreBarrier(JSContext *cx, MIRType type)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
@ -710,10 +710,10 @@ JitRuntime::generatePreBarrier(JSContext *cx, MIRType type)
|
||||
masm.ret();
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "PreBarrier");
|
||||
writePerfSpewerJitCodeProfile(code, "PreBarrier");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
@ -722,7 +722,7 @@ JitRuntime::generatePreBarrier(JSContext *cx, MIRType type)
|
||||
typedef bool (*HandleDebugTrapFn)(JSContext *, BaselineFrame *, uint8_t *, bool *);
|
||||
static const VMFunction HandleDebugTrapInfo = FunctionInfo<HandleDebugTrapFn>(HandleDebugTrap);
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateDebugTrapHandler(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
@ -744,7 +744,7 @@ JitRuntime::generateDebugTrapHandler(JSContext *cx)
|
||||
masm.movePtr(ImmPtr(nullptr), BaselineStubReg);
|
||||
EmitEnterStubFrame(masm, scratch3);
|
||||
|
||||
IonCode *code = cx->runtime()->jitRuntime()->getVMWrapper(HandleDebugTrapInfo);
|
||||
JitCode *code = cx->runtime()->jitRuntime()->getVMWrapper(HandleDebugTrapInfo);
|
||||
if (!code)
|
||||
return nullptr;
|
||||
|
||||
@ -769,16 +769,16 @@ JitRuntime::generateDebugTrapHandler(JSContext *cx)
|
||||
masm.ret();
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *codeDbg = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *codeDbg = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(codeDbg, "DebugTrapHandler");
|
||||
writePerfSpewerJitCodeProfile(codeDbg, "DebugTrapHandler");
|
||||
#endif
|
||||
|
||||
return codeDbg;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateExceptionTailStub(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
@ -786,16 +786,16 @@ JitRuntime::generateExceptionTailStub(JSContext *cx)
|
||||
masm.handleFailureWithHandlerTail();
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "ExceptionTailStub");
|
||||
writePerfSpewerJitCodeProfile(code, "ExceptionTailStub");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateBailoutTailStub(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
@ -803,10 +803,10 @@ JitRuntime::generateBailoutTailStub(JSContext *cx)
|
||||
masm.generateBailoutTail(rdx, r9);
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "BailoutTailStub");
|
||||
writePerfSpewerJitCodeProfile(code, "BailoutTailStub");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
|
@ -72,20 +72,20 @@ class RelocationIterator
|
||||
}
|
||||
};
|
||||
|
||||
static inline IonCode *
|
||||
static inline JitCode *
|
||||
CodeFromJump(uint8_t *jump)
|
||||
{
|
||||
uint8_t *target = (uint8_t *)JSC::X86Assembler::getRel32Target(jump);
|
||||
return IonCode::FromExecutable(target);
|
||||
return JitCode::FromExecutable(target);
|
||||
}
|
||||
|
||||
void
|
||||
Assembler::TraceJumpRelocations(JSTracer *trc, IonCode *code, CompactBufferReader &reader)
|
||||
Assembler::TraceJumpRelocations(JSTracer *trc, JitCode *code, CompactBufferReader &reader)
|
||||
{
|
||||
RelocationIterator iter(reader);
|
||||
while (iter.read()) {
|
||||
IonCode *child = CodeFromJump(code->raw() + iter.offset());
|
||||
MarkIonCodeUnbarriered(trc, &child, "rel32");
|
||||
JitCode *child = CodeFromJump(code->raw() + iter.offset());
|
||||
MarkJitCodeUnbarriered(trc, &child, "rel32");
|
||||
JS_ASSERT(child == CodeFromJump(code->raw() + iter.offset()));
|
||||
}
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ class Assembler : public AssemblerX86Shared
|
||||
}
|
||||
void addPendingJump(JmpSrc src, ImmPtr target, Relocation::Kind kind) {
|
||||
enoughMemory_ &= jumps_.append(RelativePatch(src.offset(), target.value, kind));
|
||||
if (kind == Relocation::IONCODE)
|
||||
if (kind == Relocation::JITCODE)
|
||||
writeRelocation(src);
|
||||
}
|
||||
|
||||
@ -156,7 +156,7 @@ class Assembler : public AssemblerX86Shared
|
||||
using AssemblerX86Shared::push;
|
||||
using AssemblerX86Shared::pop;
|
||||
|
||||
static void TraceJumpRelocations(JSTracer *trc, IonCode *code, CompactBufferReader &reader);
|
||||
static void TraceJumpRelocations(JSTracer *trc, JitCode *code, CompactBufferReader &reader);
|
||||
|
||||
// Copy the assembly code to the given buffer, and perform any pending
|
||||
// relocations relying on the target address.
|
||||
@ -339,15 +339,15 @@ class Assembler : public AssemblerX86Shared
|
||||
addPendingJump(src, target, reloc);
|
||||
}
|
||||
|
||||
void jmp(IonCode *target) {
|
||||
jmp(ImmPtr(target->raw()), Relocation::IONCODE);
|
||||
void jmp(JitCode *target) {
|
||||
jmp(ImmPtr(target->raw()), Relocation::JITCODE);
|
||||
}
|
||||
void j(Condition cond, IonCode *target) {
|
||||
j(cond, ImmPtr(target->raw()), Relocation::IONCODE);
|
||||
void j(Condition cond, JitCode *target) {
|
||||
j(cond, ImmPtr(target->raw()), Relocation::JITCODE);
|
||||
}
|
||||
void call(IonCode *target) {
|
||||
void call(JitCode *target) {
|
||||
JmpSrc src = masm.call();
|
||||
addPendingJump(src, ImmPtr(target->raw()), Relocation::IONCODE);
|
||||
addPendingJump(src, ImmPtr(target->raw()), Relocation::JITCODE);
|
||||
}
|
||||
void call(ImmWord target) {
|
||||
call(ImmPtr((void*)target.value));
|
||||
@ -366,10 +366,10 @@ class Assembler : public AssemblerX86Shared
|
||||
|
||||
// Emit a CALL or CMP (nop) instruction. ToggleCall can be used to patch
|
||||
// this instruction.
|
||||
CodeOffsetLabel toggledCall(IonCode *target, bool enabled) {
|
||||
CodeOffsetLabel toggledCall(JitCode *target, bool enabled) {
|
||||
CodeOffsetLabel offset(size());
|
||||
JmpSrc src = enabled ? masm.call() : masm.cmp_eax();
|
||||
addPendingJump(src, ImmPtr(target->raw()), Relocation::IONCODE);
|
||||
addPendingJump(src, ImmPtr(target->raw()), Relocation::JITCODE);
|
||||
JS_ASSERT(size() - offset.offset() == ToggledCallSize());
|
||||
return offset;
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ IonBailoutIterator::IonBailoutIterator(const JitActivationIterator &activations,
|
||||
// Compute the snapshot offset from the bailout ID.
|
||||
JitActivation *activation = activations.activation()->asJit();
|
||||
JSRuntime *rt = activation->compartment()->runtimeFromMainThread();
|
||||
IonCode *code = rt->jitRuntime()->getBailoutTable(bailout->frameClass());
|
||||
JitCode *code = rt->jitRuntime()->getBailoutTable(bailout->frameClass());
|
||||
uintptr_t tableOffset = bailout->tableOffset();
|
||||
uintptr_t tableStart = reinterpret_cast<uintptr_t>(code->raw());
|
||||
|
||||
|
@ -72,7 +72,7 @@ EmitChangeICReturnAddress(MacroAssembler &masm, Register reg)
|
||||
}
|
||||
|
||||
inline void
|
||||
EmitTailCallVM(IonCode *target, MacroAssembler &masm, uint32_t argSize)
|
||||
EmitTailCallVM(JitCode *target, MacroAssembler &masm, uint32_t argSize)
|
||||
{
|
||||
// We assume during this that R0 and R1 have been pushed.
|
||||
|
||||
@ -106,7 +106,7 @@ EmitCreateStubFrameDescriptor(MacroAssembler &masm, Register reg)
|
||||
}
|
||||
|
||||
inline void
|
||||
EmitCallVM(IonCode *target, MacroAssembler &masm)
|
||||
EmitCallVM(JitCode *target, MacroAssembler &masm)
|
||||
{
|
||||
EmitCreateStubFrameDescriptor(masm, eax);
|
||||
masm.push(eax);
|
||||
@ -222,7 +222,7 @@ EmitUnstowICValues(MacroAssembler &masm, int values, bool discard = false)
|
||||
}
|
||||
|
||||
inline void
|
||||
EmitCallTypeUpdateIC(MacroAssembler &masm, IonCode *code, uint32_t objectOffset)
|
||||
EmitCallTypeUpdateIC(MacroAssembler &masm, JitCode *code, uint32_t objectOffset)
|
||||
{
|
||||
// R0 contains the value that needs to be typechecked.
|
||||
// The object we're updating is a boxed Value on the stack, at offset
|
||||
|
@ -291,7 +291,7 @@ MacroAssemblerX86::handleFailureWithHandler(void *handler)
|
||||
passABIArg(eax);
|
||||
callWithABI(handler);
|
||||
|
||||
IonCode *excTail = GetIonContext()->runtime->jitRuntime()->getExceptionTail();
|
||||
JitCode *excTail = GetIonContext()->runtime->jitRuntime()->getExceptionTail();
|
||||
jmp(excTail);
|
||||
}
|
||||
|
||||
|
@ -1066,7 +1066,7 @@ class MacroAssemblerX86 : public MacroAssemblerX86Shared
|
||||
movl(StackPointer, Operand(AbsoluteAddress(GetIonContext()->runtime->addressOfIonTop())));
|
||||
}
|
||||
|
||||
void callWithExitFrame(IonCode *target, Register dynStack) {
|
||||
void callWithExitFrame(JitCode *target, Register dynStack) {
|
||||
addPtr(Imm32(framePushed()), dynStack);
|
||||
makeFrameDescriptor(dynStack, IonFrame_OptimizedJS);
|
||||
Push(dynStack);
|
||||
|
@ -43,10 +43,10 @@ enum EnterJitEbpArgumentOffset {
|
||||
};
|
||||
|
||||
/*
|
||||
* Generates a trampoline for a C++ function with the EnterIonCode signature,
|
||||
* Generates a trampoline for a C++ function with the EnterJitCode signature,
|
||||
* using the standard cdecl calling convention.
|
||||
*/
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateEnterJIT(JSContext *cx, EnterJitType type)
|
||||
{
|
||||
MacroAssembler masm(cx);
|
||||
@ -275,16 +275,16 @@ JitRuntime::generateEnterJIT(JSContext *cx, EnterJitType type)
|
||||
masm.ret();
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "EnterJIT");
|
||||
writePerfSpewerJitCodeProfile(code, "EnterJIT");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateInvalidator(JSContext *cx)
|
||||
{
|
||||
AutoIonContextAlloc aica(cx);
|
||||
@ -328,21 +328,21 @@ JitRuntime::generateInvalidator(JSContext *cx)
|
||||
masm.lea(Operand(esp, ebx, TimesOne, sizeof(InvalidationBailoutStack)), esp);
|
||||
|
||||
// Jump to shared bailout tail. The BailoutInfo pointer has to be in ecx.
|
||||
IonCode *bailoutTail = cx->runtime()->jitRuntime()->getBailoutTail();
|
||||
JitCode *bailoutTail = cx->runtime()->jitRuntime()->getBailoutTail();
|
||||
masm.jmp(bailoutTail);
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
IonSpew(IonSpew_Invalidate, " invalidation thunk created at %p", (void *) code->raw());
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "Invalidator");
|
||||
writePerfSpewerJitCodeProfile(code, "Invalidator");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateArgumentsRectifier(JSContext *cx, ExecutionMode mode, void **returnAddrOut)
|
||||
{
|
||||
MacroAssembler masm(cx);
|
||||
@ -429,10 +429,10 @@ JitRuntime::generateArgumentsRectifier(JSContext *cx, ExecutionMode mode, void *
|
||||
masm.ret();
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "ArgumentsRectifier");
|
||||
writePerfSpewerJitCodeProfile(code, "ArgumentsRectifier");
|
||||
#endif
|
||||
|
||||
CodeOffsetLabel returnLabel(returnOffset);
|
||||
@ -492,11 +492,11 @@ GenerateBailoutThunk(JSContext *cx, MacroAssembler &masm, uint32_t frameClass)
|
||||
}
|
||||
|
||||
// Jump to shared bailout tail. The BailoutInfo pointer has to be in ecx.
|
||||
IonCode *bailoutTail = cx->runtime()->jitRuntime()->getBailoutTail();
|
||||
JitCode *bailoutTail = cx->runtime()->jitRuntime()->getBailoutTail();
|
||||
masm.jmp(bailoutTail);
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateBailoutTable(JSContext *cx, uint32_t frameClass)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
@ -509,16 +509,16 @@ JitRuntime::generateBailoutTable(JSContext *cx, uint32_t frameClass)
|
||||
GenerateBailoutThunk(cx, masm, frameClass);
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "BailoutHandler");
|
||||
writePerfSpewerJitCodeProfile(code, "BailoutHandler");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateBailoutHandler(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
@ -526,16 +526,16 @@ JitRuntime::generateBailoutHandler(JSContext *cx)
|
||||
GenerateBailoutThunk(cx, masm, NO_FRAME_SIZE_CLASS_ID);
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "BailoutHandler");
|
||||
writePerfSpewerJitCodeProfile(code, "BailoutHandler");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateVMWrapper(JSContext *cx, const VMFunction &f)
|
||||
{
|
||||
JS_ASSERT(!StackKeptAligned);
|
||||
@ -698,12 +698,12 @@ JitRuntime::generateVMWrapper(JSContext *cx, const VMFunction &f)
|
||||
f.extraValuesToPop * sizeof(Value)));
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *wrapper = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *wrapper = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
if (!wrapper)
|
||||
return nullptr;
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(wrapper, "VMWrapper");
|
||||
writePerfSpewerJitCodeProfile(wrapper, "VMWrapper");
|
||||
#endif
|
||||
|
||||
// linker.newCode may trigger a GC and sweep functionWrappers_ so we have to
|
||||
@ -714,7 +714,7 @@ JitRuntime::generateVMWrapper(JSContext *cx, const VMFunction &f)
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generatePreBarrier(JSContext *cx, MIRType type)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
@ -747,10 +747,10 @@ JitRuntime::generatePreBarrier(JSContext *cx, MIRType type)
|
||||
masm.ret();
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "PreBarrier");
|
||||
writePerfSpewerJitCodeProfile(code, "PreBarrier");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
@ -759,7 +759,7 @@ JitRuntime::generatePreBarrier(JSContext *cx, MIRType type)
|
||||
typedef bool (*HandleDebugTrapFn)(JSContext *, BaselineFrame *, uint8_t *, bool *);
|
||||
static const VMFunction HandleDebugTrapInfo = FunctionInfo<HandleDebugTrapFn>(HandleDebugTrap);
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateDebugTrapHandler(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
@ -781,7 +781,7 @@ JitRuntime::generateDebugTrapHandler(JSContext *cx)
|
||||
masm.movePtr(ImmPtr(nullptr), BaselineStubReg);
|
||||
EmitEnterStubFrame(masm, scratch3);
|
||||
|
||||
IonCode *code = cx->runtime()->jitRuntime()->getVMWrapper(HandleDebugTrapInfo);
|
||||
JitCode *code = cx->runtime()->jitRuntime()->getVMWrapper(HandleDebugTrapInfo);
|
||||
if (!code)
|
||||
return nullptr;
|
||||
|
||||
@ -806,16 +806,16 @@ JitRuntime::generateDebugTrapHandler(JSContext *cx)
|
||||
masm.ret();
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *codeDbg = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *codeDbg = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(codeDbg, "DebugTrapHandler");
|
||||
writePerfSpewerJitCodeProfile(codeDbg, "DebugTrapHandler");
|
||||
#endif
|
||||
|
||||
return codeDbg;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateExceptionTailStub(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
@ -823,16 +823,16 @@ JitRuntime::generateExceptionTailStub(JSContext *cx)
|
||||
masm.handleFailureWithHandlerTail();
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "ExceptionTailStub");
|
||||
writePerfSpewerJitCodeProfile(code, "ExceptionTailStub");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
IonCode *
|
||||
JitCode *
|
||||
JitRuntime::generateBailoutTailStub(JSContext *cx)
|
||||
{
|
||||
MacroAssembler masm;
|
||||
@ -840,10 +840,10 @@ JitRuntime::generateBailoutTailStub(JSContext *cx)
|
||||
masm.generateBailoutTail(edx, ecx);
|
||||
|
||||
Linker linker(masm);
|
||||
IonCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
JitCode *code = linker.newCode<NoGC>(cx, JSC::OTHER_CODE);
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerIonCodeProfile(code, "BailoutTailStub");
|
||||
writePerfSpewerJitCodeProfile(code, "BailoutTailStub");
|
||||
#endif
|
||||
|
||||
return code;
|
||||
|
@ -276,7 +276,7 @@ const uint32_t Arena::ThingSizes[] = {
|
||||
sizeof(JSShortString), /* FINALIZE_SHORT_STRING */
|
||||
sizeof(JSString), /* FINALIZE_STRING */
|
||||
sizeof(JSExternalString), /* FINALIZE_EXTERNAL_STRING */
|
||||
sizeof(jit::IonCode), /* FINALIZE_IONCODE */
|
||||
sizeof(jit::JitCode), /* FINALIZE_JITCODE */
|
||||
};
|
||||
|
||||
#define OFFSET(type) uint32_t(sizeof(ArenaHeader) + (ArenaSize - sizeof(ArenaHeader)) % sizeof(type))
|
||||
@ -302,7 +302,7 @@ const uint32_t Arena::FirstThingOffsets[] = {
|
||||
OFFSET(JSShortString), /* FINALIZE_SHORT_STRING */
|
||||
OFFSET(JSString), /* FINALIZE_STRING */
|
||||
OFFSET(JSExternalString), /* FINALIZE_EXTERNAL_STRING */
|
||||
OFFSET(jit::IonCode), /* FINALIZE_IONCODE */
|
||||
OFFSET(jit::JitCode), /* FINALIZE_JITCODE */
|
||||
};
|
||||
|
||||
#undef OFFSET
|
||||
@ -320,27 +320,27 @@ static const AllocKind FinalizePhaseScripts[] = {
|
||||
FINALIZE_LAZY_SCRIPT
|
||||
};
|
||||
|
||||
static const AllocKind FinalizePhaseIonCode[] = {
|
||||
FINALIZE_IONCODE
|
||||
static const AllocKind FinalizePhaseJitCode[] = {
|
||||
FINALIZE_JITCODE
|
||||
};
|
||||
|
||||
static const AllocKind * const FinalizePhases[] = {
|
||||
FinalizePhaseStrings,
|
||||
FinalizePhaseScripts,
|
||||
FinalizePhaseIonCode
|
||||
FinalizePhaseJitCode
|
||||
};
|
||||
static const int FinalizePhaseCount = sizeof(FinalizePhases) / sizeof(AllocKind*);
|
||||
|
||||
static const int FinalizePhaseLength[] = {
|
||||
sizeof(FinalizePhaseStrings) / sizeof(AllocKind),
|
||||
sizeof(FinalizePhaseScripts) / sizeof(AllocKind),
|
||||
sizeof(FinalizePhaseIonCode) / sizeof(AllocKind)
|
||||
sizeof(FinalizePhaseJitCode) / sizeof(AllocKind)
|
||||
};
|
||||
|
||||
static const gcstats::Phase FinalizePhaseStatsPhase[] = {
|
||||
gcstats::PHASE_SWEEP_STRING,
|
||||
gcstats::PHASE_SWEEP_SCRIPT,
|
||||
gcstats::PHASE_SWEEP_IONCODE
|
||||
gcstats::PHASE_SWEEP_JITCODE
|
||||
};
|
||||
|
||||
/*
|
||||
@ -591,13 +591,13 @@ FinalizeArenas(FreeOp *fop,
|
||||
return FinalizeTypedArenas<JSShortString>(fop, src, dest, thingKind, budget);
|
||||
case FINALIZE_EXTERNAL_STRING:
|
||||
return FinalizeTypedArenas<JSExternalString>(fop, src, dest, thingKind, budget);
|
||||
case FINALIZE_IONCODE:
|
||||
case FINALIZE_JITCODE:
|
||||
#ifdef JS_ION
|
||||
{
|
||||
// IonCode finalization may release references on an executable
|
||||
// JitCode finalization may release references on an executable
|
||||
// allocator that is accessed when triggering interrupts.
|
||||
JSRuntime::AutoLockForOperationCallback lock(fop->runtime());
|
||||
return FinalizeTypedArenas<jit::IonCode>(fop, src, dest, thingKind, budget);
|
||||
return FinalizeTypedArenas<jit::JitCode>(fop, src, dest, thingKind, budget);
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
@ -1614,10 +1614,10 @@ ArenaLists::queueScriptsForSweep(FreeOp *fop)
|
||||
}
|
||||
|
||||
void
|
||||
ArenaLists::queueIonCodeForSweep(FreeOp *fop)
|
||||
ArenaLists::queueJitCodeForSweep(FreeOp *fop)
|
||||
{
|
||||
gcstats::AutoPhase ap(fop->runtime()->gcStats, gcstats::PHASE_SWEEP_IONCODE);
|
||||
queueForForegroundSweep(fop, FINALIZE_IONCODE);
|
||||
gcstats::AutoPhase ap(fop->runtime()->gcStats, gcstats::PHASE_SWEEP_JITCODE);
|
||||
queueForForegroundSweep(fop, FINALIZE_JITCODE);
|
||||
}
|
||||
|
||||
void
|
||||
@ -3970,7 +3970,7 @@ BeginSweepingZoneGroup(JSRuntime *rt)
|
||||
#ifdef JS_ION
|
||||
for (GCZoneGroupIter zone(rt); !zone.done(); zone.next()) {
|
||||
gcstats::AutoSCC scc(rt->gcStats, rt->gcZoneGroupIndex);
|
||||
zone->allocator.arenas.queueIonCodeForSweep(&fop);
|
||||
zone->allocator.arenas.queueJitCodeForSweep(&fop);
|
||||
}
|
||||
#endif
|
||||
for (GCZoneGroupIter zone(rt); !zone.done(); zone.next()) {
|
||||
|
@ -51,7 +51,7 @@ enum HeapState {
|
||||
};
|
||||
|
||||
namespace jit {
|
||||
class IonCode;
|
||||
class JitCode;
|
||||
}
|
||||
|
||||
namespace gc {
|
||||
@ -119,7 +119,7 @@ MapAllocToTraceKind(AllocKind kind)
|
||||
JSTRACE_STRING, /* FINALIZE_SHORT_STRING */
|
||||
JSTRACE_STRING, /* FINALIZE_STRING */
|
||||
JSTRACE_STRING, /* FINALIZE_EXTERNAL_STRING */
|
||||
JSTRACE_IONCODE, /* FINALIZE_IONCODE */
|
||||
JSTRACE_JITCODE, /* FINALIZE_JITCODE */
|
||||
};
|
||||
JS_STATIC_ASSERT(JS_ARRAY_LENGTH(map) == FINALIZE_LIMIT);
|
||||
return map[kind];
|
||||
@ -146,7 +146,7 @@ template <> struct MapTypeToTraceKind<JSString> { static const JSGCTrace
|
||||
template <> struct MapTypeToTraceKind<JSFlatString> { static const JSGCTraceKind kind = JSTRACE_STRING; };
|
||||
template <> struct MapTypeToTraceKind<JSLinearString> { static const JSGCTraceKind kind = JSTRACE_STRING; };
|
||||
template <> struct MapTypeToTraceKind<PropertyName> { static const JSGCTraceKind kind = JSTRACE_STRING; };
|
||||
template <> struct MapTypeToTraceKind<jit::IonCode> { static const JSGCTraceKind kind = JSTRACE_IONCODE; };
|
||||
template <> struct MapTypeToTraceKind<jit::JitCode> { static const JSGCTraceKind kind = JSTRACE_JITCODE; };
|
||||
|
||||
#if defined(JSGC_GENERATIONAL) || defined(DEBUG)
|
||||
static inline bool
|
||||
@ -174,7 +174,7 @@ IsNurseryAllocable(AllocKind kind)
|
||||
false, /* FINALIZE_SHORT_STRING */
|
||||
false, /* FINALIZE_STRING */
|
||||
false, /* FINALIZE_EXTERNAL_STRING */
|
||||
false, /* FINALIZE_IONCODE */
|
||||
false, /* FINALIZE_JITCODE */
|
||||
};
|
||||
JS_STATIC_ASSERT(JS_ARRAY_LENGTH(map) == FINALIZE_LIMIT);
|
||||
return map[kind];
|
||||
@ -206,7 +206,7 @@ IsBackgroundFinalized(AllocKind kind)
|
||||
true, /* FINALIZE_SHORT_STRING */
|
||||
true, /* FINALIZE_STRING */
|
||||
false, /* FINALIZE_EXTERNAL_STRING */
|
||||
false, /* FINALIZE_IONCODE */
|
||||
false, /* FINALIZE_JITCODE */
|
||||
};
|
||||
JS_STATIC_ASSERT(JS_ARRAY_LENGTH(map) == FINALIZE_LIMIT);
|
||||
return map[kind];
|
||||
@ -603,7 +603,7 @@ class ArenaLists
|
||||
void queueStringsForSweep(FreeOp *fop);
|
||||
void queueShapesForSweep(FreeOp *fop);
|
||||
void queueScriptsForSweep(FreeOp *fop);
|
||||
void queueIonCodeForSweep(FreeOp *fop);
|
||||
void queueJitCodeForSweep(FreeOp *fop);
|
||||
|
||||
bool foregroundFinalize(FreeOp *fop, AllocKind thingKind, SliceBudget &sliceBudget);
|
||||
static void backgroundFinalize(FreeOp *fop, ArenaHeader *listHead, bool onBackgroundThread);
|
||||
@ -1092,8 +1092,8 @@ struct GCMarker : public JSTracer {
|
||||
TypeTag,
|
||||
XmlTag,
|
||||
SavedValueArrayTag,
|
||||
IonCodeTag,
|
||||
LastTag = IonCodeTag
|
||||
JitCodeTag,
|
||||
LastTag = JitCodeTag
|
||||
};
|
||||
|
||||
static const uintptr_t StackTagMask = 7;
|
||||
@ -1122,8 +1122,8 @@ struct GCMarker : public JSTracer {
|
||||
pushTaggedPtr(TypeTag, type);
|
||||
}
|
||||
|
||||
void pushIonCode(jit::IonCode *code) {
|
||||
pushTaggedPtr(IonCodeTag, code);
|
||||
void pushJitCode(jit::JitCode *code) {
|
||||
pushTaggedPtr(JitCodeTag, code);
|
||||
}
|
||||
|
||||
uint32_t getMarkColor() const {
|
||||
|
@ -426,7 +426,7 @@ NewGCThing(ThreadSafeContext *cx, AllocKind kind, size_t thingSize, InitialHeap
|
||||
JS_ASSERT_IF(rt->isAtomsCompartment(ncx->compartment()),
|
||||
kind == FINALIZE_STRING ||
|
||||
kind == FINALIZE_SHORT_STRING ||
|
||||
kind == FINALIZE_IONCODE);
|
||||
kind == FINALIZE_JITCODE);
|
||||
JS_ASSERT(!rt->isHeapBusy());
|
||||
JS_ASSERT(!rt->noGCOrAllocationCheck);
|
||||
|
||||
|
@ -130,7 +130,7 @@ typedef enum {
|
||||
* it implements JSTraceCallback.
|
||||
*/
|
||||
JSTRACE_LAZY_SCRIPT,
|
||||
JSTRACE_IONCODE,
|
||||
JSTRACE_JITCODE,
|
||||
JSTRACE_SHAPE,
|
||||
JSTRACE_BASE_SHAPE,
|
||||
JSTRACE_TYPE_OBJECT,
|
||||
@ -301,7 +301,7 @@ enum ThingRootKind
|
||||
THING_ROOT_BASE_SHAPE,
|
||||
THING_ROOT_TYPE_OBJECT,
|
||||
THING_ROOT_STRING,
|
||||
THING_ROOT_ION_CODE,
|
||||
THING_ROOT_JIT_CODE,
|
||||
THING_ROOT_SCRIPT,
|
||||
THING_ROOT_ID,
|
||||
THING_ROOT_PROPERTY_ID,
|
||||
|
@ -1273,7 +1273,7 @@ js::ParallelDo::hasScript(Vector<types::RecompileInfo> &scripts, JSScript *scrip
|
||||
template <uint32_t maxArgc>
|
||||
class ParallelIonInvoke
|
||||
{
|
||||
EnterIonCode enter_;
|
||||
EnterJitCode enter_;
|
||||
void *jitcode_;
|
||||
void *calleeToken_;
|
||||
Value argv_[maxArgc + 2];
|
||||
@ -1296,7 +1296,7 @@ class ParallelIonInvoke
|
||||
|
||||
// Find JIT code pointer.
|
||||
IonScript *ion = callee->nonLazyScript()->parallelIonScript();
|
||||
IonCode *code = ion->method();
|
||||
JitCode *code = ion->method();
|
||||
jitcode_ = code->raw();
|
||||
enter_ = rt->jitRuntime()->enterIon();
|
||||
calleeToken_ = CalleeToToken(callee);
|
||||
|
@ -375,9 +375,9 @@ StatsCellCallback(JSRuntime *rt, void *data, void *thing, JSGCTraceKind traceKin
|
||||
break;
|
||||
}
|
||||
|
||||
case JSTRACE_IONCODE: {
|
||||
case JSTRACE_JITCODE: {
|
||||
#ifdef JS_ION
|
||||
zStats->ionCodesGCHeap += thingSize;
|
||||
zStats->jitCodesGCHeap += thingSize;
|
||||
// The code for a script is counted in ExecutableAllocator::sizeOfCode().
|
||||
#endif
|
||||
break;
|
||||
|
@ -1792,11 +1792,11 @@ ReportZoneStats(const JS::ZoneStats &zStats,
|
||||
"Memory holding miscellaneous additional information associated with lazy "
|
||||
"scripts. This memory is allocated on the malloc heap.");
|
||||
|
||||
ZCREPORT_GC_BYTES(pathPrefix + NS_LITERAL_CSTRING("ion-codes-gc-heap"),
|
||||
zStats.ionCodesGCHeap,
|
||||
ZCREPORT_GC_BYTES(pathPrefix + NS_LITERAL_CSTRING("jit-codes-gc-heap"),
|
||||
zStats.jitCodesGCHeap,
|
||||
"Memory on the garbage-collected JavaScript "
|
||||
"heap that holds references to executable code pools "
|
||||
"used by the IonMonkey JIT.");
|
||||
"used by the JITs.");
|
||||
|
||||
ZCREPORT_GC_BYTES(pathPrefix + NS_LITERAL_CSTRING("type-objects/gc-heap"),
|
||||
zStats.typeObjectsGCHeap,
|
||||
|
Loading…
Reference in New Issue
Block a user