зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1157628: Reformat spidermonkey source directory, again; r=jandem
--HG-- extra : rebase_source : 6a1a1671f5ccb323d475b8711e5a8977146e98c6
This commit is contained in:
Родитель
ed59f0c98f
Коммит
b3cbd604e8
|
@ -19,7 +19,7 @@ CPOWTimer::~CPOWTimer()
|
||||||
if (!js::IsStopwatchActive(runtime))
|
if (!js::IsStopwatchActive(runtime))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
js::PerformanceData *performance = js::GetPerformanceData(runtime);
|
js::PerformanceData* performance = js::GetPerformanceData(runtime);
|
||||||
uint64_t duration = PR_IntervalToMicroseconds(PR_IntervalNow() - startInterval);
|
uint64_t duration = PR_IntervalToMicroseconds(PR_IntervalNow() - startInterval);
|
||||||
performance->totalCPOWTime += duration;
|
performance->totalCPOWTime += duration;
|
||||||
}
|
}
|
||||||
|
|
|
@ -219,7 +219,7 @@ class JS_PUBLIC_API(CallbackTracer) : public JSTracer
|
||||||
class AutoTracingName
|
class AutoTracingName
|
||||||
{
|
{
|
||||||
CallbackTracer* trc_;
|
CallbackTracer* trc_;
|
||||||
const char *prior_;
|
const char* prior_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AutoTracingName(CallbackTracer* trc, const char* name) : trc_(trc), prior_(trc->contextName_) {
|
AutoTracingName(CallbackTracer* trc, const char* name) : trc_(trc), prior_(trc->contextName_) {
|
||||||
|
@ -290,7 +290,7 @@ class AutoTracingDetails
|
||||||
class AutoOriginalTraceLocation
|
class AutoOriginalTraceLocation
|
||||||
{
|
{
|
||||||
#ifdef JS_GC_ZEAL
|
#ifdef JS_GC_ZEAL
|
||||||
CallbackTracer *trc_;
|
CallbackTracer* trc_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|
|
@ -211,7 +211,7 @@ GetBuildConfiguration(JSContext* cx, unsigned argc, jsval* vp)
|
||||||
if (!JS_SetProperty(cx, info, "moz-memory", value))
|
if (!JS_SetProperty(cx, info, "moz-memory", value))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
value.setInt32(sizeof(void *));
|
value.setInt32(sizeof(void*));
|
||||||
if (!JS_SetProperty(cx, info, "pointer-byte-size", value))
|
if (!JS_SetProperty(cx, info, "pointer-byte-size", value))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -404,7 +404,7 @@ struct InternalGCMethods<jsid>
|
||||||
static JS::shadow::Runtime* shadowRuntimeFromAnyThread(jsid id) {
|
static JS::shadow::Runtime* shadowRuntimeFromAnyThread(jsid id) {
|
||||||
return reinterpret_cast<JS::shadow::Runtime*>(runtimeFromAnyThread(id));
|
return reinterpret_cast<JS::shadow::Runtime*>(runtimeFromAnyThread(id));
|
||||||
}
|
}
|
||||||
static void preBarrierImpl(Zone *zone, jsid id) {
|
static void preBarrierImpl(Zone* zone, jsid id) {
|
||||||
JS::shadow::Zone* shadowZone = JS::shadow::Zone::asShadowZone(zone);
|
JS::shadow::Zone* shadowZone = JS::shadow::Zone::asShadowZone(zone);
|
||||||
if (shadowZone->needsIncrementalBarrier()) {
|
if (shadowZone->needsIncrementalBarrier()) {
|
||||||
jsid tmp(id);
|
jsid tmp(id);
|
||||||
|
|
|
@ -351,13 +351,13 @@ ICStub::trace(JSTracer* trc)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ICStub::In_Native: {
|
case ICStub::In_Native: {
|
||||||
ICIn_Native *inStub = toIn_Native();
|
ICIn_Native* inStub = toIn_Native();
|
||||||
TraceEdge(trc, &inStub->shape(), "baseline-innative-stub-shape");
|
TraceEdge(trc, &inStub->shape(), "baseline-innative-stub-shape");
|
||||||
TraceEdge(trc, &inStub->name(), "baseline-innative-stub-name");
|
TraceEdge(trc, &inStub->name(), "baseline-innative-stub-name");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ICStub::In_NativePrototype: {
|
case ICStub::In_NativePrototype: {
|
||||||
ICIn_NativePrototype *inStub = toIn_NativePrototype();
|
ICIn_NativePrototype* inStub = toIn_NativePrototype();
|
||||||
TraceEdge(trc, &inStub->shape(), "baseline-innativeproto-stub-shape");
|
TraceEdge(trc, &inStub->shape(), "baseline-innativeproto-stub-shape");
|
||||||
TraceEdge(trc, &inStub->name(), "baseline-innativeproto-stub-name");
|
TraceEdge(trc, &inStub->name(), "baseline-innativeproto-stub-name");
|
||||||
TraceEdge(trc, &inStub->holder(), "baseline-innativeproto-stub-holder");
|
TraceEdge(trc, &inStub->holder(), "baseline-innativeproto-stub-holder");
|
||||||
|
@ -365,7 +365,7 @@ ICStub::trace(JSTracer* trc)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ICStub::In_NativeDoesNotExist: {
|
case ICStub::In_NativeDoesNotExist: {
|
||||||
ICIn_NativeDoesNotExist *inStub = toIn_NativeDoesNotExist();
|
ICIn_NativeDoesNotExist* inStub = toIn_NativeDoesNotExist();
|
||||||
TraceEdge(trc, &inStub->name(), "baseline-innativedoesnotexist-stub-name");
|
TraceEdge(trc, &inStub->name(), "baseline-innativedoesnotexist-stub-name");
|
||||||
JS_STATIC_ASSERT(ICIn_NativeDoesNotExist::MAX_PROTO_CHAIN_DEPTH == 8);
|
JS_STATIC_ASSERT(ICIn_NativeDoesNotExist::MAX_PROTO_CHAIN_DEPTH == 8);
|
||||||
switch (inStub->protoChainDepth()) {
|
switch (inStub->protoChainDepth()) {
|
||||||
|
@ -383,7 +383,7 @@ ICStub::trace(JSTracer* trc)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ICStub::In_Dense: {
|
case ICStub::In_Dense: {
|
||||||
ICIn_Dense *inStub = toIn_Dense();
|
ICIn_Dense* inStub = toIn_Dense();
|
||||||
TraceEdge(trc, &inStub->shape(), "baseline-in-dense-shape");
|
TraceEdge(trc, &inStub->shape(), "baseline-in-dense-shape");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3806,7 +3806,7 @@ ArgumentsGetElemStubExists(ICGetElem_Fallback* stub, ICGetElem_Arguments::Which
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
IsOptimizableElementPropertyName(JSContext *cx, HandleValue key, MutableHandleId idp)
|
IsOptimizableElementPropertyName(JSContext* cx, HandleValue key, MutableHandleId idp)
|
||||||
{
|
{
|
||||||
if (!key.isString())
|
if (!key.isString())
|
||||||
return false;
|
return false;
|
||||||
|
@ -5856,8 +5856,8 @@ ICSetElem_TypedArray::Compiler::generateStubCode(MacroAssembler& masm)
|
||||||
//
|
//
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
TryAttachDenseInStub(JSContext *cx, HandleScript script, ICIn_Fallback *stub,
|
TryAttachDenseInStub(JSContext* cx, HandleScript script, ICIn_Fallback* stub,
|
||||||
HandleValue key, HandleObject obj, bool *attached)
|
HandleValue key, HandleObject obj, bool* attached)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(!*attached);
|
MOZ_ASSERT(!*attached);
|
||||||
|
|
||||||
|
@ -5866,7 +5866,7 @@ TryAttachDenseInStub(JSContext *cx, HandleScript script, ICIn_Fallback *stub,
|
||||||
|
|
||||||
JitSpew(JitSpew_BaselineIC, " Generating In(Native[Int32] dense) stub");
|
JitSpew(JitSpew_BaselineIC, " Generating In(Native[Int32] dense) stub");
|
||||||
ICIn_Dense::Compiler compiler(cx, obj->as<NativeObject>().lastProperty());
|
ICIn_Dense::Compiler compiler(cx, obj->as<NativeObject>().lastProperty());
|
||||||
ICStub *denseStub = compiler.getStub(compiler.getStubSpace(script));
|
ICStub* denseStub = compiler.getStub(compiler.getStubSpace(script));
|
||||||
if (!denseStub)
|
if (!denseStub)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -5876,8 +5876,8 @@ TryAttachDenseInStub(JSContext *cx, HandleScript script, ICIn_Fallback *stub,
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
TryAttachNativeInStub(JSContext *cx, HandleScript script, ICIn_Fallback *stub,
|
TryAttachNativeInStub(JSContext* cx, HandleScript script, ICIn_Fallback* stub,
|
||||||
HandleValue key, HandleObject obj, bool *attached)
|
HandleValue key, HandleObject obj, bool* attached)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(!*attached);
|
MOZ_ASSERT(!*attached);
|
||||||
|
|
||||||
|
@ -5897,7 +5897,7 @@ TryAttachNativeInStub(JSContext *cx, HandleScript script, ICIn_Fallback *stub,
|
||||||
JitSpew(JitSpew_BaselineIC, " Generating In(Native %s) stub",
|
JitSpew(JitSpew_BaselineIC, " Generating In(Native %s) stub",
|
||||||
(obj == holder) ? "direct" : "prototype");
|
(obj == holder) ? "direct" : "prototype");
|
||||||
ICInNativeCompiler compiler(cx, kind, obj, holder, name);
|
ICInNativeCompiler compiler(cx, kind, obj, holder, name);
|
||||||
ICStub *newStub = compiler.getStub(compiler.getStubSpace(script));
|
ICStub* newStub = compiler.getStub(compiler.getStubSpace(script));
|
||||||
if (!newStub)
|
if (!newStub)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -5910,9 +5910,9 @@ TryAttachNativeInStub(JSContext *cx, HandleScript script, ICIn_Fallback *stub,
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
TryAttachNativeInDoesNotExistStub(JSContext *cx, HandleScript script,
|
TryAttachNativeInDoesNotExistStub(JSContext* cx, HandleScript script,
|
||||||
ICIn_Fallback *stub, HandleValue key,
|
ICIn_Fallback* stub, HandleValue key,
|
||||||
HandleObject obj, bool *attached)
|
HandleObject obj, bool* attached)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(!*attached);
|
MOZ_ASSERT(!*attached);
|
||||||
|
|
||||||
|
@ -5934,7 +5934,7 @@ TryAttachNativeInDoesNotExistStub(JSContext *cx, HandleScript script,
|
||||||
// Confirmed no-such-property. Add stub.
|
// Confirmed no-such-property. Add stub.
|
||||||
JitSpew(JitSpew_BaselineIC, " Generating In_NativeDoesNotExist stub");
|
JitSpew(JitSpew_BaselineIC, " Generating In_NativeDoesNotExist stub");
|
||||||
ICInNativeDoesNotExistCompiler compiler(cx, obj, name, protoChainDepth);
|
ICInNativeDoesNotExistCompiler compiler(cx, obj, name, protoChainDepth);
|
||||||
ICStub *newStub = compiler.getStub(compiler.getStubSpace(script));
|
ICStub* newStub = compiler.getStub(compiler.getStubSpace(script));
|
||||||
if (!newStub)
|
if (!newStub)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -5944,7 +5944,7 @@ TryAttachNativeInDoesNotExistStub(JSContext *cx, HandleScript script,
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
DoInFallback(JSContext *cx, BaselineFrame *frame, ICIn_Fallback *stub_,
|
DoInFallback(JSContext* cx, BaselineFrame* frame, ICIn_Fallback* stub_,
|
||||||
HandleValue key, HandleValue objValue, MutableHandleValue res)
|
HandleValue key, HandleValue objValue, MutableHandleValue res)
|
||||||
{
|
{
|
||||||
// This fallback stub may trigger debug mode toggling.
|
// This fallback stub may trigger debug mode toggling.
|
||||||
|
@ -5993,7 +5993,7 @@ DoInFallback(JSContext *cx, BaselineFrame *frame, ICIn_Fallback *stub_,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef bool (*DoInFallbackFn)(JSContext *, BaselineFrame *, ICIn_Fallback *, HandleValue,
|
typedef bool (*DoInFallbackFn)(JSContext*, BaselineFrame*, ICIn_Fallback*, HandleValue,
|
||||||
HandleValue, MutableHandleValue);
|
HandleValue, MutableHandleValue);
|
||||||
static const VMFunction DoInFallbackInfo =
|
static const VMFunction DoInFallbackInfo =
|
||||||
FunctionInfo<DoInFallbackFn>(DoInFallback, TailCall, PopValues(2));
|
FunctionInfo<DoInFallbackFn>(DoInFallback, TailCall, PopValues(2));
|
||||||
|
@ -6017,7 +6017,7 @@ ICIn_Fallback::Compiler::generateStubCode(MacroAssembler& masm)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ICInNativeCompiler::generateStubCode(MacroAssembler &masm)
|
ICInNativeCompiler::generateStubCode(MacroAssembler& masm)
|
||||||
{
|
{
|
||||||
Label failure, failurePopR0Scratch;
|
Label failure, failurePopR0Scratch;
|
||||||
|
|
||||||
|
@ -6061,8 +6061,8 @@ ICInNativeCompiler::generateStubCode(MacroAssembler &masm)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ICStub *
|
ICStub*
|
||||||
ICInNativeDoesNotExistCompiler::getStub(ICStubSpace *space)
|
ICInNativeDoesNotExistCompiler::getStub(ICStubSpace* space)
|
||||||
{
|
{
|
||||||
AutoShapeVector shapes(cx);
|
AutoShapeVector shapes(cx);
|
||||||
if (!shapes.append(obj_->as<NativeObject>().lastProperty()))
|
if (!shapes.append(obj_->as<NativeObject>().lastProperty()))
|
||||||
|
@ -6073,7 +6073,7 @@ ICInNativeDoesNotExistCompiler::getStub(ICStubSpace *space)
|
||||||
|
|
||||||
JS_STATIC_ASSERT(ICIn_NativeDoesNotExist::MAX_PROTO_CHAIN_DEPTH == 8);
|
JS_STATIC_ASSERT(ICIn_NativeDoesNotExist::MAX_PROTO_CHAIN_DEPTH == 8);
|
||||||
|
|
||||||
ICStub *stub = nullptr;
|
ICStub* stub = nullptr;
|
||||||
switch (protoChainDepth_) {
|
switch (protoChainDepth_) {
|
||||||
case 0: stub = getStubSpecific<0>(space, &shapes); break;
|
case 0: stub = getStubSpecific<0>(space, &shapes); break;
|
||||||
case 1: stub = getStubSpecific<1>(space, &shapes); break;
|
case 1: stub = getStubSpecific<1>(space, &shapes); break;
|
||||||
|
@ -6092,7 +6092,7 @@ ICInNativeDoesNotExistCompiler::getStub(ICStubSpace *space)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ICInNativeDoesNotExistCompiler::generateStubCode(MacroAssembler &masm)
|
ICInNativeDoesNotExistCompiler::generateStubCode(MacroAssembler& masm)
|
||||||
{
|
{
|
||||||
Label failure, failurePopR0Scratch;
|
Label failure, failurePopR0Scratch;
|
||||||
|
|
||||||
|
@ -6149,7 +6149,7 @@ ICInNativeDoesNotExistCompiler::generateStubCode(MacroAssembler &masm)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ICIn_Dense::Compiler::generateStubCode(MacroAssembler &masm)
|
ICIn_Dense::Compiler::generateStubCode(MacroAssembler& masm)
|
||||||
{
|
{
|
||||||
Label failure;
|
Label failure;
|
||||||
|
|
||||||
|
@ -7335,10 +7335,10 @@ TryAttachPrimitiveGetPropStub(JSContext* cx, HandleScript script, jsbytecode* pc
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
TryAttachNativeGetPropDoesNotExistStub(JSContext *cx, HandleScript script,
|
TryAttachNativeGetPropDoesNotExistStub(JSContext* cx, HandleScript script,
|
||||||
jsbytecode *pc, ICGetProp_Fallback *stub,
|
jsbytecode* pc, ICGetProp_Fallback* stub,
|
||||||
HandlePropertyName name, HandleValue val,
|
HandlePropertyName name, HandleValue val,
|
||||||
bool *attached)
|
bool* attached)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(!*attached);
|
MOZ_ASSERT(!*attached);
|
||||||
|
|
||||||
|
@ -12372,14 +12372,14 @@ ICSetElem_TypedArray::ICSetElem_TypedArray(JitCode* stubCode, Shape* shape, Scal
|
||||||
extra_ |= (static_cast<uint16_t>(expectOutOfBounds) << 8);
|
extra_ |= (static_cast<uint16_t>(expectOutOfBounds) << 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
ICInNativeStub::ICInNativeStub(ICStub::Kind kind, JitCode *stubCode, HandleShape shape,
|
ICInNativeStub::ICInNativeStub(ICStub::Kind kind, JitCode* stubCode, HandleShape shape,
|
||||||
HandlePropertyName name)
|
HandlePropertyName name)
|
||||||
: ICStub(kind, stubCode),
|
: ICStub(kind, stubCode),
|
||||||
shape_(shape),
|
shape_(shape),
|
||||||
name_(name)
|
name_(name)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
ICIn_NativePrototype::ICIn_NativePrototype(JitCode *stubCode, HandleShape shape,
|
ICIn_NativePrototype::ICIn_NativePrototype(JitCode* stubCode, HandleShape shape,
|
||||||
HandlePropertyName name, HandleObject holder,
|
HandlePropertyName name, HandleObject holder,
|
||||||
HandleShape holderShape)
|
HandleShape holderShape)
|
||||||
: ICInNativeStub(In_NativePrototype, stubCode, shape, name),
|
: ICInNativeStub(In_NativePrototype, stubCode, shape, name),
|
||||||
|
@ -12387,7 +12387,7 @@ ICIn_NativePrototype::ICIn_NativePrototype(JitCode *stubCode, HandleShape shape,
|
||||||
holderShape_(holderShape)
|
holderShape_(holderShape)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
ICIn_NativeDoesNotExist::ICIn_NativeDoesNotExist(JitCode *stubCode, size_t protoChainDepth,
|
ICIn_NativeDoesNotExist::ICIn_NativeDoesNotExist(JitCode* stubCode, size_t protoChainDepth,
|
||||||
HandlePropertyName name)
|
HandlePropertyName name)
|
||||||
: ICStub(In_NativeDoesNotExist, stubCode),
|
: ICStub(In_NativeDoesNotExist, stubCode),
|
||||||
name_(name)
|
name_(name)
|
||||||
|
@ -12407,7 +12407,7 @@ ICIn_NativeDoesNotExist::offsetOfShape(size_t idx)
|
||||||
|
|
||||||
template <size_t ProtoChainDepth>
|
template <size_t ProtoChainDepth>
|
||||||
ICIn_NativeDoesNotExistImpl<ProtoChainDepth>::ICIn_NativeDoesNotExistImpl(
|
ICIn_NativeDoesNotExistImpl<ProtoChainDepth>::ICIn_NativeDoesNotExistImpl(
|
||||||
JitCode *stubCode, const AutoShapeVector *shapes, HandlePropertyName name)
|
JitCode* stubCode, const AutoShapeVector* shapes, HandlePropertyName name)
|
||||||
: ICIn_NativeDoesNotExist(stubCode, ProtoChainDepth, name)
|
: ICIn_NativeDoesNotExist(stubCode, ProtoChainDepth, name)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(shapes->length() == NumShapes);
|
MOZ_ASSERT(shapes->length() == NumShapes);
|
||||||
|
@ -12416,7 +12416,7 @@ ICIn_NativeDoesNotExistImpl<ProtoChainDepth>::ICIn_NativeDoesNotExistImpl(
|
||||||
}
|
}
|
||||||
|
|
||||||
ICInNativeDoesNotExistCompiler::ICInNativeDoesNotExistCompiler(
|
ICInNativeDoesNotExistCompiler::ICInNativeDoesNotExistCompiler(
|
||||||
JSContext *cx, HandleObject obj, HandlePropertyName name, size_t protoChainDepth)
|
JSContext* cx, HandleObject obj, HandlePropertyName name, size_t protoChainDepth)
|
||||||
: ICStubCompiler(cx, ICStub::In_NativeDoesNotExist),
|
: ICStubCompiler(cx, ICStub::In_NativeDoesNotExist),
|
||||||
obj_(cx, obj),
|
obj_(cx, obj),
|
||||||
name_(cx, name),
|
name_(cx, name),
|
||||||
|
@ -12425,7 +12425,7 @@ ICInNativeDoesNotExistCompiler::ICInNativeDoesNotExistCompiler(
|
||||||
MOZ_ASSERT(protoChainDepth_ <= ICIn_NativeDoesNotExist::MAX_PROTO_CHAIN_DEPTH);
|
MOZ_ASSERT(protoChainDepth_ <= ICIn_NativeDoesNotExist::MAX_PROTO_CHAIN_DEPTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
ICIn_Dense::ICIn_Dense(JitCode *stubCode, HandleShape shape)
|
ICIn_Dense::ICIn_Dense(JitCode* stubCode, HandleShape shape)
|
||||||
: ICStub(In_Dense, stubCode),
|
: ICStub(In_Dense, stubCode),
|
||||||
shape_(shape)
|
shape_(shape)
|
||||||
{ }
|
{ }
|
||||||
|
|
|
@ -3422,18 +3422,18 @@ class ICInNativeStub : public ICStub
|
||||||
HeapPtrPropertyName name_;
|
HeapPtrPropertyName name_;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ICInNativeStub(ICStub::Kind kind, JitCode *stubCode, HandleShape shape,
|
ICInNativeStub(ICStub::Kind kind, JitCode* stubCode, HandleShape shape,
|
||||||
HandlePropertyName name);
|
HandlePropertyName name);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HeapPtrShape &shape() {
|
HeapPtrShape& shape() {
|
||||||
return shape_;
|
return shape_;
|
||||||
}
|
}
|
||||||
static size_t offsetOfShape() {
|
static size_t offsetOfShape() {
|
||||||
return offsetof(ICInNativeStub, shape_);
|
return offsetof(ICInNativeStub, shape_);
|
||||||
}
|
}
|
||||||
|
|
||||||
HeapPtrPropertyName &name() {
|
HeapPtrPropertyName& name() {
|
||||||
return name_;
|
return name_;
|
||||||
}
|
}
|
||||||
static size_t offsetOfName() {
|
static size_t offsetOfName() {
|
||||||
|
@ -3446,7 +3446,7 @@ class ICIn_Native : public ICInNativeStub
|
||||||
{
|
{
|
||||||
friend class ICStubSpace;
|
friend class ICStubSpace;
|
||||||
|
|
||||||
ICIn_Native(JitCode *stubCode, HandleShape shape, HandlePropertyName name)
|
ICIn_Native(JitCode* stubCode, HandleShape shape, HandlePropertyName name)
|
||||||
: ICInNativeStub(In_Native, stubCode, shape, name)
|
: ICInNativeStub(In_Native, stubCode, shape, name)
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
@ -3461,14 +3461,14 @@ class ICIn_NativePrototype : public ICInNativeStub
|
||||||
HeapPtrObject holder_;
|
HeapPtrObject holder_;
|
||||||
HeapPtrShape holderShape_;
|
HeapPtrShape holderShape_;
|
||||||
|
|
||||||
ICIn_NativePrototype(JitCode *stubCode, HandleShape shape, HandlePropertyName name,
|
ICIn_NativePrototype(JitCode* stubCode, HandleShape shape, HandlePropertyName name,
|
||||||
HandleObject holder, HandleShape holderShape);
|
HandleObject holder, HandleShape holderShape);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HeapPtrObject &holder() {
|
HeapPtrObject& holder() {
|
||||||
return holder_;
|
return holder_;
|
||||||
}
|
}
|
||||||
HeapPtrShape &holderShape() {
|
HeapPtrShape& holderShape() {
|
||||||
return holderShape_;
|
return holderShape_;
|
||||||
}
|
}
|
||||||
static size_t offsetOfHolder() {
|
static size_t offsetOfHolder() {
|
||||||
|
@ -3486,10 +3486,10 @@ class ICInNativeCompiler : public ICStubCompiler
|
||||||
RootedObject holder_;
|
RootedObject holder_;
|
||||||
RootedPropertyName name_;
|
RootedPropertyName name_;
|
||||||
|
|
||||||
bool generateStubCode(MacroAssembler &masm);
|
bool generateStubCode(MacroAssembler& masm);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ICInNativeCompiler(JSContext *cx, ICStub::Kind kind, HandleObject obj, HandleObject holder,
|
ICInNativeCompiler(JSContext* cx, ICStub::Kind kind, HandleObject obj, HandleObject holder,
|
||||||
HandlePropertyName name)
|
HandlePropertyName name)
|
||||||
: ICStubCompiler(cx, kind),
|
: ICStubCompiler(cx, kind),
|
||||||
obj_(cx, obj),
|
obj_(cx, obj),
|
||||||
|
@ -3497,7 +3497,7 @@ class ICInNativeCompiler : public ICStubCompiler
|
||||||
name_(cx, name)
|
name_(cx, name)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
ICStub *getStub(ICStubSpace *space) {
|
ICStub* getStub(ICStubSpace* space) {
|
||||||
RootedShape shape(cx, obj_->as<NativeObject>().lastProperty());
|
RootedShape shape(cx, obj_->as<NativeObject>().lastProperty());
|
||||||
if (kind == ICStub::In_Native) {
|
if (kind == ICStub::In_Native) {
|
||||||
MOZ_ASSERT(obj_ == holder_);
|
MOZ_ASSERT(obj_ == holder_);
|
||||||
|
@ -3524,7 +3524,7 @@ class ICIn_NativeDoesNotExist : public ICStub
|
||||||
static const size_t MAX_PROTO_CHAIN_DEPTH = 8;
|
static const size_t MAX_PROTO_CHAIN_DEPTH = 8;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ICIn_NativeDoesNotExist(JitCode *stubCode, size_t protoChainDepth,
|
ICIn_NativeDoesNotExist(JitCode* stubCode, size_t protoChainDepth,
|
||||||
HandlePropertyName name);
|
HandlePropertyName name);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -3532,14 +3532,14 @@ class ICIn_NativeDoesNotExist : public ICStub
|
||||||
MOZ_ASSERT(extra_ <= MAX_PROTO_CHAIN_DEPTH);
|
MOZ_ASSERT(extra_ <= MAX_PROTO_CHAIN_DEPTH);
|
||||||
return extra_;
|
return extra_;
|
||||||
}
|
}
|
||||||
HeapPtrPropertyName &name() {
|
HeapPtrPropertyName& name() {
|
||||||
return name_;
|
return name_;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <size_t ProtoChainDepth>
|
template <size_t ProtoChainDepth>
|
||||||
ICIn_NativeDoesNotExistImpl<ProtoChainDepth> *toImpl() {
|
ICIn_NativeDoesNotExistImpl<ProtoChainDepth>* toImpl() {
|
||||||
MOZ_ASSERT(ProtoChainDepth == protoChainDepth());
|
MOZ_ASSERT(ProtoChainDepth == protoChainDepth());
|
||||||
return static_cast<ICIn_NativeDoesNotExistImpl<ProtoChainDepth> *>(this);
|
return static_cast<ICIn_NativeDoesNotExistImpl<ProtoChainDepth>*>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
static size_t offsetOfShape(size_t idx);
|
static size_t offsetOfShape(size_t idx);
|
||||||
|
@ -3560,11 +3560,11 @@ class ICIn_NativeDoesNotExistImpl : public ICIn_NativeDoesNotExist
|
||||||
private:
|
private:
|
||||||
mozilla::Array<HeapPtrShape, NumShapes> shapes_;
|
mozilla::Array<HeapPtrShape, NumShapes> shapes_;
|
||||||
|
|
||||||
ICIn_NativeDoesNotExistImpl(JitCode *stubCode, const AutoShapeVector *shapes,
|
ICIn_NativeDoesNotExistImpl(JitCode* stubCode, const AutoShapeVector* shapes,
|
||||||
HandlePropertyName name);
|
HandlePropertyName name);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void traceShapes(JSTracer *trc) {
|
void traceShapes(JSTracer* trc) {
|
||||||
for (size_t i = 0; i < NumShapes; i++)
|
for (size_t i = 0; i < NumShapes; i++)
|
||||||
TraceEdge(trc, &shapes_[i], "baseline-innativedoesnotexist-stub-shape");
|
TraceEdge(trc, &shapes_[i], "baseline-innativedoesnotexist-stub-shape");
|
||||||
}
|
}
|
||||||
|
@ -3585,19 +3585,19 @@ class ICInNativeDoesNotExistCompiler : public ICStubCompiler
|
||||||
return static_cast<int32_t>(kind) | (static_cast<int32_t>(protoChainDepth_) << 16);
|
return static_cast<int32_t>(kind) | (static_cast<int32_t>(protoChainDepth_) << 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool generateStubCode(MacroAssembler &masm);
|
bool generateStubCode(MacroAssembler& masm);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ICInNativeDoesNotExistCompiler(JSContext *cx, HandleObject obj, HandlePropertyName name,
|
ICInNativeDoesNotExistCompiler(JSContext* cx, HandleObject obj, HandlePropertyName name,
|
||||||
size_t protoChainDepth);
|
size_t protoChainDepth);
|
||||||
|
|
||||||
template <size_t ProtoChainDepth>
|
template <size_t ProtoChainDepth>
|
||||||
ICStub *getStubSpecific(ICStubSpace *space, const AutoShapeVector *shapes) {
|
ICStub* getStubSpecific(ICStubSpace* space, const AutoShapeVector* shapes) {
|
||||||
return ICStub::New<ICIn_NativeDoesNotExistImpl<ProtoChainDepth>>(space, getStubCode(),
|
return ICStub::New<ICIn_NativeDoesNotExistImpl<ProtoChainDepth>>(space, getStubCode(),
|
||||||
shapes, name_);
|
shapes, name_);
|
||||||
}
|
}
|
||||||
|
|
||||||
ICStub *getStub(ICStubSpace *space);
|
ICStub* getStub(ICStubSpace* space);
|
||||||
};
|
};
|
||||||
|
|
||||||
class ICIn_Dense : public ICStub
|
class ICIn_Dense : public ICStub
|
||||||
|
@ -3606,10 +3606,10 @@ class ICIn_Dense : public ICStub
|
||||||
|
|
||||||
HeapPtrShape shape_;
|
HeapPtrShape shape_;
|
||||||
|
|
||||||
ICIn_Dense(JitCode *stubCode, HandleShape shape);
|
ICIn_Dense(JitCode* stubCode, HandleShape shape);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HeapPtrShape &shape() {
|
HeapPtrShape& shape() {
|
||||||
return shape_;
|
return shape_;
|
||||||
}
|
}
|
||||||
static size_t offsetOfShape() {
|
static size_t offsetOfShape() {
|
||||||
|
@ -3620,15 +3620,15 @@ class ICIn_Dense : public ICStub
|
||||||
RootedShape shape_;
|
RootedShape shape_;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool generateStubCode(MacroAssembler &masm);
|
bool generateStubCode(MacroAssembler& masm);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Compiler(JSContext *cx, Shape *shape)
|
Compiler(JSContext* cx, Shape* shape)
|
||||||
: ICStubCompiler(cx, ICStub::In_Dense),
|
: ICStubCompiler(cx, ICStub::In_Dense),
|
||||||
shape_(cx, shape)
|
shape_(cx, shape)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
ICStub *getStub(ICStubSpace *space) {
|
ICStub* getStub(ICStubSpace* space) {
|
||||||
return ICStub::New<ICIn_Dense>(space, getStubCode(), shape_);
|
return ICStub::New<ICIn_Dense>(space, getStubCode(), shape_);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1023,7 +1023,7 @@ RegExpPairsVectorStartOffset(size_t inputOutputDataStartOffset)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Address
|
static Address
|
||||||
RegExpPairCountAddress(MacroAssembler &masm, size_t inputOutputDataStartOffset)
|
RegExpPairCountAddress(MacroAssembler& masm, size_t inputOutputDataStartOffset)
|
||||||
{
|
{
|
||||||
return Address(masm.getStackPointer(), inputOutputDataStartOffset
|
return Address(masm.getStackPointer(), inputOutputDataStartOffset
|
||||||
+ sizeof(irregexp::InputOutputData)
|
+ sizeof(irregexp::InputOutputData)
|
||||||
|
|
|
@ -102,7 +102,7 @@ AnalyzeLsh(TempAllocator& alloc, MLsh* lsh)
|
||||||
|
|
||||||
template<typename MAsmJSHeapAccessType>
|
template<typename MAsmJSHeapAccessType>
|
||||||
bool
|
bool
|
||||||
EffectiveAddressAnalysis::tryAddDisplacement(MAsmJSHeapAccessType *ins, int32_t o)
|
EffectiveAddressAnalysis::tryAddDisplacement(MAsmJSHeapAccessType* ins, int32_t o)
|
||||||
{
|
{
|
||||||
// Compute the new offset. Check for overflow and negative. In theory it
|
// Compute the new offset. Check for overflow and negative. In theory it
|
||||||
// ought to be possible to support negative offsets, but it'd require
|
// ought to be possible to support negative offsets, but it'd require
|
||||||
|
|
|
@ -18,13 +18,13 @@ class EffectiveAddressAnalysis
|
||||||
MIRGraph& graph_;
|
MIRGraph& graph_;
|
||||||
|
|
||||||
template<typename MAsmJSHeapAccessType>
|
template<typename MAsmJSHeapAccessType>
|
||||||
bool tryAddDisplacement(MAsmJSHeapAccessType *ins, int32_t o);
|
bool tryAddDisplacement(MAsmJSHeapAccessType* ins, int32_t o);
|
||||||
|
|
||||||
template<typename MAsmJSHeapAccessType>
|
template<typename MAsmJSHeapAccessType>
|
||||||
void analyzeAsmHeapAccess(MAsmJSHeapAccessType* ins);
|
void analyzeAsmHeapAccess(MAsmJSHeapAccessType* ins);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
EffectiveAddressAnalysis(MIRGenerator *mir, MIRGraph& graph)
|
EffectiveAddressAnalysis(MIRGenerator* mir, MIRGraph& graph)
|
||||||
: mir_(mir), graph_(graph)
|
: mir_(mir), graph_(graph)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
|
@ -12883,7 +12883,7 @@ IonBuilder::constant(const Value& v)
|
||||||
MOZ_ASSERT(!v.isString() || v.toString()->isAtom(),
|
MOZ_ASSERT(!v.isString() || v.toString()->isAtom(),
|
||||||
"To handle non-atomized strings, you should use constantMaybeAtomize instead of constant.");
|
"To handle non-atomized strings, you should use constantMaybeAtomize instead of constant.");
|
||||||
if (v.isString() && MOZ_UNLIKELY(!v.toString()->isAtom())) {
|
if (v.isString() && MOZ_UNLIKELY(!v.toString()->isAtom())) {
|
||||||
MConstant *cst = constantMaybeAtomize(v);
|
MConstant* cst = constantMaybeAtomize(v);
|
||||||
if (!cst)
|
if (!cst)
|
||||||
js::CrashAtUnhandlableOOM("Use constantMaybeAtomize.");
|
js::CrashAtUnhandlableOOM("Use constantMaybeAtomize.");
|
||||||
return cst;
|
return cst;
|
||||||
|
|
|
@ -528,7 +528,7 @@ BaselineFrameAndStackPointersFromTryNote(JSTryNote* tn, const JitFrameIterator&
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
SettleOnTryNote(JSContext* cx, JSTryNote *tn, const JitFrameIterator& frame,
|
SettleOnTryNote(JSContext* cx, JSTryNote* tn, const JitFrameIterator& frame,
|
||||||
ScopeIter& si, ResumeFromException* rfe, jsbytecode** pc)
|
ScopeIter& si, ResumeFromException* rfe, jsbytecode** pc)
|
||||||
{
|
{
|
||||||
RootedScript script(cx, frame.baselineFrame()->script());
|
RootedScript script(cx, frame.baselineFrame()->script());
|
||||||
|
|
|
@ -8090,7 +8090,7 @@ class MNot
|
||||||
cacheOperandMightEmulateUndefined(constraints);
|
cacheOperandMightEmulateUndefined(constraints);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cacheOperandMightEmulateUndefined(CompilerConstraintList *constraints);
|
void cacheOperandMightEmulateUndefined(CompilerConstraintList* constraints);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static MNot* New(TempAllocator& alloc, MDefinition* elements,
|
static MNot* New(TempAllocator& alloc, MDefinition* elements,
|
||||||
|
|
|
@ -970,15 +970,15 @@ class MacroAssembler : public MacroAssemblerSpecific
|
||||||
// On ARM64, sp can function as the zero register depending on context.
|
// On ARM64, sp can function as the zero register depending on context.
|
||||||
// Code shared across platforms must use these functions to be valid.
|
// Code shared across platforms must use these functions to be valid.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void branchTestStackPtr(Condition cond, T t, Label *label) {
|
void branchTestStackPtr(Condition cond, T t, Label* label) {
|
||||||
branchTestPtr(cond, getStackPointer(), t, label);
|
branchTestPtr(cond, getStackPointer(), t, label);
|
||||||
}
|
}
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void branchStackPtr(Condition cond, T rhs, Label *label) {
|
void branchStackPtr(Condition cond, T rhs, Label* label) {
|
||||||
branchPtr(cond, getStackPointer(), rhs, label);
|
branchPtr(cond, getStackPointer(), rhs, label);
|
||||||
}
|
}
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void branchStackPtrRhs(Condition cond, T lhs, Label *label) {
|
void branchStackPtrRhs(Condition cond, T lhs, Label* label) {
|
||||||
branchPtr(cond, lhs, getStackPointer(), label);
|
branchPtr(cond, lhs, getStackPointer(), label);
|
||||||
}
|
}
|
||||||
#endif // !JS_CODEGEN_ARM64
|
#endif // !JS_CODEGEN_ARM64
|
||||||
|
|
|
@ -984,7 +984,7 @@ extern JS_PUBLIC_API(JSString*)
|
||||||
JS_ValueToSource(JSContext* cx, JS::Handle<JS::Value> v);
|
JS_ValueToSource(JSContext* cx, JS::Handle<JS::Value> v);
|
||||||
|
|
||||||
extern JS_PUBLIC_API(bool)
|
extern JS_PUBLIC_API(bool)
|
||||||
JS_DoubleIsInt32(double d, int32_t *ip);
|
JS_DoubleIsInt32(double d, int32_t* ip);
|
||||||
|
|
||||||
extern JS_PUBLIC_API(JSType)
|
extern JS_PUBLIC_API(JSType)
|
||||||
JS_TypeOfValue(JSContext* cx, JS::Handle<JS::Value> v);
|
JS_TypeOfValue(JSContext* cx, JS::Handle<JS::Value> v);
|
||||||
|
@ -5430,14 +5430,14 @@ struct PerformanceGroup {
|
||||||
|
|
||||||
// Mark that an instance of `AutoStopwatch` is monitoring
|
// Mark that an instance of `AutoStopwatch` is monitoring
|
||||||
// the performance of this group for a given iteration.
|
// the performance of this group for a given iteration.
|
||||||
void acquireStopwatch(uint64_t iteration, const AutoStopwatch *stopwatch) {
|
void acquireStopwatch(uint64_t iteration, const AutoStopwatch* stopwatch) {
|
||||||
iteration_ = iteration;
|
iteration_ = iteration;
|
||||||
stopwatch_ = stopwatch;
|
stopwatch_ = stopwatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mark that no `AutoStopwatch` is monitoring the
|
// Mark that no `AutoStopwatch` is monitoring the
|
||||||
// performance of this group for the iteration.
|
// performance of this group for the iteration.
|
||||||
void releaseStopwatch(uint64_t iteration, const AutoStopwatch *stopwatch) {
|
void releaseStopwatch(uint64_t iteration, const AutoStopwatch* stopwatch) {
|
||||||
if (iteration_ != iteration)
|
if (iteration_ != iteration)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -5460,7 +5460,7 @@ struct PerformanceGroup {
|
||||||
|
|
||||||
// The stopwatch currently monitoring the group,
|
// The stopwatch currently monitoring the group,
|
||||||
// or `nullptr` if none. Used ony for comparison.
|
// or `nullptr` if none. Used ony for comparison.
|
||||||
const AutoStopwatch *stopwatch_;
|
const AutoStopwatch* stopwatch_;
|
||||||
|
|
||||||
// The current iteration of the event loop. If necessary,
|
// The current iteration of the event loop. If necessary,
|
||||||
// may safely overflow.
|
// may safely overflow.
|
||||||
|
@ -5490,7 +5490,7 @@ struct PerformanceGroupHolder {
|
||||||
// Get the group.
|
// Get the group.
|
||||||
// On first call, this causes a single Hashtable lookup.
|
// On first call, this causes a single Hashtable lookup.
|
||||||
// Successive calls do not require further lookups.
|
// Successive calls do not require further lookups.
|
||||||
js::PerformanceGroup *getGroup();
|
js::PerformanceGroup* getGroup();
|
||||||
|
|
||||||
// `true` if the this holder is currently associated to a
|
// `true` if the this holder is currently associated to a
|
||||||
// PerformanceGroup, `false` otherwise. Use this method to avoid
|
// PerformanceGroup, `false` otherwise. Use this method to avoid
|
||||||
|
@ -5505,7 +5505,7 @@ struct PerformanceGroupHolder {
|
||||||
// (new values of `isSystem()`, `principals()` or `addonId`).
|
// (new values of `isSystem()`, `principals()` or `addonId`).
|
||||||
void unlink();
|
void unlink();
|
||||||
|
|
||||||
PerformanceGroupHolder(JSRuntime *runtime, JSCompartment *compartment)
|
PerformanceGroupHolder(JSRuntime* runtime, JSCompartment* compartment)
|
||||||
: runtime_(runtime)
|
: runtime_(runtime)
|
||||||
, compartment_(compartment)
|
, compartment_(compartment)
|
||||||
, group_(nullptr)
|
, group_(nullptr)
|
||||||
|
@ -5517,13 +5517,13 @@ private:
|
||||||
// Do not deallocate the key.
|
// Do not deallocate the key.
|
||||||
void* getHashKey();
|
void* getHashKey();
|
||||||
|
|
||||||
JSRuntime *runtime_;
|
JSRuntime* runtime_;
|
||||||
JSCompartment *compartment_;
|
JSCompartment* compartment_;
|
||||||
|
|
||||||
// The PerformanceGroup held by this object.
|
// The PerformanceGroup held by this object.
|
||||||
// Initially set to `nullptr` until the first cal to `getGroup`.
|
// Initially set to `nullptr` until the first cal to `getGroup`.
|
||||||
// May be reset to `nullptr` by a call to `unlink`.
|
// May be reset to `nullptr` by a call to `unlink`.
|
||||||
js::PerformanceGroup *group_;
|
js::PerformanceGroup* group_;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -5560,7 +5560,7 @@ struct PerformanceStats {
|
||||||
* If this group represents an add-on, the ID of the addon,
|
* If this group represents an add-on, the ID of the addon,
|
||||||
* otherwise `nullptr`.
|
* otherwise `nullptr`.
|
||||||
*/
|
*/
|
||||||
JSAddonId *addonId;
|
JSAddonId* addonId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If this group represents a webpage, the process itself or a special
|
* If this group represents a webpage, the process itself or a special
|
||||||
|
@ -5598,7 +5598,7 @@ typedef js::Vector<PerformanceStats, 0, js::SystemAllocPolicy> PerformanceStatsV
|
||||||
* representing the entire process.
|
* representing the entire process.
|
||||||
*/
|
*/
|
||||||
extern JS_PUBLIC_API(bool)
|
extern JS_PUBLIC_API(bool)
|
||||||
GetPerformanceStats(JSRuntime *rt, js::PerformanceStatsVector &stats, js::PerformanceStats &global);
|
GetPerformanceStats(JSRuntime* rt, js::PerformanceStatsVector& stats, js::PerformanceStats& global);
|
||||||
|
|
||||||
} /* namespace js */
|
} /* namespace js */
|
||||||
|
|
||||||
|
|
|
@ -764,9 +764,9 @@ js::ReportErrorNumberVA(JSContext* cx, unsigned flags, JSErrorCallback callback,
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
ExpandErrorArguments(ExclusiveContext *cx, JSErrorCallback callback,
|
ExpandErrorArguments(ExclusiveContext* cx, JSErrorCallback callback,
|
||||||
void *userRef, const unsigned errorNumber,
|
void* userRef, const unsigned errorNumber,
|
||||||
char **messagep, JSErrorReport *reportp,
|
char** messagep, JSErrorReport* reportp,
|
||||||
ErrorArgumentsType argumentsType, ...)
|
ErrorArgumentsType argumentsType, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
|
@ -4041,17 +4041,17 @@ JSObject::sizeOfIncludingThisInNursery() const
|
||||||
|
|
||||||
MOZ_ASSERT(!isTenured());
|
MOZ_ASSERT(!isTenured());
|
||||||
|
|
||||||
const Nursery &nursery = compartment()->runtimeFromAnyThread()->gc.nursery;
|
const Nursery& nursery = compartment()->runtimeFromAnyThread()->gc.nursery;
|
||||||
size_t size = Arena::thingSize(allocKindForTenure(nursery));
|
size_t size = Arena::thingSize(allocKindForTenure(nursery));
|
||||||
|
|
||||||
if (is<NativeObject>()) {
|
if (is<NativeObject>()) {
|
||||||
const NativeObject &native = as<NativeObject>();
|
const NativeObject& native = as<NativeObject>();
|
||||||
|
|
||||||
size += native.numFixedSlots() * sizeof(Value);
|
size += native.numFixedSlots() * sizeof(Value);
|
||||||
size += native.numDynamicSlots() * sizeof(Value);
|
size += native.numDynamicSlots() * sizeof(Value);
|
||||||
|
|
||||||
if (native.hasDynamicElements()) {
|
if (native.hasDynamicElements()) {
|
||||||
js::ObjectElements &elements = *native.getElementsHeader();
|
js::ObjectElements& elements = *native.getElementsHeader();
|
||||||
if (!elements.isCopyOnWrite() || elements.ownerObject() == this)
|
if (!elements.isCopyOnWrite() || elements.ownerObject() == this)
|
||||||
size += elements.capacity * sizeof(HeapSlot);
|
size += elements.capacity * sizeof(HeapSlot);
|
||||||
}
|
}
|
||||||
|
@ -4063,7 +4063,7 @@ JSObject::sizeOfIncludingThisInNursery() const
|
||||||
size_t
|
size_t
|
||||||
JS::ubi::Concrete<JSObject>::size(mozilla::MallocSizeOf mallocSizeOf) const
|
JS::ubi::Concrete<JSObject>::size(mozilla::MallocSizeOf mallocSizeOf) const
|
||||||
{
|
{
|
||||||
JSObject &obj = get();
|
JSObject& obj = get();
|
||||||
|
|
||||||
if (!obj.isTenured())
|
if (!obj.isTenured())
|
||||||
return obj.sizeOfIncludingThisInNursery();
|
return obj.sizeOfIncludingThisInNursery();
|
||||||
|
|
|
@ -283,7 +283,7 @@ class JSObject : public js::gc::Cell
|
||||||
static MOZ_ALWAYS_INLINE void writeBarrierPostRemove(JSObject* obj, void* cellp);
|
static MOZ_ALWAYS_INLINE void writeBarrierPostRemove(JSObject* obj, void* cellp);
|
||||||
|
|
||||||
/* Return the allocKind we would use if we were to tenure this object. */
|
/* Return the allocKind we would use if we were to tenure this object. */
|
||||||
js::gc::AllocKind allocKindForTenure(const js::Nursery &nursery) const;
|
js::gc::AllocKind allocKindForTenure(const js::Nursery& nursery) const;
|
||||||
|
|
||||||
size_t tenuredSizeOfThis() const {
|
size_t tenuredSizeOfThis() const {
|
||||||
MOZ_ASSERT(isTenured());
|
MOZ_ASSERT(isTenured());
|
||||||
|
|
|
@ -310,7 +310,7 @@ Shape::fixupAfterMovingGC()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Shape::fixupGetterSetterForBarrier(JSTracer *trc)
|
Shape::fixupGetterSetterForBarrier(JSTracer* trc)
|
||||||
{
|
{
|
||||||
// Relocating the getterObj or setterObj will change our location in our
|
// Relocating the getterObj or setterObj will change our location in our
|
||||||
// parent's KidsHash, so remove ourself first if we're going to get moved.
|
// parent's KidsHash, so remove ourself first if we're going to get moved.
|
||||||
|
|
|
@ -408,7 +408,7 @@ struct AutoStopwatch final
|
||||||
// stopwatch.
|
// stopwatch.
|
||||||
//
|
//
|
||||||
// Previous owner is restored upon destruction.
|
// Previous owner is restored upon destruction.
|
||||||
explicit inline AutoStopwatch(JSContext *cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
|
explicit inline AutoStopwatch(JSContext* cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
|
||||||
: compartment_(nullptr)
|
: compartment_(nullptr)
|
||||||
, runtime_(nullptr)
|
, runtime_(nullptr)
|
||||||
, iteration_(0)
|
, iteration_(0)
|
||||||
|
@ -428,7 +428,7 @@ struct AutoStopwatch final
|
||||||
return;
|
return;
|
||||||
iteration_ = runtime_->stopwatch.iteration;
|
iteration_ = runtime_->stopwatch.iteration;
|
||||||
|
|
||||||
PerformanceGroup *group = compartment_->performanceMonitoring.getGroup();
|
PerformanceGroup* group = compartment_->performanceMonitoring.getGroup();
|
||||||
MOZ_ASSERT(group);
|
MOZ_ASSERT(group);
|
||||||
|
|
||||||
if (group->hasStopwatch(iteration_)) {
|
if (group->hasStopwatch(iteration_)) {
|
||||||
|
@ -477,7 +477,7 @@ struct AutoStopwatch final
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PerformanceGroup *group = compartment_->performanceMonitoring.getGroup();
|
PerformanceGroup* group = compartment_->performanceMonitoring.getGroup();
|
||||||
MOZ_ASSERT(group);
|
MOZ_ASSERT(group);
|
||||||
|
|
||||||
// Compute time spent.
|
// Compute time spent.
|
||||||
|
@ -606,11 +606,11 @@ struct AutoStopwatch final
|
||||||
private:
|
private:
|
||||||
// The compartment with which this object was initialized.
|
// The compartment with which this object was initialized.
|
||||||
// Non-null.
|
// Non-null.
|
||||||
JSCompartment *compartment_;
|
JSCompartment* compartment_;
|
||||||
|
|
||||||
// The runtime with which this object was initialized.
|
// The runtime with which this object was initialized.
|
||||||
// Non-null.
|
// Non-null.
|
||||||
JSRuntime *runtime_;
|
JSRuntime* runtime_;
|
||||||
|
|
||||||
// An indication of the number of times we have entered the event
|
// An indication of the number of times we have entered the event
|
||||||
// loop. Used only for comparison.
|
// loop. Used only for comparison.
|
||||||
|
|
|
@ -323,7 +323,7 @@ class MOZ_STACK_CLASS TryNoteIter
|
||||||
};
|
};
|
||||||
|
|
||||||
bool
|
bool
|
||||||
HandleClosingGeneratorReturn(JSContext *cx, AbstractFramePtr frame, bool ok);
|
HandleClosingGeneratorReturn(JSContext* cx, AbstractFramePtr frame, bool ok);
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
|
|
|
@ -540,7 +540,7 @@ class ObjectGroup : public gc::TenuredCell
|
||||||
|
|
||||||
inline void clearProperties();
|
inline void clearProperties();
|
||||||
void maybeSweep(AutoClearTypeInferenceStateOnOOM* oom);
|
void maybeSweep(AutoClearTypeInferenceStateOnOOM* oom);
|
||||||
void traceChildren(JSTracer *trc);
|
void traceChildren(JSTracer* trc);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|
|
@ -870,21 +870,21 @@ JS::IsProfilingEnabledForRuntime(JSRuntime* runtime)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
js::ResetStopwatches(JSRuntime *rt)
|
js::ResetStopwatches(JSRuntime* rt)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(rt);
|
MOZ_ASSERT(rt);
|
||||||
rt->stopwatch.reset();
|
rt->stopwatch.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
js::SetStopwatchActive(JSRuntime *rt, bool isActive)
|
js::SetStopwatchActive(JSRuntime* rt, bool isActive)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(rt);
|
MOZ_ASSERT(rt);
|
||||||
return rt->stopwatch.setIsActive(isActive);
|
return rt->stopwatch.setIsActive(isActive);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
js::IsStopwatchActive(JSRuntime *rt)
|
js::IsStopwatchActive(JSRuntime* rt)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(rt);
|
MOZ_ASSERT(rt);
|
||||||
return rt->stopwatch.isActive();
|
return rt->stopwatch.isActive();
|
||||||
|
@ -931,7 +931,7 @@ js::PerformanceGroupHolder::unlink()
|
||||||
js_delete(group);
|
js_delete(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
PerformanceGroup *
|
PerformanceGroup*
|
||||||
js::PerformanceGroupHolder::getGroup()
|
js::PerformanceGroupHolder::getGroup()
|
||||||
{
|
{
|
||||||
if (group_)
|
if (group_)
|
||||||
|
@ -954,7 +954,7 @@ js::PerformanceGroupHolder::getGroup()
|
||||||
}
|
}
|
||||||
|
|
||||||
PerformanceData*
|
PerformanceData*
|
||||||
js::GetPerformanceData(JSRuntime *rt)
|
js::GetPerformanceData(JSRuntime* rt)
|
||||||
{
|
{
|
||||||
return &rt->stopwatch.performance;
|
return &rt->stopwatch.performance;
|
||||||
}
|
}
|
||||||
|
|
|
@ -970,7 +970,7 @@ class Shape : public gc::TenuredCell
|
||||||
inline Shape* searchLinear(jsid id);
|
inline Shape* searchLinear(jsid id);
|
||||||
|
|
||||||
void fixupAfterMovingGC();
|
void fixupAfterMovingGC();
|
||||||
void fixupGetterSetterForBarrier(JSTracer *trc);
|
void fixupGetterSetterForBarrier(JSTracer* trc);
|
||||||
|
|
||||||
/* For JIT usage */
|
/* For JIT usage */
|
||||||
static inline size_t offsetOfBase() { return offsetof(Shape, base_); }
|
static inline size_t offsetOfBase() { return offsetof(Shape, base_); }
|
||||||
|
@ -1252,14 +1252,14 @@ GetterSetterWriteBarrierPost(AccessorShape* shape)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(shape);
|
MOZ_ASSERT(shape);
|
||||||
if (shape->hasGetterObject()) {
|
if (shape->hasGetterObject()) {
|
||||||
gc::StoreBuffer *sb = reinterpret_cast<gc::Cell*>(shape->getterObject())->storeBuffer();
|
gc::StoreBuffer* sb = reinterpret_cast<gc::Cell*>(shape->getterObject())->storeBuffer();
|
||||||
if (sb) {
|
if (sb) {
|
||||||
sb->putGeneric(ShapeGetterSetterRef(shape));
|
sb->putGeneric(ShapeGetterSetterRef(shape));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (shape->hasSetterObject()) {
|
if (shape->hasSetterObject()) {
|
||||||
gc::StoreBuffer *sb = reinterpret_cast<gc::Cell*>(shape->setterObject())->storeBuffer();
|
gc::StoreBuffer* sb = reinterpret_cast<gc::Cell*>(shape->setterObject())->storeBuffer();
|
||||||
if (sb) {
|
if (sb) {
|
||||||
sb->putGeneric(ShapeGetterSetterRef(shape));
|
sb->putGeneric(ShapeGetterSetterRef(shape));
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -2111,8 +2111,8 @@ js::StringIsTypedArrayIndex(const Latin1Char* s, size_t length, uint64_t* indexp
|
||||||
|
|
||||||
/* ES6 draft rev 34 (2015 Feb 20) 9.4.5.3 [[DefineOwnProperty]] step 3.c. */
|
/* ES6 draft rev 34 (2015 Feb 20) 9.4.5.3 [[DefineOwnProperty]] step 3.c. */
|
||||||
bool
|
bool
|
||||||
js::DefineTypedArrayElement(JSContext *cx, HandleObject obj, uint64_t index,
|
js::DefineTypedArrayElement(JSContext* cx, HandleObject obj, uint64_t index,
|
||||||
Handle<PropertyDescriptor> desc, ObjectOpResult &result)
|
Handle<PropertyDescriptor> desc, ObjectOpResult& result)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(IsAnyTypedArray(obj));
|
MOZ_ASSERT(IsAnyTypedArray(obj));
|
||||||
|
|
||||||
|
|
|
@ -291,8 +291,8 @@ IsTypedArrayIndex(jsid id, uint64_t* indexp)
|
||||||
* when the property key is a TypedArray index.
|
* when the property key is a TypedArray index.
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
DefineTypedArrayElement(JSContext *cx, HandleObject arr, uint64_t index,
|
DefineTypedArrayElement(JSContext* cx, HandleObject arr, uint64_t index,
|
||||||
Handle<PropertyDescriptor> desc, ObjectOpResult &result);
|
Handle<PropertyDescriptor> desc, ObjectOpResult& result);
|
||||||
|
|
||||||
static inline unsigned
|
static inline unsigned
|
||||||
TypedArrayShift(Scalar::Type viewType)
|
TypedArrayShift(Scalar::Type viewType)
|
||||||
|
|
|
@ -565,7 +565,7 @@ XPCConvert::JSData2Native(void* d, HandleValue s,
|
||||||
if (length == size_t(-1)) {
|
if (length == size_t(-1)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
char* buffer = static_cast<char *>(moz_xmalloc(length + 1));
|
char* buffer = static_cast<char*>(moz_xmalloc(length + 1));
|
||||||
if (!buffer) {
|
if (!buffer) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1721,7 +1721,7 @@ XPCConvert::JSStringWithSize2Native(void* d, HandleValue s,
|
||||||
len = count;
|
len = count;
|
||||||
|
|
||||||
uint32_t alloc_len = (len + 1) * sizeof(char);
|
uint32_t alloc_len = (len + 1) * sizeof(char);
|
||||||
char* buffer = static_cast<char *>(moz_xmalloc(alloc_len));
|
char* buffer = static_cast<char*>(moz_xmalloc(alloc_len));
|
||||||
if (!buffer) {
|
if (!buffer) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче