mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-01 05:43:46 +00:00
Merge inbound to m-c
This commit is contained in:
commit
caf568aae3
@ -97,7 +97,7 @@ Handler.prototype = {
|
||||
if (desc) {
|
||||
if ("value" in desc) {
|
||||
let [wrapped, path] = this.wrap(target, key, desc.value);
|
||||
desc.value = wrapped
|
||||
desc.value = wrapped;
|
||||
this._emitter.emit("get", path, desc.value);
|
||||
} else {
|
||||
if ("get" in desc) {
|
||||
@ -112,7 +112,8 @@ Handler.prototype = {
|
||||
},
|
||||
defineProperty: function(target, key, desc) {
|
||||
if ("value" in desc) {
|
||||
[desc.value, path] = this.unwrap(target, key, desc.value);
|
||||
let [unwrapped, path] = this.unwrap(target, key, desc.value);
|
||||
desc.value = unwrapped;
|
||||
Object.defineProperty(target, key, desc);
|
||||
this._emitter.emit("set", path, desc.value);
|
||||
} else {
|
||||
|
@ -201,7 +201,7 @@ let testCounter = 0;
|
||||
function doTest(data) {
|
||||
testCounter++;
|
||||
|
||||
[blobs, options, tests] = data;
|
||||
var [blobs, options, tests] = data;
|
||||
|
||||
function runTest(test) {
|
||||
|
||||
|
@ -1211,8 +1211,7 @@ public:
|
||||
bool preventDefaultCalled;
|
||||
nsIScriptGlobalObject* sgo;
|
||||
|
||||
if (aWorkerPrivate ||
|
||||
!(sgo = nsJSUtils::GetStaticScriptGlobal(target))) {
|
||||
if (aWorkerPrivate) {
|
||||
WorkerGlobalScope* globalTarget = aWorkerPrivate->GlobalScope();
|
||||
MOZ_ASSERT(target == globalTarget->GetWrapperPreserveColor());
|
||||
|
||||
@ -1233,7 +1232,7 @@ public:
|
||||
|
||||
preventDefaultCalled = status == nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
else {
|
||||
else if ((sgo = nsJSUtils::GetStaticScriptGlobal(target))) {
|
||||
// Icky, we have to fire an InternalScriptErrorEvent...
|
||||
InternalScriptErrorEvent event(true, NS_LOAD_ERROR);
|
||||
event.lineNr = aLineNumber;
|
||||
|
@ -118,7 +118,7 @@ extern JS_PUBLIC_DATA(const HandleValue) UndefinedHandleValue;
|
||||
|
||||
namespace detail {
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef JS_DEBUG
|
||||
extern JS_PUBLIC_API(void)
|
||||
CheckIsValidConstructible(Value v);
|
||||
#endif
|
||||
@ -147,7 +147,7 @@ class MOZ_STACK_CLASS UsedRvalBase<NoUsedRval>
|
||||
|
||||
template<UsedRval WantUsedRval>
|
||||
class MOZ_STACK_CLASS CallReceiverBase : public UsedRvalBase<
|
||||
#ifdef DEBUG
|
||||
#ifdef JS_DEBUG
|
||||
WantUsedRval
|
||||
#else
|
||||
NoUsedRval
|
||||
@ -197,7 +197,7 @@ class MOZ_STACK_CLASS CallReceiverBase : public UsedRvalBase<
|
||||
}
|
||||
|
||||
bool isConstructing() const {
|
||||
#ifdef DEBUG
|
||||
#ifdef JS_DEBUG
|
||||
if (this->usedRval_)
|
||||
CheckIsValidConstructible(calleev());
|
||||
#endif
|
||||
|
@ -214,7 +214,7 @@ GetGCNumber();
|
||||
|
||||
class JS_PUBLIC_API(AutoAssertNoGC)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
#ifdef JS_DEBUG
|
||||
JSRuntime *runtime;
|
||||
size_t gcNumber;
|
||||
|
||||
|
@ -763,7 +763,7 @@ class HashTable : private AllocPolicy
|
||||
public:
|
||||
// Leaves Ptr uninitialized.
|
||||
Ptr() {
|
||||
#ifdef DEBUG
|
||||
#ifdef JS_DEBUG
|
||||
entry_ = (Entry *)0xbad;
|
||||
#endif
|
||||
}
|
||||
@ -919,7 +919,7 @@ class HashTable : private AllocPolicy
|
||||
hashShift = sHashBits - sizeLog2;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef JS_DEBUG
|
||||
mutable struct Stats
|
||||
{
|
||||
uint32_t searches; // total number of table searches
|
||||
|
@ -49,7 +49,7 @@ FormatStackDump(JSContext *cx, char *buf, bool showArgs, bool showLocals, bool s
|
||||
|
||||
}
|
||||
|
||||
# ifdef DEBUG
|
||||
# ifdef JS_DEBUG
|
||||
JS_FRIEND_API(void) js_DumpValue(const JS::Value &val);
|
||||
JS_FRIEND_API(void) js_DumpId(jsid id);
|
||||
JS_FRIEND_API(void) js_DumpStackFrame(JSContext *cx, js::StackFrame *start = nullptr);
|
||||
|
@ -150,7 +150,7 @@ template <typename T> class PersistentRooted;
|
||||
/* This is exposing internal state of the GC for inlining purposes. */
|
||||
JS_FRIEND_API(bool) isGCEnabled();
|
||||
|
||||
#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)
|
||||
#if defined(JS_DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)
|
||||
extern void
|
||||
CheckStackRoots(JSContext *cx);
|
||||
#endif
|
||||
@ -265,7 +265,7 @@ class Heap : public js::HeapBase<T>
|
||||
T ptr;
|
||||
};
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef JS_DEBUG
|
||||
/*
|
||||
* For generational GC, assert that an object is in the tenured generation as
|
||||
* opposed to being in the nursery.
|
||||
@ -648,7 +648,7 @@ struct GCMethods<T *>
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined(DEBUG)
|
||||
#if defined(JS_DEBUG)
|
||||
/* This helper allows us to assert that Rooted<T> is scoped within a request. */
|
||||
extern JS_PUBLIC_API(bool)
|
||||
IsInRequest(JSContext *cx);
|
||||
@ -798,7 +798,7 @@ class MOZ_STACK_CLASS Rooted : public js::RootedBase<T>
|
||||
Rooted<void*> **stack, *prev;
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)
|
||||
#if defined(JS_DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)
|
||||
/* Has the rooting analysis ever scanned this Rooted's stack location? */
|
||||
friend void JS::CheckStackRoots(JSContext*);
|
||||
#endif
|
||||
@ -836,7 +836,7 @@ namespace js {
|
||||
*/
|
||||
class SkipRoot
|
||||
{
|
||||
#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)
|
||||
#if defined(JS_DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)
|
||||
|
||||
SkipRoot **stack, *prev;
|
||||
const uint8_t *start;
|
||||
@ -864,7 +864,7 @@ class SkipRoot
|
||||
return v >= start && v + len <= end;
|
||||
}
|
||||
|
||||
#else /* DEBUG && JSGC_ROOT_ANALYSIS */
|
||||
#else /* JS_DEBUG && JSGC_ROOT_ANALYSIS */
|
||||
|
||||
template <typename T>
|
||||
void init(js::ContextFriendFields *cx, const T *ptr, size_t count) {}
|
||||
@ -875,7 +875,7 @@ class SkipRoot
|
||||
// unused local variables of this type.
|
||||
}
|
||||
|
||||
#endif /* DEBUG && JSGC_ROOT_ANALYSIS */
|
||||
#endif /* JS_DEBUG && JSGC_ROOT_ANALYSIS */
|
||||
|
||||
template <typename T>
|
||||
SkipRoot(JSContext *cx, const T *ptr, size_t count = 1
|
||||
@ -1204,7 +1204,7 @@ namespace js {
|
||||
*/
|
||||
inline void MaybeCheckStackRoots(JSContext *cx)
|
||||
{
|
||||
#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)
|
||||
#if defined(JS_DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)
|
||||
JS::CheckStackRoots(cx);
|
||||
#endif
|
||||
}
|
||||
|
@ -20,6 +20,8 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "js-config.h"
|
||||
|
||||
struct JSContext;
|
||||
class JSFunction;
|
||||
class JSObject;
|
||||
@ -40,7 +42,7 @@ class JSString;
|
||||
// oblivious to the change. This feature can be explicitly disabled in debug
|
||||
// builds by defining JS_NO_JSVAL_JSID_STRUCT_TYPES.
|
||||
//
|
||||
#if defined(DEBUG) && !defined(JS_NO_JSVAL_JSID_STRUCT_TYPES)
|
||||
#if defined(JS_DEBUG) && !defined(JS_NO_JSVAL_JSID_STRUCT_TYPES)
|
||||
# define JS_USE_JSID_STRUCT_TYPES
|
||||
#endif
|
||||
|
||||
|
@ -45,7 +45,7 @@ namespace js {}
|
||||
#define JS_ALWAYS_TRUE(expr) MOZ_ALWAYS_TRUE(expr)
|
||||
#define JS_ALWAYS_FALSE(expr) MOZ_ALWAYS_FALSE(expr)
|
||||
|
||||
#if defined(DEBUG)
|
||||
#if defined(JS_DEBUG)
|
||||
# define JS_DIAGNOSTICS_ASSERT(expr) MOZ_ASSERT(expr)
|
||||
#elif defined(JS_CRASH_DIAGNOSTICS)
|
||||
# define JS_DIAGNOSTICS_ASSERT(expr) do { if (!(expr)) MOZ_CRASH(); } while(0)
|
||||
@ -72,7 +72,7 @@ extern JS_PUBLIC_API(void) JS_Abort(void);
|
||||
#if defined JS_USE_CUSTOM_ALLOCATOR
|
||||
# include "jscustomallocator.h"
|
||||
#else
|
||||
# ifdef DEBUG
|
||||
# ifdef JS_DEBUG
|
||||
/*
|
||||
* In order to test OOM conditions, when the testing function
|
||||
* oomAfterAllocations COUNT is passed, we fail continuously after the NUM'th
|
||||
@ -136,7 +136,7 @@ PrintBacktrace()
|
||||
# else
|
||||
# define JS_OOM_POSSIBLY_FAIL() do {} while(0)
|
||||
# define JS_OOM_POSSIBLY_FAIL_REPORT(cx) do {} while(0)
|
||||
# endif /* DEBUG */
|
||||
# endif /* JS_DEBUG */
|
||||
|
||||
static inline void* js_malloc(size_t bytes)
|
||||
{
|
||||
@ -535,7 +535,7 @@ namespace JS {
|
||||
|
||||
inline void PoisonPtr(void *v)
|
||||
{
|
||||
#if defined(JSGC_ROOT_ANALYSIS) && defined(DEBUG)
|
||||
#if defined(JSGC_ROOT_ANALYSIS) && defined(JS_DEBUG)
|
||||
uint8_t *ptr = (uint8_t *) v + 3;
|
||||
*ptr = JS_FREE_PATTERN;
|
||||
#endif
|
||||
@ -544,7 +544,7 @@ inline void PoisonPtr(void *v)
|
||||
template <typename T>
|
||||
inline bool IsPoisonedPtr(T *v)
|
||||
{
|
||||
#if defined(JSGC_ROOT_ANALYSIS) && defined(DEBUG)
|
||||
#if defined(JSGC_ROOT_ANALYSIS) && defined(JS_DEBUG)
|
||||
uint32_t mask = uintptr_t(v) & 0xff000000;
|
||||
return mask == uint32_t(JS_FREE_PATTERN << 24);
|
||||
#else
|
||||
|
@ -1740,7 +1740,7 @@ inline Anchor<Value>::~Anchor()
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef JS_DEBUG
|
||||
namespace detail {
|
||||
|
||||
struct ValueAlignmentTester { char c; JS::Value v; };
|
||||
@ -1752,7 +1752,7 @@ static_assert(sizeof(LayoutAlignmentTester) == 16,
|
||||
"jsval_layout must be 16-byte-aligned");
|
||||
|
||||
} // namespace detail
|
||||
#endif /* DEBUG */
|
||||
#endif /* JS_DEBUG */
|
||||
|
||||
} // namespace JS
|
||||
|
||||
|
@ -263,7 +263,7 @@ EvalKernel(JSContext *cx, const CallArgs &args, EvalType evalType, AbstractFrame
|
||||
RootedValue thisv(cx);
|
||||
if (evalType == DIRECT_EVAL) {
|
||||
JS_ASSERT_IF(caller.isStackFrame(), !caller.asStackFrame()->runningInJit());
|
||||
staticLevel = caller.script()->staticLevel + 1;
|
||||
staticLevel = caller.script()->staticLevel() + 1;
|
||||
|
||||
// Direct calls to eval are supposed to see the caller's |this|. If we
|
||||
// haven't wrapped that yet, do so now, before we make a copy of it for
|
||||
@ -347,7 +347,7 @@ js::DirectEvalStringFromIon(JSContext *cx,
|
||||
|
||||
// ES5 15.1.2.1 steps 2-8.
|
||||
|
||||
unsigned staticLevel = callerScript->staticLevel + 1;
|
||||
unsigned staticLevel = callerScript->staticLevel() + 1;
|
||||
|
||||
Rooted<JSStableString*> stableStr(cx, str->ensureStable(cx));
|
||||
if (!stableStr)
|
||||
|
@ -880,15 +880,17 @@ DumpHeapComplete(JSContext *cx, unsigned argc, jsval *vp)
|
||||
if (argc > i) {
|
||||
Value v = args[i];
|
||||
if (v.isString()) {
|
||||
JSString *str = v.toString();
|
||||
JSAutoByteString fileNameBytes;
|
||||
if (!fileNameBytes.encodeLatin1(cx, str))
|
||||
return false;
|
||||
const char *fileName = fileNameBytes.ptr();
|
||||
dumpFile = fopen(fileName, "w");
|
||||
if (!dumpFile) {
|
||||
JS_ReportError(cx, "can't open %s", fileName);
|
||||
return false;
|
||||
if (!fuzzingSafe) {
|
||||
JSString *str = v.toString();
|
||||
JSAutoByteString fileNameBytes;
|
||||
if (!fileNameBytes.encodeLatin1(cx, str))
|
||||
return false;
|
||||
const char *fileName = fileNameBytes.ptr();
|
||||
dumpFile = fopen(fileName, "w");
|
||||
if (!dumpFile) {
|
||||
JS_ReportError(cx, "can't open %s", fileName);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
++i;
|
||||
}
|
||||
|
@ -3457,6 +3457,13 @@ MOZ_ARG_ENABLE_BOOL(vtune,
|
||||
MOZ_VTUNE=1,
|
||||
MOZ_VTUNE= )
|
||||
|
||||
dnl ========================================================
|
||||
dnl Debug (see Bug 939505)
|
||||
dnl ========================================================
|
||||
if test -n "$MOZ_DEBUG"; then
|
||||
AC_DEFINE(JS_DEBUG)
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl Profiling
|
||||
dnl ========================================================
|
||||
|
@ -892,7 +892,7 @@ EmitAliasedVarOp(ExclusiveContext *cx, JSOp op, ParseNode *pn, BytecodeEmitter *
|
||||
}
|
||||
} else {
|
||||
JS_ASSERT(pn->isDefn());
|
||||
JS_ASSERT(pn->pn_cookie.level() == bce->script->staticLevel);
|
||||
JS_ASSERT(pn->pn_cookie.level() == bce->script->staticLevel());
|
||||
}
|
||||
|
||||
ScopeCoordinate sc;
|
||||
@ -939,7 +939,7 @@ EmitVarOp(ExclusiveContext *cx, ParseNode *pn, JSOp op, BytecodeEmitter *bce)
|
||||
if (!bce->isAliasedName(pn)) {
|
||||
JS_ASSERT(pn->isUsed() || pn->isDefn());
|
||||
JS_ASSERT_IF(pn->isUsed(), pn->pn_cookie.level() == 0);
|
||||
JS_ASSERT_IF(pn->isDefn(), pn->pn_cookie.level() == bce->script->staticLevel);
|
||||
JS_ASSERT_IF(pn->isDefn(), pn->pn_cookie.level() == bce->script->staticLevel());
|
||||
return EmitUnaliasedVarOp(cx, op, pn->pn_cookie.slot(), bce);
|
||||
}
|
||||
|
||||
@ -1012,7 +1012,7 @@ BytecodeEmitter::isAliasedName(ParseNode *pn)
|
||||
JS_ASSERT(dn->isBound());
|
||||
|
||||
/* If dn is in an enclosing function, it is definitely aliased. */
|
||||
if (dn->pn_cookie.level() != script->staticLevel)
|
||||
if (dn->pn_cookie.level() != script->staticLevel())
|
||||
return true;
|
||||
|
||||
switch (dn->kind()) {
|
||||
@ -1428,7 +1428,7 @@ BindNameToSlotHelper(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn)
|
||||
* Currently, the ALIASEDVAR ops do not support accessing the
|
||||
* callee of a DeclEnvObject, so use NAME.
|
||||
*/
|
||||
if (dn->pn_cookie.level() != bce->script->staticLevel)
|
||||
if (dn->pn_cookie.level() != bce->script->staticLevel())
|
||||
return true;
|
||||
|
||||
DebugOnly<JSFunction *> fun = bce->sc->asFunctionBox()->function();
|
||||
@ -1481,7 +1481,7 @@ BindNameToSlotHelper(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn)
|
||||
* the definition is the number of function scopes between the current
|
||||
* scope and dn's scope.
|
||||
*/
|
||||
unsigned skip = bce->script->staticLevel - dn->pn_cookie.level();
|
||||
unsigned skip = bce->script->staticLevel() - dn->pn_cookie.level();
|
||||
JS_ASSERT_IF(skip, dn->isClosed());
|
||||
|
||||
/*
|
||||
@ -4817,7 +4817,7 @@ EmitFunc(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn)
|
||||
Rooted<JSObject*> enclosingScope(cx, EnclosingStaticScope(bce));
|
||||
Rooted<JSObject*> sourceObject(cx, bce->script->sourceObject());
|
||||
Rooted<JSScript*> script(cx, JSScript::Create(cx, enclosingScope, false, options,
|
||||
parent->staticLevel + 1,
|
||||
parent->staticLevel() + 1,
|
||||
sourceObject,
|
||||
funbox->bufStart, funbox->bufEnd));
|
||||
if (!script)
|
||||
|
@ -224,7 +224,7 @@ JS_GetTraceThingInfo(char *buf, size_t bufsize, JSTracer *trc, void *thing,
|
||||
case JSTRACE_SCRIPT:
|
||||
{
|
||||
JSScript *script = static_cast<JSScript *>(thing);
|
||||
JS_snprintf(buf, bufsize, " %s:%u", script->filename(), unsigned(script->lineno));
|
||||
JS_snprintf(buf, bufsize, " %s:%u", script->filename(), unsigned(script->lineno()));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,7 @@
|
||||
|
||||
if (getBuildConfiguration()['generational-gc'])
|
||||
quit();
|
||||
|
||||
gczeal(2);
|
||||
var g = newGlobal();
|
||||
var dbg = new Debugger(g);
|
||||
|
@ -474,7 +474,7 @@ InitFromBailout(JSContext *cx, HandleScript caller, jsbytecode *callerPC,
|
||||
if (excInfo)
|
||||
exprStackSlots = excInfo->numExprSlots;
|
||||
else
|
||||
exprStackSlots = iter.slots() - (script->nfixed + CountArgSlots(script, fun));
|
||||
exprStackSlots = iter.slots() - (script->nfixed() + CountArgSlots(script, fun));
|
||||
|
||||
builder.resetFramePushed();
|
||||
|
||||
@ -502,7 +502,7 @@ InitFromBailout(JSContext *cx, HandleScript caller, jsbytecode *callerPC,
|
||||
// | ReturnAddr | <-- return into main jitcode after IC
|
||||
// +===============+
|
||||
|
||||
IonSpew(IonSpew_BaselineBailouts, " Unpacking %s:%d", script->filename(), script->lineno);
|
||||
IonSpew(IonSpew_BaselineBailouts, " Unpacking %s:%d", script->filename(), script->lineno());
|
||||
IonSpew(IonSpew_BaselineBailouts, " [BASELINE-JS FRAME]");
|
||||
|
||||
// Calculate and write the previous frame pointer value.
|
||||
@ -521,7 +521,7 @@ InitFromBailout(JSContext *cx, HandleScript caller, jsbytecode *callerPC,
|
||||
|
||||
// Initialize BaselineFrame::frameSize
|
||||
uint32_t frameSize = BaselineFrame::Size() + BaselineFrame::FramePointerOffset +
|
||||
(sizeof(Value) * (script->nfixed + exprStackSlots));
|
||||
(sizeof(Value) * (script->nfixed() + exprStackSlots));
|
||||
IonSpew(IonSpew_BaselineBailouts, " FrameSize=%d", (int) frameSize);
|
||||
blFrame->setFrameSize(frameSize);
|
||||
|
||||
@ -627,7 +627,7 @@ InitFromBailout(JSContext *cx, HandleScript caller, jsbytecode *callerPC,
|
||||
|
||||
JS_ASSERT(iter.slots() >= CountArgSlots(script, fun));
|
||||
IonSpew(IonSpew_BaselineBailouts, " frame slots %u, nargs %u, nfixed %u",
|
||||
iter.slots(), fun->nargs, script->nfixed);
|
||||
iter.slots(), fun->nargs, script->nfixed());
|
||||
|
||||
if (!callerPC) {
|
||||
// This is the first frame. Store the formals in a Vector until we
|
||||
@ -653,7 +653,7 @@ InitFromBailout(JSContext *cx, HandleScript caller, jsbytecode *callerPC,
|
||||
}
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < script->nfixed; i++) {
|
||||
for (uint32_t i = 0; i < script->nfixed(); i++) {
|
||||
Value slot = iter.read();
|
||||
if (!builder.writeValue(slot, "FixedValue"))
|
||||
return false;
|
||||
@ -825,7 +825,7 @@ InitFromBailout(JSContext *cx, HandleScript caller, jsbytecode *callerPC,
|
||||
|
||||
IonSpew(IonSpew_BaselineBailouts, " Resuming %s pc offset %d (op %s) (line %d) of %s:%d",
|
||||
resumeAfter ? "after" : "at", (int) pcOff, js_CodeName[op],
|
||||
PCToLineNumber(script, pc), script->filename(), (int) script->lineno);
|
||||
PCToLineNumber(script, pc), script->filename(), (int) script->lineno());
|
||||
IonSpew(IonSpew_BaselineBailouts, " Bailout kind: %s",
|
||||
BailoutKindString(bailoutKind));
|
||||
#endif
|
||||
@ -959,7 +959,7 @@ InitFromBailout(JSContext *cx, HandleScript caller, jsbytecode *callerPC,
|
||||
if (caller && bailoutKind == Bailout_ArgumentCheck) {
|
||||
IonSpew(IonSpew_BaselineBailouts, " Setting PCidx on innermost "
|
||||
"inlined frame's parent's SPS entry (%s:%d) (pcIdx=%d)!",
|
||||
caller->filename(), caller->lineno, caller->pcToOffset(callerPC));
|
||||
caller->filename(), caller->lineno(), caller->pcToOffset(callerPC));
|
||||
cx->runtime()->spsProfiler.updatePC(caller, callerPC);
|
||||
} else if (bailoutKind != Bailout_ArgumentCheck) {
|
||||
IonSpew(IonSpew_BaselineBailouts,
|
||||
@ -1057,7 +1057,7 @@ InitFromBailout(JSContext *cx, HandleScript caller, jsbytecode *callerPC,
|
||||
|
||||
JS_ASSERT(actualArgc + 2 <= exprStackSlots);
|
||||
for (unsigned i = 0; i < actualArgc + 1; i++) {
|
||||
size_t argSlot = (script->nfixed + exprStackSlots) - (i + 1);
|
||||
size_t argSlot = (script->nfixed() + exprStackSlots) - (i + 1);
|
||||
if (!builder.writeValue(*blFrame->valueSlot(argSlot), "ArgVal"))
|
||||
return false;
|
||||
}
|
||||
@ -1236,7 +1236,7 @@ jit::BailoutIonToBaseline(JSContext *cx, JitActivation *activation, IonBailoutIt
|
||||
// +---------------+
|
||||
|
||||
IonSpew(IonSpew_BaselineBailouts, "Bailing to baseline %s:%u (IonScript=%p) (FrameType=%d)",
|
||||
iter.script()->filename(), iter.script()->lineno, (void *) iter.ionScript(),
|
||||
iter.script()->filename(), iter.script()->lineno(), (void *) iter.ionScript(),
|
||||
(int) prevFrameType);
|
||||
|
||||
if (excInfo)
|
||||
@ -1260,7 +1260,7 @@ jit::BailoutIonToBaseline(JSContext *cx, JitActivation *activation, IonBailoutIt
|
||||
RootedFunction callee(cx, iter.maybeCallee());
|
||||
if (callee) {
|
||||
IonSpew(IonSpew_BaselineBailouts, " Callee function (%s:%u)",
|
||||
callee->existingScript()->filename(), callee->existingScript()->lineno);
|
||||
callee->existingScript()->filename(), callee->existingScript()->lineno());
|
||||
} else {
|
||||
IonSpew(IonSpew_BaselineBailouts, " No callee!");
|
||||
}
|
||||
@ -1351,8 +1351,8 @@ static bool
|
||||
HandleBoundsCheckFailure(JSContext *cx, HandleScript outerScript, HandleScript innerScript)
|
||||
{
|
||||
IonSpew(IonSpew_Bailouts, "Bounds check failure %s:%d, inlined into %s:%d",
|
||||
innerScript->filename(), innerScript->lineno,
|
||||
outerScript->filename(), outerScript->lineno);
|
||||
innerScript->filename(), innerScript->lineno(),
|
||||
outerScript->filename(), outerScript->lineno());
|
||||
|
||||
JS_ASSERT(!outerScript->ionScript()->invalidated());
|
||||
|
||||
@ -1370,8 +1370,8 @@ static bool
|
||||
HandleShapeGuardFailure(JSContext *cx, HandleScript outerScript, HandleScript innerScript)
|
||||
{
|
||||
IonSpew(IonSpew_Bailouts, "Shape guard failure %s:%d, inlined into %s:%d",
|
||||
innerScript->filename(), innerScript->lineno,
|
||||
outerScript->filename(), outerScript->lineno);
|
||||
innerScript->filename(), innerScript->lineno(),
|
||||
outerScript->filename(), outerScript->lineno());
|
||||
|
||||
JS_ASSERT(!outerScript->ionScript()->invalidated());
|
||||
|
||||
@ -1387,8 +1387,8 @@ static bool
|
||||
HandleBaselineInfoBailout(JSContext *cx, JSScript *outerScript, JSScript *innerScript)
|
||||
{
|
||||
IonSpew(IonSpew_Bailouts, "Baseline info failure %s:%d, inlined into %s:%d",
|
||||
innerScript->filename(), innerScript->lineno,
|
||||
outerScript->filename(), outerScript->lineno);
|
||||
innerScript->filename(), innerScript->lineno(),
|
||||
outerScript->filename(), outerScript->lineno());
|
||||
|
||||
JS_ASSERT(!outerScript->ionScript()->invalidated());
|
||||
|
||||
@ -1480,8 +1480,8 @@ jit::FinishBailoutToBaseline(BaselineBailoutInfo *bailoutInfo)
|
||||
JS_ASSERT(outerScript);
|
||||
IonSpew(IonSpew_BaselineBailouts,
|
||||
" Restored outerScript=(%s:%u,%u) innerScript=(%s:%u,%u) (bailoutKind=%u)",
|
||||
outerScript->filename(), outerScript->lineno, outerScript->getUseCount(),
|
||||
innerScript->filename(), innerScript->lineno, innerScript->getUseCount(),
|
||||
outerScript->filename(), outerScript->lineno(), outerScript->getUseCount(),
|
||||
innerScript->filename(), innerScript->lineno(), innerScript->getUseCount(),
|
||||
(unsigned) bailoutKind);
|
||||
|
||||
switch (bailoutKind) {
|
||||
|
@ -69,10 +69,10 @@ MethodStatus
|
||||
BaselineCompiler::compile()
|
||||
{
|
||||
IonSpew(IonSpew_BaselineScripts, "Baseline compiling script %s:%d (%p)",
|
||||
script->filename(), script->lineno, script.get());
|
||||
script->filename(), script->lineno(), script.get());
|
||||
|
||||
IonSpew(IonSpew_Codegen, "# Emitting baseline code for script %s:%d",
|
||||
script->filename(), script->lineno);
|
||||
script->filename(), script->lineno());
|
||||
|
||||
if (cx->typeInferenceEnabled() && !script->ensureHasTypes(cx))
|
||||
return Method_Error;
|
||||
@ -172,7 +172,7 @@ BaselineCompiler::compile()
|
||||
spsPushToggleOffset_.fixup(&masm);
|
||||
|
||||
// Note: There is an extra entry in the bytecode type map for the search hint, see below.
|
||||
size_t bytecodeTypeMapEntries = cx->typeInferenceEnabled() ? script->nTypeSets + 1 : 0;
|
||||
size_t bytecodeTypeMapEntries = cx->typeInferenceEnabled() ? script->nTypeSets() + 1 : 0;
|
||||
|
||||
BaselineScript *baselineScript = BaselineScript::New(cx, prologueOffset_.offset(),
|
||||
spsPushToggleOffset_.offset(),
|
||||
@ -190,7 +190,7 @@ BaselineCompiler::compile()
|
||||
|
||||
IonSpew(IonSpew_BaselineScripts, "Created BaselineScript %p (raw %p) for %s:%d",
|
||||
(void *) script->baselineScript(), (void *) code->raw(),
|
||||
script->filename(), script->lineno);
|
||||
script->filename(), script->lineno());
|
||||
|
||||
#ifdef JS_ION_PERF
|
||||
writePerfSpewerBaselineProfile(script, code);
|
||||
@ -239,16 +239,16 @@ BaselineCompiler::compile()
|
||||
JSOp op = JSOp(*pc);
|
||||
if (js_CodeSpec[op].format & JOF_TYPESET) {
|
||||
bytecodeMap[added++] = script->pcToOffset(pc);
|
||||
if (added == script->nTypeSets)
|
||||
if (added == script->nTypeSets())
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
JS_ASSERT(added == script->nTypeSets);
|
||||
JS_ASSERT(added == script->nTypeSets());
|
||||
|
||||
// The last entry in the last index found, and is used to avoid binary
|
||||
// searches for the sought entry when queries are in linear order.
|
||||
bytecodeMap[script->nTypeSets] = 0;
|
||||
bytecodeMap[script->nTypeSets()] = 0;
|
||||
}
|
||||
|
||||
if (script->compartment()->debugMode())
|
||||
@ -456,7 +456,7 @@ BaselineCompiler::emitStackCheck(bool earlyCheck)
|
||||
{
|
||||
Label skipCall;
|
||||
uintptr_t *limitAddr = &cx->runtime()->mainThread.ionStackLimit;
|
||||
uint32_t slotsSize = script->nslots * sizeof(Value);
|
||||
uint32_t slotsSize = script->nslots() * sizeof(Value);
|
||||
uint32_t tolerance = earlyCheck ? slotsSize : 0;
|
||||
|
||||
masm.movePtr(BaselineStackReg, R1.scratchReg());
|
||||
|
@ -190,7 +190,7 @@ class BaselineCompiler : public BaselineCompilerSpecific
|
||||
// early stack check.
|
||||
static const unsigned EARLY_STACK_CHECK_SLOT_COUNT = 128;
|
||||
bool needsEarlyStackCheck() const {
|
||||
return script->nslots > EARLY_STACK_CHECK_SLOT_COUNT;
|
||||
return script->nslots() > EARLY_STACK_CHECK_SLOT_COUNT;
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -56,7 +56,7 @@ BaselineFrame::trace(JSTracer *trc)
|
||||
bool
|
||||
BaselineFrame::copyRawFrameSlots(AutoValueVector *vec) const
|
||||
{
|
||||
unsigned nfixed = script()->nfixed;
|
||||
unsigned nfixed = script()->nfixed();
|
||||
unsigned nformals = numFormalArgs();
|
||||
|
||||
if (!vec->resize(nformals + nfixed))
|
||||
|
@ -152,7 +152,7 @@ class BaselineFrame
|
||||
|
||||
Value &unaliasedVar(unsigned i, MaybeCheckAliasing checkAliasing = CHECK_ALIASING) const {
|
||||
JS_ASSERT_IF(checkAliasing, !script()->varIsAliased(i));
|
||||
JS_ASSERT(i < script()->nfixed);
|
||||
JS_ASSERT(i < script()->nfixed());
|
||||
return *valueSlot(i);
|
||||
}
|
||||
|
||||
@ -334,7 +334,7 @@ class BaselineFrame
|
||||
return isEvalFrame() && !script()->strict;
|
||||
}
|
||||
bool isDirectEvalFrame() const {
|
||||
return isEvalFrame() && script()->staticLevel > 0;
|
||||
return isEvalFrame() && script()->staticLevel() > 0;
|
||||
}
|
||||
bool isNonStrictDirectEvalFrame() const {
|
||||
return isNonStrictEvalFrame() && isDirectEvalFrame();
|
||||
|
@ -17,7 +17,7 @@ bool
|
||||
FrameInfo::init(TempAllocator &alloc)
|
||||
{
|
||||
// One slot is always needed for this/arguments type checks.
|
||||
size_t nstack = Max(script->nslots - script->nfixed, 1);
|
||||
size_t nstack = Max(script->nslots() - script->nfixed(), size_t(1));
|
||||
if (!stack.init(alloc, nstack))
|
||||
return false;
|
||||
|
||||
|
@ -179,7 +179,7 @@ class FrameInfo
|
||||
bool init(TempAllocator &alloc);
|
||||
|
||||
uint32_t nlocals() const {
|
||||
return script->nfixed;
|
||||
return script->nfixed();
|
||||
}
|
||||
uint32_t nargs() const {
|
||||
return script->function()->nargs;
|
||||
|
@ -54,7 +54,7 @@ FallbackICSpew(JSContext *cx, ICFallbackStub *stub, const char *fmt, ...)
|
||||
IonSpew(IonSpew_BaselineICFallback,
|
||||
"Fallback hit for (%s:%d) (pc=%d,line=%d,uses=%d,stubs=%d): %s",
|
||||
script->filename(),
|
||||
script->lineno,
|
||||
script->lineno(),
|
||||
(int) script->pcToOffset(pc),
|
||||
PCToLineNumber(script, pc),
|
||||
script->getUseCount(),
|
||||
@ -79,7 +79,7 @@ TypeFallbackICSpew(JSContext *cx, ICTypeMonitor_Fallback *stub, const char *fmt,
|
||||
IonSpew(IonSpew_BaselineICFallback,
|
||||
"Type monitor fallback hit for (%s:%d) (pc=%d,line=%d,uses=%d,stubs=%d): %s",
|
||||
script->filename(),
|
||||
script->lineno,
|
||||
script->lineno(),
|
||||
(int) script->pcToOffset(pc),
|
||||
PCToLineNumber(script, pc),
|
||||
script->getUseCount(),
|
||||
@ -926,7 +926,7 @@ DoUseCountFallback(JSContext *cx, ICUseCount_Fallback *stub, BaselineFrame *fram
|
||||
// Ensure that Ion-compiled code is available.
|
||||
IonSpew(IonSpew_BaselineOSR,
|
||||
"UseCount for %s:%d reached %d at pc %p, trying to switch to Ion!",
|
||||
script->filename(), script->lineno, (int) script->getUseCount(), (void *) pc);
|
||||
script->filename(), script->lineno(), (int) script->getUseCount(), (void *) pc);
|
||||
void *jitcode = nullptr;
|
||||
if (!EnsureCanEnterIon(cx, stub, frame, script, pc, &jitcode))
|
||||
return false;
|
||||
@ -1056,7 +1056,7 @@ DoProfilerFallback(JSContext *cx, BaselineFrame *frame, ICProfiler_Fallback *stu
|
||||
return false;
|
||||
|
||||
IonSpew(IonSpew_BaselineIC, " Generating Profiler_PushFunction stub for %s:%d",
|
||||
script->filename(), script->lineno);
|
||||
script->filename(), script->lineno());
|
||||
|
||||
// Create a new optimized stub.
|
||||
ICProfiler_PushFunction::Compiler compiler(cx, string, script);
|
||||
@ -3779,7 +3779,7 @@ static bool TryAttachNativeGetElemStub(JSContext *cx, HandleScript script, jsbyt
|
||||
"(obj=%p, shape=%p, holder=%p, holderShape=%p)",
|
||||
(obj == holder) ? "direct" : "prototype",
|
||||
needsAtomize ? " atomizing" : "",
|
||||
getter->nonLazyScript()->filename(), getter->nonLazyScript()->lineno,
|
||||
getter->nonLazyScript()->filename(), getter->nonLazyScript()->lineno(),
|
||||
obj.get(), obj->lastProperty(), holder.get(), holder->lastProperty());
|
||||
} else {
|
||||
IonSpew(IonSpew_BaselineIC,
|
||||
@ -6091,7 +6091,7 @@ TryAttachNativeGetPropStub(JSContext *cx, HandleScript script, jsbytecode *pc,
|
||||
JS_ASSERT(callee->hasScript());
|
||||
|
||||
IonSpew(IonSpew_BaselineIC, " Generating GetProp(NativeObj/ScriptedGetter %s:%d) stub",
|
||||
callee->nonLazyScript()->filename(), callee->nonLazyScript()->lineno);
|
||||
callee->nonLazyScript()->filename(), callee->nonLazyScript()->lineno());
|
||||
|
||||
ICGetProp_CallScripted::Compiler compiler(cx, monitorStub, obj, holder, callee,
|
||||
script->pcToOffset(pc));
|
||||
@ -7110,7 +7110,7 @@ TryAttachSetPropStub(JSContext *cx, HandleScript script, jsbytecode *pc, ICSetPr
|
||||
JS_ASSERT(callee->hasScript());
|
||||
|
||||
IonSpew(IonSpew_BaselineIC, " Generating SetProp(NativeObj/ScriptedSetter %s:%d) stub",
|
||||
callee->nonLazyScript()->filename(), callee->nonLazyScript()->lineno);
|
||||
callee->nonLazyScript()->filename(), callee->nonLazyScript()->lineno());
|
||||
|
||||
ICSetProp_CallScripted::Compiler compiler(cx, obj, holder, callee, script->pcToOffset(pc));
|
||||
ICStub *newStub = compiler.getStub(compiler.getStubSpace(script));
|
||||
@ -7900,7 +7900,7 @@ TryAttachCallStub(JSContext *cx, ICCall_Fallback *stub, HandleScript script, jsb
|
||||
|
||||
IonSpew(IonSpew_BaselineIC,
|
||||
" Generating Call_Scripted stub (fun=%p, %s:%d, cons=%s)",
|
||||
fun.get(), fun->nonLazyScript()->filename(), fun->nonLazyScript()->lineno,
|
||||
fun.get(), fun->nonLazyScript()->filename(), fun->nonLazyScript()->lineno(),
|
||||
constructing ? "yes" : "no");
|
||||
ICCallScriptedCompiler compiler(cx, stub->fallbackMonitorStub()->firstMonitorStub(),
|
||||
calleeScript, templateObject,
|
||||
|
@ -174,7 +174,7 @@ jit::EnterBaselineAtBranch(JSContext *cx, StackFrame *fp, jsbytecode *pc)
|
||||
data.jitcode += MacroAssembler::ToggledCallSize();
|
||||
|
||||
data.osrFrame = fp;
|
||||
data.osrNumStackValues = fp->script()->nfixed + cx->interpreterRegs().stackDepth();
|
||||
data.osrNumStackValues = fp->script()->nfixed() + cx->interpreterRegs().stackDepth();
|
||||
|
||||
RootedValue thisv(cx);
|
||||
|
||||
@ -247,7 +247,7 @@ CanEnterBaselineJIT(JSContext *cx, HandleScript script, bool osr)
|
||||
{
|
||||
// Limit the locals on a given script so that stack check on baseline frames
|
||||
// doesn't overflow a uint32_t value.
|
||||
static_assert(sizeof(script->nslots) == sizeof(uint16_t), "script->nslots may get too large!");
|
||||
JS_ASSERT(script->nslots() <= UINT16_MAX);
|
||||
|
||||
JS_ASSERT(jit::IsBaselineEnabled(cx));
|
||||
|
||||
@ -747,7 +747,7 @@ BaselineScript::toggleDebugTraps(JSScript *script, jsbytecode *pc)
|
||||
if (!debugMode())
|
||||
return;
|
||||
|
||||
SrcNoteLineScanner scanner(script->notes(), script->lineno);
|
||||
SrcNoteLineScanner scanner(script->notes(), script->lineno());
|
||||
|
||||
JSRuntime *rt = script->runtimeFromMainThread();
|
||||
IonContext ictx(CompileRuntime::get(rt),
|
||||
|
@ -108,7 +108,7 @@ BytecodeAnalysis::init(TempAllocator &alloc, GSNCache &gsn)
|
||||
JSTryNote *tn = script_->trynotes()->vector;
|
||||
JSTryNote *tnlimit = tn + script_->trynotes()->length;
|
||||
for (; tn < tnlimit; tn++) {
|
||||
unsigned startOffset = script_->mainOffset + tn->start;
|
||||
unsigned startOffset = script_->mainOffset() + tn->start;
|
||||
if (startOffset == offset + 1) {
|
||||
unsigned catchOffset = startOffset + tn->length;
|
||||
|
||||
|
@ -35,8 +35,8 @@ C1Spewer::beginFunction(MIRGraph *graph, HandleScript script)
|
||||
|
||||
fprintf(spewout_, "begin_compilation\n");
|
||||
if (script) {
|
||||
fprintf(spewout_, " name \"%s:%d\"\n", script->filename(), script->lineno);
|
||||
fprintf(spewout_, " method \"%s:%d\"\n", script->filename(), script->lineno);
|
||||
fprintf(spewout_, " name \"%s:%d\"\n", script->filename(), (int)script->lineno());
|
||||
fprintf(spewout_, " method \"%s:%d\"\n", script->filename(), (int)script->lineno());
|
||||
} else {
|
||||
fprintf(spewout_, " name \"asm.js compilation\"\n");
|
||||
fprintf(spewout_, " method \"asm.js compilation\"\n");
|
||||
|
@ -2771,9 +2771,6 @@ CodeGenerator::maybeCreateScriptCounts()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (script)
|
||||
script->addIonCounts(counts);
|
||||
|
||||
for (size_t i = 0; i < graph.numBlocks(); i++) {
|
||||
MBasicBlock *block = graph.getBlock(i)->mir();
|
||||
|
||||
@ -2785,16 +2782,20 @@ CodeGenerator::maybeCreateScriptCounts()
|
||||
MResumePoint *resume = block->entryResumePoint();
|
||||
while (resume->caller())
|
||||
resume = resume->caller();
|
||||
JS_ASSERT(script->containsPC(resume->pc()));
|
||||
offset = script->pcToOffset(resume->pc());
|
||||
}
|
||||
|
||||
if (!counts->block(i).init(block->id(), offset, block->numSuccessors()))
|
||||
if (!counts->block(i).init(block->id(), offset, block->numSuccessors())) {
|
||||
js_delete(counts);
|
||||
return nullptr;
|
||||
}
|
||||
for (size_t j = 0; j < block->numSuccessors(); j++)
|
||||
counts->block(i).setSuccessor(j, block->getSuccessor(j)->id());
|
||||
}
|
||||
|
||||
if (!script) {
|
||||
if (script) {
|
||||
script->addIonCounts(counts);
|
||||
} else {
|
||||
// Compiling code for Asm.js. Leave the counts on the CodeGenerator to
|
||||
// be picked up by the AsmJSModule after generation finishes.
|
||||
unassociatedScriptCounts_ = counts;
|
||||
@ -5790,7 +5791,7 @@ CodeGenerator::generate()
|
||||
{
|
||||
IonSpew(IonSpew_Codegen, "# Emitting code for script %s:%d",
|
||||
gen->info().script()->filename(),
|
||||
gen->info().script()->lineno);
|
||||
gen->info().script()->lineno());
|
||||
|
||||
if (!safepoints_.init(gen->alloc(), graph.totalSlotCount()))
|
||||
return false;
|
||||
@ -5885,8 +5886,10 @@ CodeGenerator::link(JSContext *cx, types::CompilerConstraintList *constraints)
|
||||
cacheList_.length(), runtimeData_.length(),
|
||||
safepoints_.size(), callTargets.length(),
|
||||
patchableBackedges_.length());
|
||||
if (!ionScript)
|
||||
if (!ionScript) {
|
||||
recompileInfo.compilerOutput(cx->compartment()->types)->invalidate();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Lock the runtime against operation callbacks during the link.
|
||||
// We don't want an operation callback to protect the code for the script
|
||||
@ -5909,6 +5912,7 @@ CodeGenerator::link(JSContext *cx, types::CompilerConstraintList *constraints)
|
||||
// Use js_free instead of IonScript::Destroy: the cache list and
|
||||
// backedge list are still uninitialized.
|
||||
js_free(ionScript);
|
||||
recompileInfo.compilerOutput(cx->compartment()->types)->invalidate();
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -5929,6 +5933,7 @@ CodeGenerator::link(JSContext *cx, types::CompilerConstraintList *constraints)
|
||||
/* resetUses */ false, /* cancelOffThread*/ false))
|
||||
{
|
||||
js_free(ionScript);
|
||||
recompileInfo.compilerOutput(cx->compartment()->types)->invalidate();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -61,8 +61,8 @@ class CompileInfo
|
||||
nimplicit_ = StartArgSlot(script) /* scope chain and argument obj */
|
||||
+ (fun ? 1 : 0); /* this */
|
||||
nargs_ = fun ? fun->nargs : 0;
|
||||
nlocals_ = script->nfixed;
|
||||
nstack_ = script->nslots - script->nfixed;
|
||||
nlocals_ = script->nfixed();
|
||||
nstack_ = script->nslots() - script->nfixed();
|
||||
nslots_ = nimplicit_ + nargs_ + nlocals_ + nstack_;
|
||||
}
|
||||
|
||||
@ -107,7 +107,7 @@ class CompileInfo
|
||||
}
|
||||
|
||||
unsigned lineno() const {
|
||||
return script_->lineno;
|
||||
return script_->lineno();
|
||||
}
|
||||
unsigned lineno(jsbytecode *pc) const {
|
||||
return PCToLineNumber(script_, pc);
|
||||
|
@ -1884,13 +1884,13 @@ Compile(JSContext *cx, HandleScript script, BaselineFrame *osrFrame, jsbytecode
|
||||
}
|
||||
|
||||
if (!CheckScript(cx, script, bool(osrPc))) {
|
||||
IonSpew(IonSpew_Abort, "Aborted compilation of %s:%d", script->filename(), script->lineno);
|
||||
IonSpew(IonSpew_Abort, "Aborted compilation of %s:%d", script->filename(), script->lineno());
|
||||
return Method_CantCompile;
|
||||
}
|
||||
|
||||
MethodStatus status = CheckScriptSize(cx, script);
|
||||
if (status != Method_Compiled) {
|
||||
IonSpew(IonSpew_Abort, "Aborted compilation of %s:%d", script->filename(), script->lineno);
|
||||
IonSpew(IonSpew_Abort, "Aborted compilation of %s:%d", script->filename(), script->lineno());
|
||||
return status;
|
||||
}
|
||||
|
||||
@ -2147,7 +2147,7 @@ jit::CanEnterInParallel(JSContext *cx, HandleScript script)
|
||||
parallel::Spew(
|
||||
parallel::SpewCompile,
|
||||
"Script %p:%s:%u was garbage-collected or invalidated",
|
||||
script.get(), script->filename(), script->lineno);
|
||||
script.get(), script->filename(), script->lineno());
|
||||
return Method_Skipped;
|
||||
}
|
||||
|
||||
@ -2344,7 +2344,7 @@ InvalidateActivation(FreeOp *fop, uint8_t *ionTop, bool invalidateAll)
|
||||
JS_ASSERT(it.isScripted());
|
||||
const char *type = it.isOptimizedJS() ? "Optimized" : "Baseline";
|
||||
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(), (JSScript *)it.script(), it.returnAddressToFp());
|
||||
break;
|
||||
}
|
||||
@ -2503,7 +2503,7 @@ jit::Invalidate(types::TypeCompartment &types, FreeOp *fop,
|
||||
continue;
|
||||
|
||||
IonSpew(IonSpew_Invalidate, " Invalidate %s:%u, IonScript %p",
|
||||
co.script()->filename(), co.script()->lineno, co.ion());
|
||||
co.script()->filename(), co.script()->lineno(), co.ion());
|
||||
|
||||
// Keep the ion script alive during the invalidation and flag this
|
||||
// ionScript as being invalidated. This increment is removed by the
|
||||
@ -2663,7 +2663,7 @@ void
|
||||
jit::ForbidCompilation(JSContext *cx, JSScript *script, ExecutionMode mode)
|
||||
{
|
||||
IonSpew(IonSpew_Abort, "Disabling Ion mode %d compilation of script %s:%d",
|
||||
mode, script->filename(), script->lineno);
|
||||
mode, script->filename(), script->lineno());
|
||||
|
||||
CancelOffThreadIonCompile(cx->compartment(), script);
|
||||
|
||||
|
@ -40,6 +40,8 @@ jit::SplitCriticalEdges(MIRGraph &graph)
|
||||
|
||||
// Create a new block inheriting from the predecessor.
|
||||
MBasicBlock *split = MBasicBlock::NewSplitEdge(graph, block->info(), *block);
|
||||
if (!split)
|
||||
return false;
|
||||
split->setLoopDepth(block->loopDepth());
|
||||
graph.insertBlockAfter(*block, split);
|
||||
split->end(MGoto::New(graph.alloc(), target));
|
||||
|
@ -89,9 +89,9 @@ jit::NewBaselineFrameInspector(TempAllocator *temp, BaselineFrame *frame)
|
||||
}
|
||||
}
|
||||
|
||||
if (!inspector->varTypes.reserve(frame->script()->nfixed))
|
||||
if (!inspector->varTypes.reserve(frame->script()->nfixed()))
|
||||
return nullptr;
|
||||
for (size_t i = 0; i < frame->script()->nfixed; i++) {
|
||||
for (size_t i = 0; i < frame->script()->nfixed(); i++) {
|
||||
if (script->varIsAliased(i))
|
||||
inspector->varTypes.infallibleAppend(types::Type::UndefinedType());
|
||||
else
|
||||
@ -316,7 +316,7 @@ IonBuilder::DontInline(JSScript *targetScript, const char *reason)
|
||||
{
|
||||
if (targetScript) {
|
||||
IonSpew(IonSpew_Inlining, "Cannot inline %s:%u: %s",
|
||||
targetScript->filename(), targetScript->lineno, reason);
|
||||
targetScript->filename(), targetScript->lineno(), reason);
|
||||
} else {
|
||||
IonSpew(IonSpew_Inlining, "Cannot inline: %s", reason);
|
||||
}
|
||||
@ -604,7 +604,7 @@ IonBuilder::build()
|
||||
return false;
|
||||
|
||||
IonSpew(IonSpew_Scripts, "Analyzing script %s:%d (%p) (usecount=%d)",
|
||||
script()->filename(), script()->lineno, (void *)script(), (int)script()->getUseCount());
|
||||
script()->filename(), script()->lineno(), (void *)script(), (int)script()->getUseCount());
|
||||
|
||||
if (!initParameters())
|
||||
return false;
|
||||
@ -749,7 +749,7 @@ IonBuilder::buildInline(IonBuilder *callerBuilder, MResumePoint *callerResumePoi
|
||||
inlineCallInfo_ = &callInfo;
|
||||
|
||||
IonSpew(IonSpew_Scripts, "Inlining script %s:%d (%p)",
|
||||
script()->filename(), script()->lineno, (void *)script());
|
||||
script()->filename(), script()->lineno(), (void *)script());
|
||||
|
||||
callerBuilder_ = callerBuilder;
|
||||
callerResumePoint_ = callerResumePoint;
|
||||
@ -984,7 +984,7 @@ bool
|
||||
IonBuilder::initArgumentsObject()
|
||||
{
|
||||
IonSpew(IonSpew_MIR, "%s:%d - Emitting code to initialize arguments object! block=%p",
|
||||
script()->filename(), script()->lineno, current);
|
||||
script()->filename(), script()->lineno(), current);
|
||||
JS_ASSERT(info().needsArgsObj());
|
||||
MCreateArgumentsObject *argsObj = MCreateArgumentsObject::New(alloc(), current->scopeChain());
|
||||
current->add(argsObj);
|
||||
|
@ -410,7 +410,7 @@ IonCache::linkAndAttachStub(JSContext *cx, MacroAssembler &masm, StubAttacher &a
|
||||
|
||||
if (pc_) {
|
||||
IonSpew(IonSpew_InlineCaches, "Cache %p(%s:%d/%d) generated %s %s stub at %p",
|
||||
this, script_->filename(), script_->lineno, script_->pcToOffset(pc_),
|
||||
this, script_->filename(), script_->lineno(), script_->pcToOffset(pc_),
|
||||
attachKind, CacheName(kind()), code->raw());
|
||||
} else {
|
||||
IonSpew(IonSpew_InlineCaches, "Cache %p generated %s %s stub at %p",
|
||||
@ -1744,7 +1744,7 @@ GetPropertyIC::update(JSContext *cx, size_t cacheIndex,
|
||||
// be complicated since (due to GVN) there can be multiple pc's
|
||||
// associated with a single idempotent cache.
|
||||
IonSpew(IonSpew_InlineCaches, "Invalidating from idempotent cache %s:%d",
|
||||
topScript->filename(), topScript->lineno);
|
||||
topScript->filename(), topScript->lineno());
|
||||
|
||||
topScript->invalidatedIdempotentCache = true;
|
||||
|
||||
|
@ -313,7 +313,7 @@ CloseLiveIterator(JSContext *cx, const InlineFrameIterator &frame, uint32_t loca
|
||||
SnapshotIterator si = frame.snapshotIterator();
|
||||
|
||||
// Skip stack slots until we reach the iterator object.
|
||||
uint32_t base = CountArgSlots(frame.script(), frame.maybeCallee()) + frame.script()->nfixed;
|
||||
uint32_t base = CountArgSlots(frame.script(), frame.maybeCallee()) + frame.script()->nfixed();
|
||||
uint32_t skipSlots = base + localSlot - 1;
|
||||
|
||||
for (unsigned i = 0; i < skipSlots; i++)
|
||||
@ -465,8 +465,8 @@ HandleExceptionBaseline(JSContext *cx, const IonFrameIterator &frame, ResumeFrom
|
||||
|
||||
// Skip if the try note's stack depth exceeds the frame's stack depth.
|
||||
// See the big comment in TryNoteIter::settle for more info.
|
||||
JS_ASSERT(frame.baselineFrame()->numValueSlots() >= script->nfixed);
|
||||
size_t stackDepth = frame.baselineFrame()->numValueSlots() - script->nfixed;
|
||||
JS_ASSERT(frame.baselineFrame()->numValueSlots() >= script->nfixed());
|
||||
size_t stackDepth = frame.baselineFrame()->numValueSlots() - script->nfixed();
|
||||
if (tn->stackDepth > stackDepth)
|
||||
continue;
|
||||
|
||||
@ -477,7 +477,7 @@ HandleExceptionBaseline(JSContext *cx, const IonFrameIterator &frame, ResumeFrom
|
||||
// Compute base pointer and stack pointer.
|
||||
rfe->framePointer = frame.fp() - BaselineFrame::FramePointerOffset;
|
||||
rfe->stackPointer = rfe->framePointer - BaselineFrame::Size() -
|
||||
(script->nfixed + tn->stackDepth) * sizeof(Value);
|
||||
(script->nfixed() + tn->stackDepth) * sizeof(Value);
|
||||
|
||||
switch (tn->kind) {
|
||||
case JSTRY_CATCH:
|
||||
@ -1590,7 +1590,7 @@ IonFrameIterator::dumpBaseline() const
|
||||
}
|
||||
|
||||
fprintf(stderr, " file %s line %u\n",
|
||||
script()->filename(), (unsigned) script()->lineno);
|
||||
script()->filename(), (unsigned) script()->lineno());
|
||||
|
||||
JSContext *cx = GetIonContext()->cx;
|
||||
RootedScript script(cx);
|
||||
@ -1638,7 +1638,7 @@ InlineFrameIteratorMaybeGC<allowGC>::dump() const
|
||||
}
|
||||
|
||||
fprintf(stderr, " file %s line %u\n",
|
||||
script()->filename(), (unsigned) script()->lineno);
|
||||
script()->filename(), (unsigned) script()->lineno());
|
||||
|
||||
fprintf(stderr, " script = %p, pc = %p\n", (void*) script(), pc());
|
||||
fprintf(stderr, " current op: %s\n", js_CodeName[*pc()]);
|
||||
|
@ -53,7 +53,7 @@ FilterContainsLocation(HandleScript function)
|
||||
return false;
|
||||
|
||||
const char *filename = function->filename();
|
||||
const size_t line = function->lineno;
|
||||
const size_t line = function->lineno();
|
||||
const size_t filelen = strlen(filename);
|
||||
const char *index = strstr(filter, filename);
|
||||
while (index) {
|
||||
@ -93,7 +93,7 @@ jit::IonSpewNewFunction(MIRGraph *graph, HandleScript func)
|
||||
// off-thread spewing. Throw informative message when trying.
|
||||
if (func) {
|
||||
IonSpew(IonSpew_Logs, "Can't log script %s:%d. (Compiled on background thread.)",
|
||||
func->filename(), func->lineno);
|
||||
func->filename(), func->lineno());
|
||||
} else {
|
||||
IonSpew(IonSpew_Logs, "Can't log asm.js compilation. (Compiled on background thread.)");
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ JSONSpewer::beginFunction(JSScript *script)
|
||||
|
||||
beginObject();
|
||||
if (script)
|
||||
stringProperty("name", "%s:%d", script->filename(), script->lineno);
|
||||
stringProperty("name", "%s:%d", script->filename(), script->lineno());
|
||||
else
|
||||
stringProperty("name", "asm.js compilation");
|
||||
beginListProperty("passes");
|
||||
|
@ -68,7 +68,7 @@ EqualValues(bool useGVN, MDefinition *left, MDefinition *right)
|
||||
if (useGVN)
|
||||
return left->valueNumber() == right->valueNumber();
|
||||
|
||||
return left->id() == right->id();
|
||||
return left == right;
|
||||
}
|
||||
|
||||
static MConstant *
|
||||
@ -499,8 +499,8 @@ MConstant::printOpcode(FILE *fp) const
|
||||
}
|
||||
if (fun->hasScript()) {
|
||||
JSScript *script = fun->nonLazyScript();
|
||||
fprintf(fp, " (%s:%u)",
|
||||
script->filename() ? script->filename() : "", script->lineno);
|
||||
fprintf(fp, " (%s:%d)",
|
||||
script->filename() ? script->filename() : "", (int) script->lineno());
|
||||
}
|
||||
fprintf(fp, " at %p", (void *) fun);
|
||||
break;
|
||||
|
@ -550,7 +550,7 @@ class MIRGraph
|
||||
: alloc_(alloc),
|
||||
returnAccumulator_(nullptr),
|
||||
blockIdGen_(0),
|
||||
idGen_(0),
|
||||
idGen_(1),
|
||||
osrBlock_(nullptr),
|
||||
osrStart_(nullptr),
|
||||
numBlocks_(0),
|
||||
@ -595,7 +595,9 @@ class MIRGraph
|
||||
numBlocks_ = 0;
|
||||
}
|
||||
void resetInstructionNumber() {
|
||||
idGen_ = 0;
|
||||
// This intentionally starts above 0. The id 0 is in places used to
|
||||
// indicate a failure to perform an operation on an instruction.
|
||||
idGen_ = 1;
|
||||
}
|
||||
MBasicBlockIterator begin() {
|
||||
return blocks_.begin();
|
||||
@ -635,12 +637,9 @@ class MIRGraph
|
||||
return blockIdGen_;
|
||||
}
|
||||
void allocDefinitionId(MDefinition *ins) {
|
||||
// This intentionally starts above 0. The id 0 is in places used to
|
||||
// indicate a failure to perform an operation on an instruction.
|
||||
idGen_ += 2;
|
||||
ins->setId(idGen_);
|
||||
ins->setId(idGen_++);
|
||||
}
|
||||
uint32_t getMaxInstructionId() {
|
||||
uint32_t getNumInstructionIds() {
|
||||
return idGen_;
|
||||
}
|
||||
MResumePoint *entryResumePoint() {
|
||||
|
@ -472,8 +472,8 @@ jit::AbortPar(ParallelBailoutCause cause, JSScript *outermostScript, JSScript *c
|
||||
"Parallel abort with cause %d in %p:%s:%d "
|
||||
"(%p:%s:%d at line %d)",
|
||||
cause,
|
||||
outermostScript, outermostScript->filename(), outermostScript->lineno,
|
||||
currentScript, currentScript->filename(), currentScript->lineno,
|
||||
outermostScript, outermostScript->filename(), outermostScript->lineno(),
|
||||
currentScript, currentScript->filename(), currentScript->lineno(),
|
||||
(currentScript ? PCToLineNumber(currentScript, bytecode) : 0));
|
||||
|
||||
JS_ASSERT(InParallelSection());
|
||||
@ -492,8 +492,8 @@ jit::PropagateAbortPar(JSScript *outermostScript, JSScript *currentScript)
|
||||
{
|
||||
Spew(SpewBailouts,
|
||||
"Propagate parallel abort via %p:%s:%d (%p:%s:%d)",
|
||||
outermostScript, outermostScript->filename(), outermostScript->lineno,
|
||||
currentScript, currentScript->filename(), currentScript->lineno);
|
||||
outermostScript, outermostScript->filename(), outermostScript->lineno(),
|
||||
currentScript, currentScript->filename(), currentScript->lineno());
|
||||
|
||||
JS_ASSERT(InParallelSection());
|
||||
JS_ASSERT(outermostScript->hasParallelIonScript());
|
||||
@ -522,7 +522,7 @@ jit::CallToUncompiledScriptPar(JSObject *obj)
|
||||
if (func->hasScript()) {
|
||||
JSScript *script = func->nonLazyScript();
|
||||
Spew(SpewBailouts, "Call to uncompiled script: %p:%s:%d",
|
||||
script, script->filename(), script->lineno);
|
||||
script, script->filename(), script->lineno());
|
||||
} else if (func->isInterpretedLazy()) {
|
||||
Spew(SpewBailouts, "Call to uncompiled lazy script");
|
||||
} else if (func->isBoundFunction()) {
|
||||
@ -538,7 +538,7 @@ jit::CallToUncompiledScriptPar(JSObject *obj)
|
||||
if (target->hasScript()) {
|
||||
JSScript *script = target->nonLazyScript();
|
||||
Spew(SpewBailouts, "Call to bound function leading (depth: %d) to script: %p:%s:%d",
|
||||
depth, script, script->filename(), script->lineno);
|
||||
depth, script, script->filename(), script->lineno());
|
||||
} else {
|
||||
Spew(SpewBailouts, "Call to bound function (excessive depth: %d)", depth);
|
||||
}
|
||||
|
@ -309,11 +309,11 @@ SnapshotWriter::startFrame(JSFunction *fun, JSScript *script, jsbytecode *pc, ui
|
||||
uint32_t implicit = StartArgSlot(script);
|
||||
uint32_t formalArgs = CountArgSlots(script, fun);
|
||||
|
||||
nslots_ = formalArgs + script->nfixed + exprStack;
|
||||
nslots_ = formalArgs + script->nfixed() + exprStack;
|
||||
slotsWritten_ = 0;
|
||||
|
||||
IonSpew(IonSpew_Snapshots, "Starting frame; implicit %u, formals %u, fixed %u, exprs %u",
|
||||
implicit, formalArgs - implicit, script->nfixed, exprStack);
|
||||
implicit, formalArgs - implicit, script->nfixed(), exprStack);
|
||||
|
||||
uint32_t pcoff = script->pcToOffset(pc);
|
||||
IonSpew(IonSpew_Snapshots, "Writing pc offset %u, nslots %u", pcoff, nslots_);
|
||||
|
@ -975,8 +975,7 @@ CodeGeneratorShared::jumpToBlock(MBasicBlock *mir)
|
||||
CodeOffsetJump backedge = masm.jumpWithPatch(&rejoin);
|
||||
masm.bind(&rejoin);
|
||||
|
||||
if (!patchableBackedges_.append(PatchableBackedgeInfo(backedge, mir->lir()->label(), oolEntry)))
|
||||
MOZ_CRASH();
|
||||
masm.propagateOOM(patchableBackedges_.append(PatchableBackedgeInfo(backedge, mir->lir()->label(), oolEntry)));
|
||||
} else {
|
||||
masm.jump(mir->lir()->label());
|
||||
}
|
||||
@ -992,8 +991,7 @@ CodeGeneratorShared::jumpToBlock(MBasicBlock *mir, Assembler::Condition cond)
|
||||
CodeOffsetJump backedge = masm.jumpWithPatch(&rejoin, cond);
|
||||
masm.bind(&rejoin);
|
||||
|
||||
if (!patchableBackedges_.append(PatchableBackedgeInfo(backedge, mir->lir()->label(), oolEntry)))
|
||||
MOZ_CRASH();
|
||||
masm.propagateOOM(patchableBackedges_.append(PatchableBackedgeInfo(backedge, mir->lir()->label(), oolEntry)));
|
||||
} else {
|
||||
masm.j(cond, mir->lir()->label());
|
||||
}
|
||||
|
@ -12,6 +12,12 @@
|
||||
This header file is generated by the SpiderMonkey configure script,
|
||||
and installed along with jsapi.h. */
|
||||
|
||||
/* Define to 1 if SpiderMonkey is in debug mode. */
|
||||
#undef JS_DEBUG
|
||||
|
||||
/* Define to 1 if SpiderMonkey should not use struct types in debug builds. */
|
||||
#undef JS_NO_JSVAL_JSID_STRUCT_TYPES
|
||||
|
||||
/* Define to 1 if SpiderMonkey should support multi-threaded clients. */
|
||||
#undef JS_THREADSAFE
|
||||
|
||||
|
@ -290,7 +290,7 @@ ScriptAnalysis::analyzeBytecode(JSContext *cx)
|
||||
JSTryNote *tn = script_->trynotes()->vector;
|
||||
JSTryNote *tnlimit = tn + script_->trynotes()->length;
|
||||
for (; tn < tnlimit; tn++) {
|
||||
unsigned startOffset = script_->mainOffset + tn->start;
|
||||
unsigned startOffset = script_->mainOffset() + tn->start;
|
||||
if (startOffset == offset + 1) {
|
||||
unsigned catchOffset = startOffset + tn->length;
|
||||
|
||||
@ -317,7 +317,7 @@ ScriptAnalysis::analyzeBytecode(JSContext *cx)
|
||||
jsbytecode *next = pc + JSOP_GETLOCAL_LENGTH;
|
||||
if (JSOp(*next) != JSOP_POP || jumpTarget(next)) {
|
||||
uint32_t local = GET_SLOTNO(pc);
|
||||
if (local >= script_->nfixed) {
|
||||
if (local >= script_->nfixed()) {
|
||||
localsAliasStack_ = true;
|
||||
break;
|
||||
}
|
||||
@ -328,7 +328,7 @@ ScriptAnalysis::analyzeBytecode(JSContext *cx)
|
||||
case JSOP_CALLLOCAL:
|
||||
case JSOP_SETLOCAL: {
|
||||
uint32_t local = GET_SLOTNO(pc);
|
||||
if (local >= script_->nfixed) {
|
||||
if (local >= script_->nfixed()) {
|
||||
localsAliasStack_ = true;
|
||||
break;
|
||||
}
|
||||
@ -478,7 +478,7 @@ ScriptAnalysis::analyzeLifetimes(JSContext *cx)
|
||||
JSTryNote *tn = script_->trynotes()->vector;
|
||||
JSTryNote *tnlimit = tn + script_->trynotes()->length;
|
||||
for (; tn < tnlimit; tn++) {
|
||||
unsigned startOffset = script_->mainOffset + tn->start;
|
||||
unsigned startOffset = script_->mainOffset() + tn->start;
|
||||
if (startOffset + tn->length == offset) {
|
||||
/*
|
||||
* Extend all live variables at exception entry to the start of
|
||||
@ -877,7 +877,7 @@ ScriptAnalysis::analyzeSSA(JSContext *cx)
|
||||
}
|
||||
|
||||
LifoAlloc &alloc = cx->typeLifoAlloc();
|
||||
unsigned maxDepth = script_->nslots - script_->nfixed;
|
||||
unsigned maxDepth = script_->nslots() - script_->nfixed();
|
||||
|
||||
/*
|
||||
* Current value of each variable and stack value. Empty for missing or
|
||||
@ -1210,7 +1210,7 @@ ScriptAnalysis::analyzeSSA(JSContext *cx)
|
||||
JSTryNote *tn = script_->trynotes()->vector;
|
||||
JSTryNote *tnlimit = tn + script_->trynotes()->length;
|
||||
for (; tn < tnlimit; tn++) {
|
||||
unsigned startOffset = script_->mainOffset + tn->start;
|
||||
unsigned startOffset = script_->mainOffset() + tn->start;
|
||||
if (startOffset == offset + 1) {
|
||||
unsigned catchOffset = startOffset + tn->length;
|
||||
|
||||
|
@ -228,7 +228,7 @@ static inline uint32_t LocalSlot(JSScript *script, uint32_t local) {
|
||||
return 1 + (script->function() ? script->function()->nargs : 0) + local;
|
||||
}
|
||||
static inline uint32_t TotalSlots(JSScript *script) {
|
||||
return LocalSlot(script, 0) + script->nfixed;
|
||||
return LocalSlot(script, 0) + script->nfixed();
|
||||
}
|
||||
|
||||
static inline uint32_t StackSlot(JSScript *script, uint32_t index) {
|
||||
|
@ -52,7 +52,7 @@ class StableCharPtr : public CharPtr {
|
||||
{}
|
||||
};
|
||||
|
||||
#if defined JS_THREADSAFE && defined DEBUG
|
||||
#if defined JS_THREADSAFE && defined JS_DEBUG
|
||||
|
||||
class JS_PUBLIC_API(AutoCheckRequestDepth)
|
||||
{
|
||||
@ -71,9 +71,9 @@ class JS_PUBLIC_API(AutoCheckRequestDepth)
|
||||
# define CHECK_REQUEST(cx) \
|
||||
((void) 0)
|
||||
|
||||
#endif /* JS_THREADSAFE && DEBUG */
|
||||
#endif /* JS_THREADSAFE && JS_DEBUG */
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef JS_DEBUG
|
||||
/*
|
||||
* Assert that we're not doing GC on cx, that we're in a request as
|
||||
* needed, and that the compartments for cx and v are correct.
|
||||
@ -85,7 +85,7 @@ AssertArgumentsAreSane(JSContext *cx, JS::Handle<JS::Value> v);
|
||||
inline void AssertArgumentsAreSane(JSContext *cx, JS::Handle<JS::Value> v) {
|
||||
/* Do nothing */
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
#endif /* JS_DEBUG */
|
||||
|
||||
class JS_PUBLIC_API(AutoGCRooter) {
|
||||
public:
|
||||
@ -1370,7 +1370,7 @@ class JSAutoCheckRequest
|
||||
JSAutoCheckRequest(JSContext *cx
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
|
||||
{
|
||||
#if defined JS_THREADSAFE && defined DEBUG
|
||||
#if defined JS_THREADSAFE && defined JS_DEBUG
|
||||
mContext = cx;
|
||||
JS_ASSERT(JS_IsInRequest(JS_GetRuntime(cx)));
|
||||
#endif
|
||||
@ -1378,14 +1378,14 @@ class JSAutoCheckRequest
|
||||
}
|
||||
|
||||
~JSAutoCheckRequest() {
|
||||
#if defined JS_THREADSAFE && defined DEBUG
|
||||
#if defined JS_THREADSAFE && defined JS_DEBUG
|
||||
JS_ASSERT(JS_IsInRequest(JS_GetRuntime(mContext)));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
#if defined JS_THREADSAFE && defined DEBUG
|
||||
#if defined JS_THREADSAFE && defined JS_DEBUG
|
||||
JSContext *mContext;
|
||||
#endif
|
||||
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
|
||||
@ -2033,10 +2033,10 @@ JSVAL_TRACE_KIND(jsval v)
|
||||
return (JSGCTraceKind) JSVAL_TRACE_KIND_IMPL(JSVAL_TO_IMPL(v));
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef JS_DEBUG
|
||||
|
||||
/*
|
||||
* DEBUG-only method to dump the object graph of heap-allocated things.
|
||||
* Debug-only method to dump the object graph of heap-allocated things.
|
||||
*
|
||||
* fp: file for the dump output.
|
||||
* start: when non-null, dump only things reachable from start
|
||||
@ -2075,7 +2075,7 @@ extern JS_PUBLIC_API(bool)
|
||||
JS_IsGCMarkingTracer(JSTracer *trc);
|
||||
|
||||
/* For assertions only. */
|
||||
#ifdef DEBUG
|
||||
#ifdef JS_DEBUG
|
||||
extern JS_PUBLIC_API(bool)
|
||||
JS_IsMarkingGray(JSTracer *trc);
|
||||
#endif
|
||||
@ -3155,13 +3155,13 @@ struct JSPrincipals {
|
||||
int32_t refcount;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef JS_DEBUG
|
||||
/* A helper to facilitate principals debugging. */
|
||||
uint32_t debugToken;
|
||||
#endif
|
||||
|
||||
void setDebugToken(uint32_t token) {
|
||||
# ifdef DEBUG
|
||||
# ifdef JS_DEBUG
|
||||
debugToken = token;
|
||||
# endif
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ js_AddObjectRoot(JSRuntime *rt, JSObject **objp);
|
||||
JS_FRIEND_API(void)
|
||||
js_RemoveObjectRoot(JSRuntime *rt, JSObject **objp);
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef JS_DEBUG
|
||||
|
||||
/*
|
||||
* Routines to print out values during debugging. These are FRIEND_API to help
|
||||
@ -492,7 +492,7 @@ GetGlobalForObjectCrossCompartment(JSObject *obj);
|
||||
JS_FRIEND_API(void)
|
||||
AssertSameCompartment(JSContext *cx, JSObject *obj);
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef JS_DEBUG
|
||||
JS_FRIEND_API(void)
|
||||
AssertSameCompartment(JSObject *objA, JSObject *objB);
|
||||
#else
|
||||
@ -799,7 +799,7 @@ CastToJSFreeOp(FreeOp *fop)
|
||||
extern JS_FRIEND_API(const jschar*)
|
||||
GetErrorTypeName(JSRuntime* rt, int16_t exnType);
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef JS_DEBUG
|
||||
extern JS_FRIEND_API(unsigned)
|
||||
GetEnterCompartmentDepth(JSContext* cx);
|
||||
#endif
|
||||
@ -1712,7 +1712,7 @@ class JS_FRIEND_API(AutoCTypesActivityCallback) {
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef JS_DEBUG
|
||||
extern JS_FRIEND_API(void)
|
||||
assertEnteredPolicy(JSContext *cx, JSObject *obj, jsid id);
|
||||
#else
|
||||
|
@ -301,7 +301,7 @@ js::fun_resolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags,
|
||||
if (JSID_IS_ATOM(id, cx->names().length)) {
|
||||
if (fun->isInterpretedLazy() && !fun->getOrCreateScript(cx))
|
||||
return false;
|
||||
uint16_t length = fun->hasScript() ? fun->nonLazyScript()->funLength :
|
||||
uint16_t length = fun->hasScript() ? fun->nonLazyScript()->funLength() :
|
||||
fun->nargs - fun->hasRest();
|
||||
v.setInt32(length);
|
||||
} else {
|
||||
@ -687,8 +687,8 @@ js::FunctionToString(JSContext *cx, HandleFunction fun, bool bodyOnly, bool lamb
|
||||
// asserted below, that in Function("function f() {}"), the inner
|
||||
// function's sourceStart points to the '(', not the 'f'.
|
||||
bool funCon = !fun->isArrow() &&
|
||||
script->sourceStart == 0 &&
|
||||
script->sourceEnd == script->scriptSource()->length() &&
|
||||
script->sourceStart() == 0 &&
|
||||
script->sourceEnd() == script->scriptSource()->length() &&
|
||||
script->scriptSource()->argumentsNotIncluded();
|
||||
|
||||
// Functions created with the constructor can't be arrow functions or
|
||||
@ -1204,7 +1204,7 @@ JSFunction::createScriptForLazilyInterpretedFunction(JSContext *cx, HandleFuncti
|
||||
// A script's starting column isn't set by the bytecode emitter, so
|
||||
// specify this from the lazy script so that if an identical lazy
|
||||
// script is encountered later a match can be determined.
|
||||
script->column = lazy->column();
|
||||
script->setColumn(lazy->column());
|
||||
|
||||
LazyScriptCache::Lookup lookup(cx, lazy);
|
||||
cx->runtime()->lazyScriptCache.insert(lookup, script);
|
||||
|
@ -210,7 +210,7 @@ unsigned JSScript::id() {
|
||||
if (!id_) {
|
||||
id_ = ++compartment()->types.scriptCount;
|
||||
InferSpew(ISpewOps, "script #%u: %p %s:%d",
|
||||
id_, this, filename() ? filename() : "<null>", lineno);
|
||||
id_, this, filename() ? filename() : "<null>", lineno());
|
||||
}
|
||||
return id_;
|
||||
}
|
||||
@ -961,7 +961,7 @@ types::FinishCompilation(JSContext *cx, HandleScript script, ExecutionMode execu
|
||||
if (!CheckFrozenTypeSet(cx, &entry.argTypes[i], types::TypeScript::ArgTypes(entry.script, i)))
|
||||
succeeded = false;
|
||||
}
|
||||
for (size_t i = 0; i < entry.script->nTypeSets; i++) {
|
||||
for (size_t i = 0; i < entry.script->nTypeSets(); i++) {
|
||||
if (!CheckFrozenTypeSet(cx, &entry.bytecodeTypes[i], &entry.script->types->typeArray()[i]))
|
||||
succeeded = false;
|
||||
}
|
||||
@ -1954,7 +1954,7 @@ types::UseNewTypeForInitializer(JSScript *script, jsbytecode *pc, JSProtoKey key
|
||||
if (tn->kind != JSTRY_ITER && tn->kind != JSTRY_LOOP)
|
||||
continue;
|
||||
|
||||
unsigned startOffset = script->mainOffset + tn->start;
|
||||
unsigned startOffset = script->mainOffset() + tn->start;
|
||||
unsigned endOffset = startOffset + tn->length;
|
||||
|
||||
if (offset >= startOffset && offset < endOffset)
|
||||
@ -2140,7 +2140,7 @@ TypeCompartment::addPendingRecompile(JSContext *cx, const RecompileInfo &info)
|
||||
}
|
||||
|
||||
InferSpew(ISpewOps, "addPendingRecompile: %p:%s:%d",
|
||||
co->script(), co->script()->filename(), co->script()->lineno);
|
||||
co->script(), co->script()->filename(), co->script()->lineno());
|
||||
|
||||
co->setPendingInvalidation();
|
||||
}
|
||||
@ -3439,8 +3439,8 @@ types::UseNewTypeForClone(JSFunction *fun)
|
||||
if (fun->hasScript()) {
|
||||
if (!fun->nonLazyScript()->usesArgumentsAndApply)
|
||||
return false;
|
||||
begin = fun->nonLazyScript()->sourceStart;
|
||||
end = fun->nonLazyScript()->sourceEnd;
|
||||
begin = fun->nonLazyScript()->sourceStart();
|
||||
end = fun->nonLazyScript()->sourceEnd();
|
||||
} else {
|
||||
if (!fun->lazyScript()->usesArgumentsAndApply())
|
||||
return false;
|
||||
@ -3487,7 +3487,7 @@ JSScript::makeTypes(JSContext *cx)
|
||||
new (&typeArray[i]) StackTypeSet();
|
||||
|
||||
#ifdef DEBUG
|
||||
for (unsigned i = 0; i < nTypeSets; i++)
|
||||
for (unsigned i = 0; i < nTypeSets(); i++)
|
||||
InferSpew(ISpewOps, "typeSet: %sT%p%s bytecode%u #%u",
|
||||
InferSpewColor(&typeArray[i]), &typeArray[i], InferSpewColorReset(),
|
||||
i, id());
|
||||
@ -4376,7 +4376,7 @@ TypeScript::printTypes(JSContext *cx, HandleScript script) const
|
||||
fprintf(stderr, "Eval");
|
||||
else
|
||||
fprintf(stderr, "Main");
|
||||
fprintf(stderr, " #%u %s:%d ", script->id(), script->filename(), script->lineno);
|
||||
fprintf(stderr, " #%u %s:%d ", script->id(), script->filename(), (int) script->lineno());
|
||||
|
||||
if (script->function()) {
|
||||
if (js::PropertyName *name = script->function()->name()) {
|
||||
|
@ -592,13 +592,13 @@ extern void TypeDynamicResult(JSContext *cx, JSScript *script, jsbytecode *pc,
|
||||
/* static */ inline unsigned
|
||||
TypeScript::NumTypeSets(JSScript *script)
|
||||
{
|
||||
return script->nTypeSets + analyze::LocalSlot(script, 0);
|
||||
return script->nTypeSets() + analyze::LocalSlot(script, 0);
|
||||
}
|
||||
|
||||
/* static */ inline StackTypeSet *
|
||||
TypeScript::ThisTypes(JSScript *script)
|
||||
{
|
||||
return script->types->typeArray() + script->nTypeSets + js::analyze::ThisSlot();
|
||||
return script->types->typeArray() + script->nTypeSets() + js::analyze::ThisSlot();
|
||||
}
|
||||
|
||||
/*
|
||||
@ -611,7 +611,7 @@ TypeScript::ThisTypes(JSScript *script)
|
||||
TypeScript::ArgTypes(JSScript *script, unsigned i)
|
||||
{
|
||||
JS_ASSERT(i < script->function()->nargs);
|
||||
return script->types->typeArray() + script->nTypeSets + js::analyze::ArgSlot(i);
|
||||
return script->types->typeArray() + script->nTypeSets() + js::analyze::ArgSlot(i);
|
||||
}
|
||||
|
||||
template <typename TYPESET>
|
||||
@ -628,7 +628,7 @@ TypeScript::BytecodeTypes(JSScript *script, jsbytecode *pc, uint32_t *hint, TYPE
|
||||
uint32_t offset = script->pcToOffset(pc);
|
||||
|
||||
// See if this pc is the next typeset opcode after the last one looked up.
|
||||
if (bytecodeMap[*hint + 1] == offset && (*hint + 1) < script->nTypeSets) {
|
||||
if (bytecodeMap[*hint + 1] == offset && (*hint + 1) < script->nTypeSets()) {
|
||||
(*hint)++;
|
||||
return typeArray + *hint;
|
||||
}
|
||||
@ -639,7 +639,7 @@ TypeScript::BytecodeTypes(JSScript *script, jsbytecode *pc, uint32_t *hint, TYPE
|
||||
|
||||
// Fall back to a binary search.
|
||||
size_t bottom = 0;
|
||||
size_t top = script->nTypeSets - 1;
|
||||
size_t top = script->nTypeSets() - 1;
|
||||
size_t mid = bottom + (top - bottom) / 2;
|
||||
while (mid < top) {
|
||||
if (bytecodeMap[mid] < offset)
|
||||
@ -665,7 +665,7 @@ TypeScript::BytecodeTypes(JSScript *script, jsbytecode *pc)
|
||||
{
|
||||
JS_ASSERT(CurrentThreadCanAccessRuntime(script->runtimeFromMainThread()));
|
||||
#ifdef JS_ION
|
||||
uint32_t *hint = script->baselineScript()->bytecodeTypeMap() + script->nTypeSets;
|
||||
uint32_t *hint = script->baselineScript()->bytecodeTypeMap() + script->nTypeSets();
|
||||
#else
|
||||
uint32_t *hint = nullptr;
|
||||
MOZ_CRASH();
|
||||
|
@ -1562,7 +1562,7 @@ js_NewGenerator(JSContext *cx, const FrameRegs &stackRegs)
|
||||
(-1 + /* one Value included in JSGenerator */
|
||||
vplen +
|
||||
VALUES_PER_STACK_FRAME +
|
||||
stackfp->script()->nslots) * sizeof(HeapValue);
|
||||
stackfp->script()->nslots()) * sizeof(HeapValue);
|
||||
|
||||
JS_ASSERT(nbytes % sizeof(Value) == 0);
|
||||
JS_STATIC_ASSERT(sizeof(StackFrame) % sizeof(HeapValue) == 0);
|
||||
|
@ -5442,8 +5442,8 @@ dumpValue(const Value &v)
|
||||
}
|
||||
if (fun->hasScript()) {
|
||||
JSScript *script = fun->nonLazyScript();
|
||||
fprintf(stderr, " (%s:%u)",
|
||||
script->filename() ? script->filename() : "", script->lineno);
|
||||
fprintf(stderr, " (%s:%d)",
|
||||
script->filename() ? script->filename() : "", (int) script->lineno());
|
||||
}
|
||||
fprintf(stderr, " at %p>", (void *) fun);
|
||||
} else if (v.isObject()) {
|
||||
@ -5669,7 +5669,7 @@ js_DumpStackFrame(JSContext *cx, StackFrame *start)
|
||||
fputc('\n', stderr);
|
||||
|
||||
fprintf(stderr, "file %s line %u\n",
|
||||
i.script()->filename(), (unsigned) i.script()->lineno);
|
||||
i.script()->filename(), (unsigned) i.script()->lineno());
|
||||
|
||||
if (jsbytecode *pc = i.pc()) {
|
||||
fprintf(stderr, " pc = %p\n", pc);
|
||||
|
@ -437,11 +437,11 @@ class BytecodeParser
|
||||
}
|
||||
|
||||
uint32_t numSlots() {
|
||||
return 1 + (script_->function() ? script_->function()->nargs : 0) + script_->nfixed;
|
||||
return 1 + (script_->function() ? script_->function()->nargs : 0) + script_->nfixed();
|
||||
}
|
||||
|
||||
uint32_t maximumStackDepth() {
|
||||
return script_->nslots - script_->nfixed;
|
||||
return script_->nslots() - script_->nfixed();
|
||||
}
|
||||
|
||||
Bytecode& getCode(uint32_t offset) {
|
||||
@ -640,7 +640,7 @@ BytecodeParser::parse()
|
||||
JSTryNote *tn = script_->trynotes()->vector;
|
||||
JSTryNote *tnlimit = tn + script_->trynotes()->length;
|
||||
for (; tn < tnlimit; tn++) {
|
||||
uint32_t startOffset = script_->mainOffset + tn->start;
|
||||
uint32_t startOffset = script_->mainOffset() + tn->start;
|
||||
if (startOffset == offset + 1) {
|
||||
uint32_t catchOffset = startOffset + tn->length;
|
||||
if (tn->kind != JSTRY_ITER && tn->kind != JSTRY_LOOP) {
|
||||
@ -730,7 +730,7 @@ js_DisassembleAtPC(JSContext *cx, JSScript *scriptArg, bool lines,
|
||||
return false;
|
||||
|
||||
if (showAll)
|
||||
Sprint(sp, "%s:%u\n", script->filename(), script->lineno);
|
||||
Sprint(sp, "%s:%u\n", script->filename(), script->lineno());
|
||||
|
||||
if (pc != nullptr)
|
||||
sp->put(" ");
|
||||
@ -1601,8 +1601,8 @@ ExpressionDecompiler::decompilePC(jsbytecode *pc)
|
||||
case JSOP_CALLLOCAL: {
|
||||
unsigned i = GET_SLOTNO(pc);
|
||||
JSAtom *atom;
|
||||
if (i >= script->nfixed) {
|
||||
i -= script->nfixed;
|
||||
if (i >= script->nfixed()) {
|
||||
i -= script->nfixed();
|
||||
JS_ASSERT(i < unsigned(parser.stackDepthAtPC(pc)));
|
||||
atom = findLetVar(pc, i);
|
||||
if (!atom)
|
||||
@ -2119,7 +2119,7 @@ js::GetPCCountScriptSummary(JSContext *cx, size_t index)
|
||||
buf.append(str);
|
||||
|
||||
AppendJSONProperty(buf, "line");
|
||||
NumberValueToStringBuffer(cx, Int32Value(script->lineno), buf);
|
||||
NumberValueToStringBuffer(cx, Int32Value(script->lineno()), buf);
|
||||
|
||||
if (script->function()) {
|
||||
JSAtom *atom = script->function()->displayAtom();
|
||||
@ -2218,13 +2218,13 @@ GetPCCountJSON(JSContext *cx, const ScriptAndCounts &sac, StringBuffer &buf)
|
||||
buf.append(str);
|
||||
|
||||
AppendJSONProperty(buf, "line");
|
||||
NumberValueToStringBuffer(cx, Int32Value(script->lineno), buf);
|
||||
NumberValueToStringBuffer(cx, Int32Value(script->lineno()), buf);
|
||||
|
||||
AppendJSONProperty(buf, "opcodes");
|
||||
buf.append('[');
|
||||
bool comma = false;
|
||||
|
||||
SrcNoteLineScanner scanner(script->notes(), script->lineno);
|
||||
SrcNoteLineScanner scanner(script->notes(), script->lineno());
|
||||
|
||||
for (jsbytecode *pc = script->code(); pc < script->codeEnd(); pc += GetBytecodeLength(pc)) {
|
||||
size_t offset = script->pcToOffset(pc);
|
||||
|
@ -426,7 +426,7 @@ class JS_FRIEND_API(AutoEnterPolicy)
|
||||
typedef BaseProxyHandler::Action Action;
|
||||
AutoEnterPolicy(JSContext *cx, BaseProxyHandler *handler,
|
||||
HandleObject wrapper, HandleId id, Action act, bool mayThrow)
|
||||
#ifdef DEBUG
|
||||
#ifdef JS_DEBUG
|
||||
: context(nullptr)
|
||||
#endif
|
||||
{
|
||||
@ -449,7 +449,7 @@ class JS_FRIEND_API(AutoEnterPolicy)
|
||||
protected:
|
||||
// no-op constructor for subclass
|
||||
AutoEnterPolicy()
|
||||
#ifdef DEBUG
|
||||
#ifdef JS_DEBUG
|
||||
: context(nullptr)
|
||||
#endif
|
||||
{};
|
||||
@ -457,7 +457,7 @@ class JS_FRIEND_API(AutoEnterPolicy)
|
||||
bool allow;
|
||||
bool rv;
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef JS_DEBUG
|
||||
JSContext *context;
|
||||
mozilla::Maybe<HandleObject> enteredProxy;
|
||||
mozilla::Maybe<HandleId> enteredId;
|
||||
@ -476,7 +476,7 @@ class JS_FRIEND_API(AutoEnterPolicy)
|
||||
|
||||
};
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef JS_DEBUG
|
||||
class JS_FRIEND_API(AutoWaivePolicy) : public AutoEnterPolicy {
|
||||
public:
|
||||
AutoWaivePolicy(JSContext *cx, HandleObject proxy, HandleId id)
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#include "js/TypeDecls.h"
|
||||
|
||||
#if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING) || defined(DEBUG)
|
||||
#if defined(JSGC_ROOT_ANALYSIS) || defined(JSGC_USE_EXACT_ROOTING) || defined(JS_DEBUG)
|
||||
# define JSGC_TRACK_EXACT_ROOTS
|
||||
#endif
|
||||
|
||||
@ -365,7 +365,7 @@ struct ContextFriendFields
|
||||
#ifdef JSGC_TRACK_EXACT_ROOTS
|
||||
mozilla::PodArrayZero(thingGCRooters);
|
||||
#endif
|
||||
#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)
|
||||
#if defined(JS_DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)
|
||||
skipGCRooters = nullptr;
|
||||
#endif
|
||||
}
|
||||
@ -386,7 +386,7 @@ struct ContextFriendFields
|
||||
JS::Rooted<void*> *thingGCRooters[THING_ROOT_LIMIT];
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)
|
||||
#if defined(JS_DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)
|
||||
/*
|
||||
* Stack allocated list of stack locations which hold non-relocatable
|
||||
* GC heap pointers (where the target is rooted somewhere else) or integer
|
||||
@ -447,7 +447,7 @@ struct PerThreadDataFriendFields
|
||||
struct PerThreadDummy {
|
||||
void *field1;
|
||||
uintptr_t field2;
|
||||
#ifdef DEBUG
|
||||
#ifdef JS_DEBUG
|
||||
uint64_t field3;
|
||||
#endif
|
||||
} mainThread;
|
||||
@ -465,7 +465,7 @@ struct PerThreadDataFriendFields
|
||||
JS::Rooted<void*> *thingGCRooters[THING_ROOT_LIMIT];
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)
|
||||
#if defined(JS_DEBUG) && defined(JS_GC_ZEAL) && defined(JSGC_ROOT_ANALYSIS) && !defined(JS_THREADSAFE)
|
||||
/*
|
||||
* Stack allocated list of stack locations which hold non-relocatable
|
||||
* GC heap pointers (where the target is rooted somewhere else) or integer
|
||||
|
@ -167,7 +167,7 @@ Bindings::clone(JSContext *cx, InternalBindingsHandle self,
|
||||
Bindings &src = srcScript->bindings;
|
||||
ptrdiff_t off = (uint8_t *)src.bindingArray() - srcScript->data;
|
||||
JS_ASSERT(off >= 0);
|
||||
JS_ASSERT(size_t(off) <= srcScript->dataSize);
|
||||
JS_ASSERT(size_t(off) <= srcScript->dataSize());
|
||||
Binding *dstPackedBindings = (Binding *)(dstScriptData + off);
|
||||
|
||||
/*
|
||||
@ -453,13 +453,13 @@ js::XDRScript(XDRState<mode> *xdr, HandleObject enclosingScope, HandleScript enc
|
||||
return false;
|
||||
|
||||
if (mode == XDR_ENCODE) {
|
||||
prologLength = script->mainOffset;
|
||||
prologLength = script->mainOffset();
|
||||
JS_ASSERT(script->getVersion() != JSVERSION_UNKNOWN);
|
||||
version = (uint32_t)script->getVersion() | (script->nfixed << 16);
|
||||
lineno = script->lineno;
|
||||
nslots = (uint32_t)script->nslots;
|
||||
nslots = (uint32_t)((script->staticLevel << 16) | script->nslots);
|
||||
natoms = script->natoms;
|
||||
version = (uint32_t)script->getVersion() | (script->nfixed() << 16);
|
||||
lineno = script->lineno();
|
||||
nslots = (uint32_t)script->nslots();
|
||||
nslots = (uint32_t)((script->staticLevel() << 16) | script->nslots());
|
||||
natoms = script->natoms();
|
||||
|
||||
nsrcnotes = script->numNotes();
|
||||
|
||||
@ -474,8 +474,8 @@ js::XDRScript(XDRState<mode> *xdr, HandleObject enclosingScope, HandleScript enc
|
||||
if (script->hasBlockScopes())
|
||||
nblockscopes = script->blockScopes()->length;
|
||||
|
||||
nTypeSets = script->nTypeSets;
|
||||
funLength = script->funLength;
|
||||
nTypeSets = script->nTypeSets();
|
||||
funLength = script->funLength();
|
||||
|
||||
if (script->noScriptRval)
|
||||
scriptBits |= (1 << NoScriptRval);
|
||||
@ -590,11 +590,11 @@ js::XDRScript(XDRState<mode> *xdr, HandleObject enclosingScope, HandleScript enc
|
||||
return false;
|
||||
}
|
||||
|
||||
JS_ASSERT(!script->mainOffset);
|
||||
script->mainOffset = prologLength;
|
||||
JS_ASSERT(!script->mainOffset());
|
||||
script->mainOffset_ = prologLength;
|
||||
script->setLength(length);
|
||||
script->nfixed = uint16_t(version >> 16);
|
||||
script->funLength = funLength;
|
||||
script->nfixed_ = uint16_t(version >> 16);
|
||||
script->funLength_ = funLength;
|
||||
|
||||
scriptp.set(script);
|
||||
|
||||
@ -631,18 +631,18 @@ js::XDRScript(XDRState<mode> *xdr, HandleObject enclosingScope, HandleScript enc
|
||||
if (!script->scriptSource()->performXDR<mode>(xdr))
|
||||
return false;
|
||||
}
|
||||
if (!xdr->codeUint32(&script->sourceStart))
|
||||
if (!xdr->codeUint32(&script->sourceStart_))
|
||||
return false;
|
||||
if (!xdr->codeUint32(&script->sourceEnd))
|
||||
if (!xdr->codeUint32(&script->sourceEnd_))
|
||||
return false;
|
||||
|
||||
if (!xdr->codeUint32(&lineno) || !xdr->codeUint32(&nslots))
|
||||
return false;
|
||||
|
||||
if (mode == XDR_DECODE) {
|
||||
script->lineno = lineno;
|
||||
script->nslots = uint16_t(nslots);
|
||||
script->staticLevel = uint16_t(nslots >> 16);
|
||||
script->lineno_ = lineno;
|
||||
script->nslots_ = uint16_t(nslots);
|
||||
script->staticLevel_ = uint16_t(nslots >> 16);
|
||||
}
|
||||
|
||||
jsbytecode *code = script->code();
|
||||
@ -653,7 +653,7 @@ js::XDRScript(XDRState<mode> *xdr, HandleObject enclosingScope, HandleScript enc
|
||||
return false;
|
||||
code = ssd->data;
|
||||
if (natoms != 0) {
|
||||
script->natoms = natoms;
|
||||
script->natoms_ = natoms;
|
||||
script->atoms = ssd->atoms();
|
||||
}
|
||||
}
|
||||
@ -1061,7 +1061,7 @@ JSFlatString *
|
||||
JSScript::sourceData(JSContext *cx)
|
||||
{
|
||||
JS_ASSERT(scriptSource()->hasSourceData());
|
||||
return scriptSource()->substring(cx, sourceStart, sourceEnd);
|
||||
return scriptSource()->substring(cx, sourceStart(), sourceEnd());
|
||||
}
|
||||
|
||||
SourceDataCache::AutoSuppressPurge::AutoSuppressPurge(JSContext *cx)
|
||||
@ -1805,11 +1805,11 @@ JSScript::Create(ExclusiveContext *cx, HandleObject enclosingScope, bool savedCa
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
script->staticLevel = uint16_t(staticLevel);
|
||||
script->staticLevel_ = uint16_t(staticLevel);
|
||||
|
||||
script->setSourceObject(sourceObject);
|
||||
script->sourceStart = bufStart;
|
||||
script->sourceEnd = bufEnd;
|
||||
script->sourceStart_ = bufStart;
|
||||
script->sourceEnd_ = bufEnd;
|
||||
|
||||
return script;
|
||||
}
|
||||
@ -1836,10 +1836,10 @@ JSScript::partiallyInit(ExclusiveContext *cx, HandleScript script, uint32_t ncon
|
||||
script->data = AllocScriptData(cx, size);
|
||||
if (!script->data)
|
||||
return false;
|
||||
script->dataSize = size;
|
||||
script->dataSize_ = size;
|
||||
|
||||
JS_ASSERT(nTypeSets <= UINT16_MAX);
|
||||
script->nTypeSets = uint16_t(nTypeSets);
|
||||
script->nTypeSets_ = uint16_t(nTypeSets);
|
||||
|
||||
uint8_t *cursor = script->data;
|
||||
if (nconsts != 0) {
|
||||
@ -1948,13 +1948,13 @@ JSScript::fullyInitFromEmitter(ExclusiveContext *cx, HandleScript script, Byteco
|
||||
return false;
|
||||
}
|
||||
|
||||
JS_ASSERT(script->mainOffset == 0);
|
||||
script->mainOffset = prologLength;
|
||||
JS_ASSERT(script->mainOffset() == 0);
|
||||
script->mainOffset_ = prologLength;
|
||||
|
||||
script->lineno = bce->firstLine;
|
||||
script->lineno_ = bce->firstLine;
|
||||
|
||||
script->setLength(prologLength + mainLength);
|
||||
script->natoms = natoms;
|
||||
script->natoms_ = natoms;
|
||||
SharedScriptData *ssd = SharedScriptData::new_(cx, script->length(), nsrcnotes, natoms);
|
||||
if (!ssd)
|
||||
return false;
|
||||
@ -1971,12 +1971,12 @@ JSScript::fullyInitFromEmitter(ExclusiveContext *cx, HandleScript script, Byteco
|
||||
|
||||
uint32_t nfixed = bce->sc->isFunctionBox() ? script->bindings.numVars() : 0;
|
||||
JS_ASSERT(nfixed < SLOTNO_LIMIT);
|
||||
script->nfixed = uint16_t(nfixed);
|
||||
if (script->nfixed + bce->maxStackDepth >= JS_BIT(16)) {
|
||||
script->nfixed_ = uint16_t(nfixed);
|
||||
if (script->nfixed() + bce->maxStackDepth >= JS_BIT(16)) {
|
||||
bce->reportError(nullptr, JSMSG_NEED_DIET, "script");
|
||||
return false;
|
||||
}
|
||||
script->nslots = script->nfixed + bce->maxStackDepth;
|
||||
script->nslots_ = script->nfixed() + bce->maxStackDepth;
|
||||
|
||||
FunctionBox *funbox = bce->sc->isFunctionBox() ? bce->sc->asFunctionBox() : nullptr;
|
||||
|
||||
@ -2007,7 +2007,7 @@ JSScript::fullyInitFromEmitter(ExclusiveContext *cx, HandleScript script, Byteco
|
||||
JS_ASSERT(!funbox->definitelyNeedsArgsObj());
|
||||
}
|
||||
|
||||
script->funLength = funbox->length;
|
||||
script->funLength_ = funbox->length;
|
||||
}
|
||||
|
||||
RootedFunction fun(cx, nullptr);
|
||||
@ -2031,7 +2031,7 @@ JSScript::fullyInitFromEmitter(ExclusiveContext *cx, HandleScript script, Byteco
|
||||
size_t
|
||||
JSScript::computedSizeOfData() const
|
||||
{
|
||||
return dataSize;
|
||||
return dataSize();
|
||||
}
|
||||
|
||||
size_t
|
||||
@ -2099,7 +2099,7 @@ js::CallNewScriptHook(JSContext *cx, HandleScript script, HandleFunction fun)
|
||||
JS_ASSERT(!script->isActiveEval);
|
||||
if (JSNewScriptHook hook = cx->runtime()->debugHooks.newScriptHook) {
|
||||
AutoKeepAtoms keepAtoms(cx->perThreadData);
|
||||
hook(cx, script->filename(), script->lineno, script, fun,
|
||||
hook(cx, script->filename(), script->lineno(), script, fun,
|
||||
cx->runtime()->debugHooks.newScriptHookData);
|
||||
}
|
||||
}
|
||||
@ -2268,7 +2268,7 @@ js::PCToLineNumber(JSScript *script, jsbytecode *pc, unsigned *columnp)
|
||||
if (!pc)
|
||||
return 0;
|
||||
|
||||
return PCToLineNumber(script->lineno, script->notes(), script->code(), pc, columnp);
|
||||
return PCToLineNumber(script->lineno(), script->notes(), script->code(), pc, columnp);
|
||||
}
|
||||
|
||||
/* The line number limit is the same as the jssrcnote offset limit. */
|
||||
@ -2279,14 +2279,14 @@ js_LineNumberToPC(JSScript *script, unsigned target)
|
||||
{
|
||||
ptrdiff_t offset = 0;
|
||||
ptrdiff_t best = -1;
|
||||
unsigned lineno = script->lineno;
|
||||
unsigned lineno = script->lineno();
|
||||
unsigned bestdiff = SN_LINE_LIMIT;
|
||||
for (jssrcnote *sn = script->notes(); !SN_IS_TERMINATOR(sn); sn = SN_NEXT(sn)) {
|
||||
/*
|
||||
* Exact-match only if offset is not in the prolog; otherwise use
|
||||
* nearest greater-or-equal line number match.
|
||||
*/
|
||||
if (lineno == target && offset >= ptrdiff_t(script->mainOffset))
|
||||
if (lineno == target && offset >= ptrdiff_t(script->mainOffset()))
|
||||
goto out;
|
||||
if (lineno >= target) {
|
||||
unsigned diff = lineno - target;
|
||||
@ -2312,7 +2312,7 @@ out:
|
||||
JS_FRIEND_API(unsigned)
|
||||
js_GetScriptLineExtent(JSScript *script)
|
||||
{
|
||||
unsigned lineno = script->lineno;
|
||||
unsigned lineno = script->lineno();
|
||||
unsigned maxLineNo = lineno;
|
||||
for (jssrcnote *sn = script->notes(); !SN_IS_TERMINATOR(sn); sn = SN_NEXT(sn)) {
|
||||
SrcNoteType type = (SrcNoteType) SN_TYPE(sn);
|
||||
@ -2325,7 +2325,7 @@ js_GetScriptLineExtent(JSScript *script)
|
||||
maxLineNo = lineno;
|
||||
}
|
||||
|
||||
return 1 + maxLineNo - script->lineno;
|
||||
return 1 + maxLineNo - script->lineno();
|
||||
}
|
||||
|
||||
void
|
||||
@ -2385,7 +2385,7 @@ js::CloneScript(JSContext *cx, HandleObject enclosingScope, HandleFunction fun,
|
||||
|
||||
/* Script data */
|
||||
|
||||
size_t size = src->dataSize;
|
||||
size_t size = src->dataSize();
|
||||
uint8_t *data = AllocScriptData(cx, size);
|
||||
if (!data)
|
||||
return nullptr;
|
||||
@ -2479,8 +2479,8 @@ js::CloneScript(JSContext *cx, HandleObject enclosingScope, HandleFunction fun,
|
||||
.setVersion(src->getVersion());
|
||||
|
||||
RootedScript dst(cx, JSScript::Create(cx, enclosingScope, src->savedCallerFun,
|
||||
options, src->staticLevel,
|
||||
sourceObject, src->sourceStart, src->sourceEnd));
|
||||
options, src->staticLevel(),
|
||||
sourceObject, src->sourceStart(), src->sourceEnd()));
|
||||
if (!dst) {
|
||||
js_free(data);
|
||||
return nullptr;
|
||||
@ -2490,7 +2490,7 @@ js::CloneScript(JSContext *cx, HandleObject enclosingScope, HandleFunction fun,
|
||||
|
||||
/* This assignment must occur before all the Rebase calls. */
|
||||
dst->data = data;
|
||||
dst->dataSize = size;
|
||||
dst->dataSize_ = size;
|
||||
memcpy(data, src->data, size);
|
||||
|
||||
/* Script filenames, bytecodes and atoms are runtime-wide. */
|
||||
@ -2498,13 +2498,13 @@ js::CloneScript(JSContext *cx, HandleObject enclosingScope, HandleFunction fun,
|
||||
dst->atoms = src->atoms;
|
||||
|
||||
dst->setLength(src->length());
|
||||
dst->lineno = src->lineno;
|
||||
dst->mainOffset = src->mainOffset;
|
||||
dst->natoms = src->natoms;
|
||||
dst->funLength = src->funLength;
|
||||
dst->nfixed = src->nfixed;
|
||||
dst->nTypeSets = src->nTypeSets;
|
||||
dst->nslots = src->nslots;
|
||||
dst->lineno_ = src->lineno();
|
||||
dst->mainOffset_ = src->mainOffset();
|
||||
dst->natoms_ = src->natoms();
|
||||
dst->funLength_ = src->funLength();
|
||||
dst->nfixed_ = src->nfixed();
|
||||
dst->nTypeSets_ = src->nTypeSets();
|
||||
dst->nslots_ = src->nslots();
|
||||
if (src->argumentsHasVarBinding()) {
|
||||
dst->setArgumentsHasVarBinding();
|
||||
if (src->analyzedArgsUsage())
|
||||
@ -2810,7 +2810,7 @@ JSScript::markChildren(JSTracer *trc)
|
||||
|
||||
JS_ASSERT_IF(trc->runtime->gcStrictCompartmentChecking, zone()->isCollecting());
|
||||
|
||||
for (uint32_t i = 0; i < natoms; ++i) {
|
||||
for (uint32_t i = 0; i < natoms(); ++i) {
|
||||
if (atoms[i])
|
||||
MarkString(trc, &atoms[i], "atom");
|
||||
}
|
||||
@ -3118,7 +3118,7 @@ LazyScript::staticLevel(JSContext *cx) const
|
||||
{
|
||||
for (StaticScopeIter<NoGC> ssi(enclosingScope()); !ssi.done(); ssi++) {
|
||||
if (ssi.type() == StaticScopeIter<NoGC>::FUNCTION)
|
||||
return ssi.funScript()->staticLevel + 1;
|
||||
return ssi.funScript()->staticLevel() + 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@ -3178,7 +3178,7 @@ LazyScriptHashPolicy::hash(const Lookup &lookup, HashNumber hashes[3])
|
||||
void
|
||||
LazyScriptHashPolicy::hash(JSScript *script, HashNumber hashes[3])
|
||||
{
|
||||
LazyScriptHash(script->lineno, script->column, script->sourceStart, script->sourceEnd, hashes);
|
||||
LazyScriptHash(script->lineno(), script->column(), script->sourceStart(), script->sourceEnd(), hashes);
|
||||
}
|
||||
|
||||
bool
|
||||
@ -3199,11 +3199,11 @@ LazyScriptHashPolicy::match(JSScript *script, const Lookup &lookup)
|
||||
// original script can differ. If there is a match, these will be fixed
|
||||
// up in the resulting clone by the caller.
|
||||
|
||||
if (script->lineno != lazy->lineno() ||
|
||||
script->column != lazy->column() ||
|
||||
if (script->lineno() != lazy->lineno() ||
|
||||
script->column() != lazy->column() ||
|
||||
script->getVersion() != lazy->version() ||
|
||||
script->sourceStart != lazy->begin() ||
|
||||
script->sourceEnd != lazy->end())
|
||||
script->sourceStart() != lazy->begin() ||
|
||||
script->sourceEnd() != lazy->end())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -3218,7 +3218,7 @@ LazyScriptHashPolicy::match(JSScript *script, const Lookup &lookup)
|
||||
if (!lazyChars)
|
||||
return false;
|
||||
|
||||
size_t begin = script->sourceStart;
|
||||
size_t length = script->sourceEnd - begin;
|
||||
size_t begin = script->sourceStart();
|
||||
size_t length = script->sourceEnd() - begin;
|
||||
return !memcmp(scriptChars + begin, lazyChars + begin, length);
|
||||
}
|
||||
|
@ -487,6 +487,20 @@ GeneratorKindFromBits(unsigned val) {
|
||||
return static_cast<GeneratorKind>(val);
|
||||
}
|
||||
|
||||
/*
|
||||
* NB: after a successful XDR_DECODE, XDRScript callers must do any required
|
||||
* subsequent set-up of owning function or script object and then call
|
||||
* js_CallNewScriptHook.
|
||||
*/
|
||||
template<XDRMode mode>
|
||||
bool
|
||||
XDRScript(XDRState<mode> *xdr, HandleObject enclosingScope, HandleScript enclosingScript,
|
||||
HandleFunction fun, MutableHandleScript scriptp);
|
||||
|
||||
JSScript *
|
||||
CloneScript(JSContext *cx, HandleObject enclosingScope, HandleFunction fun, HandleScript script,
|
||||
NewObjectKind newKind = GenericObject);
|
||||
|
||||
} /* namespace js */
|
||||
|
||||
class JSScript : public js::gc::BarrieredCell<JSScript>
|
||||
@ -494,6 +508,16 @@ class JSScript : public js::gc::BarrieredCell<JSScript>
|
||||
static const uint32_t stepFlagMask = 0x80000000U;
|
||||
static const uint32_t stepCountMask = 0x7fffffffU;
|
||||
|
||||
template <js::XDRMode mode>
|
||||
friend
|
||||
bool
|
||||
js::XDRScript(js::XDRState<mode> *xdr, js::HandleObject enclosingScope, js::HandleScript enclosingScript,
|
||||
js::HandleFunction fun, js::MutableHandleScript scriptp);
|
||||
|
||||
friend JSScript *
|
||||
js::CloneScript(JSContext *cx, js::HandleObject enclosingScope, js::HandleFunction fun, js::HandleScript src,
|
||||
js::NewObjectKind newKind);
|
||||
|
||||
public:
|
||||
//
|
||||
// We order fields according to their size in order to avoid wasting space
|
||||
@ -551,22 +575,20 @@ class JSScript : public js::gc::BarrieredCell<JSScript>
|
||||
// 32-bit fields.
|
||||
|
||||
uint32_t length_; /* length of code vector */
|
||||
public:
|
||||
uint32_t dataSize; /* size of the used part of the data array */
|
||||
uint32_t dataSize_; /* size of the used part of the data array */
|
||||
|
||||
uint32_t lineno; /* base line number of script */
|
||||
uint32_t column; /* base column of script, optionally set */
|
||||
uint32_t lineno_; /* base line number of script */
|
||||
uint32_t column_; /* base column of script, optionally set */
|
||||
|
||||
uint32_t mainOffset; /* offset of main entry point from code, after
|
||||
uint32_t mainOffset_;/* offset of main entry point from code, after
|
||||
predef'ing prolog */
|
||||
|
||||
uint32_t natoms; /* length of atoms array */
|
||||
uint32_t natoms_; /* length of atoms array */
|
||||
|
||||
/* Range of characters in scriptSource which contains this script's source. */
|
||||
uint32_t sourceStart;
|
||||
uint32_t sourceEnd;
|
||||
uint32_t sourceStart_;
|
||||
uint32_t sourceEnd_;
|
||||
|
||||
private:
|
||||
uint32_t useCount; /* Number of times the script has been called
|
||||
* or has had backedges taken. Reset if the
|
||||
* script's JIT code is forcibly discarded. */
|
||||
@ -575,27 +597,24 @@ class JSScript : public js::gc::BarrieredCell<JSScript>
|
||||
// Unique identifier within the compartment for this script, used for
|
||||
// printing analysis information.
|
||||
uint32_t id_;
|
||||
private:
|
||||
uint32_t idpad;
|
||||
#endif
|
||||
|
||||
// 16-bit fields.
|
||||
|
||||
private:
|
||||
uint16_t PADDING16;
|
||||
uint16_t version; /* JS version under which script was compiled */
|
||||
|
||||
public:
|
||||
uint16_t funLength; /* ES6 function length */
|
||||
uint16_t funLength_; /* ES6 function length */
|
||||
|
||||
uint16_t nfixed; /* number of slots besides stack operands in
|
||||
uint16_t nfixed_; /* number of slots besides stack operands in
|
||||
slot array */
|
||||
|
||||
uint16_t nTypeSets; /* number of type sets used in this script for
|
||||
uint16_t nTypeSets_; /* number of type sets used in this script for
|
||||
dynamic type monitoring */
|
||||
|
||||
uint16_t nslots; /* vars plus maximum stack depth */
|
||||
uint16_t staticLevel;/* static level for display maintenance */
|
||||
uint16_t nslots_; /* vars plus maximum stack depth */
|
||||
uint16_t staticLevel_;/* static level for display maintenance */
|
||||
|
||||
// Bit fields.
|
||||
|
||||
@ -748,6 +767,58 @@ class JSScript : public js::gc::BarrieredCell<JSScript>
|
||||
return code() + offset;
|
||||
}
|
||||
|
||||
size_t mainOffset() const {
|
||||
js::AutoThreadSafeAccess ts(this);
|
||||
return mainOffset_;
|
||||
}
|
||||
|
||||
size_t lineno() const {
|
||||
js::AutoThreadSafeAccess ts(this);
|
||||
return lineno_;
|
||||
}
|
||||
|
||||
size_t column() const {
|
||||
js::AutoThreadSafeAccess ts(this);
|
||||
return column_;
|
||||
}
|
||||
|
||||
void setColumn(size_t column) { column_ = column; }
|
||||
|
||||
size_t nfixed() const {
|
||||
js::AutoThreadSafeAccess ts(this);
|
||||
return nfixed_;
|
||||
}
|
||||
|
||||
size_t nslots() const {
|
||||
js::AutoThreadSafeAccess ts(this);
|
||||
return nslots_;
|
||||
}
|
||||
|
||||
size_t staticLevel() const {
|
||||
js::AutoThreadSafeAccess ts(this);
|
||||
return staticLevel_;
|
||||
}
|
||||
|
||||
size_t nTypeSets() const {
|
||||
js::AutoThreadSafeAccess ts(this);
|
||||
return nTypeSets_;
|
||||
}
|
||||
|
||||
size_t funLength() const {
|
||||
js::AutoThreadSafeAccess ts(this);
|
||||
return funLength_;
|
||||
}
|
||||
|
||||
size_t sourceStart() const {
|
||||
js::AutoThreadSafeAccess ts(this);
|
||||
return sourceStart_;
|
||||
}
|
||||
|
||||
size_t sourceEnd() const {
|
||||
js::AutoThreadSafeAccess ts(this);
|
||||
return sourceEnd_;
|
||||
}
|
||||
|
||||
/* See ContextFlags::funArgumentsHasLocalBinding comment. */
|
||||
bool argumentsHasVarBinding() const { return argsHasVarBinding_; }
|
||||
jsbytecode *argumentsBytecode() const { JS_ASSERT(code()[0] == JSOP_ARGUMENTS); return code(); }
|
||||
@ -973,7 +1044,7 @@ class JSScript : public js::gc::BarrieredCell<JSScript>
|
||||
void destroyScriptCounts(js::FreeOp *fop);
|
||||
|
||||
jsbytecode *main() {
|
||||
return code() + mainOffset;
|
||||
return code() + mainOffset();
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1008,6 +1079,8 @@ class JSScript : public js::gc::BarrieredCell<JSScript>
|
||||
size_t trynotesOffset() { return OFF(regexpsOffset, hasRegexps, js::ObjectArray); }
|
||||
size_t blockScopesOffset(){ return OFF(trynotesOffset, hasTrynotes, js::TryNoteArray); }
|
||||
|
||||
size_t dataSize() const { return dataSize_; }
|
||||
|
||||
js::ConstArray *consts() {
|
||||
JS_ASSERT(hasConsts());
|
||||
return reinterpret_cast<js::ConstArray *>(data + constsOffset());
|
||||
@ -1035,8 +1108,10 @@ class JSScript : public js::gc::BarrieredCell<JSScript>
|
||||
|
||||
bool hasLoops();
|
||||
|
||||
size_t natoms() const { return natoms_; }
|
||||
|
||||
js::HeapPtrAtom &getAtom(size_t index) const {
|
||||
JS_ASSERT(index < natoms);
|
||||
JS_ASSERT(index < natoms());
|
||||
return atoms[index];
|
||||
}
|
||||
|
||||
@ -1563,10 +1638,6 @@ extern void
|
||||
CurrentScriptFileLineOrigin(JSContext *cx, const char **file, unsigned *linenop,
|
||||
JSPrincipals **origin, LineOption opt = NOT_CALLED_FROM_JSOP_EVAL);
|
||||
|
||||
extern JSScript *
|
||||
CloneScript(JSContext *cx, HandleObject enclosingScope, HandleFunction fun, HandleScript script,
|
||||
NewObjectKind newKind = GenericObject);
|
||||
|
||||
bool
|
||||
CloneFunctionScript(JSContext *cx, HandleFunction original, HandleFunction clone,
|
||||
NewObjectKind newKind = GenericObject);
|
||||
@ -1584,16 +1655,6 @@ NormalizeOriginPrincipals(JSPrincipals *principals, JSPrincipals *originPrincipa
|
||||
return originPrincipals ? originPrincipals : principals;
|
||||
}
|
||||
|
||||
/*
|
||||
* NB: after a successful XDR_DECODE, XDRScript callers must do any required
|
||||
* subsequent set-up of owning function or script object and then call
|
||||
* js_CallNewScriptHook.
|
||||
*/
|
||||
template<XDRMode mode>
|
||||
bool
|
||||
XDRScript(XDRState<mode> *xdr, HandleObject enclosingScope, HandleScript enclosingScript,
|
||||
HandleFunction fun, MutableHandleScript scriptp);
|
||||
|
||||
} /* namespace js */
|
||||
|
||||
#endif /* jsscript_h */
|
||||
|
@ -1522,7 +1522,7 @@ TrapHandler(JSContext *cx, JSScript *, jsbytecode *pc, jsval *rvalArg,
|
||||
|
||||
if (!frame.evaluateUCInStackFrame(cx, chars, length,
|
||||
script->filename(),
|
||||
script->lineno,
|
||||
script->lineno(),
|
||||
&rval))
|
||||
{
|
||||
*rvalArg = rval;
|
||||
@ -1706,7 +1706,7 @@ SrcNotes(JSContext *cx, HandleScript script, Sprinter *sp)
|
||||
Sprint(sp, "---- ---- ----- ------ -------- ------\n");
|
||||
unsigned offset = 0;
|
||||
unsigned colspan = 0;
|
||||
unsigned lineno = script->lineno;
|
||||
unsigned lineno = script->lineno();
|
||||
jssrcnote *notes = script->notes();
|
||||
unsigned switchTableEnd = 0, switchTableStart = 0;
|
||||
for (jssrcnote *sn = notes; !SN_IS_TERMINATOR(sn); sn = SN_NEXT(sn)) {
|
||||
@ -2715,10 +2715,22 @@ static const JSClass resolver_class = {
|
||||
static bool
|
||||
Resolver(JSContext *cx, unsigned argc, jsval *vp)
|
||||
{
|
||||
RootedObject referent(cx, nullptr);
|
||||
RootedObject proto(cx, nullptr);
|
||||
if (!JS_ConvertArguments(cx, argc, JS_ARGV(cx, vp), "o/o", &referent, &proto))
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
|
||||
RootedObject referent(cx);
|
||||
if (!JS_ValueToObject(cx, args.get(0), &referent))
|
||||
return false;
|
||||
if (!referent) {
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_CANT_CONVERT_TO,
|
||||
args.get(0).isNull() ? "null" : "undefined", "object");
|
||||
return false;
|
||||
}
|
||||
|
||||
RootedObject proto(cx, nullptr);
|
||||
if (!args.get(1).isNullOrUndefined()) {
|
||||
if (!JS_ValueToObject(cx, args.get(1), &proto))
|
||||
return false;
|
||||
}
|
||||
|
||||
RootedObject parent(cx, JS_GetParent(referent));
|
||||
JSObject *result = (argc > 1
|
||||
@ -2727,8 +2739,8 @@ Resolver(JSContext *cx, unsigned argc, jsval *vp)
|
||||
if (!result)
|
||||
return false;
|
||||
|
||||
JS_SetReservedSlot(result, 0, OBJECT_TO_JSVAL(referent));
|
||||
JS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(result));
|
||||
JS_SetReservedSlot(result, 0, ObjectValue(*referent));
|
||||
args.rval().setObject(*result);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -4641,8 +4653,9 @@ env_setProperty(JSContext *cx, HandleObject obj, HandleId id, bool strict, Mutab
|
||||
int rv;
|
||||
|
||||
RootedValue idvalue(cx, IdToValue(id));
|
||||
RootedString idstring(cx, ToString(cx, idvalue));
|
||||
JSAutoByteString idstr;
|
||||
if (!idstr.encodeLatin1(cx, idvalue.toString()))
|
||||
if (!idstr.encodeLatin1(cx, idstring))
|
||||
return false;
|
||||
|
||||
RootedString value(cx, ToString(cx, vp));
|
||||
@ -4716,8 +4729,9 @@ env_resolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags,
|
||||
MutableHandleObject objp)
|
||||
{
|
||||
RootedValue idvalue(cx, IdToValue(id));
|
||||
RootedString idstring(cx, ToString(cx, idvalue));
|
||||
JSAutoByteString idstr;
|
||||
if (!idstr.encodeLatin1(cx, idvalue.toString()))
|
||||
if (!idstr.encodeLatin1(cx, idstring))
|
||||
return false;
|
||||
|
||||
const char *name = idstr.ptr();
|
||||
|
@ -2581,7 +2581,7 @@ class Debugger::ScriptQuery {
|
||||
return;
|
||||
}
|
||||
if (hasLine) {
|
||||
if (line < script->lineno || script->lineno + js_GetScriptLineExtent(script) < line)
|
||||
if (line < script->lineno() || script->lineno() + js_GetScriptLineExtent(script) < line)
|
||||
return;
|
||||
}
|
||||
if (innermost) {
|
||||
@ -2601,7 +2601,7 @@ class Debugger::ScriptQuery {
|
||||
if (p) {
|
||||
/* Is our newly found script deeper than the last one we found? */
|
||||
JSScript *incumbent = p->value();
|
||||
if (script->staticLevel > incumbent->staticLevel)
|
||||
if (script->staticLevel() > incumbent->staticLevel())
|
||||
p->value() = script;
|
||||
} else {
|
||||
/*
|
||||
@ -2884,7 +2884,7 @@ static bool
|
||||
DebuggerScript_getStartLine(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
THIS_DEBUGSCRIPT_SCRIPT(cx, argc, vp, "(get startLine)", args, obj, script);
|
||||
args.rval().setNumber(script->lineno);
|
||||
args.rval().setNumber(uint32_t(script->lineno()));
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -2917,7 +2917,7 @@ static bool
|
||||
DebuggerScript_getSourceStart(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
THIS_DEBUGSCRIPT_SCRIPT(cx, argc, vp, "(get sourceStart)", args, obj, script);
|
||||
args.rval().setNumber(script->sourceStart);
|
||||
args.rval().setNumber(uint32_t(script->sourceStart()));
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -2925,7 +2925,7 @@ static bool
|
||||
DebuggerScript_getSourceLength(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
THIS_DEBUGSCRIPT_SCRIPT(cx, argc, vp, "(get sourceEnd)", args, obj, script);
|
||||
args.rval().setNumber(script->sourceEnd - script->sourceStart);
|
||||
args.rval().setNumber(uint32_t(script->sourceEnd() - script->sourceStart()));
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -2933,7 +2933,7 @@ static bool
|
||||
DebuggerScript_getStaticLevel(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
THIS_DEBUGSCRIPT_SCRIPT(cx, argc, vp, "(get staticLevel)", args, obj, script);
|
||||
args.rval().setNumber(uint32_t(script->staticLevel));
|
||||
args.rval().setNumber(uint32_t(script->staticLevel()));
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -3037,7 +3037,7 @@ class BytecodeRangeWithPosition : private BytecodeRange
|
||||
using BytecodeRange::frontOffset;
|
||||
|
||||
BytecodeRangeWithPosition(JSContext *cx, JSScript *script)
|
||||
: BytecodeRange(cx, script), lineno(script->lineno), column(0),
|
||||
: BytecodeRange(cx, script), lineno(script->lineno()), column(0),
|
||||
sn(script->notes()), snpc(script->code())
|
||||
{
|
||||
if (!SN_IS_TERMINATOR(sn))
|
||||
@ -3202,7 +3202,7 @@ class FlowGraphSummary {
|
||||
for (size_t i = mainOffset + 1; i < script->length(); i++)
|
||||
entries_[i] = Entry::createWithNoEdges();
|
||||
|
||||
size_t prevLineno = script->lineno;
|
||||
size_t prevLineno = script->lineno();
|
||||
size_t prevColumn = 0;
|
||||
JSOp prevOp = JSOP_NOP;
|
||||
for (BytecodeRangeWithPosition r(cx, script); !r.empty(); r.popFront()) {
|
||||
@ -3582,7 +3582,7 @@ DebuggerScript_isInCatchScope(JSContext *cx, unsigned argc, Value* vp)
|
||||
* Try note ranges are relative to the mainOffset of the script, so adjust
|
||||
* offset accordingly.
|
||||
*/
|
||||
offset -= script->mainOffset;
|
||||
offset -= script->mainOffset();
|
||||
|
||||
args.rval().setBoolean(false);
|
||||
if (script->hasTrynotes()) {
|
||||
|
@ -699,12 +699,12 @@ js::ParallelDo::enqueueInitialScript(ExecutionStatus *status)
|
||||
if (script->hasParallelIonScript()) {
|
||||
if (!script->parallelIonScript()->hasUncompiledCallTarget()) {
|
||||
Spew(SpewOps, "Script %p:%s:%d already compiled, no uncompiled callees",
|
||||
script.get(), script->filename(), script->lineno);
|
||||
script.get(), script->filename(), script->lineno());
|
||||
return GreenLight;
|
||||
}
|
||||
|
||||
Spew(SpewOps, "Script %p:%s:%d already compiled, may have uncompiled callees",
|
||||
script.get(), script->filename(), script->lineno);
|
||||
script.get(), script->filename(), script->lineno());
|
||||
}
|
||||
|
||||
// Otherwise, add to the worklist of scripts to process.
|
||||
@ -765,7 +765,7 @@ js::ParallelDo::compileForParallelExecution(ExecutionStatus *status)
|
||||
Spew(SpewCompile,
|
||||
"Script %p:%s:%d has no baseline script, "
|
||||
"but use count grew from %d to %d",
|
||||
script.get(), script->filename(), script->lineno,
|
||||
script.get(), script->filename(), script->lineno(),
|
||||
previousUseCount, currentUseCount);
|
||||
} else {
|
||||
uint32_t stallCount = ++worklistData_[i].stallCount;
|
||||
@ -776,7 +776,7 @@ js::ParallelDo::compileForParallelExecution(ExecutionStatus *status)
|
||||
Spew(SpewCompile,
|
||||
"Script %p:%s:%d has no baseline script, "
|
||||
"and use count has %u stalls at %d",
|
||||
script.get(), script->filename(), script->lineno,
|
||||
script.get(), script->filename(), script->lineno(),
|
||||
stallCount, previousUseCount);
|
||||
}
|
||||
continue;
|
||||
@ -796,7 +796,7 @@ js::ParallelDo::compileForParallelExecution(ExecutionStatus *status)
|
||||
Spew(SpewCompile,
|
||||
"Script %p:%s:%d cannot be compiled, "
|
||||
"falling back to sequential execution",
|
||||
script.get(), script->filename(), script->lineno);
|
||||
script.get(), script->filename(), script->lineno());
|
||||
return sequentialExecution(true, status);
|
||||
|
||||
case Method_Skipped:
|
||||
@ -805,7 +805,7 @@ js::ParallelDo::compileForParallelExecution(ExecutionStatus *status)
|
||||
if (script->isParallelIonCompilingOffThread()) {
|
||||
Spew(SpewCompile,
|
||||
"Script %p:%s:%d compiling off-thread",
|
||||
script.get(), script->filename(), script->lineno);
|
||||
script.get(), script->filename(), script->lineno());
|
||||
offMainThreadCompilationsInProgress = true;
|
||||
continue;
|
||||
}
|
||||
@ -814,7 +814,7 @@ js::ParallelDo::compileForParallelExecution(ExecutionStatus *status)
|
||||
case Method_Compiled:
|
||||
Spew(SpewCompile,
|
||||
"Script %p:%s:%d compiled",
|
||||
script.get(), script->filename(), script->lineno);
|
||||
script.get(), script->filename(), script->lineno());
|
||||
JS_ASSERT(script->hasParallelIonScript());
|
||||
break;
|
||||
}
|
||||
@ -863,7 +863,7 @@ js::ParallelDo::compileForParallelExecution(ExecutionStatus *status)
|
||||
"Script %p:%s:%d is not stalled, "
|
||||
"but no parallel ion script found, "
|
||||
"restarting loop",
|
||||
script.get(), script->filename(), script->lineno);
|
||||
script.get(), script->filename(), script->lineno());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -914,7 +914,7 @@ js::ParallelDo::appendCallTargetsToWorklist(uint32_t index,
|
||||
target = ion->callTargetList()[i];
|
||||
parallel::Spew(parallel::SpewCompile,
|
||||
"Adding call target %s:%u",
|
||||
target->filename(), target->lineno);
|
||||
target->filename(), target->lineno());
|
||||
if (appendCallTargetToWorklist(target, status) == RedLight)
|
||||
return RedLight;
|
||||
}
|
||||
@ -934,7 +934,7 @@ js::ParallelDo::appendCallTargetToWorklist(HandleScript script,
|
||||
// Fallback to sequential if disabled.
|
||||
if (!script->canParallelIonCompile()) {
|
||||
Spew(SpewCompile, "Skipping %p:%s:%u, canParallelIonCompile() is false",
|
||||
script.get(), script->filename(), script->lineno);
|
||||
script.get(), script->filename(), script->lineno());
|
||||
return sequentialExecution(true, status);
|
||||
}
|
||||
|
||||
@ -942,7 +942,7 @@ js::ParallelDo::appendCallTargetToWorklist(HandleScript script,
|
||||
// Skip if the code is expected to result in a bailout.
|
||||
if (script->parallelIonScript()->bailoutExpected()) {
|
||||
Spew(SpewCompile, "Skipping %p:%s:%u, bailout expected",
|
||||
script.get(), script->filename(), script->lineno);
|
||||
script.get(), script->filename(), script->lineno());
|
||||
return sequentialExecution(false, status);
|
||||
}
|
||||
}
|
||||
@ -959,13 +959,13 @@ js::ParallelDo::addToWorklist(HandleScript script)
|
||||
for (uint32_t i = 0; i < worklist_.length(); i++) {
|
||||
if (worklist_[i] == script) {
|
||||
Spew(SpewCompile, "Skipping %p:%s:%u, already in worklist",
|
||||
script.get(), script->filename(), script->lineno);
|
||||
script.get(), script->filename(), script->lineno());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Spew(SpewCompile, "Enqueued %p:%s:%u",
|
||||
script.get(), script->filename(), script->lineno);
|
||||
script.get(), script->filename(), script->lineno());
|
||||
|
||||
// Note that we add all possibly compilable functions to the worklist,
|
||||
// even if they're already compiled. This is so that we can return
|
||||
@ -1115,7 +1115,7 @@ js::ParallelDo::invalidateBailedOutScripts()
|
||||
"Bailout from thread %d: cause %d, topScript %p:%s:%d",
|
||||
i,
|
||||
bailoutRecords_[i].cause,
|
||||
script.get(), script->filename(), script->lineno);
|
||||
script.get(), script->filename(), script->lineno());
|
||||
|
||||
switch (bailoutRecords_[i].cause) {
|
||||
// An interrupt is not the fault of the script, so don't
|
||||
@ -1134,7 +1134,7 @@ js::ParallelDo::invalidateBailedOutScripts()
|
||||
continue;
|
||||
|
||||
Spew(SpewBailouts, "Invalidating script %p:%s:%d due to cause %d",
|
||||
script.get(), script->filename(), script->lineno,
|
||||
script.get(), script->filename(), script->lineno(),
|
||||
bailoutRecords_[i].cause);
|
||||
|
||||
types::RecompileInfo co = script->parallelIonScript()->recompileInfo();
|
||||
@ -2069,7 +2069,7 @@ class ParallelSpewer
|
||||
if (!active[SpewCompile])
|
||||
return;
|
||||
|
||||
spew(SpewCompile, "COMPILE %p:%s:%u", script.get(), script->filename(), script->lineno);
|
||||
spew(SpewCompile, "COMPILE %p:%s:%u", script.get(), script->filename(), script->lineno());
|
||||
depth++;
|
||||
}
|
||||
|
||||
|
@ -1349,7 +1349,7 @@ Interpret(JSContext *cx, RunState &state)
|
||||
|
||||
if (JS_UNLIKELY(REGS.fp()->isGeneratorFrame())) {
|
||||
JS_ASSERT(script->containsPC(REGS.pc));
|
||||
JS_ASSERT(REGS.stackDepth() <= script->nslots);
|
||||
JS_ASSERT(REGS.stackDepth() <= script->nslots());
|
||||
|
||||
/*
|
||||
* To support generator_throw and to catch ignored exceptions,
|
||||
@ -3231,7 +3231,7 @@ CASE(JSOP_ENTERLET2)
|
||||
|
||||
if (*REGS.pc == JSOP_ENTERBLOCK) {
|
||||
JS_ASSERT(REGS.stackDepth() == blockObj.stackDepth());
|
||||
JS_ASSERT(REGS.stackDepth() + blockObj.slotCount() <= script->nslots);
|
||||
JS_ASSERT(REGS.stackDepth() + blockObj.slotCount() <= script->nslots());
|
||||
Value *vp = REGS.sp + blockObj.slotCount();
|
||||
SetValueRangeToUndefined(REGS.sp, vp);
|
||||
REGS.sp = vp;
|
||||
@ -3302,8 +3302,8 @@ CASE(JSOP_YIELD)
|
||||
CASE(JSOP_ARRAYPUSH)
|
||||
{
|
||||
uint32_t slot = GET_UINT16(REGS.pc);
|
||||
JS_ASSERT(script->nfixed <= slot);
|
||||
JS_ASSERT(slot < script->nslots);
|
||||
JS_ASSERT(script->nfixed() <= slot);
|
||||
JS_ASSERT(slot < script->nslots());
|
||||
RootedObject &obj = rootObject0;
|
||||
obj = ®S.fp()->unaliasedLocal(slot).toObject();
|
||||
if (!js_NewbornArrayPush(cx, obj, REGS.sp[-1]))
|
||||
|
@ -410,7 +410,7 @@ JS_GetLinePCs(JSContext *cx, JSScript *script,
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned lineno = script->lineno;
|
||||
unsigned lineno = script->lineno();
|
||||
unsigned offset = 0;
|
||||
unsigned i = 0;
|
||||
for (jssrcnote *sn = script->notes(); !SN_IS_TERMINATOR(sn); sn = SN_NEXT(sn)) {
|
||||
@ -578,7 +578,7 @@ JS_GetScriptSourceMap(JSContext *cx, JSScript *script)
|
||||
JS_PUBLIC_API(unsigned)
|
||||
JS_GetScriptBaseLineNumber(JSContext *cx, JSScript *script)
|
||||
{
|
||||
return script->lineno;
|
||||
return script->lineno();
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(unsigned)
|
||||
@ -837,10 +837,10 @@ JS_DumpBytecode(JSContext *cx, JSScript *scriptArg)
|
||||
if (!sprinter.init())
|
||||
return;
|
||||
|
||||
fprintf(stdout, "--- SCRIPT %s:%d ---\n", script->filename(), script->lineno);
|
||||
fprintf(stdout, "--- SCRIPT %s:%d ---\n", script->filename(), (int) script->lineno());
|
||||
js_Disassemble(cx, script, true, &sprinter);
|
||||
fputs(sprinter.string(), stdout);
|
||||
fprintf(stdout, "--- END SCRIPT %s:%d ---\n", script->filename(), script->lineno);
|
||||
fprintf(stdout, "--- END SCRIPT %s:%d ---\n", script->filename(), (int) script->lineno());
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -854,10 +854,10 @@ JS_DumpPCCounts(JSContext *cx, JSScript *scriptArg)
|
||||
if (!sprinter.init())
|
||||
return;
|
||||
|
||||
fprintf(stdout, "--- SCRIPT %s:%d ---\n", script->filename(), script->lineno);
|
||||
fprintf(stdout, "--- SCRIPT %s:%d ---\n", script->filename(), (int) script->lineno());
|
||||
js_DumpPCCounts(cx, script, &sprinter);
|
||||
fputs(sprinter.string(), stdout);
|
||||
fprintf(stdout, "--- END SCRIPT %s:%d ---\n", script->filename(), script->lineno);
|
||||
fprintf(stdout, "--- END SCRIPT %s:%d ---\n", script->filename(), (int) script->lineno());
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
@ -89,7 +89,7 @@ probes::StartExecution(JSScript *script)
|
||||
#ifdef INCLUDE_MOZILLA_DTRACE
|
||||
if (JAVASCRIPT_EXECUTE_START_ENABLED())
|
||||
JAVASCRIPT_EXECUTE_START((script->filename() ? (char *)script->filename() : nullName),
|
||||
script->lineno);
|
||||
script->lineno());
|
||||
#endif
|
||||
|
||||
return ok;
|
||||
@ -103,7 +103,7 @@ probes::StopExecution(JSScript *script)
|
||||
#ifdef INCLUDE_MOZILLA_DTRACE
|
||||
if (JAVASCRIPT_EXECUTE_DONE_ENABLED())
|
||||
JAVASCRIPT_EXECUTE_DONE((script->filename() ? (char *)script->filename() : nullName),
|
||||
script->lineno);
|
||||
script->lineno());
|
||||
#endif
|
||||
|
||||
return ok;
|
||||
|
@ -228,7 +228,7 @@ SPSProfiler::allocProfileString(JSContext *cx, JSScript *script, JSFunction *may
|
||||
}
|
||||
if (!buf.append(":"))
|
||||
return nullptr;
|
||||
if (!NumberValueToStringBuffer(cx, NumberValue(script->lineno), buf))
|
||||
if (!NumberValueToStringBuffer(cx, NumberValue(script->lineno()), buf))
|
||||
return nullptr;
|
||||
if (hasAtom && !buf.append(")"))
|
||||
return nullptr;
|
||||
|
@ -610,7 +610,7 @@ ClonedBlockObject::create(JSContext *cx, Handle<StaticBlockObject *> block, Abst
|
||||
* any fixup since the initial value is 'undefined'.
|
||||
*/
|
||||
unsigned nslots = block->slotCount();
|
||||
unsigned base = frame.script()->nfixed + block->stackDepth();
|
||||
unsigned base = frame.script()->nfixed() + block->stackDepth();
|
||||
for (unsigned i = 0; i < nslots; ++i) {
|
||||
if (block->isAliased(i))
|
||||
obj->as<ClonedBlockObject>().setVar(i, frame.unaliasedLocal(base + i));
|
||||
@ -625,7 +625,7 @@ void
|
||||
ClonedBlockObject::copyUnaliasedValues(AbstractFramePtr frame)
|
||||
{
|
||||
StaticBlockObject &block = staticBlock();
|
||||
unsigned base = frame.script()->nfixed + block.stackDepth();
|
||||
unsigned base = frame.script()->nfixed() + block.stackDepth();
|
||||
for (unsigned i = 0; i < slotCount(); ++i) {
|
||||
if (!block.isAliased(i))
|
||||
setVar(i, frame.unaliasedLocal(base + i), DONT_CHECK_ALIASING);
|
||||
@ -2241,14 +2241,14 @@ AnalyzeEntrainedVariablesInScript(JSContext *cx, HandleScript script, HandleScri
|
||||
buf.printf(" ");
|
||||
}
|
||||
|
||||
buf.printf("(%s:%d) has variables entrained by ", script->filename(), script->lineno);
|
||||
buf.printf("(%s:%d) has variables entrained by ", script->filename(), script->lineno());
|
||||
|
||||
if (JSAtom *name = innerScript->function()->displayAtom()) {
|
||||
buf.putString(name);
|
||||
buf.printf(" ");
|
||||
}
|
||||
|
||||
buf.printf("(%s:%d) ::", innerScript->filename(), innerScript->lineno);
|
||||
buf.printf("(%s:%d) ::", innerScript->filename(), innerScript->lineno());
|
||||
|
||||
for (PropertyNameSet::Range r = remainingNames.all(); !r.empty(); r.popFront()) {
|
||||
buf.printf(" ");
|
||||
|
@ -95,14 +95,14 @@ StackFrame::initCallFrame(JSContext *cx, StackFrame *prev, jsbytecode *prevpc, V
|
||||
inline void
|
||||
StackFrame::initVarsToUndefined()
|
||||
{
|
||||
SetValueRangeToUndefined(slots(), script()->nfixed);
|
||||
SetValueRangeToUndefined(slots(), script()->nfixed());
|
||||
}
|
||||
|
||||
inline Value &
|
||||
StackFrame::unaliasedVar(unsigned i, MaybeCheckAliasing checkAliasing)
|
||||
{
|
||||
JS_ASSERT_IF(checkAliasing, !script()->varIsAliased(i));
|
||||
JS_ASSERT(i < script()->nfixed);
|
||||
JS_ASSERT(i < script()->nfixed());
|
||||
return slots()[i];
|
||||
}
|
||||
|
||||
@ -256,7 +256,7 @@ InterpreterStack::getCallFrame(JSContext *cx, const CallArgs &args, HandleScript
|
||||
|
||||
JS_ASSERT(fun->nonLazyScript() == script);
|
||||
unsigned nformal = fun->nargs;
|
||||
unsigned nvals = script->nslots;
|
||||
unsigned nvals = script->nslots();
|
||||
|
||||
if (args.length() >= nformal) {
|
||||
*pargv = args.array();
|
||||
|
@ -99,7 +99,7 @@ StackFrame::copyFrameAndValues(JSContext *cx, Value *vp, StackFrame *otherfp,
|
||||
{
|
||||
JS_ASSERT(othervp == otherfp->generatorArgsSnapshotBegin());
|
||||
JS_ASSERT(othersp >= otherfp->slots());
|
||||
JS_ASSERT(othersp <= otherfp->generatorSlotsSnapshotBegin() + otherfp->script()->nslots);
|
||||
JS_ASSERT(othersp <= otherfp->generatorSlotsSnapshotBegin() + otherfp->script()->nslots());
|
||||
|
||||
/* Copy args, StackFrame, and slots. */
|
||||
const Value *srcend = otherfp->generatorArgsSnapshotEnd();
|
||||
@ -179,10 +179,10 @@ StackFrame::maybeSuspendedGenerator(JSRuntime *rt)
|
||||
bool
|
||||
StackFrame::copyRawFrameSlots(AutoValueVector *vec)
|
||||
{
|
||||
if (!vec->resize(numFormalArgs() + script()->nfixed))
|
||||
if (!vec->resize(numFormalArgs() + script()->nfixed()))
|
||||
return false;
|
||||
PodCopy(vec->begin(), argv(), numFormalArgs());
|
||||
PodCopy(vec->begin() + numFormalArgs(), slots(), script()->nfixed);
|
||||
PodCopy(vec->begin() + numFormalArgs(), slots(), script()->nfixed());
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -497,7 +497,7 @@ InterpreterStack::pushExecuteFrame(JSContext *cx, HandleScript script, const Val
|
||||
{
|
||||
LifoAlloc::Mark mark = allocator_.mark();
|
||||
|
||||
unsigned nvars = 2 /* callee, this */ + script->nslots;
|
||||
unsigned nvars = 2 /* callee, this */ + script->nslots();
|
||||
uint8_t *buffer = allocateFrame(cx, sizeof(StackFrame) + nvars * sizeof(Value));
|
||||
if (!buffer)
|
||||
return nullptr;
|
||||
@ -1206,9 +1206,9 @@ ScriptFrameIter::numFrameSlots() const
|
||||
case JIT: {
|
||||
#ifdef JS_ION
|
||||
if (data_.ionFrames_.isOptimizedJS())
|
||||
return ionInlineFrames_.snapshotIterator().slots() - ionInlineFrames_.script()->nfixed;
|
||||
return ionInlineFrames_.snapshotIterator().slots() - ionInlineFrames_.script()->nfixed();
|
||||
jit::BaselineFrame *frame = data_.ionFrames_.baselineFrame();
|
||||
return frame->numValueSlots() - data_.ionFrames_.script()->nfixed;
|
||||
return frame->numValueSlots() - data_.ionFrames_.script()->nfixed();
|
||||
#else
|
||||
break;
|
||||
#endif
|
||||
@ -1230,11 +1230,11 @@ ScriptFrameIter::frameSlotValue(size_t index) const
|
||||
#ifdef JS_ION
|
||||
if (data_.ionFrames_.isOptimizedJS()) {
|
||||
jit::SnapshotIterator si(ionInlineFrames_.snapshotIterator());
|
||||
index += ionInlineFrames_.script()->nfixed;
|
||||
index += ionInlineFrames_.script()->nfixed();
|
||||
return si.maybeReadSlotByIndex(index);
|
||||
}
|
||||
|
||||
index += data_.ionFrames_.script()->nfixed;
|
||||
index += data_.ionFrames_.script()->nfixed();
|
||||
return *data_.ionFrames_.baselineFrame()->valueSlot(index);
|
||||
#else
|
||||
break;
|
||||
@ -1290,11 +1290,11 @@ js::CheckLocalUnaliased(MaybeCheckAliasing checkAliasing, JSScript *script,
|
||||
if (!checkAliasing)
|
||||
return;
|
||||
|
||||
JS_ASSERT(i < script->nslots);
|
||||
if (i < script->nfixed) {
|
||||
JS_ASSERT(i < script->nslots());
|
||||
if (i < script->nfixed()) {
|
||||
JS_ASSERT(!script->varIsAliased(i));
|
||||
} else {
|
||||
unsigned depth = i - script->nfixed;
|
||||
unsigned depth = i - script->nfixed();
|
||||
for (StaticBlockObject *b = maybeBlock; b; b = b->enclosingBlock()) {
|
||||
if (b->containsVarAtDepth(depth)) {
|
||||
JS_ASSERT(!b->isAliased(depth - b->stackDepth()));
|
||||
|
@ -380,7 +380,7 @@ class StackFrame
|
||||
*/
|
||||
public:
|
||||
Value *slots() const { return (Value *)(this + 1); }
|
||||
Value *base() const { return slots() + script()->nfixed; }
|
||||
Value *base() const { return slots() + script()->nfixed(); }
|
||||
Value *argv() const { return argv_; }
|
||||
|
||||
private:
|
||||
@ -483,7 +483,7 @@ class StackFrame
|
||||
}
|
||||
|
||||
bool isDirectEvalFrame() const {
|
||||
return isEvalFrame() && script()->staticLevel > 0;
|
||||
return isEvalFrame() && script()->staticLevel() > 0;
|
||||
}
|
||||
|
||||
bool isNonStrictDirectEvalFrame() const {
|
||||
@ -1021,7 +1021,7 @@ class FrameRegs
|
||||
}
|
||||
|
||||
Value *spForStackDepth(unsigned depth) const {
|
||||
JS_ASSERT(fp_->script()->nfixed + depth <= fp_->script()->nslots);
|
||||
JS_ASSERT(fp_->script()->nfixed() + depth <= fp_->script()->nslots());
|
||||
return fp_->base() + depth;
|
||||
}
|
||||
|
||||
@ -1041,7 +1041,7 @@ class FrameRegs
|
||||
}
|
||||
void prepareToRun(StackFrame &fp, JSScript *script) {
|
||||
pc = script->code();
|
||||
sp = fp.slots() + script->nfixed;
|
||||
sp = fp.slots() + script->nfixed();
|
||||
fp_ = &fp;
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include <Windows.h>
|
||||
#include <WinSock.h>
|
||||
#include <MMSystem.h>
|
||||
#elif ((defined WEBRTC_LINUX) || (defined WEBRTC_MAC))
|
||||
#elif ((defined WEBRTC_LINUX) || (defined WEBRTC_BSD) || (defined WEBRTC_MAC))
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#endif
|
||||
@ -209,7 +209,7 @@ class WindowsRealTimeClock : public RealTimeClock {
|
||||
WindowsHelpTimer* _helpTimer;
|
||||
};
|
||||
|
||||
#elif ((defined WEBRTC_LINUX) || (defined WEBRTC_MAC))
|
||||
#elif ((defined WEBRTC_LINUX) || (defined WEBRTC_BSD) || (defined WEBRTC_MAC))
|
||||
class UnixRealTimeClock : public RealTimeClock {
|
||||
public:
|
||||
UnixRealTimeClock() {}
|
||||
@ -240,7 +240,7 @@ Clock* Clock::GetRealTimeClock() {
|
||||
#if defined(_WIN32)
|
||||
static WindowsRealTimeClock clock(&global_help_timer);
|
||||
return &clock;
|
||||
#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC)
|
||||
#elif ((defined WEBRTC_LINUX) || (defined WEBRTC_BSD) || (defined WEBRTC_MAC))
|
||||
static UnixRealTimeClock clock;
|
||||
return &clock;
|
||||
#else
|
||||
|
@ -30,7 +30,6 @@
|
||||
#include "nsIPrefBranch.h"
|
||||
#include "nsIStringBundle.h"
|
||||
#include "nsAuthInformationHolder.h"
|
||||
#include "nsICharsetConverterManager.h"
|
||||
#include "nsIProtocolProxyService.h"
|
||||
#include "nsICancelable.h"
|
||||
#include "nsICacheEntryDescriptor.h"
|
||||
@ -1742,12 +1741,6 @@ nsFtpState::Init(nsFtpChannel *channel)
|
||||
// now unescape it... %xx reduced inline to resulting character
|
||||
int32_t len = NS_UnescapeURL(fwdPtr);
|
||||
mPath.Assign(fwdPtr, len);
|
||||
if (IsUTF8(mPath)) {
|
||||
nsAutoCString originCharset;
|
||||
rv = mChannel->URI()->GetOriginCharset(originCharset);
|
||||
if (NS_SUCCEEDED(rv) && !originCharset.EqualsLiteral("UTF-8"))
|
||||
ConvertUTF8PathToCharset(originCharset);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
if (mPath.FindCharInSet(CRLF) >= 0)
|
||||
@ -2455,58 +2448,3 @@ nsFtpState::CheckCache()
|
||||
return NS_SUCCEEDED(rv);
|
||||
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsFtpState::ConvertUTF8PathToCharset(const nsACString &aCharset)
|
||||
{
|
||||
nsresult rv;
|
||||
NS_ASSERTION(IsUTF8(mPath), "mPath isn't UTF8 string!");
|
||||
NS_ConvertUTF8toUTF16 ucsPath(mPath);
|
||||
nsAutoCString result;
|
||||
|
||||
nsCOMPtr<nsICharsetConverterManager> charsetMgr(
|
||||
do_GetService("@mozilla.org/charset-converter-manager;1", &rv));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIUnicodeEncoder> encoder;
|
||||
rv = charsetMgr->GetUnicodeEncoder(PromiseFlatCString(aCharset).get(),
|
||||
getter_AddRefs(encoder));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
int32_t len = ucsPath.Length();
|
||||
int32_t maxlen;
|
||||
|
||||
rv = encoder->GetMaxLength(ucsPath.get(), len, &maxlen);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
char buf[256], *p = buf;
|
||||
if (uint32_t(maxlen) > sizeof(buf) - 1) {
|
||||
p = (char *) malloc(maxlen + 1);
|
||||
if (!p)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
rv = encoder->Convert(ucsPath.get(), &len, p, &maxlen);
|
||||
if (NS_FAILED(rv))
|
||||
goto end;
|
||||
if (rv == NS_ERROR_UENC_NOMAPPING) {
|
||||
NS_WARNING("unicode conversion failed");
|
||||
rv = NS_ERROR_UNEXPECTED;
|
||||
goto end;
|
||||
}
|
||||
p[maxlen] = 0;
|
||||
result.Assign(p);
|
||||
|
||||
len = sizeof(buf) - 1;
|
||||
rv = encoder->Finish(buf, &len);
|
||||
if (NS_FAILED(rv))
|
||||
goto end;
|
||||
buf[len] = 0;
|
||||
result.Append(buf);
|
||||
mPath = result;
|
||||
|
||||
end:
|
||||
if (p != buf)
|
||||
free(p);
|
||||
return rv;
|
||||
}
|
||||
|
@ -144,7 +144,6 @@ private:
|
||||
void ConvertDirspecFromVMS(nsCString& fileSpec);
|
||||
nsresult BuildStreamConverter(nsIStreamListener** convertStreamListener);
|
||||
nsresult SetContentType();
|
||||
nsresult ConvertUTF8PathToCharset(const nsACString &aCharset);
|
||||
|
||||
/**
|
||||
* This method is called to kick-off the FTP state machine. mState is
|
||||
|
Loading…
Reference in New Issue
Block a user