Bug 867426 - Remove RawScript typedef; r=jonco

--HG--
extra : rebase_source : c32ce48bca7fea1dfdafbf9395835613d8a57276
This commit is contained in:
Terrence Cole 2013-04-30 15:40:40 -07:00
Родитель 6b5a5fb7f0
Коммит 05bb64b19d
74 изменённых файлов: 304 добавлений и 307 удалений

Просмотреть файл

@ -824,7 +824,6 @@ class CompilerRootNode
} /* namespace js */ } /* namespace js */
ForwardDeclareJS(Script);
ForwardDeclareJS(Object); ForwardDeclareJS(Object);
#endif /* jsgc_root_h___ */ #endif /* jsgc_root_h___ */

Просмотреть файл

@ -34,7 +34,7 @@ AssertInnerizedScopeChain(JSContext *cx, JSObject &scopeobj)
} }
static bool static bool
IsEvalCacheCandidate(RawScript script) IsEvalCacheCandidate(JSScript *script)
{ {
// Make sure there are no inner objects which might use the wrong parent // Make sure there are no inner objects which might use the wrong parent
// and/or call scope by reusing the previous eval's script. Skip the // and/or call scope by reusing the previous eval's script. Skip the
@ -123,7 +123,7 @@ class EvalScriptGuard
} }
} }
void setNewScript(RawScript script) { void setNewScript(JSScript *script) {
// JSScript::initFromEmitter has already called js_CallNewScriptHook. // JSScript::initFromEmitter has already called js_CallNewScriptHook.
JS_ASSERT(!script_ && script); JS_ASSERT(!script_ && script);
script_ = script; script_ = script;
@ -289,7 +289,7 @@ EvalKernel(JSContext *cx, const CallArgs &args, EvalType evalType, AbstractFrame
.setNoScriptRval(false) .setNoScriptRval(false)
.setPrincipals(principals) .setPrincipals(principals)
.setOriginPrincipals(originPrincipals); .setOriginPrincipals(originPrincipals);
RawScript compiled = frontend::CompileScript(cx, scopeobj, callerScript, options, JSScript *compiled = frontend::CompileScript(cx, scopeobj, callerScript, options,
chars.get(), length, stableStr, staticLevel); chars.get(), length, stableStr, staticLevel);
if (!compiled) if (!compiled)
return false; return false;
@ -350,7 +350,7 @@ js::DirectEvalFromIon(JSContext *cx,
.setNoScriptRval(false) .setNoScriptRval(false)
.setPrincipals(principals) .setPrincipals(principals)
.setOriginPrincipals(originPrincipals); .setOriginPrincipals(originPrincipals);
RawScript compiled = frontend::CompileScript(cx, scopeobj, callerScript, options, JSScript *compiled = frontend::CompileScript(cx, scopeobj, callerScript, options,
chars.get(), length, stableStr, staticLevel); chars.get(), length, stableStr, staticLevel);
if (!compiled) if (!compiled)
return false; return false;

Просмотреть файл

@ -38,7 +38,7 @@ CheckLength(JSContext *cx, size_t length)
} }
static bool static bool
SetSourceMap(JSContext *cx, TokenStream &tokenStream, ScriptSource *ss, RawScript script) SetSourceMap(JSContext *cx, TokenStream &tokenStream, ScriptSource *ss, JSScript *script)
{ {
if (tokenStream.hasSourceMap()) { if (tokenStream.hasSourceMap()) {
if (!ss->setSourceMap(cx, tokenStream.releaseSourceMap(), script->filename())) if (!ss->setSourceMap(cx, tokenStream.releaseSourceMap(), script->filename()))
@ -74,7 +74,7 @@ CheckArgumentsWithinEval(JSContext *cx, Parser<FullParseHandler> &parser, Handle
return true; return true;
} }
RawScript JSScript *
frontend::CompileScript(JSContext *cx, HandleObject scopeChain, frontend::CompileScript(JSContext *cx, HandleObject scopeChain,
HandleScript evalCaller, HandleScript evalCaller,
const CompileOptions &options, const CompileOptions &options,

Просмотреть файл

@ -12,7 +12,7 @@
namespace js { namespace js {
namespace frontend { namespace frontend {
RawScript JSScript *
CompileScript(JSContext *cx, HandleObject scopeChain, HandleScript evalCaller, CompileScript(JSContext *cx, HandleObject scopeChain, HandleScript evalCaller,
const CompileOptions &options, const jschar *chars, size_t length, const CompileOptions &options, const jschar *chars, size_t length,
JSString *source_ = NULL, unsigned staticLevel = 0, JSString *source_ = NULL, unsigned staticLevel = 0,

Просмотреть файл

@ -66,7 +66,7 @@ static inline void
PushMarkStack(GCMarker *gcmarker, JSFunction *thing); PushMarkStack(GCMarker *gcmarker, JSFunction *thing);
static inline void static inline void
PushMarkStack(GCMarker *gcmarker, RawScript thing); PushMarkStack(GCMarker *gcmarker, JSScript *thing);
static inline void static inline void
PushMarkStack(GCMarker *gcmarker, Shape *thing); PushMarkStack(GCMarker *gcmarker, Shape *thing);
@ -81,7 +81,7 @@ namespace js {
namespace gc { namespace gc {
static void MarkChildren(JSTracer *trc, JSString *str); static void MarkChildren(JSTracer *trc, JSString *str);
static void MarkChildren(JSTracer *trc, RawScript script); static void MarkChildren(JSTracer *trc, JSScript *script);
static void MarkChildren(JSTracer *trc, Shape *shape); static void MarkChildren(JSTracer *trc, Shape *shape);
static void MarkChildren(JSTracer *trc, BaseShape *base); static void MarkChildren(JSTracer *trc, BaseShape *base);
static void MarkChildren(JSTracer *trc, types::TypeObject *type); static void MarkChildren(JSTracer *trc, types::TypeObject *type);
@ -389,7 +389,7 @@ gc::MarkKind(JSTracer *trc, void **thingp, JSGCTraceKind kind)
MarkInternal(trc, reinterpret_cast<RawString *>(thingp)); MarkInternal(trc, reinterpret_cast<RawString *>(thingp));
break; break;
case JSTRACE_SCRIPT: case JSTRACE_SCRIPT:
MarkInternal(trc, reinterpret_cast<RawScript *>(thingp)); MarkInternal(trc, reinterpret_cast<JSScript **>(thingp));
break; break;
case JSTRACE_SHAPE: case JSTRACE_SHAPE:
MarkInternal(trc, reinterpret_cast<Shape **>(thingp)); MarkInternal(trc, reinterpret_cast<Shape **>(thingp));
@ -714,7 +714,7 @@ gc::MarkCrossCompartmentSlot(JSTracer *trc, RawObject src, HeapSlot *dst, const
/*** Special Marking ***/ /*** Special Marking ***/
void void
gc::MarkObject(JSTracer *trc, HeapPtr<GlobalObject, RawScript> *thingp, const char *name) gc::MarkObject(JSTracer *trc, HeapPtr<GlobalObject, JSScript *> *thingp, const char *name)
{ {
JS_SET_TRACING_NAME(trc, name); JS_SET_TRACING_NAME(trc, name);
MarkInternal(trc, thingp->unsafeGet()); MarkInternal(trc, thingp->unsafeGet());
@ -779,7 +779,7 @@ PushMarkStack(GCMarker *gcmarker, types::TypeObject *thing)
} }
static void static void
PushMarkStack(GCMarker *gcmarker, RawScript thing) PushMarkStack(GCMarker *gcmarker, JSScript *thing)
{ {
JS_COMPARTMENT_ASSERT(gcmarker->runtime, thing); JS_COMPARTMENT_ASSERT(gcmarker->runtime, thing);
JS_ASSERT(!IsInsideNursery(thing->runtime(), thing)); JS_ASSERT(!IsInsideNursery(thing->runtime(), thing));
@ -993,7 +993,7 @@ gc::MarkChildren(JSTracer *trc, JSString *str)
} }
static void static void
gc::MarkChildren(JSTracer *trc, RawScript script) gc::MarkChildren(JSTracer *trc, JSScript *script)
{ {
script->markChildren(trc); script->markChildren(trc);
} }
@ -1499,7 +1499,7 @@ js::TraceChildren(JSTracer *trc, void *thing, JSGCTraceKind kind)
break; break;
case JSTRACE_SCRIPT: case JSTRACE_SCRIPT:
MarkChildren(trc, static_cast<RawScript>(thing)); MarkChildren(trc, static_cast<JSScript *>(thing));
break; break;
case JSTRACE_SHAPE: case JSTRACE_SHAPE:

Просмотреть файл

@ -62,7 +62,7 @@ IonBailoutIterator::dump() const
} }
} }
static RawScript static JSScript *
GetBailedJSScript(JSContext *cx) GetBailedJSScript(JSContext *cx)
{ {
// Just after the frame conversion, we can safely interpret the ionTop as JS // Just after the frame conversion, we can safely interpret the ionTop as JS
@ -530,7 +530,7 @@ uint32_t
ion::BoundsCheckFailure() ion::BoundsCheckFailure()
{ {
JSContext *cx = GetIonContext()->cx; JSContext *cx = GetIonContext()->cx;
RawScript script = GetBailedJSScript(cx); JSScript *script = GetBailedJSScript(cx);
IonSpew(IonSpew_Bailouts, "Bounds check failure %s:%d", script->filename(), IonSpew(IonSpew_Bailouts, "Bounds check failure %s:%d", script->filename(),
script->lineno); script->lineno);
@ -551,7 +551,7 @@ uint32_t
ion::ShapeGuardFailure() ion::ShapeGuardFailure()
{ {
JSContext *cx = GetIonContext()->cx; JSContext *cx = GetIonContext()->cx;
RawScript script = GetBailedJSScript(cx); JSScript *script = GetBailedJSScript(cx);
JS_ASSERT(!script->ionScript()->invalidated()); JS_ASSERT(!script->ionScript()->invalidated());
@ -566,7 +566,7 @@ uint32_t
ion::CachedShapeGuardFailure() ion::CachedShapeGuardFailure()
{ {
JSContext *cx = GetIonContext()->cx; JSContext *cx = GetIonContext()->cx;
RawScript script = GetBailedJSScript(cx); JSScript *script = GetBailedJSScript(cx);
JS_ASSERT(!script->ionScript()->invalidated()); JS_ASSERT(!script->ionScript()->invalidated());

Просмотреть файл

@ -781,7 +781,7 @@ PrepareOsrTempData(JSContext *cx, ICUseCount_Fallback *stub, BaselineFrame *fram
*((JSFunction **) (stackFrame + StackFrame::offsetOfExec())) = frame->fun(); *((JSFunction **) (stackFrame + StackFrame::offsetOfExec())) = frame->fun();
*((uint32_t *) (stackFrame + StackFrame::offsetOfFlags())) = StackFrame::FUNCTION; *((uint32_t *) (stackFrame + StackFrame::offsetOfFlags())) = StackFrame::FUNCTION;
} else { } else {
*((RawScript *) (stackFrame + StackFrame::offsetOfExec())) = frame->script(); *((JSScript **) (stackFrame + StackFrame::offsetOfExec())) = frame->script();
*((uint32_t *) (stackFrame + StackFrame::offsetOfFlags())) = 0; *((uint32_t *) (stackFrame + StackFrame::offsetOfFlags())) = 0;
} }
@ -1659,7 +1659,7 @@ DoCompareFallback(JSContext *cx, BaselineFrame *frame, ICCompare_Fallback *stub,
return true; return true;
} }
RawScript script = frame->script(); JSScript *script = frame->script();
// Try to generate new stubs. // Try to generate new stubs.
if (lhs.isInt32() && rhs.isInt32()) { if (lhs.isInt32() && rhs.isInt32()) {
@ -2070,7 +2070,7 @@ DoToBoolFallback(JSContext *cx, BaselineFrame *frame, ICToBool_Fallback *stub, H
JS_ASSERT(!arg.isBoolean()); JS_ASSERT(!arg.isBoolean());
RawScript script = frame->script(); JSScript *script = frame->script();
// Try to generate new stubs. // Try to generate new stubs.
if (arg.isInt32()) { if (arg.isInt32()) {

Просмотреть файл

@ -49,7 +49,7 @@ class BaselineInspector
ICEntry *prevLookedUpEntry; ICEntry *prevLookedUpEntry;
public: public:
BaselineInspector(JSContext *cx, RawScript rawScript) BaselineInspector(JSContext *cx, JSScript *rawScript)
: script(cx, rawScript), prevLookedUpEntry(NULL) : script(cx, rawScript), prevLookedUpEntry(NULL)
{ {
JS_ASSERT(script); JS_ASSERT(script);

Просмотреть файл

@ -659,7 +659,7 @@ BaselineScript::pcForReturnAddress(JSScript *script, uint8_t *nativeAddress)
} }
void void
BaselineScript::toggleDebugTraps(RawScript script, jsbytecode *pc) BaselineScript::toggleDebugTraps(JSScript *script, jsbytecode *pc)
{ {
JS_ASSERT(script->baselineScript() == this); JS_ASSERT(script->baselineScript() == this);
@ -779,7 +779,7 @@ BaselineScript::purgeOptimizedStubs(Zone *zone)
} }
void void
ion::FinishDiscardBaselineScript(FreeOp *fop, RawScript script) ion::FinishDiscardBaselineScript(FreeOp *fop, JSScript *script)
{ {
if (!script->hasBaselineScript()) if (!script->hasBaselineScript())
return; return;

Просмотреть файл

@ -243,7 +243,7 @@ struct BaselineScript
// Toggle debug traps (used for breakpoints and step mode) in the script. // Toggle debug traps (used for breakpoints and step mode) in the script.
// If |pc| is NULL, toggle traps for all ops in the script. Else, only // If |pc| is NULL, toggle traps for all ops in the script. Else, only
// toggle traps at |pc|. // toggle traps at |pc|.
void toggleDebugTraps(RawScript script, jsbytecode *pc); void toggleDebugTraps(JSScript *script, jsbytecode *pc);
void toggleSPS(bool enable); void toggleSPS(bool enable);
@ -268,7 +268,7 @@ IonExecStatus
EnterBaselineAtBranch(JSContext *cx, StackFrame *fp, jsbytecode *pc); EnterBaselineAtBranch(JSContext *cx, StackFrame *fp, jsbytecode *pc);
void void
FinishDiscardBaselineScript(FreeOp *fop, RawScript script); FinishDiscardBaselineScript(FreeOp *fop, JSScript *script);
void void
SizeOfBaselineData(JSScript *script, JSMallocSizeOfFun mallocSizeOf, size_t *data, SizeOfBaselineData(JSScript *script, JSMallocSizeOfFun mallocSizeOf, size_t *data,

Просмотреть файл

@ -1545,7 +1545,7 @@ CodeGenerator::visitCallKnown(LCallKnown *call)
// If the function is known to be uncompilable, just emit the call to // If the function is known to be uncompilable, just emit the call to
// Invoke in sequential mode, else mark as cannot compile. // Invoke in sequential mode, else mark as cannot compile.
JS_ASSERT(call->mir()->hasRootedScript()); JS_ASSERT(call->mir()->hasRootedScript());
RawScript targetScript = target->nonLazyScript(); JSScript *targetScript = target->nonLazyScript();
if (GetIonScript(targetScript, executionMode) == ION_DISABLED_SCRIPT) { if (GetIonScript(targetScript, executionMode) == ION_DISABLED_SCRIPT) {
if (executionMode == ParallelExecution) if (executionMode == ParallelExecution)
return false; return false;
@ -2220,7 +2220,7 @@ CodeGenerator::maybeCreateScriptCounts()
IonScriptCounts *counts = NULL; IonScriptCounts *counts = NULL;
CompileInfo *outerInfo = &gen->info(); CompileInfo *outerInfo = &gen->info();
RawScript script = outerInfo->script(); JSScript *script = outerInfo->script();
if (cx->runtime->profilingScripts) { if (cx->runtime->profilingScripts) {
if (script && !script->hasScriptCounts && !script->initScriptCounts(cx)) if (script && !script->hasScriptCounts && !script->initScriptCounts(cx))
@ -4929,7 +4929,7 @@ CodeGenerator::link()
// We encode safepoints after the OSI-point offsets have been determined. // We encode safepoints after the OSI-point offsets have been determined.
encodeSafepoints(); encodeSafepoints();
RawScript script = gen->info().script(); JSScript *script = gen->info().script();
ExecutionMode executionMode = gen->info().executionMode(); ExecutionMode executionMode = gen->info().executionMode();
JS_ASSERT(!HasIonScript(script, executionMode)); JS_ASSERT(!HasIonScript(script, executionMode));

Просмотреть файл

@ -13,7 +13,7 @@ namespace js {
namespace ion { namespace ion {
inline unsigned inline unsigned
StartArgSlot(RawScript script, JSFunction *fun) StartArgSlot(JSScript *script, JSFunction *fun)
{ {
// First slot is for scope chain. // First slot is for scope chain.
// Second one may be for arguments object. // Second one may be for arguments object.
@ -21,7 +21,7 @@ StartArgSlot(RawScript script, JSFunction *fun)
} }
inline unsigned inline unsigned
CountArgSlots(RawScript script, JSFunction *fun) CountArgSlots(JSScript *script, JSFunction *fun)
{ {
return StartArgSlot(script, fun) + (fun ? fun->nargs + 1 : 0); return StartArgSlot(script, fun) + (fun ? fun->nargs + 1 : 0);
} }
@ -39,7 +39,7 @@ enum ExecutionMode {
class CompileInfo class CompileInfo
{ {
public: public:
CompileInfo(RawScript script, JSFunction *fun, jsbytecode *osrPc, bool constructing, CompileInfo(JSScript *script, JSFunction *fun, jsbytecode *osrPc, bool constructing,
ExecutionMode executionMode) ExecutionMode executionMode)
: script_(script), fun_(fun), osrPc_(osrPc), constructing_(constructing), : script_(script), fun_(fun), osrPc_(osrPc), constructing_(constructing),
executionMode_(executionMode) executionMode_(executionMode)
@ -63,7 +63,7 @@ class CompileInfo
nslots_ = nlocals_ + nstack_; nslots_ = nlocals_ + nstack_;
} }
RawScript script() const { JSScript *script() const {
return script_; return script_;
} }
JSFunction *fun() const { JSFunction *fun() const {

Просмотреть файл

@ -11,7 +11,7 @@ namespace js {
namespace ion { namespace ion {
static inline bool static inline bool
HasIonScript(RawScript script, ExecutionMode cmode) HasIonScript(JSScript *script, ExecutionMode cmode)
{ {
switch (cmode) { switch (cmode) {
case SequentialExecution: return script->hasIonScript(); case SequentialExecution: return script->hasIonScript();
@ -22,7 +22,7 @@ HasIonScript(RawScript script, ExecutionMode cmode)
} }
static inline IonScript * static inline IonScript *
GetIonScript(RawScript script, ExecutionMode cmode) GetIonScript(JSScript *script, ExecutionMode cmode)
{ {
switch (cmode) { switch (cmode) {
case SequentialExecution: return script->maybeIonScript(); case SequentialExecution: return script->maybeIonScript();
@ -33,7 +33,7 @@ GetIonScript(RawScript script, ExecutionMode cmode)
} }
static inline void static inline void
SetIonScript(RawScript script, ExecutionMode cmode, IonScript *ionScript) SetIonScript(JSScript *script, ExecutionMode cmode, IonScript *ionScript)
{ {
switch (cmode) { switch (cmode) {
case SequentialExecution: script->setIonScript(ionScript); return; case SequentialExecution: script->setIonScript(ionScript); return;
@ -53,7 +53,7 @@ OffsetOfIonInJSScript(ExecutionMode cmode)
} }
static inline bool static inline bool
CanIonCompile(RawScript script, ExecutionMode cmode) CanIonCompile(JSScript *script, ExecutionMode cmode)
{ {
switch (cmode) { switch (cmode) {
case SequentialExecution: return script->canIonCompile(); case SequentialExecution: return script->canIonCompile();
@ -70,7 +70,7 @@ CanIonCompile(JSFunction *fun, ExecutionMode cmode)
} }
static inline bool static inline bool
CompilingOffThread(RawScript script, ExecutionMode cmode) CompilingOffThread(JSScript *script, ExecutionMode cmode)
{ {
switch (cmode) { switch (cmode) {
case SequentialExecution: return script->isIonCompilingOffThread(); case SequentialExecution: return script->isIonCompilingOffThread();

Просмотреть файл

@ -609,8 +609,8 @@ IonScript::New(JSContext *cx, uint32_t frameSlots, uint32_t frameSize, size_t sn
size_t paddedCacheEntriesSize = AlignBytes(cacheEntries * sizeof(uint32_t), DataAlignment); size_t paddedCacheEntriesSize = AlignBytes(cacheEntries * sizeof(uint32_t), DataAlignment);
size_t paddedRuntimeSize = AlignBytes(runtimeSize, DataAlignment); size_t paddedRuntimeSize = AlignBytes(runtimeSize, DataAlignment);
size_t paddedSafepointSize = AlignBytes(safepointsSize, DataAlignment); size_t paddedSafepointSize = AlignBytes(safepointsSize, DataAlignment);
size_t paddedScriptSize = AlignBytes(scriptEntries * sizeof(RawScript), DataAlignment); size_t paddedScriptSize = AlignBytes(scriptEntries * sizeof(JSScript *), DataAlignment);
size_t paddedCallTargetSize = AlignBytes(callTargetEntries * sizeof(RawScript), DataAlignment); size_t paddedCallTargetSize = AlignBytes(callTargetEntries * sizeof(JSScript *), DataAlignment);
size_t bytes = paddedSnapshotsSize + size_t bytes = paddedSnapshotsSize +
paddedBailoutSize + paddedBailoutSize +
paddedConstantsSize + paddedConstantsSize +
@ -904,7 +904,7 @@ ion::ToggleBarriers(JS::Zone *zone, bool needs)
AutoFlushCache afc("ToggleBarriers", zone->rt->ionRuntime()); AutoFlushCache afc("ToggleBarriers", zone->rt->ionRuntime());
for (gc::CellIterUnderGC i(zone, gc::FINALIZE_SCRIPT); !i.done(); i.next()) { for (gc::CellIterUnderGC i(zone, gc::FINALIZE_SCRIPT); !i.done(); i.next()) {
RawScript script = i.get<JSScript>(); JSScript *script = i.get<JSScript>();
if (script->hasIonScript()) if (script->hasIonScript())
script->ionScript()->toggleBarriers(needs); script->ionScript()->toggleBarriers(needs);
if (script->hasBaselineScript()) if (script->hasBaselineScript())
@ -1241,7 +1241,7 @@ public:
return SequentialExecution; return SequentialExecution;
} }
MethodStatus checkScriptSize(JSContext *cx, RawScript script); MethodStatus checkScriptSize(JSContext *cx, JSScript *script);
AbortReason compile(IonBuilder *builder, MIRGraph *graph, AbortReason compile(IonBuilder *builder, MIRGraph *graph,
ScopedJSDeletePtr<LifoAlloc> &autoDelete); ScopedJSDeletePtr<LifoAlloc> &autoDelete);
}; };
@ -1473,7 +1473,7 @@ CheckFrame(AbstractFramePtr fp)
} }
static bool static bool
CheckScript(RawScript script, bool osr) CheckScript(JSScript *script, bool osr)
{ {
if (osr && script->needsArgsObj()) { if (osr && script->needsArgsObj()) {
// OSR-ing into functions with arguments objects is not supported. // OSR-ing into functions with arguments objects is not supported.
@ -1490,7 +1490,7 @@ CheckScript(RawScript script, bool osr)
} }
MethodStatus MethodStatus
SequentialCompileContext::checkScriptSize(JSContext *cx, RawScript script) SequentialCompileContext::checkScriptSize(JSContext *cx, JSScript *script)
{ {
if (!js_IonOptions.limitScriptSize) if (!js_IonOptions.limitScriptSize)
return Method_Compiled; return Method_Compiled;
@ -1742,7 +1742,7 @@ ion::CompileFunctionForBaseline(JSContext *cx, HandleScript script, AbstractFram
} }
MethodStatus MethodStatus
ParallelCompileContext::checkScriptSize(JSContext *cx, RawScript script) ParallelCompileContext::checkScriptSize(JSContext *cx, JSScript *script)
{ {
if (!js_IonOptions.limitScriptSize) if (!js_IonOptions.limitScriptSize)
return Method_Compiled; return Method_Compiled;
@ -2155,7 +2155,7 @@ InvalidateActivation(FreeOp *fop, uint8_t *ionTop, bool invalidateAll)
const char *type = it.isOptimizedJS() ? "Optimized" : "Baseline"; const char *type = it.isOptimizedJS() ? "Optimized" : "Baseline";
IonSpew(IonSpew_Invalidate, "#%d %s JS frame @ %p, %s:%d (fun: %p, script: %p, pc %p)", IonSpew(IonSpew_Invalidate, "#%d %s JS frame @ %p, %s:%d (fun: %p, script: %p, pc %p)",
frameno, type, it.fp(), it.script()->filename(), it.script()->lineno, frameno, type, it.fp(), it.script()->filename(), it.script()->lineno,
it.maybeCallee(), (RawScript)it.script(), it.returnAddressToFp()); it.maybeCallee(), (JSScript *)it.script(), it.returnAddressToFp());
break; break;
} }
case IonFrame_BaselineStub: case IonFrame_BaselineStub:
@ -2187,7 +2187,7 @@ InvalidateActivation(FreeOp *fop, uint8_t *ionTop, bool invalidateAll)
if (it.checkInvalidation()) if (it.checkInvalidation())
continue; continue;
RawScript script = it.script(); JSScript *script = it.script();
if (!script->hasIonScript()) if (!script->hasIonScript())
continue; continue;
@ -2333,7 +2333,7 @@ ion::Invalidate(types::TypeCompartment &types, FreeOp *fop,
break; break;
} }
JS_ASSERT(co.isValid()); JS_ASSERT(co.isValid());
RawScript script = co.script; JSScript *script = co.script;
IonScript *ionScript = GetIonScript(script, executionMode); IonScript *ionScript = GetIonScript(script, executionMode);
Zone *zone = script->zone(); Zone *zone = script->zone();
@ -2372,7 +2372,7 @@ ion::Invalidate(JSContext *cx, const Vector<types::RecompileInfo> &invalid, bool
} }
bool bool
ion::Invalidate(JSContext *cx, RawScript script, ExecutionMode mode, bool resetUses) ion::Invalidate(JSContext *cx, JSScript *script, ExecutionMode mode, bool resetUses)
{ {
JS_ASSERT(script->hasIonScript()); JS_ASSERT(script->hasIonScript());
@ -2396,13 +2396,13 @@ ion::Invalidate(JSContext *cx, RawScript script, ExecutionMode mode, bool resetU
} }
bool bool
ion::Invalidate(JSContext *cx, RawScript script, bool resetUses) ion::Invalidate(JSContext *cx, JSScript *script, bool resetUses)
{ {
return Invalidate(cx, script, SequentialExecution, resetUses); return Invalidate(cx, script, SequentialExecution, resetUses);
} }
static void static void
FinishInvalidationOf(FreeOp *fop, RawScript script, IonScript *ionScript, bool parallel) FinishInvalidationOf(FreeOp *fop, JSScript *script, IonScript *ionScript, bool parallel)
{ {
// If this script has Ion code on the stack, invalidation() will return // If this script has Ion code on the stack, invalidation() will return
// true. In this case we have to wait until destroying it. // true. In this case we have to wait until destroying it.
@ -2422,7 +2422,7 @@ FinishInvalidationOf(FreeOp *fop, RawScript script, IonScript *ionScript, bool p
} }
void void
ion::FinishInvalidation(FreeOp *fop, RawScript script) ion::FinishInvalidation(FreeOp *fop, JSScript *script)
{ {
if (script->hasIonScript()) if (script->hasIonScript())
FinishInvalidationOf(fop, script, script->ionScript(), false); FinishInvalidationOf(fop, script, script->ionScript(), false);
@ -2444,13 +2444,13 @@ ion::MarkShapeFromIon(JSRuntime *rt, Shape **shapep)
} }
void void
ion::ForbidCompilation(JSContext *cx, RawScript script) ion::ForbidCompilation(JSContext *cx, JSScript *script)
{ {
ForbidCompilation(cx, script, SequentialExecution); ForbidCompilation(cx, script, SequentialExecution);
} }
void void
ion::ForbidCompilation(JSContext *cx, RawScript script, ExecutionMode mode) ion::ForbidCompilation(JSContext *cx, JSScript *script, ExecutionMode mode)
{ {
IonSpew(IonSpew_Abort, "Disabling Ion mode %d compilation of script %s:%d", IonSpew(IonSpew_Abort, "Disabling Ion mode %d compilation of script %s:%d",
mode, script->filename(), script->lineno); mode, script->filename(), script->lineno);
@ -2486,7 +2486,7 @@ ion::ForbidCompilation(JSContext *cx, RawScript script, ExecutionMode mode)
} }
uint32_t uint32_t
ion::UsesBeforeIonRecompile(RawScript script, jsbytecode *pc) ion::UsesBeforeIonRecompile(JSScript *script, jsbytecode *pc)
{ {
JS_ASSERT(pc == script->code || JSOp(*pc) == JSOP_LOOPENTRY); JS_ASSERT(pc == script->code || JSOp(*pc) == JSOP_LOOPENTRY);
@ -2564,7 +2564,7 @@ AutoFlushInhibitor::~AutoFlushInhibitor()
int js::ion::LabelBase::id_count = 0; int js::ion::LabelBase::id_count = 0;
void void
ion::PurgeCaches(RawScript script, Zone *zone) ion::PurgeCaches(JSScript *script, Zone *zone)
{ {
if (script->hasIonScript()) if (script->hasIonScript())
script->ionScript()->purgeCaches(zone); script->ionScript()->purgeCaches(zone);
@ -2574,7 +2574,7 @@ ion::PurgeCaches(RawScript script, Zone *zone)
} }
size_t size_t
ion::SizeOfIonData(RawScript script, JSMallocSizeOfFun mallocSizeOf) ion::SizeOfIonData(JSScript *script, JSMallocSizeOfFun mallocSizeOf)
{ {
size_t result = 0; size_t result = 0;
@ -2588,7 +2588,7 @@ ion::SizeOfIonData(RawScript script, JSMallocSizeOfFun mallocSizeOf)
} }
void void
ion::DestroyIonScripts(FreeOp *fop, RawScript script) ion::DestroyIonScripts(FreeOp *fop, JSScript *script)
{ {
if (script->hasIonScript()) if (script->hasIonScript())
ion::IonScript::Destroy(fop, script->ionScript()); ion::IonScript::Destroy(fop, script->ionScript());
@ -2601,7 +2601,7 @@ ion::DestroyIonScripts(FreeOp *fop, RawScript script)
} }
void void
ion::TraceIonScripts(JSTracer* trc, RawScript script) ion::TraceIonScripts(JSTracer* trc, JSScript *script)
{ {
if (script->hasIonScript()) if (script->hasIonScript())
ion::IonScript::Trace(trc, script->ionScript()); ion::IonScript::Trace(trc, script->ionScript());

Просмотреть файл

@ -318,8 +318,8 @@ IonExecStatus FastInvoke(JSContext *cx, HandleFunction fun, CallArgsList &args);
void Invalidate(types::TypeCompartment &types, FreeOp *fop, void Invalidate(types::TypeCompartment &types, FreeOp *fop,
const Vector<types::RecompileInfo> &invalid, bool resetUses = true); const Vector<types::RecompileInfo> &invalid, bool resetUses = true);
void Invalidate(JSContext *cx, const Vector<types::RecompileInfo> &invalid, bool resetUses = true); void Invalidate(JSContext *cx, const Vector<types::RecompileInfo> &invalid, bool resetUses = true);
bool Invalidate(JSContext *cx, RawScript script, ExecutionMode mode, bool resetUses = true); bool Invalidate(JSContext *cx, JSScript *script, ExecutionMode mode, bool resetUses = true);
bool Invalidate(JSContext *cx, RawScript script, bool resetUses = true); bool Invalidate(JSContext *cx, JSScript *script, bool resetUses = true);
void MarkValueFromIon(JSRuntime *rt, Value *vp); void MarkValueFromIon(JSRuntime *rt, Value *vp);
void MarkShapeFromIon(JSRuntime *rt, Shape **shapep); void MarkShapeFromIon(JSRuntime *rt, Shape **shapep);
@ -344,14 +344,14 @@ static inline bool IsEnabled(JSContext *cx)
return cx->hasOption(JSOPTION_ION) && cx->typeInferenceEnabled(); return cx->hasOption(JSOPTION_ION) && cx->typeInferenceEnabled();
} }
void ForbidCompilation(JSContext *cx, RawScript script); void ForbidCompilation(JSContext *cx, JSScript *script);
void ForbidCompilation(JSContext *cx, RawScript script, ExecutionMode mode); void ForbidCompilation(JSContext *cx, JSScript *script, ExecutionMode mode);
uint32_t UsesBeforeIonRecompile(RawScript script, jsbytecode *pc); uint32_t UsesBeforeIonRecompile(JSScript *script, jsbytecode *pc);
void PurgeCaches(RawScript script, JS::Zone *zone); void PurgeCaches(JSScript *script, JS::Zone *zone);
size_t SizeOfIonData(RawScript script, JSMallocSizeOfFun mallocSizeOf); size_t SizeOfIonData(JSScript *script, JSMallocSizeOfFun mallocSizeOf);
void DestroyIonScripts(FreeOp *fop, RawScript script); void DestroyIonScripts(FreeOp *fop, JSScript *script);
void TraceIonScripts(JSTracer* trc, RawScript script); void TraceIonScripts(JSTracer* trc, JSScript *script);
} // namespace ion } // namespace ion
} // namespace js } // namespace js

Просмотреть файл

@ -2225,7 +2225,7 @@ GenerateScopeChainGuard(MacroAssembler &masm, JSObject *scopeObj,
CallObject *callObj = &scopeObj->asCall(); CallObject *callObj = &scopeObj->asCall();
if (!callObj->isForEval()) { if (!callObj->isForEval()) {
JSFunction *fun = &callObj->callee(); JSFunction *fun = &callObj->callee();
RawScript script = fun->nonLazyScript(); JSScript *script = fun->nonLazyScript();
if (!script->funHasExtensibleScope) if (!script->funHasExtensibleScope)
return; return;
} }

Просмотреть файл

@ -251,7 +251,7 @@ class IonCache
idempotent_ = true; idempotent_ = true;
} }
void setScriptedLocation(RawScript script, jsbytecode *pc) { void setScriptedLocation(JSScript *script, jsbytecode *pc) {
JS_ASSERT(!idempotent_); JS_ASSERT(!idempotent_);
this->script = script; this->script = script;
this->pc = pc; this->pc = pc;

Просмотреть файл

@ -381,7 +381,7 @@ struct IonScript
size_t safepointsSize() const { size_t safepointsSize() const {
return safepointsSize_; return safepointsSize_;
} }
RawScript getScript(size_t i) const { JSScript *getScript(size_t i) const {
JS_ASSERT(i < scriptEntries_); JS_ASSERT(i < scriptEntries_);
return scriptList()[i]; return scriptList()[i];
} }

Просмотреть файл

@ -389,7 +389,7 @@ class IonActivation
// Called from JSCompartment::discardJitCode(). // Called from JSCompartment::discardJitCode().
void InvalidateAll(FreeOp *fop, JS::Zone *zone); void InvalidateAll(FreeOp *fop, JS::Zone *zone);
void FinishInvalidation(FreeOp *fop, RawScript script); void FinishInvalidation(FreeOp *fop, JSScript *script);
} // namespace ion } // namespace ion
} // namespace js } // namespace js

Просмотреть файл

@ -19,7 +19,7 @@ template <class Op>
inline void inline void
SnapshotIterator::readFrameArgs(Op &op, const Value *argv, Value *scopeChain, Value *thisv, SnapshotIterator::readFrameArgs(Op &op, const Value *argv, Value *scopeChain, Value *thisv,
unsigned start, unsigned formalEnd, unsigned iterEnd, unsigned start, unsigned formalEnd, unsigned iterEnd,
RawScript script) JSScript *script)
{ {
if (scopeChain) if (scopeChain)
*scopeChain = read(); *scopeChain = read();

Просмотреть файл

@ -153,7 +153,7 @@ class IonFrameIterator
JSFunction *callee() const; JSFunction *callee() const;
JSFunction *maybeCallee() const; JSFunction *maybeCallee() const;
unsigned numActualArgs() const; unsigned numActualArgs() const;
RawScript script() const; JSScript *script() const;
void baselineScriptAndPc(JSScript **scriptRes, jsbytecode **pcRes) const; void baselineScriptAndPc(JSScript **scriptRes, jsbytecode **pcRes) const;
Value *nativeVp() const; Value *nativeVp() const;
Value *actualArgs() const; Value *actualArgs() const;
@ -270,7 +270,7 @@ class SnapshotIterator : public SnapshotReader
template <class Op> template <class Op>
inline void readFrameArgs(Op &op, const Value *argv, Value *scopeChain, Value *thisv, inline void readFrameArgs(Op &op, const Value *argv, Value *scopeChain, Value *thisv,
unsigned start, unsigned formalEnd, unsigned iterEnd, unsigned start, unsigned formalEnd, unsigned iterEnd,
RawScript script); JSScript *script);
Value maybeReadSlotByIndex(size_t index) { Value maybeReadSlotByIndex(size_t index) {
while (index--) { while (index--) {
@ -324,7 +324,7 @@ class InlineFrameIteratorMaybeGC
template <class Op> template <class Op>
inline void forEachCanonicalActualArg(JSContext *cx, Op op, unsigned start, unsigned count) const; inline void forEachCanonicalActualArg(JSContext *cx, Op op, unsigned start, unsigned count) const;
RawScript script() const { JSScript *script() const {
return script_; return script_;
} }
jsbytecode *pc() const { jsbytecode *pc() const {

Просмотреть файл

@ -101,7 +101,7 @@ IonFrameIterator::frameSize() const
} }
// Returns the JSScript associated with the topmost Ion frame. // Returns the JSScript associated with the topmost Ion frame.
inline RawScript inline JSScript *
GetTopIonJSScript(PerThreadData *pt, const SafepointIndex **safepointIndexOut, void **returnAddrOut) GetTopIonJSScript(PerThreadData *pt, const SafepointIndex **safepointIndexOut, void **returnAddrOut)
{ {
IonFrameIterator iter(pt->ionTop); IonFrameIterator iter(pt->ionTop);
@ -126,7 +126,7 @@ GetTopIonJSScript(PerThreadData *pt, const SafepointIndex **safepointIndexOut, v
} }
inline RawScript inline JSScript *
GetTopIonJSScript(JSContext *cx, const SafepointIndex **safepointIndexOut, void **returnAddrOut) GetTopIonJSScript(JSContext *cx, const SafepointIndex **safepointIndexOut, void **returnAddrOut)
{ {
return GetTopIonJSScript(&cx->mainThread(), safepointIndexOut, returnAddrOut); return GetTopIonJSScript(&cx->mainThread(), safepointIndexOut, returnAddrOut);

Просмотреть файл

@ -59,7 +59,7 @@ bool
IonFrameIterator::checkInvalidation(IonScript **ionScriptOut) const IonFrameIterator::checkInvalidation(IonScript **ionScriptOut) const
{ {
uint8_t *returnAddr = returnAddressToFp(); uint8_t *returnAddr = returnAddressToFp();
RawScript script = this->script(); JSScript *script = this->script();
// N.B. the current IonScript is not the same as the frame's // N.B. the current IonScript is not the same as the frame's
// IonScript if the frame has since been invalidated. // IonScript if the frame has since been invalidated.
bool invalidated; bool invalidated;
@ -174,13 +174,13 @@ IonFrameIterator::isEntryJSFrame() const
return true; return true;
} }
RawScript JSScript *
IonFrameIterator::script() const IonFrameIterator::script() const
{ {
JS_ASSERT(isScripted()); JS_ASSERT(isScripted());
if (isBaselineJS()) if (isBaselineJS())
return baselineFrame()->script(); return baselineFrame()->script();
RawScript script = ScriptFromCalleeToken(calleeToken()); JSScript *script = ScriptFromCalleeToken(calleeToken());
JS_ASSERT(script); JS_ASSERT(script);
return script; return script;
} }
@ -189,7 +189,7 @@ void
IonFrameIterator::baselineScriptAndPc(JSScript **scriptRes, jsbytecode **pcRes) const IonFrameIterator::baselineScriptAndPc(JSScript **scriptRes, jsbytecode **pcRes) const
{ {
JS_ASSERT(isBaselineJS()); JS_ASSERT(isBaselineJS());
RawScript script = this->script(); JSScript *script = this->script();
if (scriptRes) if (scriptRes)
*scriptRes = script; *scriptRes = script;
uint8_t *retAddr = returnAddressToFp(); uint8_t *retAddr = returnAddressToFp();
@ -474,7 +474,7 @@ HandleException(ResumeFromException *rfe)
// When profiling, each frame popped needs a notification that // When profiling, each frame popped needs a notification that
// the function has exited, so invoke the probe that a function // the function has exited, so invoke the probe that a function
// is exiting. // is exiting.
RawScript script = frames.script(); JSScript *script = frames.script();
Probes::exitScript(cx, script, script->function(), NULL); Probes::exitScript(cx, script, script->function(), NULL);
if (!frames.more()) if (!frames.more())
break; break;
@ -494,7 +494,7 @@ HandleException(ResumeFromException *rfe)
return; return;
// Unwind profiler pseudo-stack // Unwind profiler pseudo-stack
RawScript script = iter.script(); JSScript *script = iter.script();
Probes::exitScript(cx, script, script->function(), NULL); Probes::exitScript(cx, script, script->function(), NULL);
if (cx->compartment->debugMode() && !calledDebugEpilogue) { if (cx->compartment->debugMode() && !calledDebugEpilogue) {
@ -633,7 +633,7 @@ MarkCalleeToken(JSTracer *trc, CalleeToken token)
} }
case CalleeToken_Script: case CalleeToken_Script:
{ {
RawScript script = CalleeTokenToScript(token); JSScript *script = CalleeTokenToScript(token);
MarkScriptRoot(trc, &script, "ion-entry"); MarkScriptRoot(trc, &script, "ion-entry");
JS_ASSERT(script == CalleeTokenToScript(token)); JS_ASSERT(script == CalleeTokenToScript(token));
break; break;

Просмотреть файл

@ -49,7 +49,7 @@ CalleeToParallelToken(JSFunction *fun)
return CalleeToken(uintptr_t(fun) | uintptr_t(CalleeToken_ParallelFunction)); return CalleeToken(uintptr_t(fun) | uintptr_t(CalleeToken_ParallelFunction));
} }
static inline CalleeToken static inline CalleeToken
CalleeToToken(RawScript script) CalleeToToken(JSScript *script)
{ {
return CalleeToken(uintptr_t(script) | uintptr_t(CalleeToken_Script)); return CalleeToken(uintptr_t(script) | uintptr_t(CalleeToken_Script));
} }
@ -70,14 +70,14 @@ CalleeTokenToParallelFunction(CalleeToken token)
JS_ASSERT(GetCalleeTokenTag(token) == CalleeToken_ParallelFunction); JS_ASSERT(GetCalleeTokenTag(token) == CalleeToken_ParallelFunction);
return (JSFunction *)(uintptr_t(token) & ~uintptr_t(0x3)); return (JSFunction *)(uintptr_t(token) & ~uintptr_t(0x3));
} }
static inline RawScript static inline JSScript *
CalleeTokenToScript(CalleeToken token) CalleeTokenToScript(CalleeToken token)
{ {
JS_ASSERT(GetCalleeTokenTag(token) == CalleeToken_Script); JS_ASSERT(GetCalleeTokenTag(token) == CalleeToken_Script);
return (RawScript)(uintptr_t(token) & ~uintptr_t(0x3)); return (JSScript *)(uintptr_t(token) & ~uintptr_t(0x3));
} }
static inline RawScript static inline JSScript *
ScriptFromCalleeToken(CalleeToken token) ScriptFromCalleeToken(CalleeToken token)
{ {
switch (GetCalleeTokenTag(token)) { switch (GetCalleeTokenTag(token)) {
@ -293,7 +293,7 @@ MakeFrameDescriptor(uint32_t frameSize, FrameType type)
namespace js { namespace js {
namespace ion { namespace ion {
RawScript JSScript *
GetTopIonJSScript(JSContext *cx, GetTopIonJSScript(JSContext *cx,
const SafepointIndex **safepointIndexOut = NULL, const SafepointIndex **safepointIndexOut = NULL,
void **returnAddrOut = NULL); void **returnAddrOut = NULL);

Просмотреть файл

@ -763,7 +763,7 @@ class MacroAssembler : public MacroAssemblerSpecific
bind(&stackFull); bind(&stackFull);
} }
void spsPushFrame(SPSProfiler *p, const char *str, RawScript s, Register temp) { void spsPushFrame(SPSProfiler *p, const char *str, JSScript *s, Register temp) {
Label stackFull; Label stackFull;
spsProfileEntryAddress(p, 0, temp, &stackFull); spsProfileEntryAddress(p, 0, temp, &stackFull);

Просмотреть файл

@ -176,7 +176,7 @@ JSONSpewer::init(const char *path)
} }
void void
JSONSpewer::beginFunction(RawScript script) JSONSpewer::beginFunction(JSScript *script)
{ {
if (inFunction_) if (inFunction_)
endFunction(); endFunction();

Просмотреть файл

@ -60,7 +60,7 @@ class JSONSpewer
~JSONSpewer(); ~JSONSpewer();
bool init(const char *path); bool init(const char *path);
void beginFunction(RawScript script); void beginFunction(JSScript *script);
void beginPass(const char * pass); void beginPass(const char * pass);
void spewMDef(MDefinition *def); void spewMDef(MDefinition *def);
void spewMResumePoint(MResumePoint *rp); void spewMResumePoint(MResumePoint *rp);

Просмотреть файл

@ -4354,7 +4354,7 @@ class LFunctionBoundary : public LInstructionHelper<0, 0, 1>
return getTemp(0); return getTemp(0);
} }
RawScript script() { JSScript *script() {
return mir_->toFunctionBoundary()->script(); return mir_->toFunctionBoundary()->script();
} }

Просмотреть файл

@ -395,7 +395,7 @@ MConstant::printOpcode(FILE *fp)
fputs("unnamed function", fp); fputs("unnamed function", fp);
} }
if (fun->hasScript()) { if (fun->hasScript()) {
RawScript script = fun->nonLazyScript(); JSScript *script = fun->nonLazyScript();
fprintf(fp, " (%s:%u)", fprintf(fp, " (%s:%u)",
script->filename() ? script->filename() : "", script->lineno); script->filename() ? script->filename() : "", script->lineno);
} }

Просмотреть файл

@ -5849,7 +5849,7 @@ class MBindNameCache
CompilerRootScript script_; CompilerRootScript script_;
jsbytecode *pc_; jsbytecode *pc_;
MBindNameCache(MDefinition *scopeChain, PropertyName *name, RawScript script, jsbytecode *pc) MBindNameCache(MDefinition *scopeChain, PropertyName *name, JSScript *script, jsbytecode *pc)
: MUnaryInstruction(scopeChain), name_(name), script_(script), pc_(pc) : MUnaryInstruction(scopeChain), name_(name), script_(script), pc_(pc)
{ {
setResultType(MIRType_Object); setResultType(MIRType_Object);
@ -5858,7 +5858,7 @@ class MBindNameCache
public: public:
INSTRUCTION_HEADER(BindNameCache) INSTRUCTION_HEADER(BindNameCache)
static MBindNameCache *New(MDefinition *scopeChain, PropertyName *name, RawScript script, static MBindNameCache *New(MDefinition *scopeChain, PropertyName *name, JSScript *script,
jsbytecode *pc) { jsbytecode *pc) {
return new MBindNameCache(scopeChain, name, script, pc); return new MBindNameCache(scopeChain, name, script, pc);
} }
@ -5872,7 +5872,7 @@ class MBindNameCache
PropertyName *name() const { PropertyName *name() const {
return name_; return name_;
} }
RawScript script() const { JSScript *script() const {
return script_; return script_;
} }
jsbytecode *pc() const { jsbytecode *pc() const {
@ -7334,7 +7334,7 @@ class MFunctionBoundary : public MNullaryInstruction
Type type_; Type type_;
unsigned inlineLevel_; unsigned inlineLevel_;
MFunctionBoundary(RawScript script, Type type, unsigned inlineLevel) MFunctionBoundary(JSScript *script, Type type, unsigned inlineLevel)
: script_(script), type_(type), inlineLevel_(inlineLevel) : script_(script), type_(type), inlineLevel_(inlineLevel)
{ {
JS_ASSERT_IF(type != Inline_Exit, script != NULL); JS_ASSERT_IF(type != Inline_Exit, script != NULL);
@ -7345,12 +7345,12 @@ class MFunctionBoundary : public MNullaryInstruction
public: public:
INSTRUCTION_HEADER(FunctionBoundary) INSTRUCTION_HEADER(FunctionBoundary)
static MFunctionBoundary *New(RawScript script, Type type, static MFunctionBoundary *New(JSScript *script, Type type,
unsigned inlineLevel = 0) { unsigned inlineLevel = 0) {
return new MFunctionBoundary(script, type, inlineLevel); return new MFunctionBoundary(script, type, inlineLevel);
} }
RawScript script() { JSScript *script() {
return script_; return script_;
} }

Просмотреть файл

@ -510,11 +510,11 @@ class MIRGraph
MStart *osrStart_; MStart *osrStart_;
// List of compiled/inlined scripts. // List of compiled/inlined scripts.
Vector<RawScript, 4, IonAllocPolicy> scripts_; Vector<JSScript *, 4, IonAllocPolicy> scripts_;
// List of possible scripts that this graph may call. Currently this is // List of possible scripts that this graph may call. Currently this is
// only tracked when compiling for parallel execution. // only tracked when compiling for parallel execution.
Vector<RawScript, 4, IonAllocPolicy> callTargets_; Vector<JSScript *, 4, IonAllocPolicy> callTargets_;
size_t numBlocks_; size_t numBlocks_;
@ -634,7 +634,7 @@ class MIRGraph
MStart *osrStart() { MStart *osrStart() {
return osrStart_; return osrStart_;
} }
bool addScript(RawScript script) { bool addScript(JSScript *script) {
// The same script may be inlined multiple times, add it only once. // The same script may be inlined multiple times, add it only once.
for (size_t i = 0; i < scripts_.length(); i++) { for (size_t i = 0; i < scripts_.length(); i++) {
if (scripts_[i] == script) if (scripts_[i] == script)
@ -648,7 +648,7 @@ class MIRGraph
JSScript **scripts() { JSScript **scripts() {
return scripts_.begin(); return scripts_.begin();
} }
bool addCallTarget(RawScript script) { bool addCallTarget(JSScript *script) {
for (size_t i = 0; i < callTargets_.length(); i++) { for (size_t i = 0; i < callTargets_.length(); i++) {
if (callTargets_[i] == script) if (callTargets_[i] == script)
return true; return true;

Просмотреть файл

@ -47,7 +47,7 @@ class ParallelCompileContext
} }
// Defined in Ion.cpp, so that they can make use of static fns defined there // Defined in Ion.cpp, so that they can make use of static fns defined there
MethodStatus checkScriptSize(JSContext *cx, RawScript script); MethodStatus checkScriptSize(JSContext *cx, JSScript *script);
MethodStatus compileTransitively(); MethodStatus compileTransitively();
AbortReason compile(IonBuilder *builder, MIRGraph *graph, AbortReason compile(IonBuilder *builder, MIRGraph *graph,
ScopedJSDeletePtr<LifoAlloc> &autoDelete); ScopedJSDeletePtr<LifoAlloc> &autoDelete);

Просмотреть файл

@ -19,7 +19,7 @@ struct PcScriptCacheEntry
{ {
uint8_t *returnAddress; // Key into the hash table. uint8_t *returnAddress; // Key into the hash table.
jsbytecode *pc; // Cached PC. jsbytecode *pc; // Cached PC.
RawScript script; // Cached script. JSScript *script; // Cached script.
}; };
struct PcScriptCache struct PcScriptCache
@ -45,7 +45,7 @@ struct PcScriptCache
bool get(JSRuntime *rt, uint32_t hash, uint8_t *addr, bool get(JSRuntime *rt, uint32_t hash, uint8_t *addr,
JSScript **scriptRes, jsbytecode **pcRes); JSScript **scriptRes, jsbytecode **pcRes);
void add(uint32_t hash, uint8_t *addr, jsbytecode *pc, RawScript script) { void add(uint32_t hash, uint8_t *addr, jsbytecode *pc, JSScript *script) {
entries[hash].returnAddress = addr; entries[hash].returnAddress = addr;
entries[hash].pc = pc; entries[hash].pc = pc;
entries[hash].script = script; entries[hash].script = script;

Просмотреть файл

@ -33,7 +33,7 @@ class SnapshotWriter
public: public:
SnapshotOffset startSnapshot(uint32_t frameCount, BailoutKind kind, bool resumeAfter); SnapshotOffset startSnapshot(uint32_t frameCount, BailoutKind kind, bool resumeAfter);
void startFrame(JSFunction *fun, RawScript script, jsbytecode *pc, uint32_t exprStack); void startFrame(JSFunction *fun, JSScript *script, jsbytecode *pc, uint32_t exprStack);
#ifdef TRACK_SNAPSHOTS #ifdef TRACK_SNAPSHOTS
void trackFrame(uint32_t pcOpcode, uint32_t mirOpcode, uint32_t mirId, void trackFrame(uint32_t pcOpcode, uint32_t mirOpcode, uint32_t mirId,
uint32_t lirOpcode, uint32_t lirId); uint32_t lirOpcode, uint32_t lirId);

Просмотреть файл

@ -30,7 +30,7 @@ using namespace js::ion;
// Snapshot body, repeated "frame count" times, from oldest frame to newest frame. // Snapshot body, repeated "frame count" times, from oldest frame to newest frame.
// Note that the first frame doesn't have the "parent PC" field. // Note that the first frame doesn't have the "parent PC" field.
// //
// [ptr] Debug only: RawScript // [ptr] Debug only: JSScript *
// [vwu] pc offset // [vwu] pc offset
// [vwu] # of slots, including nargs // [vwu] # of slots, including nargs
// [slot*] N slot entries, where N = nargs + nfixed + stackDepth // [slot*] N slot entries, where N = nargs + nfixed + stackDepth
@ -296,7 +296,7 @@ SnapshotWriter::startSnapshot(uint32_t frameCount, BailoutKind kind, bool resume
} }
void void
SnapshotWriter::startFrame(JSFunction *fun, RawScript script, jsbytecode *pc, uint32_t exprStack) SnapshotWriter::startFrame(JSFunction *fun, JSScript *script, jsbytecode *pc, uint32_t exprStack)
{ {
JS_ASSERT(CountArgSlots(script, fun) < SNAPSHOT_MAX_NARGS); JS_ASSERT(CountArgSlots(script, fun) < SNAPSHOT_MAX_NARGS);

Просмотреть файл

@ -254,7 +254,7 @@ template <> struct TypeToArgProperties<Handle<StaticBlockObject *> > {
static const uint32_t result = TypeToArgProperties<StaticBlockObject *>::result | VMFunction::ByRef; static const uint32_t result = TypeToArgProperties<StaticBlockObject *>::result | VMFunction::ByRef;
}; };
template <> struct TypeToArgProperties<HandleScript> { template <> struct TypeToArgProperties<HandleScript> {
static const uint32_t result = TypeToArgProperties<RawScript>::result | VMFunction::ByRef; static const uint32_t result = TypeToArgProperties<JSScript *>::result | VMFunction::ByRef;
}; };
template <> struct TypeToArgProperties<HandleValue> { template <> struct TypeToArgProperties<HandleValue> {
static const uint32_t result = TypeToArgProperties<Value>::result | VMFunction::ByRef; static const uint32_t result = TypeToArgProperties<Value>::result | VMFunction::ByRef;

Просмотреть файл

@ -374,14 +374,14 @@ class OutOfLineCode : public TempObject
uint32_t framePushed() const { uint32_t framePushed() const {
return framePushed_; return framePushed_;
} }
void setSource(RawScript script, jsbytecode *pc) { void setSource(JSScript *script, jsbytecode *pc) {
script_ = script; script_ = script;
pc_ = pc; pc_ = pc;
} }
jsbytecode *pc() { jsbytecode *pc() {
return pc_; return pc_;
} }
RawScript script() { JSScript *script() {
return script_; return script_;
} }
}; };

Просмотреть файл

@ -1958,7 +1958,7 @@ CrossScriptSSA::foldValue(const CrossSSAValue &cv)
const Frame &frame = getFrame(cv.frame); const Frame &frame = getFrame(cv.frame);
const SSAValue &v = cv.v; const SSAValue &v = cv.v;
RawScript parentScript = NULL; JSScript *parentScript = NULL;
ScriptAnalysis *parentAnalysis = NULL; ScriptAnalysis *parentAnalysis = NULL;
if (frame.parent != INVALID_FRAME) { if (frame.parent != INVALID_FRAME) {
parentScript = getFrame(frame.parent).script; parentScript = getFrame(frame.parent).script;
@ -1991,7 +1991,7 @@ CrossScriptSSA::foldValue(const CrossSSAValue &cv)
* If there is a single inline callee with a single return site, * If there is a single inline callee with a single return site,
* propagate back to that. * propagate back to that.
*/ */
RawScript callee = NULL; JSScript *callee = NULL;
uint32_t calleeFrame = INVALID_FRAME; uint32_t calleeFrame = INVALID_FRAME;
for (unsigned i = 0; i < numFrames(); i++) { for (unsigned i = 0; i < numFrames(); i++) {
if (iterFrame(i).parent == cv.frame && iterFrame(i).parentpc == pc) { if (iterFrame(i).parent == cv.frame && iterFrame(i).parentpc == pc) {

Просмотреть файл

@ -172,7 +172,7 @@ class Bytecode
}; };
static inline unsigned static inline unsigned
GetDefCount(RawScript script, unsigned offset) GetDefCount(JSScript *script, unsigned offset)
{ {
JS_ASSERT(offset < script->length); JS_ASSERT(offset < script->length);
jsbytecode *pc = script->code + offset; jsbytecode *pc = script->code + offset;
@ -199,7 +199,7 @@ GetDefCount(RawScript script, unsigned offset)
} }
static inline unsigned static inline unsigned
GetUseCount(RawScript script, unsigned offset) GetUseCount(JSScript *script, unsigned offset)
{ {
JS_ASSERT(offset < script->length); JS_ASSERT(offset < script->length);
jsbytecode *pc = script->code + offset; jsbytecode *pc = script->code + offset;
@ -326,7 +326,7 @@ NegateCompareOp(JSOp op)
} }
static inline unsigned static inline unsigned
FollowBranch(JSContext *cx, RawScript script, unsigned offset) FollowBranch(JSContext *cx, JSScript *script, unsigned offset)
{ {
/* /*
* Get the target offset of a branch. For GOTO opcodes implementing * Get the target offset of a branch. For GOTO opcodes implementing
@ -354,18 +354,18 @@ static inline uint32_t ThisSlot() {
static inline uint32_t ArgSlot(uint32_t arg) { static inline uint32_t ArgSlot(uint32_t arg) {
return 2 + arg; return 2 + arg;
} }
static inline uint32_t LocalSlot(RawScript script, uint32_t local) { static inline uint32_t LocalSlot(JSScript *script, uint32_t local) {
return 2 + (script->function() ? script->function()->nargs : 0) + local; return 2 + (script->function() ? script->function()->nargs : 0) + local;
} }
static inline uint32_t TotalSlots(RawScript script) { static inline uint32_t TotalSlots(JSScript *script) {
return LocalSlot(script, 0) + script->nfixed; return LocalSlot(script, 0) + script->nfixed;
} }
static inline uint32_t StackSlot(RawScript script, uint32_t index) { static inline uint32_t StackSlot(JSScript *script, uint32_t index) {
return TotalSlots(script) + index; return TotalSlots(script) + index;
} }
static inline uint32_t GetBytecodeSlot(RawScript script, jsbytecode *pc) static inline uint32_t GetBytecodeSlot(JSScript *script, jsbytecode *pc)
{ {
switch (JSOp(*pc)) { switch (JSOp(*pc)) {
@ -541,7 +541,7 @@ struct LifetimeVariable
} }
/* Return true if the variable cannot decrease during the body of a loop. */ /* Return true if the variable cannot decrease during the body of a loop. */
bool nonDecreasing(RawScript script, LoopAnalysis *loop) const { bool nonDecreasing(JSScript *script, LoopAnalysis *loop) const {
Lifetime *segment = lifetime ? lifetime : saved; Lifetime *segment = lifetime ? lifetime : saved;
while (segment && segment->start <= loop->backedge) { while (segment && segment->start <= loop->backedge) {
if (segment->start >= loop->head && segment->write) { if (segment->start >= loop->head && segment->write) {
@ -858,7 +858,7 @@ class ScriptAnalysis
public: public:
ScriptAnalysis(RawScript script) { ScriptAnalysis(JSScript *script) {
mozilla::PodZero(this); mozilla::PodZero(this);
this->script_ = script; this->script_ = script;
#ifdef DEBUG #ifdef DEBUG
@ -1231,7 +1231,7 @@ class CrossScriptSSA
uint32_t parent; uint32_t parent;
jsbytecode *parentpc; jsbytecode *parentpc;
Frame(uint32_t index, RawScript script, uint32_t depth, uint32_t parent, Frame(uint32_t index, JSScript *script, uint32_t depth, uint32_t parent,
jsbytecode *parentpc) jsbytecode *parentpc)
: index(index), script(script), depth(depth), parent(parent), parentpc(parentpc) : index(index), script(script), depth(depth), parent(parent), parentpc(parentpc)
{} {}
@ -1250,7 +1250,7 @@ class CrossScriptSSA
return inlineFrames[i - 1]; return inlineFrames[i - 1];
} }
RawScript outerScript() { return outerFrame.script; } JSScript *outerScript() { return outerFrame.script; }
/* Total length of scripts preceding a frame. */ /* Total length of scripts preceding a frame. */
size_t frameLength(uint32_t index) { size_t frameLength(uint32_t index) {
@ -1266,14 +1266,14 @@ class CrossScriptSSA
return getFrame(cv.frame).script->analysis()->getValueTypes(cv.v); return getFrame(cv.frame).script->analysis()->getValueTypes(cv.v);
} }
bool addInlineFrame(RawScript script, uint32_t depth, uint32_t parent, bool addInlineFrame(JSScript *script, uint32_t depth, uint32_t parent,
jsbytecode *parentpc) jsbytecode *parentpc)
{ {
uint32_t index = inlineFrames.length(); uint32_t index = inlineFrames.length();
return inlineFrames.append(Frame(index, script, depth, parent, parentpc)); return inlineFrames.append(Frame(index, script, depth, parent, parentpc));
} }
CrossScriptSSA(JSContext *cx, RawScript outer) CrossScriptSSA(JSContext *cx, JSScript *outer)
: outerFrame(OUTER_FRAME, outer, 0, INVALID_FRAME, NULL), inlineFrames(cx) : outerFrame(OUTER_FRAME, outer, 0, INVALID_FRAME, NULL), inlineFrames(cx)
{} {}

Просмотреть файл

@ -7198,7 +7198,7 @@ JS::AssertArgumentsAreSane(JSContext *cx, const JS::Value &value)
#endif /* DEBUG */ #endif /* DEBUG */
JS_PUBLIC_API(void *) JS_PUBLIC_API(void *)
JS_EncodeScript(JSContext *cx, RawScript scriptArg, uint32_t *lengthp) JS_EncodeScript(JSContext *cx, JSScript *scriptArg, uint32_t *lengthp)
{ {
XDREncoder encoder(cx); XDREncoder encoder(cx);
RootedScript script(cx, scriptArg); RootedScript script(cx, scriptArg);

Просмотреть файл

@ -1552,7 +1552,7 @@ MatchNumericComparator(const Value &v)
if (!fun->hasScript()) if (!fun->hasScript())
return Match_None; return Match_None;
RawScript script = fun->nonLazyScript(); JSScript *script = fun->nonLazyScript();
jsbytecode *pc = script->code; jsbytecode *pc = script->code;
uint16_t arg0, arg1; uint16_t arg0, arg1;

Просмотреть файл

@ -565,7 +565,7 @@ checkReportFlags(JSContext *cx, unsigned *flags)
* We assume that if the top frame is a native, then it is strict if * We assume that if the top frame is a native, then it is strict if
* the nearest scripted frame is strict, see bug 536306. * the nearest scripted frame is strict, see bug 536306.
*/ */
RawScript script = cx->stack.currentScript(); JSScript *script = cx->stack.currentScript();
if (script && script->strict) if (script && script->strict)
*flags &= ~JSREPORT_WARNING; *flags &= ~JSREPORT_WARNING;
else if (cx->hasStrictOption()) else if (cx->hasStrictOption())

Просмотреть файл

@ -383,7 +383,7 @@ JS_ClearAllWatchPoints(JSContext *cx)
/************************************************************************/ /************************************************************************/
JS_PUBLIC_API(unsigned) JS_PUBLIC_API(unsigned)
JS_PCToLineNumber(JSContext *cx, RawScript script, jsbytecode *pc) JS_PCToLineNumber(JSContext *cx, JSScript *script, jsbytecode *pc)
{ {
return js::PCToLineNumber(script, pc); return js::PCToLineNumber(script, pc);
} }
@ -517,7 +517,7 @@ JS_GetFunctionScript(JSContext *cx, JSFunction *fun)
if (fun->isInterpretedLazy()) { if (fun->isInterpretedLazy()) {
RootedFunction rootedFun(cx, fun); RootedFunction rootedFun(cx, fun);
AutoCompartment funCompartment(cx, rootedFun); AutoCompartment funCompartment(cx, rootedFun);
RawScript script = rootedFun->getOrCreateScript(cx); JSScript *script = rootedFun->getOrCreateScript(cx);
if (!script) if (!script)
MOZ_CRASH(); MOZ_CRASH();
return script; return script;

Просмотреть файл

@ -140,9 +140,9 @@ JS_ClearAllWatchPoints(JSContext *cx);
/************************************************************************/ /************************************************************************/
// RawScript because this needs to be callable from a signal handler // Raw JSScript* because this needs to be callable from a signal handler.
extern JS_PUBLIC_API(unsigned) extern JS_PUBLIC_API(unsigned)
JS_PCToLineNumber(JSContext *cx, js::RawScript script, jsbytecode *pc); JS_PCToLineNumber(JSContext *cx, JSScript *script, jsbytecode *pc);
extern JS_PUBLIC_API(jsbytecode *) extern JS_PUBLIC_API(jsbytecode *)
JS_LineNumberToPC(JSContext *cx, JSScript *script, unsigned lineno); JS_LineNumberToPC(JSContext *cx, JSScript *script, unsigned lineno);

Просмотреть файл

@ -720,7 +720,7 @@ JS_FRIEND_API(void)
EnableRuntimeProfilingStack(JSRuntime *rt, bool enabled); EnableRuntimeProfilingStack(JSRuntime *rt, bool enabled);
JS_FRIEND_API(jsbytecode*) JS_FRIEND_API(jsbytecode*)
ProfilingGetPC(JSRuntime *rt, RawScript script, void *ip); ProfilingGetPC(JSRuntime *rt, JSScript *script, void *ip);
#ifdef JS_THREADSAFE #ifdef JS_THREADSAFE
JS_FRIEND_API(void *) JS_FRIEND_API(void *)

Просмотреть файл

@ -126,7 +126,7 @@ fun_getProperty(JSContext *cx, HandleObject obj_, HandleId id, MutableHandleValu
// IonMonkey does not guarantee |f.arguments| can be // IonMonkey does not guarantee |f.arguments| can be
// fully recovered, so we try to mitigate observing this behavior by // fully recovered, so we try to mitigate observing this behavior by
// detecting its use early. // detecting its use early.
RawScript script = iter.script(); JSScript *script = iter.script();
ion::ForbidCompilation(cx, script); ion::ForbidCompilation(cx, script);
#endif #endif
@ -1164,7 +1164,7 @@ fun_isGenerator(JSContext *cx, unsigned argc, Value *vp)
bool result = false; bool result = false;
if (fun->hasScript()) { if (fun->hasScript()) {
RawScript script = fun->nonLazyScript(); JSScript *script = fun->nonLazyScript();
JS_ASSERT(script->length != 0); JS_ASSERT(script->length != 0);
result = script->isGenerator; result = script->isGenerator;
} }

Просмотреть файл

@ -208,7 +208,7 @@ class JSFunction : public JSObject
bool initializeLazyScript(JSContext *cx); bool initializeLazyScript(JSContext *cx);
js::RawScript getOrCreateScript(JSContext *cx) { JSScript *getOrCreateScript(JSContext *cx) {
JS_ASSERT(isInterpreted()); JS_ASSERT(isInterpreted());
JS_ASSERT(cx); JS_ASSERT(cx);
if (isInterpretedLazy()) { if (isInterpretedLazy()) {
@ -233,12 +233,12 @@ class JSFunction : public JSObject
return fun->hasScript(); return fun->hasScript();
} }
js::RawScript nonLazyScript() const { JSScript *nonLazyScript() const {
JS_ASSERT(hasScript()); JS_ASSERT(hasScript());
return JS::HandleScript::fromMarkedLocation(&u.i.script_); return JS::HandleScript::fromMarkedLocation(&u.i.script_);
} }
js::RawScript maybeNonLazyScript() const { JSScript *maybeNonLazyScript() const {
return isInterpreted() ? nonLazyScript() : NULL; return isInterpreted() ? nonLazyScript() : NULL;
} }

Просмотреть файл

@ -4945,7 +4945,7 @@ js::StopPCCountProfiling(JSContext *cx)
for (ZonesIter zone(rt); !zone.done(); zone.next()) { for (ZonesIter zone(rt); !zone.done(); zone.next()) {
for (CellIter i(zone, FINALIZE_SCRIPT); !i.done(); i.next()) { for (CellIter i(zone, FINALIZE_SCRIPT); !i.done(); i.next()) {
RawScript script = i.get<JSScript>(); JSScript *script = i.get<JSScript>();
if (script->hasScriptCounts && script->types) { if (script->hasScriptCounts && script->types) {
ScriptAndCounts sac; ScriptAndCounts sac;
sac.script = script; sac.script = script;

Просмотреть файл

@ -671,7 +671,7 @@ enum PropertyAccessKind {
template <PropertyAccessKind access> template <PropertyAccessKind access>
class TypeConstraintProp : public TypeConstraint class TypeConstraintProp : public TypeConstraint
{ {
RawScript script_; JSScript *script_;
public: public:
jsbytecode *pc; jsbytecode *pc;
@ -685,7 +685,7 @@ class TypeConstraintProp : public TypeConstraint
/* Property being accessed. This is unrooted. */ /* Property being accessed. This is unrooted. */
RawId id; RawId id;
TypeConstraintProp(RawScript script, jsbytecode *pc, StackTypeSet *target, RawId id) TypeConstraintProp(JSScript *script, jsbytecode *pc, StackTypeSet *target, RawId id)
: script_(script), pc(pc), target(target), id(id) : script_(script), pc(pc), target(target), id(id)
{ {
JS_ASSERT(script && pc && target); JS_ASSERT(script && pc && target);
@ -738,7 +738,7 @@ HeapTypeSet::addGetProperty(JSContext *cx, JSScript *script, jsbytecode *pc,
template <PropertyAccessKind access> template <PropertyAccessKind access>
class TypeConstraintCallProp : public TypeConstraint class TypeConstraintCallProp : public TypeConstraint
{ {
RawScript script_; JSScript *script_;
public: public:
jsbytecode *callpc; jsbytecode *callpc;
@ -746,7 +746,7 @@ class TypeConstraintCallProp : public TypeConstraint
/* Property being accessed. */ /* Property being accessed. */
jsid id; jsid id;
TypeConstraintCallProp(RawScript script, jsbytecode *callpc, jsid id) TypeConstraintCallProp(JSScript *script, jsbytecode *callpc, jsid id)
: script_(script), callpc(callpc), id(id) : script_(script), callpc(callpc), id(id)
{ {
JS_ASSERT(script && callpc); JS_ASSERT(script && callpc);
@ -783,7 +783,7 @@ HeapTypeSet::addCallProperty(JSContext *cx, JSScript *script, jsbytecode *pc, js
*/ */
class TypeConstraintSetElement : public TypeConstraint class TypeConstraintSetElement : public TypeConstraint
{ {
RawScript script_; JSScript *script_;
public: public:
jsbytecode *pc; jsbytecode *pc;
@ -791,7 +791,7 @@ class TypeConstraintSetElement : public TypeConstraint
StackTypeSet *objectTypes; StackTypeSet *objectTypes;
StackTypeSet *valueTypes; StackTypeSet *valueTypes;
TypeConstraintSetElement(RawScript script, jsbytecode *pc, TypeConstraintSetElement(JSScript *script, jsbytecode *pc,
StackTypeSet *objectTypes, StackTypeSet *valueTypes) StackTypeSet *objectTypes, StackTypeSet *valueTypes)
: script_(script), pc(pc), : script_(script), pc(pc),
objectTypes(objectTypes), valueTypes(valueTypes) objectTypes(objectTypes), valueTypes(valueTypes)
@ -841,7 +841,7 @@ StackTypeSet::addCall(JSContext *cx, TypeCallsite *site)
/* Constraints for arithmetic operations. */ /* Constraints for arithmetic operations. */
class TypeConstraintArith : public TypeConstraint class TypeConstraintArith : public TypeConstraint
{ {
RawScript script_; JSScript *script_;
public: public:
jsbytecode *pc; jsbytecode *pc;
@ -852,7 +852,7 @@ class TypeConstraintArith : public TypeConstraint
/* For addition operations, the other operand. */ /* For addition operations, the other operand. */
TypeSet *other; TypeSet *other;
TypeConstraintArith(RawScript script, jsbytecode *pc, TypeSet *target, TypeSet *other) TypeConstraintArith(JSScript *script, jsbytecode *pc, TypeSet *target, TypeSet *other)
: script_(script), pc(pc), target(target), other(other) : script_(script), pc(pc), target(target), other(other)
{ {
JS_ASSERT(target); JS_ASSERT(target);
@ -873,12 +873,12 @@ StackTypeSet::addArith(JSContext *cx, JSScript *script, jsbytecode *pc, TypeSet
/* Subset constraint which transforms primitive values into appropriate objects. */ /* Subset constraint which transforms primitive values into appropriate objects. */
class TypeConstraintTransformThis : public TypeConstraint class TypeConstraintTransformThis : public TypeConstraint
{ {
RawScript script_; JSScript *script_;
public: public:
TypeSet *target; TypeSet *target;
TypeConstraintTransformThis(RawScript script, TypeSet *target) TypeConstraintTransformThis(JSScript *script, TypeSet *target)
: script_(script), target(target) : script_(script), target(target)
{} {}
@ -899,14 +899,14 @@ StackTypeSet::addTransformThis(JSContext *cx, JSScript *script, TypeSet *target)
*/ */
class TypeConstraintPropagateThis : public TypeConstraint class TypeConstraintPropagateThis : public TypeConstraint
{ {
RawScript script_; JSScript *script_;
public: public:
jsbytecode *callpc; jsbytecode *callpc;
Type type; Type type;
StackTypeSet *types; StackTypeSet *types;
TypeConstraintPropagateThis(RawScript script, jsbytecode *callpc, Type type, StackTypeSet *types) TypeConstraintPropagateThis(JSScript *script, jsbytecode *callpc, Type type, StackTypeSet *types)
: script_(script), callpc(callpc), type(type), types(types) : script_(script), callpc(callpc), type(type), types(types)
{} {}
@ -1060,11 +1060,11 @@ void ScriptAnalysis::breakTypeBarriersSSA(JSContext *cx, const SSAValue &v)
class TypeConstraintSubsetBarrier : public TypeConstraint class TypeConstraintSubsetBarrier : public TypeConstraint
{ {
public: public:
RawScript script; JSScript *script;
jsbytecode *pc; jsbytecode *pc;
TypeSet *target; TypeSet *target;
TypeConstraintSubsetBarrier(RawScript script, jsbytecode *pc, TypeSet *target) TypeConstraintSubsetBarrier(JSScript *script, jsbytecode *pc, TypeSet *target)
: script(script), pc(pc), target(target) : script(script), pc(pc), target(target)
{} {}
@ -2338,7 +2338,7 @@ enum RecompileKind {
* compilation. * compilation.
*/ */
static inline bool static inline bool
JITCodeHasCheck(RawScript script, jsbytecode *pc, RecompileKind kind) JITCodeHasCheck(JSScript *script, jsbytecode *pc, RecompileKind kind)
{ {
if (kind == RECOMPILE_NONE) if (kind == RECOMPILE_NONE)
return false; return false;
@ -2380,7 +2380,7 @@ JITCodeHasCheck(RawScript script, jsbytecode *pc, RecompileKind kind)
* which this script was inlined into. * which this script was inlined into.
*/ */
static inline void static inline void
AddPendingRecompile(JSContext *cx, RawScript script, jsbytecode *pc, AddPendingRecompile(JSContext *cx, JSScript *script, jsbytecode *pc,
RecompileKind kind = RECOMPILE_NONE) RecompileKind kind = RECOMPILE_NONE)
{ {
/* /*
@ -2430,10 +2430,10 @@ AddPendingRecompile(JSContext *cx, RawScript script, jsbytecode *pc,
*/ */
class TypeConstraintFreezeStack : public TypeConstraint class TypeConstraintFreezeStack : public TypeConstraint
{ {
RawScript script_; JSScript *script_;
public: public:
TypeConstraintFreezeStack(RawScript script) TypeConstraintFreezeStack(JSScript *script)
: script_(script) : script_(script)
{} {}
@ -2637,7 +2637,7 @@ TypeCompartment::addAllocationSiteTypeObject(JSContext *cx, AllocationSiteKey ke
} }
static inline RawId static inline RawId
GetAtomId(JSContext *cx, RawScript script, const jsbytecode *pc, unsigned offset) GetAtomId(JSContext *cx, JSScript *script, const jsbytecode *pc, unsigned offset)
{ {
PropertyName *name = script->getName(GET_UINT32_INDEX(pc + offset)); PropertyName *name = script->getName(GET_UINT32_INDEX(pc + offset));
return IdToTypeId(NameToId(name)); return IdToTypeId(NameToId(name));
@ -2891,7 +2891,7 @@ TypeZone::nukeTypes(FreeOp *fop)
/* Throw away all JIT code in the compartment, but leave everything else alone. */ /* Throw away all JIT code in the compartment, but leave everything else alone. */
for (gc::CellIter i(zone(), gc::FINALIZE_SCRIPT); !i.done(); i.next()) { for (gc::CellIter i(zone(), gc::FINALIZE_SCRIPT); !i.done(); i.next()) {
RawScript script = i.get<JSScript>(); JSScript *script = i.get<JSScript>();
mjit::ReleaseScriptCode(fop, script); mjit::ReleaseScriptCode(fop, script);
# ifdef JS_ION # ifdef JS_ION
ion::FinishInvalidation(fop, script); ion::FinishInvalidation(fop, script);
@ -2958,7 +2958,7 @@ TypeCompartment::addPendingRecompile(JSContext *cx, const RecompileInfo &info)
} }
void void
TypeCompartment::addPendingRecompile(JSContext *cx, RawScript script, jsbytecode *pc) TypeCompartment::addPendingRecompile(JSContext *cx, JSScript *script, jsbytecode *pc)
{ {
JS_ASSERT(script); JS_ASSERT(script);
if (!constrainedOutputs) if (!constrainedOutputs)
@ -5980,7 +5980,7 @@ JSScript::makeTypes(JSContext *cx)
JS_ASSERT(originalFunction()); JS_ASSERT(originalFunction());
JS_ASSERT(function()->nargs == originalFunction()->nargs); JS_ASSERT(function()->nargs == originalFunction()->nargs);
RawScript original = originalFunction()->nonLazyScript(); JSScript *original = originalFunction()->nonLazyScript();
if (!original->ensureHasTypes(cx)) if (!original->ensureHasTypes(cx))
return false; return false;
@ -6741,7 +6741,7 @@ TypeCompartment::~TypeCompartment()
} }
/* static */ void /* static */ void
TypeScript::Sweep(FreeOp *fop, RawScript script) TypeScript::Sweep(FreeOp *fop, JSScript *script)
{ {
JSCompartment *compartment = script->compartment(); JSCompartment *compartment = script->compartment();
JS_ASSERT(compartment->zone()->isGCSweeping()); JS_ASSERT(compartment->zone()->isGCSweeping());
@ -6921,7 +6921,7 @@ TypeCompartment::maybePurgeAnalysis(JSContext *cx, bool force)
} }
static void static void
SizeOfScriptTypeInferenceData(RawScript script, JS::TypeInferenceSizes *sizes, SizeOfScriptTypeInferenceData(JSScript *script, JS::TypeInferenceSizes *sizes,
JSMallocSizeOfFun mallocSizeOf) JSMallocSizeOfFun mallocSizeOf)
{ {
TypeScript *typeScript = script->types; TypeScript *typeScript = script->types;
@ -7039,7 +7039,7 @@ TypeZone::sweep(FreeOp *fop, bool releaseTypes)
gcstats::AutoPhase ap2(rt->gcStats, gcstats::PHASE_DISCARD_TI); gcstats::AutoPhase ap2(rt->gcStats, gcstats::PHASE_DISCARD_TI);
for (CellIterUnderGC i(zone(), FINALIZE_SCRIPT); !i.done(); i.next()) { for (CellIterUnderGC i(zone(), FINALIZE_SCRIPT); !i.done(); i.next()) {
RawScript script = i.get<JSScript>(); JSScript *script = i.get<JSScript>();
if (script->types) { if (script->types) {
types::TypeScript::Sweep(fop, script); types::TypeScript::Sweep(fop, script);

Просмотреть файл

@ -20,7 +20,7 @@
#include "js/HashTable.h" #include "js/HashTable.h"
#include "js/Vector.h" #include "js/Vector.h"
ForwardDeclareJS(Script); class JSScript;
namespace js { namespace js {
@ -1165,7 +1165,7 @@ struct TypeCallsite
/* Type set receiving the return value of this call. */ /* Type set receiving the return value of this call. */
StackTypeSet *returnTypes; StackTypeSet *returnTypes;
inline TypeCallsite(JSContext *cx, RawScript script, jsbytecode *pc, inline TypeCallsite(JSContext *cx, JSScript *script, jsbytecode *pc,
bool isNew, unsigned argumentCount); bool isNew, unsigned argumentCount);
}; };
@ -1191,15 +1191,15 @@ class TypeScript
/* Array of type type sets for variables and JOF_TYPESET ops. */ /* Array of type type sets for variables and JOF_TYPESET ops. */
TypeSet *typeArray() { return (TypeSet *) (uintptr_t(this) + sizeof(TypeScript)); } TypeSet *typeArray() { return (TypeSet *) (uintptr_t(this) + sizeof(TypeScript)); }
static inline unsigned NumTypeSets(RawScript script); static inline unsigned NumTypeSets(JSScript *script);
static inline HeapTypeSet *ReturnTypes(RawScript script); static inline HeapTypeSet *ReturnTypes(JSScript *script);
static inline StackTypeSet *ThisTypes(RawScript script); static inline StackTypeSet *ThisTypes(JSScript *script);
static inline StackTypeSet *ArgTypes(RawScript script, unsigned i); static inline StackTypeSet *ArgTypes(JSScript *script, unsigned i);
static inline StackTypeSet *LocalTypes(RawScript script, unsigned i); static inline StackTypeSet *LocalTypes(JSScript *script, unsigned i);
/* Follows slot layout in jsanalyze.h, can get this/arg/local type sets. */ /* Follows slot layout in jsanalyze.h, can get this/arg/local type sets. */
static inline StackTypeSet *SlotTypes(RawScript script, unsigned slot); static inline StackTypeSet *SlotTypes(JSScript *script, unsigned slot);
/* Get the default 'new' object for a given standard class, per the script's global. */ /* Get the default 'new' object for a given standard class, per the script's global. */
static inline TypeObject *StandardType(JSContext *cx, JSProtoKey kind); static inline TypeObject *StandardType(JSContext *cx, JSProtoKey kind);
@ -1248,7 +1248,7 @@ class TypeScript
static void AddFreezeConstraints(JSContext *cx, JSScript *script); static void AddFreezeConstraints(JSContext *cx, JSScript *script);
static void Purge(JSContext *cx, HandleScript script); static void Purge(JSContext *cx, HandleScript script);
static void Sweep(FreeOp *fop, RawScript script); static void Sweep(FreeOp *fop, JSScript *script);
void destroy(); void destroy();
}; };
@ -1431,7 +1431,7 @@ struct TypeCompartment
/* Mark a script as needing recompilation once inference has finished. */ /* Mark a script as needing recompilation once inference has finished. */
void addPendingRecompile(JSContext *cx, const RecompileInfo &info); void addPendingRecompile(JSContext *cx, const RecompileInfo &info);
void addPendingRecompile(JSContext *cx, RawScript script, jsbytecode *pc); void addPendingRecompile(JSContext *cx, JSScript *script, jsbytecode *pc);
/* Monitor future effects on a bytecode. */ /* Monitor future effects on a bytecode. */
void monitorBytecode(JSContext *cx, JSScript *script, uint32_t offset, void monitorBytecode(JSContext *cx, JSScript *script, uint32_t offset,

Просмотреть файл

@ -418,7 +418,7 @@ struct AutoEnterCompilation
JS_ASSERT(info.outputIndex == RecompileInfo::NoCompilerRunning); JS_ASSERT(info.outputIndex == RecompileInfo::NoCompilerRunning);
} }
bool init(RawScript script, bool constructing, unsigned chunkIndex) bool init(JSScript *script, bool constructing, unsigned chunkIndex)
{ {
CompilerOutput co; CompilerOutput co;
co.script = script; co.script = script;
@ -725,7 +725,7 @@ FixObjectType(JSContext *cx, HandleObject obj)
cx->compartment->types.fixObjectType(cx, obj); cx->compartment->types.fixObjectType(cx, obj);
} }
/* Interface helpers for RawScript */ /* Interface helpers for JSScript*. */
extern void TypeMonitorResult(JSContext *cx, JSScript *script, jsbytecode *pc, extern void TypeMonitorResult(JSContext *cx, JSScript *script, jsbytecode *pc,
const js::Value &rval); const js::Value &rval);
extern void TypeDynamicResult(JSContext *cx, JSScript *script, jsbytecode *pc, extern void TypeDynamicResult(JSContext *cx, JSScript *script, jsbytecode *pc,
@ -780,7 +780,7 @@ UseNewTypeForClone(JSFunction *fun)
* instance a singleton type and clone the underlying script. * instance a singleton type and clone the underlying script.
*/ */
RawScript script = fun->nonLazyScript(); JSScript *script = fun->nonLazyScript();
if (script->length >= 50) if (script->length >= 50)
return false; return false;
@ -809,20 +809,20 @@ UseNewTypeForClone(JSFunction *fun)
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
/* static */ inline unsigned /* static */ inline unsigned
TypeScript::NumTypeSets(RawScript script) TypeScript::NumTypeSets(JSScript *script)
{ {
return script->nTypeSets + analyze::TotalSlots(script); return script->nTypeSets + analyze::TotalSlots(script);
} }
/* static */ inline HeapTypeSet * /* static */ inline HeapTypeSet *
TypeScript::ReturnTypes(RawScript script) TypeScript::ReturnTypes(JSScript *script)
{ {
TypeSet *types = script->types->typeArray() + script->nTypeSets + js::analyze::CalleeSlot(); TypeSet *types = script->types->typeArray() + script->nTypeSets + js::analyze::CalleeSlot();
return types->toHeapTypeSet(); return types->toHeapTypeSet();
} }
/* static */ inline StackTypeSet * /* static */ inline StackTypeSet *
TypeScript::ThisTypes(RawScript script) TypeScript::ThisTypes(JSScript *script)
{ {
TypeSet *types = script->types->typeArray() + script->nTypeSets + js::analyze::ThisSlot(); TypeSet *types = script->types->typeArray() + script->nTypeSets + js::analyze::ThisSlot();
return types->toStackTypeSet(); return types->toStackTypeSet();
@ -835,7 +835,7 @@ TypeScript::ThisTypes(RawScript script)
*/ */
/* static */ inline StackTypeSet * /* static */ inline StackTypeSet *
TypeScript::ArgTypes(RawScript script, unsigned i) TypeScript::ArgTypes(JSScript *script, unsigned i)
{ {
JS_ASSERT(i < script->function()->nargs); JS_ASSERT(i < script->function()->nargs);
TypeSet *types = script->types->typeArray() + script->nTypeSets + js::analyze::ArgSlot(i); TypeSet *types = script->types->typeArray() + script->nTypeSets + js::analyze::ArgSlot(i);
@ -843,7 +843,7 @@ TypeScript::ArgTypes(RawScript script, unsigned i)
} }
/* static */ inline StackTypeSet * /* static */ inline StackTypeSet *
TypeScript::LocalTypes(RawScript script, unsigned i) TypeScript::LocalTypes(JSScript *script, unsigned i)
{ {
JS_ASSERT(i < script->nfixed); JS_ASSERT(i < script->nfixed);
TypeSet *types = script->types->typeArray() + script->nTypeSets + js::analyze::LocalSlot(script, i); TypeSet *types = script->types->typeArray() + script->nTypeSets + js::analyze::LocalSlot(script, i);
@ -851,7 +851,7 @@ TypeScript::LocalTypes(RawScript script, unsigned i)
} }
/* static */ inline StackTypeSet * /* static */ inline StackTypeSet *
TypeScript::SlotTypes(RawScript script, unsigned slot) TypeScript::SlotTypes(JSScript *script, unsigned slot)
{ {
JS_ASSERT(slot < js::analyze::TotalSlots(script)); JS_ASSERT(slot < js::analyze::TotalSlots(script));
TypeSet *types = script->types->typeArray() + script->nTypeSets + slot; TypeSet *types = script->types->typeArray() + script->nTypeSets + slot;
@ -1553,7 +1553,7 @@ TypeSet::getTypeObject(unsigned i) const
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
inline inline
TypeCallsite::TypeCallsite(JSContext *cx, RawScript script, jsbytecode *pc, TypeCallsite::TypeCallsite(JSContext *cx, JSScript *script, jsbytecode *pc,
bool isNew, unsigned argumentCount) bool isNew, unsigned argumentCount)
: script(script), pc(pc), isNew(isNew), argumentCount(argumentCount), : script(script), pc(pc), isNew(isNew), argumentCount(argumentCount),
thisTypes(NULL), returnTypes(NULL) thisTypes(NULL), returnTypes(NULL)

Просмотреть файл

@ -312,7 +312,7 @@ js::RunScript(JSContext *cx, StackFrame *fp)
if (!iter.done()) { if (!iter.done()) {
++iter; ++iter;
if (iter.isScript()) { if (iter.isScript()) {
RawScript script = iter.script(); JSScript *script = iter.script();
jsbytecode *pc = iter.pc(); jsbytecode *pc = iter.pc();
if (UseNewType(cx, script, pc)) if (UseNewType(cx, script, pc))
fp->setUseNewType(); fp->setUseNewType();

Просмотреть файл

@ -887,7 +887,7 @@ GetElementOperation(JSContext *cx, JSOp op, MutableHandleValue lref, HandleValue
static JS_ALWAYS_INLINE bool static JS_ALWAYS_INLINE bool
SetObjectElementOperation(JSContext *cx, Handle<JSObject*> obj, HandleId id, const Value &value, SetObjectElementOperation(JSContext *cx, Handle<JSObject*> obj, HandleId id, const Value &value,
bool strict, RawScript maybeScript = NULL, jsbytecode *pc = NULL) bool strict, JSScript *maybeScript = NULL, jsbytecode *pc = NULL)
{ {
RootedScript script(cx, maybeScript); RootedScript script(cx, maybeScript);
types::TypeScript::MonitorAssign(cx, obj, id); types::TypeScript::MonitorAssign(cx, obj, id);

Просмотреть файл

@ -1563,7 +1563,7 @@ js::CreateThisForFunction(JSContext *cx, HandleObject callee, bool newType)
* checking whether document.all is defined. * checking whether document.all is defined.
*/ */
static bool static bool
Detecting(JSContext *cx, RawScript script, jsbytecode *pc) Detecting(JSContext *cx, JSScript *script, jsbytecode *pc)
{ {
/* General case: a branch or equality op follows the access. */ /* General case: a branch or equality op follows the access. */
JSOp op = JSOp(*pc); JSOp op = JSOp(*pc);
@ -1614,7 +1614,7 @@ js_InferFlags(JSContext *cx, unsigned defaultFlags)
* handle the case of cross-compartment property access. * handle the case of cross-compartment property access.
*/ */
jsbytecode *pc; jsbytecode *pc;
RawScript script = cx->stack.currentScript(&pc, ContextStack::ALLOW_CROSS_COMPARTMENT); JSScript *script = cx->stack.currentScript(&pc, ContextStack::ALLOW_CROSS_COMPARTMENT);
if (!script) if (!script)
return defaultFlags; return defaultFlags;
@ -3759,7 +3759,7 @@ NativeGetInline(JSContext *cx,
{ {
jsbytecode *pc; jsbytecode *pc;
RawScript script = cx->stack.currentScript(&pc); JSScript *script = cx->stack.currentScript(&pc);
if (script && script->hasAnalysis()) { if (script && script->hasAnalysis()) {
analyze::Bytecode *code = script->analysis()->maybeCode(pc); analyze::Bytecode *code = script->analysis()->maybeCode(pc);
if (code) if (code)
@ -4110,7 +4110,7 @@ static bool
MaybeReportUndeclaredVarAssignment(JSContext *cx, JSString *propname) MaybeReportUndeclaredVarAssignment(JSContext *cx, JSString *propname)
{ {
{ {
RawScript script = cx->stack.currentScript(NULL, ContextStack::ALLOW_CROSS_COMPARTMENT); JSScript *script = cx->stack.currentScript(NULL, ContextStack::ALLOW_CROSS_COMPARTMENT);
if (!script) if (!script)
return true; return true;
@ -4133,7 +4133,7 @@ js::ReportIfUndeclaredVarAssignment(JSContext *cx, HandleString propname)
{ {
{ {
jsbytecode *pc; jsbytecode *pc;
RawScript script = cx->stack.currentScript(&pc, ContextStack::ALLOW_CROSS_COMPARTMENT); JSScript *script = cx->stack.currentScript(&pc, ContextStack::ALLOW_CROSS_COMPARTMENT);
if (!script) if (!script)
return true; return true;
@ -4991,7 +4991,7 @@ dumpValue(const Value &v)
fputs("<unnamed function", stderr); fputs("<unnamed function", stderr);
} }
if (fun->hasScript()) { if (fun->hasScript()) {
RawScript script = fun->nonLazyScript(); JSScript *script = fun->nonLazyScript();
fprintf(stderr, " (%s:%u)", fprintf(stderr, " (%s:%u)",
script->filename() ? script->filename() : "", script->lineno); script->filename() ? script->filename() : "", script->lineno);
} }
@ -5259,7 +5259,7 @@ js_DumpBacktrace(JSContext *cx)
if (i.isScript()) { if (i.isScript()) {
const char *filename = JS_GetScriptFilename(cx, i.script()); const char *filename = JS_GetScriptFilename(cx, i.script());
unsigned line = JS_PCToLineNumber(cx, i.script(), i.pc()); unsigned line = JS_PCToLineNumber(cx, i.script(), i.pc());
RawScript script = i.script(); JSScript *script = i.script();
sprinter.printf("#%d %14p %s:%d (%p @ %d)\n", sprinter.printf("#%d %14p %s:%d (%p @ %d)\n",
depth, (i.isIon() ? 0 : i.interpFrame()), filename, line, depth, (i.isIon() ? 0 : i.interpFrame()), filename, line,
script, i.pc() - script->code); script, i.pc() - script->code);

Просмотреть файл

@ -55,7 +55,7 @@ Probes::discardMJITCode(FreeOp *fop, mjit::JITScript *jscr, mjit::JITChunk *chun
bool bool
Probes::registerICCode(JSContext *cx, Probes::registerICCode(JSContext *cx,
mjit::JITChunk *chunk, RawScript script, jsbytecode* pc, mjit::JITChunk *chunk, JSScript *script, jsbytecode* pc,
void *start, size_t size) void *start, size_t size)
{ {
if (cx->runtime->spsProfiler.enabled() && if (cx->runtime->spsProfiler.enabled() &&
@ -79,7 +79,7 @@ Probes::discardExecutableRegion(void *start, size_t size)
#ifdef INCLUDE_MOZILLA_DTRACE #ifdef INCLUDE_MOZILLA_DTRACE
static const char * static const char *
ScriptFilename(const RawScript script) ScriptFilename(const JSScript *script)
{ {
if (!script) if (!script)
return Probes::nullName; return Probes::nullName;
@ -106,7 +106,7 @@ FunctionName(JSContext *cx, JSFunction *fun, JSAutoByteString* bytes)
* a number of usually unused lines of code would cause. * a number of usually unused lines of code would cause.
*/ */
void void
Probes::DTraceEnterJSFun(JSContext *cx, JSFunction *fun, RawScript script) Probes::DTraceEnterJSFun(JSContext *cx, JSFunction *fun, JSScript *script)
{ {
JSAutoByteString funNameBytes; JSAutoByteString funNameBytes;
JAVASCRIPT_FUNCTION_ENTRY(ScriptFilename(script), Probes::nullName, JAVASCRIPT_FUNCTION_ENTRY(ScriptFilename(script), Probes::nullName,
@ -114,7 +114,7 @@ Probes::DTraceEnterJSFun(JSContext *cx, JSFunction *fun, RawScript script)
} }
void void
Probes::DTraceExitJSFun(JSContext *cx, JSFunction *fun, RawScript script) Probes::DTraceExitJSFun(JSContext *cx, JSFunction *fun, JSScript *script)
{ {
JSAutoByteString funNameBytes; JSAutoByteString funNameBytes;
JAVASCRIPT_FUNCTION_RETURN(ScriptFilename(script), Probes::nullName, JAVASCRIPT_FUNCTION_RETURN(ScriptFilename(script), Probes::nullName,

Просмотреть файл

@ -75,16 +75,16 @@ bool callTrackingActive(JSContext *);
bool wantNativeAddressInfo(JSContext *); bool wantNativeAddressInfo(JSContext *);
/* Entering a JS function */ /* Entering a JS function */
bool enterScript(JSContext *, RawScript, JSFunction *, StackFrame *); bool enterScript(JSContext *, JSScript *, JSFunction *, StackFrame *);
/* About to leave a JS function */ /* About to leave a JS function */
bool exitScript(JSContext *, RawScript, JSFunction *, StackFrame *); bool exitScript(JSContext *, JSScript *, JSFunction *, StackFrame *);
/* Executing a script */ /* Executing a script */
bool startExecution(RawScript script); bool startExecution(JSScript *script);
/* Script has completed execution */ /* Script has completed execution */
bool stopExecution(RawScript script); bool stopExecution(JSScript *script);
/* /*
* Object has been created. |obj| must exist (its class and size are read) * Object has been created. |obj| must exist (its class and size are read)
@ -132,7 +132,7 @@ discardMJITCode(FreeOp *fop, mjit::JITScript *jscr, mjit::JITChunk *chunk, void*
*/ */
bool bool
registerICCode(JSContext *cx, registerICCode(JSContext *cx,
mjit::JITChunk *chunk, RawScript script, jsbytecode* pc, mjit::JITChunk *chunk, JSScript *script, jsbytecode* pc,
void *start, size_t size); void *start, size_t size);
#endif /* JS_METHODJIT */ #endif /* JS_METHODJIT */
@ -149,8 +149,8 @@ discardExecutableRegion(void *start, size_t size);
* marshalling required for these probe points is expensive enough that it * marshalling required for these probe points is expensive enough that it
* shouldn't really matter. * shouldn't really matter.
*/ */
void DTraceEnterJSFun(JSContext *cx, JSFunction *fun, RawScript script); void DTraceEnterJSFun(JSContext *cx, JSFunction *fun, JSScript *script);
void DTraceExitJSFun(JSContext *cx, JSFunction *fun, RawScript script); void DTraceExitJSFun(JSContext *cx, JSFunction *fun, JSScript *script);
} /* namespace Probes */ } /* namespace Probes */
@ -181,7 +181,7 @@ Probes::wantNativeAddressInfo(JSContext *cx)
} }
inline bool inline bool
Probes::enterScript(JSContext *cx, RawScript script, JSFunction *maybeFun, Probes::enterScript(JSContext *cx, JSScript *script, JSFunction *maybeFun,
StackFrame *fp) StackFrame *fp)
{ {
bool ok = true; bool ok = true;
@ -204,7 +204,7 @@ Probes::enterScript(JSContext *cx, RawScript script, JSFunction *maybeFun,
} }
inline bool inline bool
Probes::exitScript(JSContext *cx, RawScript script, JSFunction *maybeFun, Probes::exitScript(JSContext *cx, JSScript *script, JSFunction *maybeFun,
StackFrame *fp) StackFrame *fp)
{ {
bool ok = true; bool ok = true;
@ -275,7 +275,7 @@ Probes::finalizeObject(JSObject *obj)
return ok; return ok;
} }
inline bool inline bool
Probes::startExecution(RawScript script) Probes::startExecution(JSScript *script)
{ {
bool ok = true; bool ok = true;
@ -289,7 +289,7 @@ Probes::startExecution(RawScript script)
} }
inline bool inline bool
Probes::stopExecution(RawScript script) Probes::stopExecution(JSScript *script)
{ {
bool ok = true; bool ok = true;

Просмотреть файл

@ -371,7 +371,7 @@ XDRScriptConst(XDRState<mode> *xdr, HeapValue *vp)
} }
static inline uint32_t static inline uint32_t
FindBlockIndex(RawScript script, StaticBlockObject &block) FindBlockIndex(JSScript *script, StaticBlockObject &block)
{ {
ObjectArray *objects = script->objects(); ObjectArray *objects = script->objects();
HeapPtrObject *vector = objects->vector; HeapPtrObject *vector = objects->vector;
@ -844,7 +844,7 @@ JSScript::initScriptCounts(JSContext *cx)
return true; return true;
} }
static inline ScriptCountsMap::Ptr GetScriptCountsMapEntry(RawScript script) static inline ScriptCountsMap::Ptr GetScriptCountsMapEntry(JSScript *script)
{ {
JS_ASSERT(script->hasScriptCounts); JS_ASSERT(script->hasScriptCounts);
ScriptCountsMap *map = script->compartment()->scriptCountsMap; ScriptCountsMap *map = script->compartment()->scriptCountsMap;
@ -1632,7 +1632,7 @@ ScriptDataSize(uint32_t nbindings, uint32_t nobjects, uint32_t nregexps,
return size; return size;
} }
RawScript JSScript *
JSScript::Create(JSContext *cx, HandleObject enclosingScope, bool savedCallerFun, JSScript::Create(JSContext *cx, HandleObject enclosingScope, bool savedCallerFun,
const CompileOptions &options, unsigned staticLevel, const CompileOptions &options, unsigned staticLevel,
ScriptSource *ss, uint32_t bufStart, uint32_t bufEnd) ScriptSource *ss, uint32_t bufStart, uint32_t bufEnd)
@ -1962,7 +1962,7 @@ js::CallNewScriptHook(JSContext *cx, HandleScript script, HandleFunction fun)
} }
void void
js::CallDestroyScriptHook(FreeOp *fop, RawScript script) js::CallDestroyScriptHook(FreeOp *fop, JSScript *script)
{ {
if (script->selfHosted) if (script->selfHosted)
return; return;
@ -2019,10 +2019,10 @@ GSNCache::purge()
} }
jssrcnote * jssrcnote *
js_GetSrcNote(JSContext *cx, RawScript script, jsbytecode *pc) js_GetSrcNote(JSContext *cx, JSScript *script, jsbytecode *pc)
{ {
GSNCache *cache = &cx->runtime->gsnCache; GSNCache *cache = &cx->runtime->gsnCache;
cx = NULL; // nulling |cx| ensures GC can't be triggered, so |RawScript script| is safe cx = NULL; // nulling |cx| ensures GC can't be triggered, so |JSScript *script| is safe
size_t target = pc - script->code; size_t target = pc - script->code;
if (target >= size_t(script->length)) if (target >= size_t(script->length))
@ -2122,7 +2122,7 @@ js::PCToLineNumber(unsigned startLine, jssrcnote *notes, jsbytecode *code, jsbyt
} }
unsigned unsigned
js::PCToLineNumber(RawScript script, jsbytecode *pc, unsigned *columnp) js::PCToLineNumber(JSScript *script, jsbytecode *pc, unsigned *columnp)
{ {
/* Cope with StackFrame.pc value prior to entering js_Interpret. */ /* Cope with StackFrame.pc value prior to entering js_Interpret. */
if (!pc) if (!pc)
@ -2135,7 +2135,7 @@ js::PCToLineNumber(RawScript script, jsbytecode *pc, unsigned *columnp)
#define SN_LINE_LIMIT (SN_3BYTE_OFFSET_FLAG << 16) #define SN_LINE_LIMIT (SN_3BYTE_OFFSET_FLAG << 16)
jsbytecode * jsbytecode *
js_LineNumberToPC(RawScript script, unsigned target) js_LineNumberToPC(JSScript *script, unsigned target)
{ {
ptrdiff_t offset = 0; ptrdiff_t offset = 0;
ptrdiff_t best = -1; ptrdiff_t best = -1;
@ -2170,7 +2170,7 @@ out:
} }
JS_FRIEND_API(unsigned) JS_FRIEND_API(unsigned)
js_GetScriptLineExtent(RawScript script) js_GetScriptLineExtent(JSScript *script)
{ {
unsigned lineno = script->lineno; unsigned lineno = script->lineno;
unsigned maxLineNo = 0; unsigned maxLineNo = 0;
@ -2217,7 +2217,7 @@ js::CurrentScriptFileLineOriginSlow(JSContext *cx, const char **file, unsigned *
return; return;
} }
RawScript script = iter.script(); JSScript *script = iter.script();
*file = script->filename(); *file = script->filename();
*linenop = PCToLineNumber(iter.script(), iter.pc()); *linenop = PCToLineNumber(iter.script(), iter.pc());
*origin = script->originPrincipals; *origin = script->originPrincipals;
@ -2225,13 +2225,13 @@ js::CurrentScriptFileLineOriginSlow(JSContext *cx, const char **file, unsigned *
template <class T> template <class T>
static inline T * static inline T *
Rebase(RawScript dst, RawScript src, T *srcp) Rebase(JSScript *dst, JSScript *src, T *srcp)
{ {
size_t off = reinterpret_cast<uint8_t *>(srcp) - src->data; size_t off = reinterpret_cast<uint8_t *>(srcp) - src->data;
return reinterpret_cast<T *>(dst->data + off); return reinterpret_cast<T *>(dst->data + off);
} }
RawScript JSScript *
js::CloneScript(JSContext *cx, HandleObject enclosingScope, HandleFunction fun, HandleScript src) js::CloneScript(JSContext *cx, HandleObject enclosingScope, HandleFunction fun, HandleScript src)
{ {
/* NB: Keep this in sync with XDRScript. */ /* NB: Keep this in sync with XDRScript. */
@ -2412,7 +2412,7 @@ js::CloneFunctionScript(JSContext *cx, HandleFunction original, HandleFunction c
clone->mutableScript().init(NULL); clone->mutableScript().init(NULL);
RawScript cscript = CloneScript(cx, scope, clone, script); JSScript *cscript = CloneScript(cx, scope, clone, script);
if (!cscript) if (!cscript)
return false; return false;

Просмотреть файл

@ -19,8 +19,6 @@
#include "js/RootingAPI.h" #include "js/RootingAPI.h"
#include "vm/Shape.h" #include "vm/Shape.h"
ForwardDeclareJS(Script);
namespace js { namespace js {
namespace ion { namespace ion {
@ -244,9 +242,9 @@ class ScriptCounts
} }
}; };
typedef HashMap<RawScript, typedef HashMap<JSScript *,
ScriptCounts, ScriptCounts,
DefaultHasher<RawScript>, DefaultHasher<JSScript *>,
SystemAllocPolicy> ScriptCountsMap; SystemAllocPolicy> ScriptCountsMap;
class DebugScript class DebugScript
@ -272,9 +270,9 @@ class DebugScript
BreakpointSite *breakpoints[1]; BreakpointSite *breakpoints[1];
}; };
typedef HashMap<RawScript, typedef HashMap<JSScript *,
DebugScript *, DebugScript *,
DefaultHasher<RawScript>, DefaultHasher<JSScript *>,
SystemAllocPolicy> DebugScriptMap; SystemAllocPolicy> DebugScriptMap;
struct ScriptSource; struct ScriptSource;
@ -531,7 +529,7 @@ class JSScript : public js::gc::Cell
// //
public: public:
static js::RawScript Create(JSContext *cx, js::HandleObject enclosingScope, bool savedCallerFun, static JSScript *Create(JSContext *cx, js::HandleObject enclosingScope, bool savedCallerFun,
const JS::CompileOptions &options, unsigned staticLevel, const JS::CompileOptions &options, unsigned staticLevel,
js::ScriptSource *ss, uint32_t sourceStart, uint32_t sourceEnd); js::ScriptSource *ss, uint32_t sourceStart, uint32_t sourceEnd);
@ -855,7 +853,7 @@ class JSScript : public js::gc::Cell
bool hasArray(ArrayKind kind) { return (hasArrayBits & (1 << kind)); } bool hasArray(ArrayKind kind) { return (hasArrayBits & (1 << kind)); }
void setHasArray(ArrayKind kind) { hasArrayBits |= (1 << kind); } void setHasArray(ArrayKind kind) { hasArrayBits |= (1 << kind); }
void cloneHasArray(js::RawScript script) { hasArrayBits = script->hasArrayBits; } void cloneHasArray(JSScript *script) { hasArrayBits = script->hasArrayBits; }
bool hasConsts() { return hasArray(CONSTS); } bool hasConsts() { return hasArray(CONSTS); }
bool hasObjects() { return hasArray(OBJECTS); } bool hasObjects() { return hasArray(OBJECTS); }
@ -1006,8 +1004,8 @@ class JSScript : public js::gc::Cell
JS::Zone *zone() const { return tenuredZone(); } JS::Zone *zone() const { return tenuredZone(); }
static inline void writeBarrierPre(js::RawScript script); static inline void writeBarrierPre(JSScript *script);
static inline void writeBarrierPost(js::RawScript script, void *addr); static inline void writeBarrierPost(JSScript *script, void *addr);
static inline js::ThingRootKind rootKind() { return js::THING_ROOT_SCRIPT; } static inline js::ThingRootKind rootKind() { return js::THING_ROOT_SCRIPT; }
@ -1083,7 +1081,7 @@ class AliasedFormalIter
} }
public: public:
explicit inline AliasedFormalIter(js::RawScript script); explicit inline AliasedFormalIter(JSScript *script);
bool done() const { return p_ == end_; } bool done() const { return p_ == end_; }
operator bool() const { return !done(); } operator bool() const { return !done(); }
@ -1296,7 +1294,7 @@ extern void
CallNewScriptHook(JSContext *cx, JS::HandleScript script, JS::HandleFunction fun); CallNewScriptHook(JSContext *cx, JS::HandleScript script, JS::HandleFunction fun);
extern void extern void
CallDestroyScriptHook(FreeOp *fop, js::RawScript script); CallDestroyScriptHook(FreeOp *fop, JSScript *script);
struct SharedScriptData struct SharedScriptData
{ {
@ -1360,7 +1358,7 @@ FreeScriptData(JSRuntime *rt);
struct ScriptAndCounts struct ScriptAndCounts
{ {
/* This structure is stored and marked from the JSRuntime. */ /* This structure is stored and marked from the JSRuntime. */
js::RawScript script; JSScript *script;
ScriptCounts scriptCounts; ScriptCounts scriptCounts;
PCCounts &getPCCounts(jsbytecode *pc) const { PCCounts &getPCCounts(jsbytecode *pc) const {
@ -1376,18 +1374,18 @@ struct ScriptAndCounts
} /* namespace js */ } /* namespace js */
extern jssrcnote * extern jssrcnote *
js_GetSrcNote(JSContext *cx, js::RawScript script, jsbytecode *pc); js_GetSrcNote(JSContext *cx, JSScript *script, jsbytecode *pc);
extern jsbytecode * extern jsbytecode *
js_LineNumberToPC(js::RawScript script, unsigned lineno); js_LineNumberToPC(JSScript *script, unsigned lineno);
extern JS_FRIEND_API(unsigned) extern JS_FRIEND_API(unsigned)
js_GetScriptLineExtent(js::RawScript script); js_GetScriptLineExtent(JSScript *script);
namespace js { namespace js {
extern unsigned extern unsigned
PCToLineNumber(js::RawScript script, jsbytecode *pc, unsigned *columnp = NULL); PCToLineNumber(JSScript *script, jsbytecode *pc, unsigned *columnp = NULL);
extern unsigned extern unsigned
PCToLineNumber(unsigned startLine, jssrcnote *notes, jsbytecode *code, jsbytecode *pc, PCToLineNumber(unsigned startLine, jssrcnote *notes, jsbytecode *code, jsbytecode *pc,
@ -1413,7 +1411,7 @@ enum LineOption {
inline void inline void
CurrentScriptFileLineOrigin(JSContext *cx, unsigned *linenop, LineOption = NOT_CALLED_FROM_JSOP_EVAL); CurrentScriptFileLineOrigin(JSContext *cx, unsigned *linenop, LineOption = NOT_CALLED_FROM_JSOP_EVAL);
extern RawScript extern JSScript *
CloneScript(JSContext *cx, HandleObject enclosingScope, HandleFunction fun, HandleScript script); CloneScript(JSContext *cx, HandleObject enclosingScope, HandleFunction fun, HandleScript script);
bool bool

Просмотреть файл

@ -28,7 +28,7 @@ Bindings::Bindings()
{} {}
inline inline
AliasedFormalIter::AliasedFormalIter(js::RawScript script) AliasedFormalIter::AliasedFormalIter(JSScript *script)
: begin_(script->bindings.bindingArray()), : begin_(script->bindings.bindingArray()),
p_(begin_), p_(begin_),
end_(begin_ + (script->funHasAnyAliasedFormal ? script->bindings.numArgs() : 0)), end_(begin_ + (script->funHasAnyAliasedFormal ? script->bindings.numArgs() : 0)),
@ -176,7 +176,7 @@ JSScript::destroyMJITInfo(js::FreeOp *fop)
#endif /* JS_METHODJIT */ #endif /* JS_METHODJIT */
inline void inline void
JSScript::writeBarrierPre(js::RawScript script) JSScript::writeBarrierPre(JSScript *script)
{ {
#ifdef JSGC_INCREMENTAL #ifdef JSGC_INCREMENTAL
if (!script || !script->runtime()->needsBarrier()) if (!script || !script->runtime()->needsBarrier())
@ -185,7 +185,7 @@ JSScript::writeBarrierPre(js::RawScript script)
JS::Zone *zone = script->zone(); JS::Zone *zone = script->zone();
if (zone->needsBarrier()) { if (zone->needsBarrier()) {
JS_ASSERT(!zone->rt->isHeapBusy()); JS_ASSERT(!zone->rt->isHeapBusy());
js::RawScript tmp = script; JSScript *tmp = script;
MarkScriptUnbarriered(zone->barrierTracer(), &tmp, "write barrier"); MarkScriptUnbarriered(zone->barrierTracer(), &tmp, "write barrier");
JS_ASSERT(tmp == script); JS_ASSERT(tmp == script);
} }
@ -193,7 +193,7 @@ JSScript::writeBarrierPre(js::RawScript script)
} }
inline void inline void
JSScript::writeBarrierPost(js::RawScript script, void *addr) JSScript::writeBarrierPost(JSScript *script, void *addr)
{ {
} }

Просмотреть файл

@ -2615,7 +2615,7 @@ LambdaIsGetElem(JSObject &lambda)
if (!fun->hasScript()) if (!fun->hasScript())
return NULL; return NULL;
RawScript script = fun->nonLazyScript(); JSScript *script = fun->nonLazyScript();
jsbytecode *pc = script->code; jsbytecode *pc = script->code;
/* /*

Просмотреть файл

@ -1308,7 +1308,7 @@ class CallCompiler : public BaseCompiler
} }
JS_ASSERT(fun); JS_ASSERT(fun);
RawScript script = fun->nonLazyScript(); JSScript *script = fun->nonLazyScript();
JS_ASSERT(script); JS_ASSERT(script);
uint32_t flags = callingNew ? StackFrame::CONSTRUCTING : 0; uint32_t flags = callingNew ? StackFrame::CONSTRUCTING : 0;
@ -1488,7 +1488,7 @@ ic::GenerateArgumentCheckStub(VMFrame &f)
JITScript *jit = f.jit(); JITScript *jit = f.jit();
StackFrame *fp = f.fp(); StackFrame *fp = f.fp();
JSFunction *fun = fp->fun(); JSFunction *fun = fp->fun();
RawScript script = fun->nonLazyScript(); JSScript *script = fun->nonLazyScript();
if (jit->argsCheckPool) if (jit->argsCheckPool)
jit->resetArgsCheck(); jit->resetArgsCheck();

Просмотреть файл

@ -2170,7 +2170,7 @@ frameCountersOffset(VMFrame &f)
} }
jsbytecode *pc; jsbytecode *pc;
RawScript script = cx->stack.currentScript(&pc); JSScript *script = cx->stack.currentScript(&pc);
offset += pc - script->code; offset += pc - script->code;
return offset; return offset;

Просмотреть файл

@ -1568,7 +1568,7 @@ stubs::AssertArgumentTypes(VMFrame &f)
{ {
StackFrame *fp = f.fp(); StackFrame *fp = f.fp();
JSFunction *fun = fp->fun(); JSFunction *fun = fp->fun();
RawScript script = fun->nonLazyScript(); JSScript *script = fun->nonLazyScript();
/* /*
* Don't check the type of 'this' for constructor frames, the 'this' value * Don't check the type of 'this' for constructor frames, the 'this' value
@ -1612,7 +1612,7 @@ stubs::InvariantFailure(VMFrame &f, void *rval)
*frameAddr = repatchCode; *frameAddr = repatchCode;
/* Recompile the outermost script, and don't hoist any bounds checks. */ /* Recompile the outermost script, and don't hoist any bounds checks. */
RawScript script = f.fp()->script(); JSScript *script = f.fp()->script();
JS_ASSERT(!script->failedBoundsCheck); JS_ASSERT(!script->failedBoundsCheck);
script->failedBoundsCheck = true; script->failedBoundsCheck = true;

Просмотреть файл

@ -1403,7 +1403,7 @@ AssertEq(JSContext *cx, unsigned argc, jsval *vp)
return true; return true;
} }
static RawScript static JSScript *
ValueToScript(JSContext *cx, jsval v, JSFunction **funp = NULL) ValueToScript(JSContext *cx, jsval v, JSFunction **funp = NULL)
{ {
RootedFunction fun(cx, JS_ValueToFunction(cx, v)); RootedFunction fun(cx, JS_ValueToFunction(cx, v));
@ -1485,7 +1485,7 @@ GetScriptAndPCArgs(JSContext *cx, unsigned argc, jsval *argv, MutableHandleScrip
} }
static JSTrapStatus static JSTrapStatus
TrapHandler(JSContext *cx, RawScript, jsbytecode *pc, jsval *rvalArg, TrapHandler(JSContext *cx, JSScript *, jsbytecode *pc, jsval *rvalArg,
jsval closure) jsval closure)
{ {
JSString *str = JSVAL_TO_STRING(closure); JSString *str = JSVAL_TO_STRING(closure);
@ -1558,7 +1558,7 @@ Untrap(JSContext *cx, unsigned argc, jsval *vp)
} }
static JSTrapStatus static JSTrapStatus
DebuggerAndThrowHandler(JSContext *cx, RawScript script, jsbytecode *pc, jsval *rval, DebuggerAndThrowHandler(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,
void *closure) void *closure)
{ {
return TrapHandler(cx, script, pc, rval, STRING_TO_JSVAL((JSString *)closure)); return TrapHandler(cx, script, pc, rval, STRING_TO_JSVAL((JSString *)closure));

Просмотреть файл

@ -55,7 +55,7 @@ CopyStackFrameArguments(const AbstractFramePtr frame, HeapValue *dst, unsigned t
ArgumentsObject::MaybeForwardToCallObject(AbstractFramePtr frame, JSObject *obj, ArgumentsObject::MaybeForwardToCallObject(AbstractFramePtr frame, JSObject *obj,
ArgumentsData *data) ArgumentsData *data)
{ {
RawScript script = frame.script(); JSScript *script = frame.script();
if (frame.fun()->isHeavyweight() && script->argsObjAliasesFormals()) { if (frame.fun()->isHeavyweight() && script->argsObjAliasesFormals()) {
obj->initFixedSlot(MAYBE_CALL_SLOT, ObjectValue(frame.callObj())); obj->initFixedSlot(MAYBE_CALL_SLOT, ObjectValue(frame.callObj()));
for (AliasedFormalIter fi(script); fi; fi++) for (AliasedFormalIter fi(script); fi; fi++)
@ -69,7 +69,7 @@ ArgumentsObject::MaybeForwardToCallObject(ion::IonJSFrameLayout *frame, HandleOb
JSObject *obj, ArgumentsData *data) JSObject *obj, ArgumentsData *data)
{ {
JSFunction *callee = ion::CalleeTokenToFunction(frame->calleeToken()); JSFunction *callee = ion::CalleeTokenToFunction(frame->calleeToken());
RawScript script = callee->nonLazyScript(); JSScript *script = callee->nonLazyScript();
if (callee->isHeavyweight() && script->argsObjAliasesFormals()) { if (callee->isHeavyweight() && script->argsObjAliasesFormals()) {
JS_ASSERT(callObj && callObj->isCall()); JS_ASSERT(callObj && callObj->isCall());
obj->initFixedSlot(MAYBE_CALL_SLOT, ObjectValue(*callObj.get())); obj->initFixedSlot(MAYBE_CALL_SLOT, ObjectValue(*callObj.get()));

Просмотреть файл

@ -1231,7 +1231,7 @@ Debugger::onSingleStep(JSContext *cx, MutableHandleValue vp)
*/ */
{ {
uint32_t stepperCount = 0; uint32_t stepperCount = 0;
RawScript trappingScript = iter.script(); JSScript *trappingScript = iter.script();
GlobalObject *global = cx->global(); GlobalObject *global = cx->global();
if (GlobalObject::DebuggerVector *debuggers = global->getDebuggers()) { if (GlobalObject::DebuggerVector *debuggers = global->getDebuggers()) {
for (Debugger **p = debuggers->begin(); p != debuggers->end(); p++) { for (Debugger **p = debuggers->begin(); p != debuggers->end(); p++) {
@ -3796,7 +3796,7 @@ static JSBool
DebuggerFrame_getOffset(JSContext *cx, unsigned argc, Value *vp) DebuggerFrame_getOffset(JSContext *cx, unsigned argc, Value *vp)
{ {
THIS_FRAME(cx, argc, vp, "get offset", args, thisobj, iter); THIS_FRAME(cx, argc, vp, "get offset", args, thisobj, iter);
RawScript script = iter.script(); JSScript *script = iter.script();
iter.updatePcQuadratic(); iter.updatePcQuadratic();
jsbytecode *pc = iter.pc(); jsbytecode *pc = iter.pc();
JS_ASSERT(script->code <= pc); JS_ASSERT(script->code <= pc);

Просмотреть файл

@ -82,7 +82,7 @@ SPSProfiler::enable(bool enabled)
/* Lookup the string for the function/script, creating one if necessary */ /* Lookup the string for the function/script, creating one if necessary */
const char* const char*
SPSProfiler::profileString(JSContext *cx, RawScript script, JSFunction *maybeFun) SPSProfiler::profileString(JSContext *cx, JSScript *script, JSFunction *maybeFun)
{ {
JS_ASSERT(strings.initialized()); JS_ASSERT(strings.initialized());
ProfileStringMap::AddPtr s = strings.lookupForAdd(script); ProfileStringMap::AddPtr s = strings.lookupForAdd(script);
@ -99,7 +99,7 @@ SPSProfiler::profileString(JSContext *cx, RawScript script, JSFunction *maybeFun
} }
void void
SPSProfiler::onScriptFinalized(RawScript script) SPSProfiler::onScriptFinalized(JSScript *script)
{ {
/* /*
* This function is called whenever a script is destroyed, regardless of * This function is called whenever a script is destroyed, regardless of
@ -118,7 +118,7 @@ SPSProfiler::onScriptFinalized(RawScript script)
} }
bool bool
SPSProfiler::enter(JSContext *cx, RawScript script, JSFunction *maybeFun) SPSProfiler::enter(JSContext *cx, JSScript *script, JSFunction *maybeFun)
{ {
const char *str = profileString(cx, script, maybeFun); const char *str = profileString(cx, script, maybeFun);
if (str == NULL) if (str == NULL)
@ -131,7 +131,7 @@ SPSProfiler::enter(JSContext *cx, RawScript script, JSFunction *maybeFun)
} }
void void
SPSProfiler::exit(JSContext *cx, RawScript script, JSFunction *maybeFun) SPSProfiler::exit(JSContext *cx, JSScript *script, JSFunction *maybeFun)
{ {
pop(); pop();
@ -182,7 +182,7 @@ SPSProfiler::enterNative(const char *string, void *sp)
} }
void void
SPSProfiler::push(const char *string, void *sp, RawScript script, jsbytecode *pc) SPSProfiler::push(const char *string, void *sp, JSScript *script, jsbytecode *pc)
{ {
/* these operations cannot be re-ordered, so volatile-ize operations */ /* these operations cannot be re-ordered, so volatile-ize operations */
volatile ProfileEntry *stack = stack_; volatile ProfileEntry *stack = stack_;
@ -214,7 +214,7 @@ SPSProfiler::pop()
* AddPtr held while invoking allocProfileString. * AddPtr held while invoking allocProfileString.
*/ */
const char* const char*
SPSProfiler::allocProfileString(JSContext *cx, RawScript script, JSFunction *maybeFun) SPSProfiler::allocProfileString(JSContext *cx, JSScript *script, JSFunction *maybeFun)
{ {
DebugOnly<uint64_t> gcBefore = cx->runtime->gcNumber; DebugOnly<uint64_t> gcBefore = cx->runtime->gcNumber;
StringBuffer buf(cx); StringBuffer buf(cx);
@ -267,7 +267,7 @@ JMChunkInfo::JMChunkInfo(mjit::JSActiveFrame *frame,
{} {}
jsbytecode* jsbytecode*
SPSProfiler::ipToPC(RawScript script, size_t ip) SPSProfiler::ipToPC(JSScript *script, size_t ip)
{ {
if (!jminfo.initialized()) if (!jminfo.initialized())
return NULL; return NULL;
@ -295,7 +295,7 @@ SPSProfiler::ipToPC(RawScript script, size_t ip)
} }
jsbytecode* jsbytecode*
JMChunkInfo::convert(RawScript script, size_t ip) JMChunkInfo::convert(JSScript *script, size_t ip)
{ {
if (mainStart <= ip && ip < mainEnd) { if (mainStart <= ip && ip < mainEnd) {
size_t offset = 0; size_t offset = 0;
@ -393,7 +393,7 @@ SPSProfiler::registerScript(mjit::JSActiveFrame *frame,
bool bool
SPSProfiler::registerICCode(mjit::JITChunk *chunk, SPSProfiler::registerICCode(mjit::JITChunk *chunk,
RawScript script, jsbytecode *pc, JSScript *script, jsbytecode *pc,
void *base, size_t size) void *base, size_t size)
{ {
JS_ASSERT(jminfo.initialized()); JS_ASSERT(jminfo.initialized());
@ -415,7 +415,7 @@ SPSProfiler::discardMJITCode(mjit::JITScript *jscr,
} }
void void
SPSProfiler::unregisterScript(RawScript script, mjit::JITChunk *chunk) SPSProfiler::unregisterScript(JSScript *script, mjit::JITChunk *chunk)
{ {
JITInfoMap::Ptr ptr = jminfo.lookup(script); JITInfoMap::Ptr ptr = jminfo.lookup(script);
if (!ptr) if (!ptr)

Просмотреть файл

@ -135,9 +135,9 @@ class SPSProfiler
bool slowAssertions; bool slowAssertions;
uint32_t enabled_; uint32_t enabled_;
const char *allocProfileString(JSContext *cx, RawScript script, const char *allocProfileString(JSContext *cx, JSScript *script,
JSFunction *function); JSFunction *function);
void push(const char *string, void *sp, RawScript script, jsbytecode *pc); void push(const char *string, void *sp, JSScript *script, jsbytecode *pc);
void pop(); void pop();
public: public:
@ -164,9 +164,9 @@ class SPSProfiler
* - exit: this function has ceased execution, and no further * - exit: this function has ceased execution, and no further
* entries/exits will be made * entries/exits will be made
*/ */
bool enter(JSContext *cx, RawScript script, JSFunction *maybeFun); bool enter(JSContext *cx, JSScript *script, JSFunction *maybeFun);
void exit(JSContext *cx, RawScript script, JSFunction *maybeFun); void exit(JSContext *cx, JSScript *script, JSFunction *maybeFun);
void updatePC(RawScript script, jsbytecode *pc) { void updatePC(JSScript *script, jsbytecode *pc) {
if (enabled() && *size_ - 1 < max_) { if (enabled() && *size_ - 1 < max_) {
JS_ASSERT(*size_ > 0); JS_ASSERT(*size_ > 0);
JS_ASSERT(stack_[*size_ - 1].script() == script); JS_ASSERT(stack_[*size_ - 1].script() == script);
@ -203,7 +203,7 @@ class SPSProfiler
mjit::PCLengthEntry *pcLengths, mjit::PCLengthEntry *pcLengths,
mjit::JITChunk *chunk); mjit::JITChunk *chunk);
jsbytecode *convert(RawScript script, size_t ip); jsbytecode *convert(JSScript *script, size_t ip);
}; };
struct JMScriptInfo struct JMScriptInfo
@ -236,23 +236,23 @@ class SPSProfiler
mjit::JSActiveFrame **inlineFrames); mjit::JSActiveFrame **inlineFrames);
void discardMJITCode(mjit::JITScript *jscr, void discardMJITCode(mjit::JITScript *jscr,
mjit::JITChunk *chunk, void* address); mjit::JITChunk *chunk, void* address);
bool registerICCode(mjit::JITChunk *chunk, RawScript script, jsbytecode* pc, bool registerICCode(mjit::JITChunk *chunk, JSScript *script, jsbytecode* pc,
void *start, size_t size); void *start, size_t size);
jsbytecode *ipToPC(RawScript script, size_t ip); jsbytecode *ipToPC(JSScript *script, size_t ip);
private: private:
JMChunkInfo *registerScript(mjit::JSActiveFrame *frame, JMChunkInfo *registerScript(mjit::JSActiveFrame *frame,
mjit::PCLengthEntry *lenths, mjit::PCLengthEntry *lenths,
mjit::JITChunk *chunk); mjit::JITChunk *chunk);
void unregisterScript(RawScript script, mjit::JITChunk *chunk); void unregisterScript(JSScript *script, mjit::JITChunk *chunk);
public: public:
#else #else
jsbytecode *ipToPC(RawScript script, size_t ip) { return NULL; } jsbytecode *ipToPC(JSScript *script, size_t ip) { return NULL; }
#endif #endif
void setProfilingStack(ProfileEntry *stack, uint32_t *size, uint32_t max); void setProfilingStack(ProfileEntry *stack, uint32_t *size, uint32_t max);
const char *profileString(JSContext *cx, RawScript script, JSFunction *maybeFun); const char *profileString(JSContext *cx, JSScript *script, JSFunction *maybeFun);
void onScriptFinalized(RawScript script); void onScriptFinalized(JSScript *script);
/* meant to be used for testing, not recommended to call in normal code */ /* meant to be used for testing, not recommended to call in normal code */
size_t stringsCount() { return strings.count(); } size_t stringsCount() { return strings.count(); }
@ -378,7 +378,7 @@ class SPSInstrumentation
* instrumentation should be emitted. This updates internal state to flag * instrumentation should be emitted. This updates internal state to flag
* that further instrumentation should actually be emitted. * that further instrumentation should actually be emitted.
*/ */
void setPushed(RawScript script) { void setPushed(JSScript *script) {
if (!enabled()) if (!enabled())
return; return;
JS_ASSERT(frame->left == 0); JS_ASSERT(frame->left == 0);
@ -389,7 +389,7 @@ class SPSInstrumentation
* Flags entry into a JS function for the first time. Before this is called, * Flags entry into a JS function for the first time. Before this is called,
* no instrumentation is emitted, but after this instrumentation is emitted. * no instrumentation is emitted, but after this instrumentation is emitted.
*/ */
bool push(JSContext *cx, RawScript script, Assembler &masm, Register scratch) { bool push(JSContext *cx, JSScript *script, Assembler &masm, Register scratch) {
if (!enabled()) if (!enabled())
return true; return true;
const char *string = profiler_->profileString(cx, script, const char *string = profiler_->profileString(cx, script,
@ -406,7 +406,7 @@ class SPSInstrumentation
* sets the current PC to something non-null, however, so as soon as JIT * sets the current PC to something non-null, however, so as soon as JIT
* code is reentered this updates the current pc to NULL. * code is reentered this updates the current pc to NULL.
*/ */
void pushManual(RawScript script, Assembler &masm, Register scratch) { void pushManual(JSScript *script, Assembler &masm, Register scratch) {
if (!enabled()) if (!enabled())
return; return;
masm.spsUpdatePCIdx(profiler_, ProfileEntry::NullPCIndex, scratch); masm.spsUpdatePCIdx(profiler_, ProfileEntry::NullPCIndex, scratch);

Просмотреть файл

@ -88,7 +88,7 @@ StaticScopeIter::block() const
return obj->asStaticBlock(); return obj->asStaticBlock();
} }
RawScript JSScript *
StaticScopeIter::funScript() const StaticScopeIter::funScript() const
{ {
JS_ASSERT(type() == FUNCTION); JS_ASSERT(type() == FUNCTION);
@ -1232,7 +1232,7 @@ class DebugScopeProxy : public BaseProxyHandler
return false; return false;
if (maybeframe) { if (maybeframe) {
RawScript script = maybeframe.script(); JSScript *script = maybeframe.script();
unsigned local = block->slotToLocalIndex(script->bindings, shape->slot()); unsigned local = block->slotToLocalIndex(script->bindings, shape->slot());
if (action == GET) if (action == GET)
vp.set(maybeframe.unaliasedLocal(local)); vp.set(maybeframe.unaliasedLocal(local));

Просмотреть файл

@ -72,7 +72,7 @@ class StaticScopeIter
Type type() const; Type type() const;
StaticBlockObject &block() const; StaticBlockObject &block() const;
RawScript funScript() const; JSScript *funScript() const;
}; };
/*****************************************************************************/ /*****************************************************************************/

Просмотреть файл

@ -707,7 +707,7 @@ JSRuntime::cloneSelfHostedFunctionScript(JSContext *cx, Handle<PropertyName*> na
RootedFunction sourceFun(cx, funVal.toObject().toFunction()); RootedFunction sourceFun(cx, funVal.toObject().toFunction());
RootedScript sourceScript(cx, sourceFun->nonLazyScript()); RootedScript sourceScript(cx, sourceFun->nonLazyScript());
JS_ASSERT(!sourceScript->enclosingStaticScope()); JS_ASSERT(!sourceScript->enclosingStaticScope());
RawScript cscript = CloneScript(cx, NullPtr(), targetFun, sourceScript); JSScript *cscript = CloneScript(cx, NullPtr(), targetFun, sourceScript);
if (!cscript) if (!cscript)
return false; return false;
targetFun->setScript(cscript); targetFun->setScript(cscript);

Просмотреть файл

@ -133,7 +133,7 @@ StackFrame::resetInlinePrev(StackFrame *prevfp, jsbytecode *prevpc)
inline void inline void
StackFrame::initCallFrame(JSContext *cx, JSFunction &callee, StackFrame::initCallFrame(JSContext *cx, JSFunction &callee,
RawScript script, uint32_t nactual, StackFrame::Flags flagsArg) JSScript *script, uint32_t nactual, StackFrame::Flags flagsArg)
{ {
JS_ASSERT((flagsArg & ~(CONSTRUCTING | JS_ASSERT((flagsArg & ~(CONSTRUCTING |
LOWERED_CALL_APPLY | LOWERED_CALL_APPLY |
@ -507,7 +507,7 @@ ContextStack::popFrameAfterOverflow()
regs.popFrame(fp->actuals() + fp->numActualArgs()); regs.popFrame(fp->actuals() + fp->numActualArgs());
} }
inline RawScript inline JSScript *
ContextStack::currentScript(jsbytecode **ppc, ContextStack::currentScript(jsbytecode **ppc,
MaybeAllowCrossCompartment allowCrossCompartment) const MaybeAllowCrossCompartment allowCrossCompartment) const
{ {
@ -536,7 +536,7 @@ ContextStack::currentScript(jsbytecode **ppc,
mjit::JITChunk *chunk = fp->jit()->chunk(regs.pc); mjit::JITChunk *chunk = fp->jit()->chunk(regs.pc);
JS_ASSERT(inlined->inlineIndex < chunk->nInlineFrames); JS_ASSERT(inlined->inlineIndex < chunk->nInlineFrames);
mjit::InlineFrame *frame = &chunk->inlineFrames()[inlined->inlineIndex]; mjit::InlineFrame *frame = &chunk->inlineFrames()[inlined->inlineIndex];
RawScript script = frame->fun->nonLazyScript(); JSScript *script = frame->fun->nonLazyScript();
if (!allowCrossCompartment && script->compartment() != cx_->compartment) if (!allowCrossCompartment && script->compartment() != cx_->compartment)
return NULL; return NULL;
if (ppc) if (ppc)
@ -545,7 +545,7 @@ ContextStack::currentScript(jsbytecode **ppc,
} }
#endif #endif
RawScript script = fp->script(); JSScript *script = fp->script();
if (!allowCrossCompartment && script->compartment() != cx_->compartment) if (!allowCrossCompartment && script->compartment() != cx_->compartment)
return NULL; return NULL;
@ -841,7 +841,7 @@ AbstractFramePtr::isDebuggerFrame() const
#endif #endif
return false; return false;
} }
inline RawScript inline JSScript *
AbstractFramePtr::script() const AbstractFramePtr::script() const
{ {
if (isStackFrame()) if (isStackFrame())

Просмотреть файл

@ -53,7 +53,7 @@ using mozilla::PodCopy;
/*****************************************************************************/ /*****************************************************************************/
void void
StackFrame::initExecuteFrame(RawScript script, StackFrame *prevLink, AbstractFramePtr prev, StackFrame::initExecuteFrame(JSScript *script, StackFrame *prevLink, AbstractFramePtr prev,
FrameRegs *regs, const Value &thisv, JSObject &scopeChain, FrameRegs *regs, const Value &thisv, JSObject &scopeChain,
ExecuteType type) ExecuteType type)
{ {
@ -87,7 +87,7 @@ StackFrame::initExecuteFrame(RawScript script, StackFrame *prevLink, AbstractFra
dstvp[0] = NullValue(); dstvp[0] = NullValue();
exec.script = script; exec.script = script;
#ifdef DEBUG #ifdef DEBUG
u.evalScript = (RawScript)0xbad; u.evalScript = (JSScript *)0xbad;
#endif #endif
} }

Просмотреть файл

@ -292,7 +292,7 @@ class AbstractFramePtr
inline bool isFramePushedByExecute() const; inline bool isFramePushedByExecute() const;
inline bool isDebuggerFrame() const; inline bool isDebuggerFrame() const;
inline RawScript script() const; inline JSScript *script() const;
inline JSFunction *fun() const; inline JSFunction *fun() const;
inline JSFunction *maybeFun() const; inline JSFunction *maybeFun() const;
inline JSFunction *callee() const; inline JSFunction *callee() const;
@ -418,12 +418,12 @@ class StackFrame
private: private:
mutable uint32_t flags_; /* bits described by Flags */ mutable uint32_t flags_; /* bits described by Flags */
union { /* describes what code is executing in a */ union { /* describes what code is executing in a */
RawScript script; /* global frame */ JSScript *script; /* global frame */
JSFunction *fun; /* function frame, pre GetScopeChain */ JSFunction *fun; /* function frame, pre GetScopeChain */
} exec; } exec;
union { /* describes the arguments of a function */ union { /* describes the arguments of a function */
unsigned nactual; /* for non-eval frames */ unsigned nactual; /* for non-eval frames */
RawScript evalScript; /* the script of an eval-in-function */ JSScript *evalScript; /* the script of an eval-in-function */
} u; } u;
mutable JSObject *scopeChain_; /* if HAS_SCOPECHAIN, current scope chain */ mutable JSObject *scopeChain_; /* if HAS_SCOPECHAIN, current scope chain */
StackFrame *prev_; /* if HAS_PREVPC, previous cx->regs->fp */ StackFrame *prev_; /* if HAS_PREVPC, previous cx->regs->fp */
@ -485,13 +485,13 @@ class StackFrame
/* Used for Invoke, Interpret, trace-jit LeaveTree, and method-jit stubs. */ /* Used for Invoke, Interpret, trace-jit LeaveTree, and method-jit stubs. */
void initCallFrame(JSContext *cx, JSFunction &callee, void initCallFrame(JSContext *cx, JSFunction &callee,
RawScript script, uint32_t nactual, StackFrame::Flags flags); JSScript *script, uint32_t nactual, StackFrame::Flags flags);
/* Used for getFixupFrame (for FixupArity). */ /* Used for getFixupFrame (for FixupArity). */
void initFixupFrame(StackFrame *prev, StackFrame::Flags flags, void *ncode, unsigned nactual); void initFixupFrame(StackFrame *prev, StackFrame::Flags flags, void *ncode, unsigned nactual);
/* Used for eval. */ /* Used for eval. */
void initExecuteFrame(RawScript script, StackFrame *prevLink, AbstractFramePtr prev, void initExecuteFrame(JSScript *script, StackFrame *prevLink, AbstractFramePtr prev,
FrameRegs *regs, const Value &thisv, JSObject &scopeChain, FrameRegs *regs, const Value &thisv, JSObject &scopeChain,
ExecuteType type); ExecuteType type);
@ -760,7 +760,7 @@ class StackFrame
* the same VMFrame. Other calls force expansion of the inlined frames. * the same VMFrame. Other calls force expansion of the inlined frames.
*/ */
RawScript script() const { JSScript *script() const {
return isFunctionFrame() return isFunctionFrame()
? isEvalFrame() ? isEvalFrame()
? u.evalScript ? u.evalScript
@ -1342,7 +1342,7 @@ class FrameRegs
} }
/* For stubs::CompileFunction, ContextStack: */ /* For stubs::CompileFunction, ContextStack: */
void prepareToRun(StackFrame &fp, RawScript script) { void prepareToRun(StackFrame &fp, JSScript *script) {
pc = script->code; pc = script->code;
sp = fp.slots() + script->nfixed; sp = fp.slots() + script->nfixed;
fp_ = &fp; fp_ = &fp;
@ -1350,7 +1350,7 @@ class FrameRegs
} }
void setToEndOfScript() { void setToEndOfScript() {
RawScript script = fp()->script(); JSScript *script = fp()->script();
sp = fp()->base(); sp = fp()->base();
pc = script->code + script->length - JSOP_STOP_LENGTH; pc = script->code + script->length - JSOP_STOP_LENGTH;
JS_ASSERT(*pc == JSOP_STOP); JS_ASSERT(*pc == JSOP_STOP);
@ -1770,7 +1770,7 @@ class ContextStack
DONT_ALLOW_CROSS_COMPARTMENT = false, DONT_ALLOW_CROSS_COMPARTMENT = false,
ALLOW_CROSS_COMPARTMENT = true ALLOW_CROSS_COMPARTMENT = true
}; };
inline RawScript currentScript(jsbytecode **pc = NULL, inline JSScript *currentScript(jsbytecode **pc = NULL,
MaybeAllowCrossCompartment = DONT_ALLOW_CROSS_COMPARTMENT) const; MaybeAllowCrossCompartment = DONT_ALLOW_CROSS_COMPARTMENT) const;
/* Get the scope chain for the topmost scripted call on the stack. */ /* Get the scope chain for the topmost scripted call on the stack. */
@ -1965,7 +1965,7 @@ class StackIter
#endif #endif
return data_.state_ == SCRIPTED; return data_.state_ == SCRIPTED;
} }
RawScript script() const { JSScript *script() const {
JS_ASSERT(isScript()); JS_ASSERT(isScript());
if (data_.state_ == SCRIPTED) if (data_.state_ == SCRIPTED)
return interpFrame()->script(); return interpFrame()->script();