Bug 1523969 part 13 - Move method definition inline comments to new line in 'js/'. r=jorendorff

Differential Revision: https://phabricator.services.mozilla.com/D21114

--HG--
extra : rebase_source : 40badf957a93abd4a96f54f5f1f69036cb8e022e
This commit is contained in:
Ryan Hunt 2019-02-25 16:09:04 -06:00
Родитель 5e72855054
Коммит 611651806b
93 изменённых файлов: 2354 добавлений и 1830 удалений

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

@ -386,7 +386,8 @@ JS::Symbol* JavaScriptShared::fromSymbolVariant(JSContext* cx,
}
}
/* static */ void JavaScriptShared::ConvertID(const nsID& from, JSIID* to) {
/* static */
void JavaScriptShared::ConvertID(const nsID& from, JSIID* to) {
to->m0() = from.m0;
to->m1() = from.m1;
to->m2() = from.m2;
@ -400,7 +401,8 @@ JS::Symbol* JavaScriptShared::fromSymbolVariant(JSContext* cx,
to->m3_7() = from.m3[7];
}
/* static */ void JavaScriptShared::ConvertID(const JSIID& from, nsID* to) {
/* static */
void JavaScriptShared::ConvertID(const JSIID& from, nsID* to) {
to->m0 = from.m0();
to->m1 = from.m1();
to->m2 = from.m2();

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

@ -777,13 +777,15 @@ bool js::atomics_notify(JSContext* cx, unsigned argc, Value* vp) {
return true;
}
/* static */ bool js::FutexThread::initialize() {
/* static */
bool js::FutexThread::initialize() {
MOZ_ASSERT(!lock_);
lock_ = js_new<js::Mutex>(mutexid::FutexThread);
return lock_ != nullptr;
}
/* static */ void js::FutexThread::destroy() {
/* static */
void js::FutexThread::destroy() {
if (lock_) {
js::Mutex* lock = lock_;
js_delete(lock);
@ -791,7 +793,8 @@ bool js::atomics_notify(JSContext* cx, unsigned argc, Value* vp) {
}
}
/* static */ void js::FutexThread::lock() {
/* static */
void js::FutexThread::lock() {
// Load the atomic pointer.
js::Mutex* lock = lock_;
@ -802,7 +805,8 @@ bool js::atomics_notify(JSContext* cx, unsigned argc, Value* vp) {
mozilla::recordreplay::Behavior::DontPreserve>
FutexThread::lock_;
/* static */ void js::FutexThread::unlock() {
/* static */
void js::FutexThread::unlock() {
// Load the atomic pointer.
js::Mutex* lock = lock_;

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

@ -247,9 +247,11 @@ bool DataViewObject::construct(JSContext* cx, unsigned argc, Value* vp) {
}
template <typename NativeType>
/* static */ SharedMem<uint8_t*> DataViewObject::getDataPointer(
JSContext* cx, Handle<DataViewObject*> obj, uint64_t offset,
bool* isSharedMemory) {
/* static */
SharedMem<uint8_t*> DataViewObject::getDataPointer(JSContext* cx,
Handle<DataViewObject*> obj,
uint64_t offset,
bool* isSharedMemory) {
const size_t TypeSize = sizeof(NativeType);
if (offset > UINT32_MAX - TypeSize || offset + TypeSize > obj->byteLength()) {
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
@ -374,9 +376,9 @@ struct DataViewIO {
};
template <typename NativeType>
/* static */ bool DataViewObject::read(JSContext* cx,
Handle<DataViewObject*> obj,
const CallArgs& args, NativeType* val) {
/* static */
bool DataViewObject::read(JSContext* cx, Handle<DataViewObject*> obj,
const CallArgs& args, NativeType* val) {
// Steps 1-2. done by the caller
// Step 3. unnecessary assert
@ -476,9 +478,9 @@ inline bool WebIDLCast<double>(JSContext* cx, HandleValue value, double* out) {
// https://tc39.github.io/ecma262/#sec-setviewvalue
// SetViewValue ( view, requestIndex, isLittleEndian, type, value )
template <typename NativeType>
/* static */ bool DataViewObject::write(JSContext* cx,
Handle<DataViewObject*> obj,
const CallArgs& args) {
/* static */
bool DataViewObject::write(JSContext* cx, Handle<DataViewObject*> obj,
const CallArgs& args) {
// Steps 1-2. done by the caller
// Step 3. unnecessary assert

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

@ -49,7 +49,8 @@ static bool IsEvalCacheCandidate(JSScript* script) {
!script->hasObjects();
}
/* static */ HashNumber EvalCacheHashPolicy::hash(const EvalCacheLookup& l) {
/* static */
HashNumber EvalCacheHashPolicy::hash(const EvalCacheLookup& l) {
AutoCheckCannotGC nogc;
uint32_t hash = l.str->hasLatin1Chars()
? HashString(l.str->latin1Chars(nogc), l.str->length())
@ -57,8 +58,9 @@ static bool IsEvalCacheCandidate(JSScript* script) {
return AddToHash(hash, l.callerScript.get(), l.pc);
}
/* static */ bool EvalCacheHashPolicy::match(const EvalCacheEntry& cacheEntry,
const EvalCacheLookup& l) {
/* static */
bool EvalCacheHashPolicy::match(const EvalCacheEntry& cacheEntry,
const EvalCacheLookup& l) {
MOZ_ASSERT(IsEvalCacheCandidate(cacheEntry.script));
return EqualStrings(cacheEntry.str, l.str) &&

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

@ -165,8 +165,9 @@ inline MapObject::IteratorKind MapIteratorObject::kind() const {
return MapObject::IteratorKind(i);
}
/* static */ bool GlobalObject::initMapIteratorProto(
JSContext* cx, Handle<GlobalObject*> global) {
/* static */
bool GlobalObject::initMapIteratorProto(JSContext* cx,
Handle<GlobalObject*> global) {
Rooted<JSObject*> base(
cx, GlobalObject::getOrCreateIteratorPrototype(cx, global));
if (!base) {
@ -342,7 +343,8 @@ bool MapIteratorObject::next(Handle<MapIteratorObject*> mapIterator,
return false;
}
/* static */ JSObject* MapIteratorObject::createResultPair(JSContext* cx) {
/* static */
JSObject* MapIteratorObject::createResultPair(JSContext* cx) {
RootedArrayObject resultPairObj(
cx, NewDenseFullyAllocatedArray(cx, 2, nullptr, TenuredObject));
if (!resultPairObj) {
@ -626,7 +628,8 @@ void MapObject::finalize(FreeOp* fop, JSObject* obj) {
}
}
/* static */ void MapObject::sweepAfterMinorGC(FreeOp* fop, MapObject* mapobj) {
/* static */
void MapObject::sweepAfterMinorGC(FreeOp* fop, MapObject* mapobj) {
if (IsInsideNursery(mapobj) && !IsForwarded(mapobj)) {
finalize(fop, mapobj);
return;
@ -935,8 +938,9 @@ inline SetObject::IteratorKind SetIteratorObject::kind() const {
return SetObject::IteratorKind(i);
}
/* static */ bool GlobalObject::initSetIteratorProto(
JSContext* cx, Handle<GlobalObject*> global) {
/* static */
bool GlobalObject::initSetIteratorProto(JSContext* cx,
Handle<GlobalObject*> global) {
Rooted<JSObject*> base(
cx, GlobalObject::getOrCreateIteratorPrototype(cx, global));
if (!base) {
@ -1082,7 +1086,8 @@ bool SetIteratorObject::next(Handle<SetIteratorObject*> setIterator,
return false;
}
/* static */ JSObject* SetIteratorObject::createResult(JSContext* cx) {
/* static */
JSObject* SetIteratorObject::createResult(JSContext* cx) {
RootedArrayObject resultObj(
cx, NewDenseFullyAllocatedArray(cx, 1, nullptr, TenuredObject));
if (!resultObj) {
@ -1241,7 +1246,8 @@ void SetObject::finalize(FreeOp* fop, JSObject* obj) {
}
}
/* static */ void SetObject::sweepAfterMinorGC(FreeOp* fop, SetObject* setobj) {
/* static */
void SetObject::sweepAfterMinorGC(FreeOp* fop, SetObject* setobj) {
if (IsInsideNursery(setobj) && !IsForwarded(setobj)) {
finalize(fop, setobj);
return;

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

@ -94,12 +94,14 @@ DEFINE_ATOM_ACCESSOR_METHOD(ImportEntryObject, localName)
DEFINE_UINT32_ACCESSOR_METHOD(ImportEntryObject, lineNumber)
DEFINE_UINT32_ACCESSOR_METHOD(ImportEntryObject, columnNumber)
/* static */ bool ImportEntryObject::isInstance(HandleValue value) {
/* static */
bool ImportEntryObject::isInstance(HandleValue value) {
return value.isObject() && value.toObject().is<ImportEntryObject>();
}
/* static */ bool GlobalObject::initImportEntryProto(
JSContext* cx, Handle<GlobalObject*> global) {
/* static */
bool GlobalObject::initImportEntryProto(JSContext* cx,
Handle<GlobalObject*> global) {
static const JSPropertySpec protoAccessors[] = {
JS_PSG("moduleRequest", ImportEntryObject_moduleRequestGetter, 0),
JS_PSG("importName", ImportEntryObject_importNameGetter, 0),
@ -122,7 +124,8 @@ DEFINE_UINT32_ACCESSOR_METHOD(ImportEntryObject, columnNumber)
return true;
}
/* static */ ImportEntryObject* ImportEntryObject::create(
/* static */
ImportEntryObject* ImportEntryObject::create(
JSContext* cx, HandleAtom moduleRequest, HandleAtom importName,
HandleAtom localName, uint32_t lineNumber, uint32_t columnNumber) {
RootedObject proto(
@ -165,12 +168,14 @@ DEFINE_ATOM_OR_NULL_ACCESSOR_METHOD(ExportEntryObject, localName)
DEFINE_UINT32_ACCESSOR_METHOD(ExportEntryObject, lineNumber)
DEFINE_UINT32_ACCESSOR_METHOD(ExportEntryObject, columnNumber)
/* static */ bool ExportEntryObject::isInstance(HandleValue value) {
/* static */
bool ExportEntryObject::isInstance(HandleValue value) {
return value.isObject() && value.toObject().is<ExportEntryObject>();
}
/* static */ bool GlobalObject::initExportEntryProto(
JSContext* cx, Handle<GlobalObject*> global) {
/* static */
bool GlobalObject::initExportEntryProto(JSContext* cx,
Handle<GlobalObject*> global) {
static const JSPropertySpec protoAccessors[] = {
JS_PSG("exportName", ExportEntryObject_exportNameGetter, 0),
JS_PSG("moduleRequest", ExportEntryObject_moduleRequestGetter, 0),
@ -198,7 +203,8 @@ static Value StringOrNullValue(JSString* maybeString) {
return maybeString ? StringValue(maybeString) : NullValue();
}
/* static */ ExportEntryObject* ExportEntryObject::create(
/* static */
ExportEntryObject* ExportEntryObject::create(
JSContext* cx, HandleAtom maybeExportName, HandleAtom maybeModuleRequest,
HandleAtom maybeImportName, HandleAtom maybeLocalName, uint32_t lineNumber,
uint32_t columnNumber) {
@ -243,12 +249,14 @@ DEFINE_ATOM_ACCESSOR_METHOD(RequestedModuleObject, moduleSpecifier)
DEFINE_UINT32_ACCESSOR_METHOD(RequestedModuleObject, lineNumber)
DEFINE_UINT32_ACCESSOR_METHOD(RequestedModuleObject, columnNumber)
/* static */ bool RequestedModuleObject::isInstance(HandleValue value) {
/* static */
bool RequestedModuleObject::isInstance(HandleValue value) {
return value.isObject() && value.toObject().is<RequestedModuleObject>();
}
/* static */ bool GlobalObject::initRequestedModuleProto(
JSContext* cx, Handle<GlobalObject*> global) {
/* static */
bool GlobalObject::initRequestedModuleProto(JSContext* cx,
Handle<GlobalObject*> global) {
static const JSPropertySpec protoAccessors[] = {
JS_PSG("moduleSpecifier", RequestedModuleObject_moduleSpecifierGetter, 0),
JS_PSG("lineNumber", RequestedModuleObject_lineNumberGetter, 0),
@ -269,9 +277,11 @@ DEFINE_UINT32_ACCESSOR_METHOD(RequestedModuleObject, columnNumber)
return true;
}
/* static */ RequestedModuleObject* RequestedModuleObject::create(
JSContext* cx, HandleAtom moduleSpecifier, uint32_t lineNumber,
uint32_t columnNumber) {
/* static */
RequestedModuleObject* RequestedModuleObject::create(JSContext* cx,
HandleAtom moduleSpecifier,
uint32_t lineNumber,
uint32_t columnNumber) {
RootedObject proto(
cx, GlobalObject::getOrCreateRequestedModulePrototype(cx, cx->global()));
if (!proto) {
@ -357,14 +367,16 @@ bool IndirectBindingMap::lookup(jsid name, ModuleEnvironmentObject** envOut,
///////////////////////////////////////////////////////////////////////////
// ModuleNamespaceObject
/* static */ const ModuleNamespaceObject::ProxyHandler
ModuleNamespaceObject::proxyHandler;
/* static */
const ModuleNamespaceObject::ProxyHandler ModuleNamespaceObject::proxyHandler;
/* static */ bool ModuleNamespaceObject::isInstance(HandleValue value) {
/* static */
bool ModuleNamespaceObject::isInstance(HandleValue value) {
return value.isObject() && value.toObject().is<ModuleNamespaceObject>();
}
/* static */ ModuleNamespaceObject* ModuleNamespaceObject::create(
/* static */
ModuleNamespaceObject* ModuleNamespaceObject::create(
JSContext* cx, HandleModuleObject module, HandleObject exports,
UniquePtr<IndirectBindingMap> bindings) {
RootedValue priv(cx, ObjectValue(*module));
@ -708,11 +720,13 @@ DEFINE_ARRAY_SLOT_ACCESSOR(ModuleObject, indirectExportEntries,
DEFINE_ARRAY_SLOT_ACCESSOR(ModuleObject, starExportEntries,
StarExportEntriesSlot)
/* static */ bool ModuleObject::isInstance(HandleValue value) {
/* static */
bool ModuleObject::isInstance(HandleValue value) {
return value.isObject() && value.toObject().is<ModuleObject>();
}
/* static */ ModuleObject* ModuleObject::create(JSContext* cx) {
/* static */
ModuleObject* ModuleObject::create(JSContext* cx) {
RootedObject proto(
cx, GlobalObject::getOrCreateModulePrototype(cx, cx->global()));
if (!proto) {
@ -741,7 +755,8 @@ DEFINE_ARRAY_SLOT_ACCESSOR(ModuleObject, starExportEntries,
return self;
}
/* static */ void ModuleObject::finalize(js::FreeOp* fop, JSObject* obj) {
/* static */
void ModuleObject::finalize(js::FreeOp* fop, JSObject* obj) {
MOZ_ASSERT(fop->maybeOnHelperThread());
ModuleObject* self = &obj->as<ModuleObject>();
if (self->hasImportBindings()) {
@ -836,7 +851,8 @@ static bool FreezeObjectProperty(JSContext* cx, HandleNativeObject obj,
return FreezeObject(cx, property);
}
/* static */ bool ModuleObject::Freeze(JSContext* cx, HandleModuleObject self) {
/* static */
bool ModuleObject::Freeze(JSContext* cx, HandleModuleObject self) {
return FreezeObjectProperty(cx, self, RequestedModulesSlot) &&
FreezeObjectProperty(cx, self, ImportEntriesSlot) &&
FreezeObjectProperty(cx, self, LocalExportEntriesSlot) &&
@ -949,7 +965,8 @@ Scope* ModuleObject::enclosingScope() const {
return script()->enclosingScope();
}
/* static */ void ModuleObject::trace(JSTracer* trc, JSObject* obj) {
/* static */
void ModuleObject::trace(JSTracer* trc, JSObject* obj) {
ModuleObject& module = obj->as<ModuleObject>();
if (module.hasImportBindings()) {
@ -972,8 +989,9 @@ bool ModuleObject::noteFunctionDeclaration(JSContext* cx, HandleAtom name,
return true;
}
/* static */ bool ModuleObject::instantiateFunctionDeclarations(
JSContext* cx, HandleModuleObject self) {
/* static */
bool ModuleObject::instantiateFunctionDeclarations(JSContext* cx,
HandleModuleObject self) {
#ifdef DEBUG
MOZ_ASSERT(self->status() == MODULE_STATUS_INSTANTIATING);
if (!AssertFrozen(cx, self)) {
@ -1011,8 +1029,9 @@ bool ModuleObject::noteFunctionDeclaration(JSContext* cx, HandleAtom name,
return true;
}
/* static */ bool ModuleObject::execute(JSContext* cx, HandleModuleObject self,
MutableHandleValue rval) {
/* static */
bool ModuleObject::execute(JSContext* cx, HandleModuleObject self,
MutableHandleValue rval) {
#ifdef DEBUG
MOZ_ASSERT(self->status() == MODULE_STATUS_EVALUATING);
if (!AssertFrozen(cx, self)) {
@ -1036,8 +1055,10 @@ bool ModuleObject::noteFunctionDeclaration(JSContext* cx, HandleAtom name,
return Execute(cx, script, *scope, rval.address());
}
/* static */ ModuleNamespaceObject* ModuleObject::createNamespace(
JSContext* cx, HandleModuleObject self, HandleObject exports) {
/* static */
ModuleNamespaceObject* ModuleObject::createNamespace(JSContext* cx,
HandleModuleObject self,
HandleObject exports) {
MOZ_ASSERT(!self->namespace_());
MOZ_ASSERT(exports->is<ArrayObject>());
@ -1065,17 +1086,18 @@ static bool InvokeSelfHostedMethod(JSContext* cx, HandleModuleObject self,
return CallSelfHostedFunction(cx, name, thisv, args, &ignored);
}
/* static */ bool ModuleObject::Instantiate(JSContext* cx,
HandleModuleObject self) {
/* static */
bool ModuleObject::Instantiate(JSContext* cx, HandleModuleObject self) {
return InvokeSelfHostedMethod(cx, self, cx->names().ModuleInstantiate);
}
/* static */ bool ModuleObject::Evaluate(JSContext* cx,
HandleModuleObject self) {
/* static */
bool ModuleObject::Evaluate(JSContext* cx, HandleModuleObject self) {
return InvokeSelfHostedMethod(cx, self, cx->names().ModuleEvaluate);
}
/* static */ ModuleNamespaceObject* ModuleObject::GetOrCreateModuleNamespace(
/* static */
ModuleNamespaceObject* ModuleObject::GetOrCreateModuleNamespace(
JSContext* cx, HandleModuleObject self) {
FixedInvokeArgs<1> args(cx);
args[0].setObject(*self);
@ -1102,8 +1124,9 @@ DEFINE_GETTER_FUNCTIONS(ModuleObject, starExportEntries, StarExportEntriesSlot)
DEFINE_GETTER_FUNCTIONS(ModuleObject, dfsIndex, DFSIndexSlot)
DEFINE_GETTER_FUNCTIONS(ModuleObject, dfsAncestorIndex, DFSAncestorIndexSlot)
/* static */ bool GlobalObject::initModuleProto(JSContext* cx,
Handle<GlobalObject*> global) {
/* static */
bool GlobalObject::initModuleProto(JSContext* cx,
Handle<GlobalObject*> global) {
static const JSPropertySpec protoAccessors[] = {
JS_PSG("namespace", ModuleObject_namespace_Getter, 0),
JS_PSG("status", ModuleObject_statusGetter, 0),

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

@ -2130,9 +2130,10 @@ static bool PromiseConstructor(JSContext* cx, unsigned argc, Value* vp) {
}
// ES2016, 25.4.3.1. steps 3-11.
/* static */ PromiseObject* PromiseObject::create(
JSContext* cx, HandleObject executor, HandleObject proto /* = nullptr */,
bool needsWrapping /* = false */) {
/* static */
PromiseObject* PromiseObject::create(JSContext* cx, HandleObject executor,
HandleObject proto /* = nullptr */,
bool needsWrapping /* = false */) {
MOZ_ASSERT(executor->isCallable());
RootedObject usedProto(cx, proto);
@ -2220,8 +2221,8 @@ static bool PromiseConstructor(JSContext* cx, unsigned argc, Value* vp) {
// ES2016, 25.4.3.1. skipping creation of resolution functions and executor
// function invocation.
/* static */ PromiseObject* PromiseObject::createSkippingExecutor(
JSContext* cx) {
/* static */
PromiseObject* PromiseObject::createSkippingExecutor(JSContext* cx) {
return CreatePromiseObjectWithoutResolutionFunctions(cx);
}
@ -3175,8 +3176,8 @@ static bool Promise_reject(JSContext* cx, unsigned argc, Value* vp) {
/**
* Unforgeable version of ES2016, 25.4.4.4, Promise.reject.
*/
/* static */ JSObject* PromiseObject::unforgeableReject(JSContext* cx,
HandleValue value) {
/* static */
JSObject* PromiseObject::unforgeableReject(JSContext* cx, HandleValue value) {
JSObject* promiseCtor = JS::GetPromiseConstructor(cx);
if (!promiseCtor) {
return nullptr;
@ -3204,8 +3205,8 @@ static bool Promise_static_resolve(JSContext* cx, unsigned argc, Value* vp) {
/**
* Unforgeable version of ES2016, 25.4.4.5, Promise.resolve.
*/
/* static */ JSObject* PromiseObject::unforgeableResolve(JSContext* cx,
HandleValue value) {
/* static */
JSObject* PromiseObject::unforgeableResolve(JSContext* cx, HandleValue value) {
JSObject* promiseCtor = JS::GetPromiseConstructor(cx);
if (!promiseCtor) {
return nullptr;
@ -4485,9 +4486,9 @@ bool PromiseObject::dependentPromises(JSContext* cx,
return true;
}
/* static */ bool PromiseObject::resolve(JSContext* cx,
Handle<PromiseObject*> promise,
HandleValue resolutionValue) {
/* static */
bool PromiseObject::resolve(JSContext* cx, Handle<PromiseObject*> promise,
HandleValue resolutionValue) {
MOZ_ASSERT(!PromiseHasAnyFlag(*promise, PROMISE_FLAG_ASYNC));
if (promise->state() != JS::PromiseState::Pending) {
return true;
@ -4515,9 +4516,9 @@ bool PromiseObject::dependentPromises(JSContext* cx,
return Call(cx, funVal, UndefinedHandleValue, resolutionValue, &dummy);
}
/* static */ bool PromiseObject::reject(JSContext* cx,
Handle<PromiseObject*> promise,
HandleValue rejectionValue) {
/* static */
bool PromiseObject::reject(JSContext* cx, Handle<PromiseObject*> promise,
HandleValue rejectionValue) {
MOZ_ASSERT(!PromiseHasAnyFlag(*promise, PROMISE_FLAG_ASYNC));
if (promise->state() != JS::PromiseState::Pending) {
return true;
@ -4535,8 +4536,8 @@ bool PromiseObject::dependentPromises(JSContext* cx,
return Call(cx, funVal, UndefinedHandleValue, rejectionValue, &dummy);
}
/* static */ void PromiseObject::onSettled(JSContext* cx,
Handle<PromiseObject*> promise) {
/* static */
void PromiseObject::onSettled(JSContext* cx, Handle<PromiseObject*> promise) {
PromiseDebugInfo::setResolutionInfo(cx, promise);
if (promise->state() == JS::PromiseState::Rejected &&
@ -5039,7 +5040,8 @@ void OffThreadPromiseRuntimeState::init(
MOZ_ASSERT(initialized());
}
/* static */ bool OffThreadPromiseRuntimeState::internalDispatchToEventLoop(
/* static */
bool OffThreadPromiseRuntimeState::internalDispatchToEventLoop(
void* closure, JS::Dispatchable* d) {
OffThreadPromiseRuntimeState& state =
*reinterpret_cast<OffThreadPromiseRuntimeState*>(closure);

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

@ -880,8 +880,9 @@ MOZ_MUST_USE ReadableStream* CreateReadableStream(
/**
* Streams spec, 3.3.5. InitializeReadableStream ( stream )
*/
MOZ_MUST_USE /* static */ ReadableStream* ReadableStream::create(
JSContext* cx, HandleObject proto /* = nullptr */) {
MOZ_MUST_USE /* static */
ReadableStream*
ReadableStream::create(JSContext* cx, HandleObject proto /* = nullptr */) {
// In the spec, InitializeReadableStream is always passed a newly created
// ReadableStream object. We instead create it here and return it below.
Rooted<ReadableStream*> stream(

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

@ -3693,8 +3693,9 @@ static const JSFunctionSpec string_static_methods[] = {
JS_SELF_HOSTED_FN("localeCompare", "String_static_localeCompare", 2, 0),
JS_FS_END};
/* static */ Shape* StringObject::assignInitialShape(
JSContext* cx, Handle<StringObject*> obj) {
/* static */
Shape* StringObject::assignInitialShape(JSContext* cx,
Handle<StringObject*> obj) {
MOZ_ASSERT(obj->empty());
return NativeObject::addDataProperty(cx, obj, cx->names().length, LENGTH_SLOT,

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

@ -259,7 +259,8 @@ bool ScalarTypeDescr::call(JSContext* cx, unsigned argc, Value* vp) {
return true;
}
/* static */ TypeDescr* GlobalObject::getOrCreateScalarTypeDescr(
/* static */
TypeDescr* GlobalObject::getOrCreateScalarTypeDescr(
JSContext* cx, Handle<GlobalObject*> global, Scalar::Type scalarType) {
int32_t slot = 0;
switch (scalarType) {
@ -287,7 +288,8 @@ bool ScalarTypeDescr::call(JSContext* cx, unsigned argc, Value* vp) {
return &module->getReservedSlot(slot).toObject().as<TypeDescr>();
}
/* static */ TypeDescr* GlobalObject::getOrCreateReferenceTypeDescr(
/* static */
TypeDescr* GlobalObject::getOrCreateReferenceTypeDescr(
JSContext* cx, Handle<GlobalObject*> global, ReferenceType type) {
int32_t slot = 0;
switch (type) {
@ -762,9 +764,9 @@ CheckedInt32 StructMetaTypeDescr::Layout::close(int32_t* alignment) {
return RoundUpToAlignment(sizeSoFar, structAlignment);
}
/* static */ JSObject* StructMetaTypeDescr::create(JSContext* cx,
HandleObject metaTypeDescr,
HandleObject fields) {
/* static */
JSObject* StructMetaTypeDescr::create(JSContext* cx, HandleObject metaTypeDescr,
HandleObject fields) {
// Obtain names of fields, which are the own properties of `fields`
AutoIdVector ids(cx);
if (!GetPropertyKeys(cx, fields, JSITER_OWNONLY | JSITER_SYMBOLS, &ids)) {
@ -833,7 +835,8 @@ CheckedInt32 StructMetaTypeDescr::Layout::close(int32_t* alignment) {
fieldProps);
}
/* static */ StructTypeDescr* StructMetaTypeDescr::createFromArrays(
/* static */
StructTypeDescr* StructMetaTypeDescr::createFromArrays(
JSContext* cx, HandleObject structTypePrototype, bool opaque,
bool allowConstruct, AutoIdVector& ids, AutoValueVector& fieldTypeObjs,
Vector<StructFieldProps>& fieldProps) {
@ -1313,8 +1316,9 @@ static JSObject* DefineMetaTypeDescr(JSContext* cx, const char* name,
* initializer for the `TypedObject` class populate the
* `TypedObject` global (which is referred to as "module" herein).
*/
/* static */ bool GlobalObject::initTypedObjectModule(
JSContext* cx, Handle<GlobalObject*> global) {
/* static */
bool GlobalObject::initTypedObjectModule(JSContext* cx,
Handle<GlobalObject*> global) {
RootedObject objProto(cx,
GlobalObject::getOrCreateObjectPrototype(cx, global));
if (!objProto) {
@ -1490,8 +1494,8 @@ bool TypedObject::isAttached() const {
return true;
}
/* static */ bool TypedObject::GetByteOffset(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool TypedObject::GetByteOffset(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
args.rval().setInt32(
AssertedCast<int32_t>(args[0].toObject().as<TypedObject>().offset()));
@ -1502,8 +1506,10 @@ bool TypedObject::isAttached() const {
* Outline typed objects
*/
/*static*/ OutlineTypedObject* OutlineTypedObject::createUnattached(
JSContext* cx, HandleTypeDescr descr, gc::InitialHeap heap) {
/*static*/
OutlineTypedObject* OutlineTypedObject::createUnattached(JSContext* cx,
HandleTypeDescr descr,
gc::InitialHeap heap) {
if (descr->opaque()) {
return createUnattachedWithClass(cx, &OutlineOpaqueTypedObject::class_,
descr, heap);
@ -1539,7 +1545,8 @@ void OutlineTypedObject::setOwnerAndData(JSObject* owner, uint8_t* data) {
}
}
/*static*/ OutlineTypedObject* OutlineTypedObject::createUnattachedWithClass(
/*static*/
OutlineTypedObject* OutlineTypedObject::createUnattachedWithClass(
JSContext* cx, const Class* clasp, HandleTypeDescr descr,
gc::InitialHeap heap) {
MOZ_ASSERT(clasp == &OutlineTransparentTypedObject::class_ ||
@ -1606,7 +1613,8 @@ void OutlineTypedObject::attach(JSContext* cx, TypedObject& typedObj,
}
}
/*static*/ OutlineTypedObject* OutlineTypedObject::createDerived(
/*static*/
OutlineTypedObject* OutlineTypedObject::createDerived(
JSContext* cx, HandleTypeDescr type, HandleTypedObject typedObj,
uint32_t offset) {
MOZ_ASSERT(offset <= typedObj->size());
@ -1625,9 +1633,9 @@ void OutlineTypedObject::attach(JSContext* cx, TypedObject& typedObj,
return obj;
}
/*static*/ TypedObject* TypedObject::createZeroed(JSContext* cx,
HandleTypeDescr descr,
gc::InitialHeap heap) {
/*static*/
TypedObject* TypedObject::createZeroed(JSContext* cx, HandleTypeDescr descr,
gc::InitialHeap heap) {
// If possible, create an object with inline data.
if (InlineTypedObject::canAccommodateType(descr)) {
AutoSetNewObjectMetadata metadata(cx);
@ -1660,8 +1668,8 @@ void OutlineTypedObject::attach(JSContext* cx, TypedObject& typedObj,
return obj;
}
/* static */ void OutlineTypedObject::obj_trace(JSTracer* trc,
JSObject* object) {
/* static */
void OutlineTypedObject::obj_trace(JSTracer* trc, JSObject* object) {
OutlineTypedObject& typedObj = object->as<OutlineTypedObject>();
TraceEdge(trc, typedObj.shapePtr(), "OutlineTypedObject_shape");
@ -1722,9 +1730,10 @@ bool TypeDescr::hasProperty(const JSAtomState& names, jsid id) {
MOZ_CRASH("Unexpected kind");
}
/* static */ bool TypedObject::obj_lookupProperty(
JSContext* cx, HandleObject obj, HandleId id, MutableHandleObject objp,
MutableHandle<PropertyResult> propp) {
/* static */
bool TypedObject::obj_lookupProperty(JSContext* cx, HandleObject obj,
HandleId id, MutableHandleObject objp,
MutableHandle<PropertyResult> propp) {
if (obj->as<TypedObject>().typeDescr().hasProperty(cx->names(), id)) {
propp.setNonNativeProperty();
objp.set(obj);
@ -1877,11 +1886,11 @@ bool TypedObject::obj_getElement(JSContext* cx, HandleObject obj,
return GetElement(cx, proto, receiver, index, vp);
}
/*static*/ bool TypedObject::obj_getArrayElement(JSContext* cx,
Handle<TypedObject*> typedObj,
Handle<TypeDescr*> typeDescr,
uint32_t index,
MutableHandleValue vp) {
/*static*/
bool TypedObject::obj_getArrayElement(JSContext* cx,
Handle<TypedObject*> typedObj,
Handle<TypeDescr*> typeDescr,
uint32_t index, MutableHandleValue vp) {
// Elements are not inherited from the prototype.
if (index >= (size_t)typedObj->length()) {
vp.setUndefined();
@ -2117,8 +2126,10 @@ void OutlineTypedObject::notifyBufferDetached(void* newData) {
* Inline typed objects
*/
/* static */ InlineTypedObject* InlineTypedObject::create(
JSContext* cx, HandleTypeDescr descr, gc::InitialHeap heap) {
/* static */
InlineTypedObject* InlineTypedObject::create(JSContext* cx,
HandleTypeDescr descr,
gc::InitialHeap heap) {
gc::AllocKind allocKind = allocKindForTypeDescriptor(descr);
const Class* clasp = descr->opaque() ? &InlineOpaqueTypedObject::class_
@ -2136,7 +2147,8 @@ void OutlineTypedObject::notifyBufferDetached(void* newData) {
return NewObjectWithGroup<InlineTypedObject>(cx, group, allocKind, newKind);
}
/* static */ InlineTypedObject* InlineTypedObject::createCopy(
/* static */
InlineTypedObject* InlineTypedObject::createCopy(
JSContext* cx, Handle<InlineTypedObject*> templateObject,
gc::InitialHeap heap) {
AutoSetNewObjectMetadata metadata(cx);
@ -2152,8 +2164,8 @@ void OutlineTypedObject::notifyBufferDetached(void* newData) {
return res;
}
/* static */ void InlineTypedObject::obj_trace(JSTracer* trc,
JSObject* object) {
/* static */
void InlineTypedObject::obj_trace(JSTracer* trc, JSObject* object) {
InlineTypedObject& typedObj = object->as<InlineTypedObject>();
TraceEdge(trc, typedObj.shapePtr(), "InlineTypedObject_shape");
@ -2168,7 +2180,8 @@ void OutlineTypedObject::notifyBufferDetached(void* newData) {
typedObj.typeDescr().traceInstances(trc, typedObj.inlineTypedMem(), 1);
}
/* static */ size_t InlineTypedObject::obj_moved(JSObject* dst, JSObject* src) {
/* static */
size_t InlineTypedObject::obj_moved(JSObject* dst, JSObject* src) {
if (!IsInsideNursery(src)) {
return 0;
}
@ -2240,8 +2253,8 @@ DEFINE_TYPEDOBJ_CLASS(InlineTransparentTypedObject,
DEFINE_TYPEDOBJ_CLASS(InlineOpaqueTypedObject, InlineTypedObject::obj_trace,
InlineTypedObject::obj_moved);
/*static*/ bool TypedObject::construct(JSContext* cx, unsigned int argc,
Value* vp) {
/*static*/
bool TypedObject::construct(JSContext* cx, unsigned int argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
MOZ_ASSERT(args.callee().is<TypeDescr>());
@ -2900,7 +2913,8 @@ static bool CreateTraceList(JSContext* cx, HandleTypeDescr descr) {
return true;
}
/* static */ void TypeDescr::finalize(FreeOp* fop, JSObject* obj) {
/* static */
void TypeDescr::finalize(FreeOp* fop, JSObject* obj) {
TypeDescr& descr = obj->as<TypeDescr>();
if (descr.hasTraceList()) {
js_free(const_cast<int32_t*>(descr.traceList()));

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

@ -44,7 +44,8 @@ using namespace js;
return true;
}
/* static */ bool WeakMapObject::has(JSContext* cx, unsigned argc, Value* vp) {
/* static */
bool WeakMapObject::has(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod<WeakMapObject::is, WeakMapObject::has_impl>(cx,
args);
@ -72,7 +73,8 @@ using namespace js;
return true;
}
/* static */ bool WeakMapObject::get(JSContext* cx, unsigned argc, Value* vp) {
/* static */
bool WeakMapObject::get(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod<WeakMapObject::is, WeakMapObject::get_impl>(cx,
args);
@ -101,8 +103,8 @@ using namespace js;
return true;
}
/* static */ bool WeakMapObject::delete_(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool WeakMapObject::delete_(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod<WeakMapObject::is, WeakMapObject::delete_impl>(
cx, args);
@ -127,7 +129,8 @@ using namespace js;
return true;
}
/* static */ bool WeakMapObject::set(JSContext* cx, unsigned argc, Value* vp) {
/* static */
bool WeakMapObject::set(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod<WeakMapObject::is, WeakMapObject::set_impl>(cx,
args);
@ -217,8 +220,8 @@ JS_PUBLIC_API bool JS::SetWeakMapEntry(JSContext* cx, HandleObject mapObj,
return WeakCollectionPutEntryInternal(cx, rootedMap, key, val);
}
/* static */ bool WeakMapObject::construct(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool WeakMapObject::construct(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
// ES6 draft rev 31 (15 Jan 2015) 23.3.1.1 step 1.

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

@ -50,7 +50,8 @@ using namespace js;
return true;
}
/* static */ bool WeakSetObject::add(JSContext* cx, unsigned argc, Value* vp) {
/* static */
bool WeakSetObject::add(JSContext* cx, unsigned argc, Value* vp) {
// Steps 1-3.
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod<WeakSetObject::is, WeakSetObject::add_impl>(cx,
@ -85,8 +86,8 @@ using namespace js;
return true;
}
/* static */ bool WeakSetObject::delete_(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool WeakSetObject::delete_(JSContext* cx, unsigned argc, Value* vp) {
// Steps 1-3.
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod<WeakSetObject::is, WeakSetObject::delete_impl>(
@ -120,7 +121,8 @@ using namespace js;
return true;
}
/* static */ bool WeakSetObject::has(JSContext* cx, unsigned argc, Value* vp) {
/* static */
bool WeakSetObject::has(JSContext* cx, unsigned argc, Value* vp) {
// Steps 1-3.
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod<WeakSetObject::is, WeakSetObject::has_impl>(cx,

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

@ -519,8 +519,8 @@ static const JSFunctionSpec intl_static_methods[] = {
* Initializes the Intl Object and its standard built-in properties.
* Spec: ECMAScript Internationalization API Specification, 8.0, 8.1
*/
/* static */ bool GlobalObject::initIntlObject(JSContext* cx,
Handle<GlobalObject*> global) {
/* static */
bool GlobalObject::initIntlObject(JSContext* cx, Handle<GlobalObject*> global) {
RootedObject proto(cx, GlobalObject::getOrCreateObjectPrototype(cx, global));
if (!proto) {
return false;

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

@ -6222,7 +6222,8 @@ JSObject* StructType::BuildFieldsArray(JSContext* cx, JSObject* obj) {
return fieldsProp;
}
/* static */ bool StructType::IsStruct(HandleValue v) {
/* static */
bool StructType::IsStruct(HandleValue v) {
if (!v.isObject()) {
return false;
}

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

@ -13,7 +13,8 @@
namespace js {
namespace frontend {
/* static */ BinASTSourceMetadata* BinASTSourceMetadata::Create(
/* static */
BinASTSourceMetadata* BinASTSourceMetadata::Create(
const Vector<BinKind>& binKinds, uint32_t numStrings) {
uint32_t numBinKinds = binKinds.length();

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

@ -129,8 +129,8 @@ Scope* EmitterScope::enclosingScope(BytecodeEmitter* bce) const {
return bce->sc->compilationEnclosingScope();
}
/* static */ bool EmitterScope::nameCanBeFree(BytecodeEmitter* bce,
JSAtom* name) {
/* static */
bool EmitterScope::nameCanBeFree(BytecodeEmitter* bce, JSAtom* name) {
// '.generator' cannot be accessed by name.
return name != bce->cx->names().dotGenerator;
}
@ -167,9 +167,9 @@ static bool NameIsOnEnvironment(Scope* scope, JSAtom* name) {
}
#endif
/* static */ NameLocation EmitterScope::searchInEnclosingScope(JSAtom* name,
Scope* scope,
uint8_t hops) {
/* static */
NameLocation EmitterScope::searchInEnclosingScope(JSAtom* name, Scope* scope,
uint8_t hops) {
for (ScopeIter si(scope); si; si++) {
MOZ_ASSERT(NameIsOnEnvironment(si.scope(), name));

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

@ -407,8 +407,8 @@ FunctionBox* ObjectBox::asFunctionBox() {
return static_cast<FunctionBox*>(this);
}
/* static */ void TraceListNode::TraceList(JSTracer* trc,
TraceListNode* listHead) {
/* static */
void TraceListNode::TraceList(JSTracer* trc, TraceListNode* listHead) {
for (TraceListNode* node = listHead; node; node = node->traceLink) {
node->trace(trc);
}

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

@ -260,8 +260,9 @@ FOR_EACH_NONOBJECT_NONNURSERY_ALLOCKIND(DECL_ALLOCATOR_INSTANCES)
#undef DECL_ALLOCATOR_INSTANCES
template <typename T, AllowGC allowGC>
/* static */ T* GCRuntime::tryNewTenuredThing(JSContext* cx, AllocKind kind,
size_t thingSize) {
/* static */
T* GCRuntime::tryNewTenuredThing(JSContext* cx, AllocKind kind,
size_t thingSize) {
// Bump allocate in the arena's current free-list span.
T* t = reinterpret_cast<T*>(cx->freeLists().allocate(kind));
if (MOZ_UNLIKELY(!t)) {
@ -358,7 +359,8 @@ bool GCRuntime::gcIfNeededAtAllocation(JSContext* cx) {
}
template <typename T>
/* static */ void GCRuntime::checkIncrementalZoneState(JSContext* cx, T* t) {
/* static */
void GCRuntime::checkIncrementalZoneState(JSContext* cx, T* t) {
#ifdef DEBUG
if (cx->helperThread() || !t) {
return;
@ -401,8 +403,9 @@ bool GCRuntime::startBackgroundAllocTaskIfIdle() {
return allocTask.startWithLockHeld(helperLock);
}
/* static */ TenuredCell* GCRuntime::refillFreeListFromAnyThread(
JSContext* cx, AllocKind thingKind) {
/* static */
TenuredCell* GCRuntime::refillFreeListFromAnyThread(JSContext* cx,
AllocKind thingKind) {
MOZ_ASSERT(cx->freeLists().isEmpty(thingKind));
if (!cx->helperThread()) {
@ -412,8 +415,9 @@ bool GCRuntime::startBackgroundAllocTaskIfIdle() {
return refillFreeListFromHelperThread(cx, thingKind);
}
/* static */ TenuredCell* GCRuntime::refillFreeListFromMainThread(
JSContext* cx, AllocKind thingKind) {
/* static */
TenuredCell* GCRuntime::refillFreeListFromMainThread(JSContext* cx,
AllocKind thingKind) {
// It should not be possible to allocate on the main thread while we are
// inside a GC.
MOZ_ASSERT(!JS::RuntimeHeapIsBusy(), "allocating while under GC");
@ -422,8 +426,9 @@ bool GCRuntime::startBackgroundAllocTaskIfIdle() {
cx->freeLists(), thingKind, ShouldCheckThresholds::CheckThresholds);
}
/* static */ TenuredCell* GCRuntime::refillFreeListFromHelperThread(
JSContext* cx, AllocKind thingKind) {
/* static */
TenuredCell* GCRuntime::refillFreeListFromHelperThread(JSContext* cx,
AllocKind thingKind) {
// A GC may be happening on the main thread, but zones used by off thread
// tasks are never collected.
Zone* zone = cx->zone();
@ -433,8 +438,8 @@ bool GCRuntime::startBackgroundAllocTaskIfIdle() {
cx->freeLists(), thingKind, ShouldCheckThresholds::CheckThresholds);
}
/* static */ TenuredCell* GCRuntime::refillFreeListInGC(Zone* zone,
AllocKind thingKind) {
/* static */
TenuredCell* GCRuntime::refillFreeListInGC(Zone* zone, AllocKind thingKind) {
// Called by compacting GC to refill a free list while we are in a GC.
MOZ_ASSERT(JS::RuntimeHeapIsCollecting());
MOZ_ASSERT_IF(!JS::RuntimeHeapIsMinorCollecting(),
@ -717,7 +722,8 @@ void BackgroundAllocTask::run() {
}
}
/* static */ Chunk* Chunk::allocate(JSRuntime* rt) {
/* static */
Chunk* Chunk::allocate(JSRuntime* rt) {
Chunk* chunk = static_cast<Chunk*>(MapAlignedPages(ChunkSize, ChunkSize));
if (!chunk) {
return nullptr;

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

@ -539,7 +539,8 @@ void Arena::checkNoMarkedFreeCells() {
}
#endif
/* static */ void Arena::staticAsserts() {
/* static */
void Arena::staticAsserts() {
static_assert(size_t(AllocKind::LIMIT) <= 255,
"We must be able to fit the allockind into uint8_t.");
static_assert(mozilla::ArrayLength(ThingSizes) == size_t(AllocKind::LIMIT),
@ -1943,7 +1944,8 @@ float ZoneHeapThreshold::eagerAllocTrigger(bool highFrequencyGC) const {
return eagerTriggerFactor * gcTriggerBytes();
}
/* static */ float ZoneHeapThreshold::computeZoneHeapGrowthFactorForHeapSize(
/* static */
float ZoneHeapThreshold::computeZoneHeapGrowthFactorForHeapSize(
size_t lastBytes, const GCSchedulingTunables& tunables,
const GCSchedulingState& state) {
if (!tunables.isDynamicHeapGrowthEnabled()) {
@ -1994,7 +1996,8 @@ float ZoneHeapThreshold::eagerAllocTrigger(bool highFrequencyGC) const {
return factor;
}
/* static */ size_t ZoneHeapThreshold::computeZoneTriggerBytes(
/* static */
size_t ZoneHeapThreshold::computeZoneTriggerBytes(
float growthFactor, size_t lastBytes, JSGCInvocationKind gckind,
const GCSchedulingTunables& tunables, const AutoLockGC& lock) {
size_t base =
@ -3082,8 +3085,9 @@ inline void ArenaLists::queueForBackgroundSweep(AllocKind thingKind) {
concurrentUse(thingKind) = ConcurrentUse::BackgroundFinalize;
}
/*static*/ void ArenaLists::backgroundFinalize(FreeOp* fop, Arena* listHead,
Arena** empty) {
/*static*/
void ArenaLists::backgroundFinalize(FreeOp* fop, Arena* listHead,
Arena** empty) {
MOZ_ASSERT(listHead);
MOZ_ASSERT(empty);
@ -3686,7 +3690,8 @@ void GCRuntime::freeFromBackgroundThread(AutoLockHelperThreadState& lock) {
void GCRuntime::waitBackgroundFreeEnd() { freeTask.join(); }
/* static */ bool UniqueIdGCPolicy::needsSweep(Cell** cellp, uint64_t*) {
/* static */
bool UniqueIdGCPolicy::needsSweep(Cell** cellp, uint64_t*) {
Cell* cell = *cellp;
return MapGCThingTyped(cell, cell->getTraceKind(), [](auto t) {
mozilla::DebugOnly<const Cell*> prior = t;
@ -5019,7 +5024,8 @@ static bool IsGrayListObject(JSObject* obj) {
return obj->is<CrossCompartmentWrapperObject>() && !IsDeadProxyObject(obj);
}
/* static */ unsigned ProxyObject::grayLinkReservedSlot(JSObject* obj) {
/* static */
unsigned ProxyObject::grayLinkReservedSlot(JSObject* obj) {
MOZ_ASSERT(IsGrayListObject(obj));
return CrossCompartmentWrapperObject::GrayLinkReservedSlot;
}

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

@ -86,8 +86,8 @@ inline void js::NurseryChunk::poisonAfterSweep(size_t extent) {
Poison(this, JS_SWEPT_NURSERY_PATTERN, extent, MemCheckKind::MakeNoAccess);
}
/* static */ inline js::NurseryChunk* js::NurseryChunk::fromChunk(
Chunk* chunk) {
/* static */
inline js::NurseryChunk* js::NurseryChunk::fromChunk(Chunk* chunk) {
return reinterpret_cast<NurseryChunk*>(chunk);
}
@ -658,7 +658,8 @@ void js::Nursery::renderProfileJSON(JSONPrinter& json) const {
json.endObject();
}
/* static */ void js::Nursery::printProfileHeader() {
/* static */
void js::Nursery::printProfileHeader() {
fprintf(stderr, "MinorGC: Reason PRate Size ");
#define PRINT_HEADER(name, text) fprintf(stderr, " %6s", text);
FOR_EACH_NURSERY_PROFILE_TIME(PRINT_HEADER)
@ -666,8 +667,8 @@ void js::Nursery::renderProfileJSON(JSONPrinter& json) const {
fprintf(stderr, "\n");
}
/* static */ void js::Nursery::printProfileDurations(
const ProfileDurations& times) {
/* static */
void js::Nursery::printProfileDurations(const ProfileDurations& times) {
for (auto time : times) {
fprintf(stderr, " %6" PRIi64, static_cast<int64_t>(time.ToMicroseconds()));
}

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

@ -217,13 +217,15 @@ inline void AutoGCRooter::trace(JSTracer* trc) {
MOZ_CRASH("Bad AutoGCRooter::Tag");
}
/* static */ void AutoGCRooter::traceAll(JSContext* cx, JSTracer* trc) {
/* static */
void AutoGCRooter::traceAll(JSContext* cx, JSTracer* trc) {
for (AutoGCRooter* gcr = cx->autoGCRooters_; gcr; gcr = gcr->down) {
gcr->trace(trc);
}
}
/* static */ void AutoGCRooter::traceAllWrappers(JSContext* cx, JSTracer* trc) {
/* static */
void AutoGCRooter::traceAllWrappers(JSContext* cx, JSTracer* trc) {
for (AutoGCRooter* gcr = cx->autoGCRooters_; gcr; gcr = gcr->down) {
if (gcr->tag_ == Tag::WrapperVector || gcr->tag_ == Tag::Wrapper) {
gcr->trace(trc);

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

@ -814,7 +814,8 @@ Statistics::~Statistics() {
}
}
/* static */ bool Statistics::initialize() {
/* static */
bool Statistics::initialize() {
#ifdef DEBUG
// Sanity check generated tables.
for (auto i : AllPhases()) {
@ -1463,7 +1464,8 @@ void Statistics::printProfileHeader() {
fprintf(stderr, "\n");
}
/* static */ void Statistics::printProfileTimes(const ProfileDurations& times) {
/* static */
void Statistics::printProfileTimes(const ProfileDurations& times) {
for (auto time : times) {
fprintf(stderr, " %6" PRIi64, static_cast<int64_t>(time.ToMilliseconds()));
}

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

@ -1022,8 +1022,10 @@ JitCode* JitRuntime::generateBaselineDebugModeOSRHandler(
return code;
}
/* static */ void DebugModeOSRVolatileJitFrameIter::forwardLiveIterators(
JSContext* cx, uint8_t* oldAddr, uint8_t* newAddr) {
/* static */
void DebugModeOSRVolatileJitFrameIter::forwardLiveIterators(JSContext* cx,
uint8_t* oldAddr,
uint8_t* newAddr) {
DebugModeOSRVolatileJitFrameIter* iter;
for (iter = cx->liveVolatileJitFrameIter_; iter; iter = iter->prev) {
if (iter->isWasm()) {

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

@ -108,8 +108,8 @@ void ICEntry::trace(JSTracer* trc) {
}
}
/* static */ UniquePtr<ICScript> ICScript::create(JSContext* cx,
JSScript* script) {
/* static */
UniquePtr<ICScript> ICScript::create(JSContext* cx, JSScript* script) {
MOZ_ASSERT(cx->realm()->jitRealm());
MOZ_ASSERT(jit::IsBaselineEnabled(cx));
@ -463,7 +463,8 @@ void ICStubIterator::unlink(JSContext* cx) {
unlinked_ = true;
}
/* static */ bool ICStub::NonCacheIRStubMakesGCCalls(Kind kind) {
/* static */
bool ICStub::NonCacheIRStubMakesGCCalls(Kind kind) {
MOZ_ASSERT(IsValidKind(kind));
MOZ_ASSERT(!IsCacheIRKind(kind));
@ -514,7 +515,8 @@ void ICStub::updateCode(JitCode* code) {
stubCode_ = code->raw();
}
/* static */ void ICStub::trace(JSTracer* trc) {
/* static */
void ICStub::trace(JSTracer* trc) {
traceCode(trc, "shared-stub-jitcode");
// If the stub is a monitored fallback stub, then trace the monitor ICs
@ -1043,8 +1045,9 @@ bool ICUpdatedStub::initUpdatingChain(JSContext* cx, ICStubSpace* space) {
return true;
}
/* static */ ICStubSpace* ICStubCompiler::StubSpaceForStub(bool makesGCCalls,
JSScript* script) {
/* static */
ICStubSpace* ICStubCompiler::StubSpaceForStub(bool makesGCCalls,
JSScript* script) {
if (makesGCCalls) {
return script->icScript()->fallbackStubSpace();
}

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

@ -19,7 +19,8 @@ JSRuntime* CompileRuntime::runtime() {
return reinterpret_cast<JSRuntime*>(this);
}
/* static */ CompileRuntime* CompileRuntime::get(JSRuntime* rt) {
/* static */
CompileRuntime* CompileRuntime::get(JSRuntime* rt) {
return reinterpret_cast<CompileRuntime*>(rt);
}
@ -99,7 +100,8 @@ bool CompileRuntime::runtimeMatches(JSRuntime* rt) { return rt == runtime(); }
Zone* CompileZone::zone() { return reinterpret_cast<Zone*>(this); }
/* static */ CompileZone* CompileZone::get(Zone* zone) {
/* static */
CompileZone* CompileZone::get(Zone* zone) {
return reinterpret_cast<CompileZone*>(zone);
}
@ -168,7 +170,8 @@ void CompileZone::setMinorGCShouldCancelIonCompilations() {
JS::Realm* CompileRealm::realm() { return reinterpret_cast<JS::Realm*>(this); }
/* static */ CompileRealm* CompileRealm::get(JS::Realm* realm) {
/* static */
CompileRealm* CompileRealm::get(JS::Realm* realm) {
return reinterpret_cast<CompileRealm*>(realm);
}

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

@ -154,8 +154,9 @@ ExecutablePool* ExecutableAllocator::poolForSize(size_t n) {
return pool;
}
/* static */ size_t ExecutableAllocator::roundUpAllocationSize(
size_t request, size_t granularity) {
/* static */
size_t ExecutableAllocator::roundUpAllocationSize(size_t request,
size_t granularity) {
if ((std::numeric_limits<size_t>::max() - granularity) <= request) {
return OVERSIZE_ALLOCATION;
}
@ -257,16 +258,18 @@ void ExecutableAllocator::addSizeOfCode(JS::CodeSizes* sizes) const {
}
}
/* static */ void ExecutableAllocator::reprotectPool(
JSRuntime* rt, ExecutablePool* pool, ProtectionSetting protection) {
/* static */
void ExecutableAllocator::reprotectPool(JSRuntime* rt, ExecutablePool* pool,
ProtectionSetting protection) {
char* start = pool->m_allocation.pages;
if (!ReprotectRegion(start, pool->m_freePtr - start, protection)) {
MOZ_CRASH();
}
}
/* static */ void ExecutableAllocator::poisonCode(
JSRuntime* rt, JitPoisonRangeVector& ranges) {
/* static */
void ExecutableAllocator::poisonCode(JSRuntime* rt,
JitPoisonRangeVector& ranges) {
MOZ_ASSERT(CurrentThreadCanAccessRuntime(rt));
#ifdef DEBUG

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

@ -532,8 +532,8 @@ uint8_t* jit::LazyLinkTopActivation(JSContext* cx,
return calleeScript->jitCodeRaw();
}
/* static */ void JitRuntime::Trace(JSTracer* trc,
const AutoAccessAtomsZone& access) {
/* static */
void JitRuntime::Trace(JSTracer* trc, const AutoAccessAtomsZone& access) {
MOZ_ASSERT(!JS::RuntimeHeapIsMinorCollecting());
// Shared stubs are allocated in the atoms zone, so do not iterate
@ -549,7 +549,8 @@ uint8_t* jit::LazyLinkTopActivation(JSContext* cx,
}
}
/* static */ void JitRuntime::TraceJitcodeGlobalTableForMinorGC(JSTracer* trc) {
/* static */
void JitRuntime::TraceJitcodeGlobalTableForMinorGC(JSTracer* trc) {
if (trc->runtime()->geckoProfiler().enabled() &&
trc->runtime()->hasJitRuntime() &&
trc->runtime()->jitRuntime()->hasJitcodeGlobalTable()) {
@ -557,8 +558,8 @@ uint8_t* jit::LazyLinkTopActivation(JSContext* cx,
}
}
/* static */ bool JitRuntime::MarkJitcodeGlobalTableIteratively(
GCMarker* marker) {
/* static */
bool JitRuntime::MarkJitcodeGlobalTableIteratively(GCMarker* marker) {
if (marker->runtime()->hasJitRuntime() &&
marker->runtime()->jitRuntime()->hasJitcodeGlobalTable()) {
return marker->runtime()
@ -569,7 +570,8 @@ uint8_t* jit::LazyLinkTopActivation(JSContext* cx,
return false;
}
/* static */ void JitRuntime::SweepJitcodeGlobalTable(JSRuntime* rt) {
/* static */
void JitRuntime::SweepJitcodeGlobalTable(JSRuntime* rt) {
if (rt->hasJitRuntime() && rt->jitRuntime()->hasJitcodeGlobalTable()) {
rt->jitRuntime()->getJitcodeGlobalTable()->sweep(rt);
}
@ -904,7 +906,8 @@ void IonScript::trace(JSTracer* trc) {
}
}
/* static */ void IonScript::writeBarrierPre(Zone* zone, IonScript* ionScript) {
/* static */
void IonScript::writeBarrierPre(Zone* zone, IonScript* ionScript) {
if (zone->needsIncrementalBarrier()) {
ionScript->trace(zone->barrierTracer());
}

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

@ -115,11 +115,10 @@ void IonIC::trace(JSTracer* trc) {
MOZ_ASSERT(nextCodeRaw == fallbackLabel_.raw());
}
/* static */ bool IonGetPropertyIC::update(JSContext* cx,
HandleScript outerScript,
IonGetPropertyIC* ic,
HandleValue val, HandleValue idVal,
MutableHandleValue res) {
/* static */
bool IonGetPropertyIC::update(JSContext* cx, HandleScript outerScript,
IonGetPropertyIC* ic, HandleValue val,
HandleValue idVal, MutableHandleValue res) {
// Override the return value if we are invalidated (bug 728188).
IonScript* ionScript = outerScript->ionScript();
AutoDetectInvalidation adi(cx, res, ionScript);
@ -199,10 +198,11 @@ void IonIC::trace(JSTracer* trc) {
return true;
}
/* static */ bool IonGetPropSuperIC::update(
JSContext* cx, HandleScript outerScript, IonGetPropSuperIC* ic,
HandleObject obj, HandleValue receiver, HandleValue idVal,
MutableHandleValue res) {
/* static */
bool IonGetPropSuperIC::update(JSContext* cx, HandleScript outerScript,
IonGetPropSuperIC* ic, HandleObject obj,
HandleValue receiver, HandleValue idVal,
MutableHandleValue res) {
// Override the return value if we are invalidated (bug 728188).
IonScript* ionScript = outerScript->ionScript();
AutoDetectInvalidation adi(cx, res, ionScript);
@ -242,11 +242,10 @@ void IonIC::trace(JSTracer* trc) {
return true;
}
/* static */ bool IonSetPropertyIC::update(JSContext* cx,
HandleScript outerScript,
IonSetPropertyIC* ic,
HandleObject obj, HandleValue idVal,
HandleValue rhs) {
/* static */
bool IonSetPropertyIC::update(JSContext* cx, HandleScript outerScript,
IonSetPropertyIC* ic, HandleObject obj,
HandleValue idVal, HandleValue rhs) {
RootedShape oldShape(cx);
RootedObjectGroup oldGroup(cx);
IonScript* ionScript = outerScript->ionScript();
@ -384,9 +383,10 @@ static void TryAttachIonStub(JSContext* cx, IC* ic, IonScript* ionScript,
}
}
/* static */ bool IonGetNameIC::update(JSContext* cx, HandleScript outerScript,
IonGetNameIC* ic, HandleObject envChain,
MutableHandleValue res) {
/* static */
bool IonGetNameIC::update(JSContext* cx, HandleScript outerScript,
IonGetNameIC* ic, HandleObject envChain,
MutableHandleValue res) {
IonScript* ionScript = outerScript->ionScript();
jsbytecode* pc = ic->pc();
RootedPropertyName name(cx, ic->script()->getName(pc));
@ -417,10 +417,9 @@ static void TryAttachIonStub(JSContext* cx, IC* ic, IonScript* ionScript,
return true;
}
/* static */ JSObject* IonBindNameIC::update(JSContext* cx,
HandleScript outerScript,
IonBindNameIC* ic,
HandleObject envChain) {
/* static */
JSObject* IonBindNameIC::update(JSContext* cx, HandleScript outerScript,
IonBindNameIC* ic, HandleObject envChain) {
IonScript* ionScript = outerScript->ionScript();
jsbytecode* pc = ic->pc();
RootedPropertyName name(cx, ic->script()->getName(pc));
@ -436,10 +435,9 @@ static void TryAttachIonStub(JSContext* cx, IC* ic, IonScript* ionScript,
return holder;
}
/* static */ JSObject* IonGetIteratorIC::update(JSContext* cx,
HandleScript outerScript,
IonGetIteratorIC* ic,
HandleValue value) {
/* static */
JSObject* IonGetIteratorIC::update(JSContext* cx, HandleScript outerScript,
IonGetIteratorIC* ic, HandleValue value) {
IonScript* ionScript = outerScript->ionScript();
TryAttachIonStub<GetIteratorIRGenerator, IonGetIteratorIC>(cx, ic, ionScript,
@ -448,9 +446,10 @@ static void TryAttachIonStub(JSContext* cx, IC* ic, IonScript* ionScript,
return ValueToIterator(cx, value);
}
/* static */ bool IonHasOwnIC::update(JSContext* cx, HandleScript outerScript,
IonHasOwnIC* ic, HandleValue val,
HandleValue idVal, int32_t* res) {
/* static */
bool IonHasOwnIC::update(JSContext* cx, HandleScript outerScript,
IonHasOwnIC* ic, HandleValue val, HandleValue idVal,
int32_t* res) {
IonScript* ionScript = outerScript->ionScript();
TryAttachIonStub<HasPropIRGenerator, IonHasOwnIC>(
@ -465,9 +464,9 @@ static void TryAttachIonStub(JSContext* cx, IC* ic, IonScript* ionScript,
return true;
}
/* static */ bool IonInIC::update(JSContext* cx, HandleScript outerScript,
IonInIC* ic, HandleValue key,
HandleObject obj, bool* res) {
/* static */
bool IonInIC::update(JSContext* cx, HandleScript outerScript, IonInIC* ic,
HandleValue key, HandleObject obj, bool* res) {
IonScript* ionScript = outerScript->ionScript();
RootedValue objV(cx, ObjectValue(*obj));
@ -476,10 +475,10 @@ static void TryAttachIonStub(JSContext* cx, IC* ic, IonScript* ionScript,
return OperatorIn(cx, key, obj, res);
}
/* static */ bool IonInstanceOfIC::update(JSContext* cx,
HandleScript outerScript,
IonInstanceOfIC* ic, HandleValue lhs,
HandleObject rhs, bool* res) {
/* static */
bool IonInstanceOfIC::update(JSContext* cx, HandleScript outerScript,
IonInstanceOfIC* ic, HandleValue lhs,
HandleObject rhs, bool* res) {
IonScript* ionScript = outerScript->ionScript();
TryAttachIonStub<InstanceOfIRGenerator, IonInstanceOfIC>(cx, ic, ionScript,
@ -488,10 +487,10 @@ static void TryAttachIonStub(JSContext* cx, IC* ic, IonScript* ionScript,
return HasInstance(cx, rhs, lhs, res);
}
/* static */ bool IonUnaryArithIC::update(JSContext* cx,
HandleScript outerScript,
IonUnaryArithIC* ic, HandleValue val,
MutableHandleValue res) {
/* static */
bool IonUnaryArithIC::update(JSContext* cx, HandleScript outerScript,
IonUnaryArithIC* ic, HandleValue val,
MutableHandleValue res) {
IonScript* ionScript = outerScript->ionScript();
RootedScript script(cx, ic->script());
jsbytecode* pc = ic->pc();
@ -535,11 +534,10 @@ static void TryAttachIonStub(JSContext* cx, IC* ic, IonScript* ionScript,
return true;
}
/* static */ bool IonBinaryArithIC::update(JSContext* cx,
HandleScript outerScript,
IonBinaryArithIC* ic,
HandleValue lhs, HandleValue rhs,
MutableHandleValue ret) {
/* static */
bool IonBinaryArithIC::update(JSContext* cx, HandleScript outerScript,
IonBinaryArithIC* ic, HandleValue lhs,
HandleValue rhs, MutableHandleValue ret) {
IonScript* ionScript = outerScript->ionScript();
RootedScript script(cx, ic->script());
jsbytecode* pc = ic->pc();
@ -606,9 +604,10 @@ static void TryAttachIonStub(JSContext* cx, IC* ic, IonScript* ionScript,
return true;
}
/* static */ bool IonCompareIC::update(JSContext* cx, HandleScript outerScript,
IonCompareIC* ic, HandleValue lhs,
HandleValue rhs, bool* res) {
/* static */
bool IonCompareIC::update(JSContext* cx, HandleScript outerScript,
IonCompareIC* ic, HandleValue lhs, HandleValue rhs,
bool* res) {
IonScript* ionScript = outerScript->ionScript();
RootedScript script(cx, ic->script());
jsbytecode* pc = ic->pc();

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

@ -245,8 +245,9 @@ static int ComparePointers(const void* a, const void* b) {
return 0;
}
/* static */ int JitcodeGlobalEntry::compare(const JitcodeGlobalEntry& ent1,
const JitcodeGlobalEntry& ent2) {
/* static */
int JitcodeGlobalEntry::compare(const JitcodeGlobalEntry& ent1,
const JitcodeGlobalEntry& ent2) {
// Both parts of compare cannot be a query.
MOZ_ASSERT(!(ent1.isQuery() && ent2.isQuery()));
@ -275,9 +276,9 @@ static int ComparePointers(const void* a, const void* b) {
return flip * -1;
}
/* static */ char* JitcodeGlobalEntry::createScriptString(JSContext* cx,
JSScript* script,
size_t* length) {
/* static */
char* JitcodeGlobalEntry::createScriptString(JSContext* cx, JSScript* script,
size_t* length) {
// If the script has a function, try calculating its name.
bool hasName = false;
size_t nameLength = 0;
@ -1007,37 +1008,38 @@ void JitcodeGlobalEntry::IonCacheEntry::forEachOptimizationTypeInfo(
entry.forEachOptimizationTypeInfo(rt, index, op);
}
/* static */ void JitcodeRegionEntry::WriteHead(CompactBufferWriter& writer,
uint32_t nativeOffset,
uint8_t scriptDepth) {
/* static */
void JitcodeRegionEntry::WriteHead(CompactBufferWriter& writer,
uint32_t nativeOffset, uint8_t scriptDepth) {
writer.writeUnsigned(nativeOffset);
writer.writeByte(scriptDepth);
}
/* static */ void JitcodeRegionEntry::ReadHead(CompactBufferReader& reader,
uint32_t* nativeOffset,
uint8_t* scriptDepth) {
/* static */
void JitcodeRegionEntry::ReadHead(CompactBufferReader& reader,
uint32_t* nativeOffset,
uint8_t* scriptDepth) {
*nativeOffset = reader.readUnsigned();
*scriptDepth = reader.readByte();
}
/* static */ void JitcodeRegionEntry::WriteScriptPc(CompactBufferWriter& writer,
uint32_t scriptIdx,
uint32_t pcOffset) {
/* static */
void JitcodeRegionEntry::WriteScriptPc(CompactBufferWriter& writer,
uint32_t scriptIdx, uint32_t pcOffset) {
writer.writeUnsigned(scriptIdx);
writer.writeUnsigned(pcOffset);
}
/* static */ void JitcodeRegionEntry::ReadScriptPc(CompactBufferReader& reader,
uint32_t* scriptIdx,
uint32_t* pcOffset) {
/* static */
void JitcodeRegionEntry::ReadScriptPc(CompactBufferReader& reader,
uint32_t* scriptIdx, uint32_t* pcOffset) {
*scriptIdx = reader.readUnsigned();
*pcOffset = reader.readUnsigned();
}
/* static */ void JitcodeRegionEntry::WriteDelta(CompactBufferWriter& writer,
uint32_t nativeDelta,
int32_t pcDelta) {
/* static */
void JitcodeRegionEntry::WriteDelta(CompactBufferWriter& writer,
uint32_t nativeDelta, int32_t pcDelta) {
if (pcDelta >= 0) {
// 1 and 2-byte formats possible.
@ -1090,9 +1092,9 @@ void JitcodeGlobalEntry::IonCacheEntry::forEachOptimizationTypeInfo(
MOZ_CRASH("pcDelta/nativeDelta values are too large to encode.");
}
/* static */ void JitcodeRegionEntry::ReadDelta(CompactBufferReader& reader,
uint32_t* nativeDelta,
int32_t* pcDelta) {
/* static */
void JitcodeRegionEntry::ReadDelta(CompactBufferReader& reader,
uint32_t* nativeDelta, int32_t* pcDelta) {
// NB:
// It's possible to get nativeDeltas with value 0 in two cases:
//
@ -1160,8 +1162,9 @@ void JitcodeGlobalEntry::IonCacheEntry::forEachOptimizationTypeInfo(
MOZ_ASSERT_IF(*nativeDelta == 0, *pcDelta <= 0);
}
/* static */ uint32_t JitcodeRegionEntry::ExpectedRunLength(
const NativeToBytecode* entry, const NativeToBytecode* end) {
/* static */
uint32_t JitcodeRegionEntry::ExpectedRunLength(const NativeToBytecode* entry,
const NativeToBytecode* end) {
MOZ_ASSERT(entry < end);
// We always use the first entry, so runLength starts at 1
@ -1251,11 +1254,11 @@ struct JitcodeMapBufferWriteSpewer {
// Write a run, starting at the given NativeToBytecode entry, into the given
// buffer writer.
/* static */ bool JitcodeRegionEntry::WriteRun(CompactBufferWriter& writer,
JSScript** scriptList,
uint32_t scriptListSize,
uint32_t runLength,
const NativeToBytecode* entry) {
/* static */
bool JitcodeRegionEntry::WriteRun(CompactBufferWriter& writer,
JSScript** scriptList,
uint32_t scriptListSize, uint32_t runLength,
const NativeToBytecode* entry) {
MOZ_ASSERT(runLength > 0);
MOZ_ASSERT(runLength <= MAX_RUN_LENGTH);
@ -1495,7 +1498,8 @@ uint32_t JitcodeIonTable::findRegionEntry(uint32_t nativeOffset) const {
return idx;
}
/* static */ bool JitcodeIonTable::WriteIonTable(
/* static */
bool JitcodeIonTable::WriteIonTable(
CompactBufferWriter& writer, JSScript** scriptList, uint32_t scriptListSize,
const NativeToBytecode* start, const NativeToBytecode* end,
uint32_t* tableOffsetOut, uint32_t* numRegionsOut) {

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

@ -3395,8 +3395,9 @@ static inline bool MustBeUInt32(MDefinition* def, MDefinition** pwrapped) {
return false;
}
/* static */ bool MBinaryInstruction::unsignedOperands(MDefinition* left,
MDefinition* right) {
/* static */
bool MBinaryInstruction::unsignedOperands(MDefinition* left,
MDefinition* right) {
MDefinition* replace;
if (!MustBeUInt32(left, &replace)) {
return false;

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

@ -205,8 +205,8 @@ static HashNumber HashVectorContents(const Vec* xs, HashNumber h) {
return h;
}
/* static */ HashNumber UniqueTrackedOptimizations::Key::hash(
const Lookup& lookup) {
/* static */
HashNumber UniqueTrackedOptimizations::Key::hash(const Lookup& lookup) {
HashNumber h = HashVectorContents(lookup.types, 0);
h = HashVectorContents(lookup.attempts, h);
h += (h << 3);
@ -215,8 +215,9 @@ static HashNumber HashVectorContents(const Vec* xs, HashNumber h) {
return h;
}
/* static */ bool UniqueTrackedOptimizations::Key::match(const Key& key,
const Lookup& lookup) {
/* static */
bool UniqueTrackedOptimizations::Key::match(const Key& key,
const Lookup& lookup) {
return VectorContentsMatch(key.attempts, lookup.attempts) &&
VectorContentsMatch(key.types, lookup.types);
}
@ -526,7 +527,8 @@ IonTrackedOptimizationsRegionTable::findRegion(uint32_t offset) const {
return Nothing();
}
/* static */ uint32_t IonTrackedOptimizationsRegion::ExpectedRunLength(
/* static */
uint32_t IonTrackedOptimizationsRegion::ExpectedRunLength(
const NativeToTrackedOptimizations* start,
const NativeToTrackedOptimizations* end) {
MOZ_ASSERT(start < end);
@ -577,9 +579,11 @@ bool OptimizationTypeInfo::writeCompact(CompactBufferWriter& writer,
return true;
}
/* static */ void IonTrackedOptimizationsRegion::ReadDelta(
CompactBufferReader& reader, uint32_t* startDelta, uint32_t* length,
uint8_t* index) {
/* static */
void IonTrackedOptimizationsRegion::ReadDelta(CompactBufferReader& reader,
uint32_t* startDelta,
uint32_t* length,
uint8_t* index) {
// 2 bytes
// SSSS-SSSL LLLL-LII0
const uint32_t firstByte = reader.readByte();
@ -630,9 +634,10 @@ bool OptimizationTypeInfo::writeCompact(CompactBufferWriter& writer,
MOZ_ASSERT(length != 0);
}
/* static */ void IonTrackedOptimizationsRegion::WriteDelta(
CompactBufferWriter& writer, uint32_t startDelta, uint32_t length,
uint8_t index) {
/* static */
void IonTrackedOptimizationsRegion::WriteDelta(CompactBufferWriter& writer,
uint32_t startDelta,
uint32_t length, uint8_t index) {
// 2 bytes
// SSSS-SSSL LLLL-LII0
if (startDelta <= ENC1_START_DELTA_MAX && length <= ENC1_LENGTH_MAX &&
@ -692,7 +697,8 @@ bool OptimizationTypeInfo::writeCompact(CompactBufferWriter& writer,
MOZ_CRASH("startDelta,length,index triple too large to encode.");
}
/* static */ bool IonTrackedOptimizationsRegion::WriteRun(
/* static */
bool IonTrackedOptimizationsRegion::WriteRun(
CompactBufferWriter& writer, const NativeToTrackedOptimizations* start,
const NativeToTrackedOptimizations* end,
const UniqueTrackedOptimizations& unique) {

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

@ -55,9 +55,10 @@ RematerializedFrame::RematerializedFrame(JSContext* cx, uint8_t* top,
&newTarget_, ReadFrame_Actuals, fallback);
}
/* static */ RematerializedFrame* RematerializedFrame::New(
JSContext* cx, uint8_t* top, InlineFrameIterator& iter,
MaybeReadFallback& fallback) {
/* static */
RematerializedFrame* RematerializedFrame::New(JSContext* cx, uint8_t* top,
InlineFrameIterator& iter,
MaybeReadFallback& fallback) {
unsigned numFormals =
iter.isFunctionFrame() ? iter.calleeTemplate()->nargs() : 0;
unsigned argSlots = Max(numFormals, iter.numActualArgs());
@ -81,7 +82,8 @@ RematerializedFrame::RematerializedFrame(JSContext* cx, uint8_t* top,
RematerializedFrame(cx, top, iter.numActualArgs(), iter, fallback);
}
/* static */ bool RematerializedFrame::RematerializeInlineFrames(
/* static */
bool RematerializedFrame::RematerializeInlineFrames(
JSContext* cx, uint8_t* top, InlineFrameIterator& iter,
MaybeReadFallback& fallback, GCVector<RematerializedFrame*>& frames) {
Rooted<GCVector<RematerializedFrame*>> tempFrames(
@ -112,8 +114,8 @@ RematerializedFrame::RematerializedFrame(JSContext* cx, uint8_t* top,
return true;
}
/* static */ void RematerializedFrame::FreeInVector(
GCVector<RematerializedFrame*>& frames) {
/* static */
void RematerializedFrame::FreeInVector(GCVector<RematerializedFrame*>& frames) {
for (size_t i = 0; i < frames.length(); i++) {
RematerializedFrame* f = frames[i];
MOZ_ASSERT(!Debugger::inFrameMaps(f));

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

@ -146,7 +146,8 @@ bool JitRuntime::generateVMWrappers(JSContext* cx, MacroAssembler& masm) {
}
// Statics are initialized to null.
/* static */ VMFunction* VMFunction::functions;
/* static */
VMFunction* VMFunction::functions;
AutoDetectInvalidation::AutoDetectInvalidation(JSContext* cx,
MutableHandleValue rval)

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

@ -741,8 +741,9 @@ static void TraceOneDataRelocation(JSTracer* trc, InstructionIterator iter) {
}
}
/* static */ void Assembler::TraceDataRelocations(JSTracer* trc, JitCode* code,
CompactBufferReader& reader) {
/* static */
void Assembler::TraceDataRelocations(JSTracer* trc, JitCode* code,
CompactBufferReader& reader) {
while (reader.more()) {
size_t offset = reader.readUnsigned();
InstructionIterator iter((Instruction*)(code->raw() + offset));
@ -1073,7 +1074,8 @@ O2RegRegShift jit::asr(Register r, Register amt) {
static js::jit::DoubleEncoder doubleEncoder;
/* static */ const js::jit::VFPImm js::jit::VFPImm::One(0x3FF00000);
/* static */
const js::jit::VFPImm js::jit::VFPImm::One(0x3FF00000);
js::jit::VFPImm::VFPImm(uint32_t top) {
data_ = -1;
@ -1211,14 +1213,15 @@ BufferOffset Assembler::as_mov(Register dest, Operand2 op2, SBit s,
return as_alu(dest, InvalidReg, op2, OpMov, s, c);
}
/* static */ void Assembler::as_alu_patch(Register dest, Register src1,
Operand2 op2, ALUOp op, SBit s,
Condition c, uint32_t* pos) {
/* static */
void Assembler::as_alu_patch(Register dest, Register src1, Operand2 op2,
ALUOp op, SBit s, Condition c, uint32_t* pos) {
WriteInstStatic(EncodeAlu(dest, src1, op2, op, s, c), pos);
}
/* static */ void Assembler::as_mov_patch(Register dest, Operand2 op2, SBit s,
Condition c, uint32_t* pos) {
/* static */
void Assembler::as_mov_patch(Register dest, Operand2 op2, SBit s, Condition c,
uint32_t* pos) {
as_alu_patch(dest, InvalidReg, op2, OpMov, s, c, pos);
}
@ -1335,8 +1338,9 @@ BufferOffset Assembler::as_movw(Register dest, Imm16 imm, Condition c) {
return writeInst(EncodeMovW(dest, imm, c));
}
/* static */ void Assembler::as_movw_patch(Register dest, Imm16 imm,
Condition c, Instruction* pos) {
/* static */
void Assembler::as_movw_patch(Register dest, Imm16 imm, Condition c,
Instruction* pos) {
WriteInstStatic(EncodeMovW(dest, imm, c), (uint32_t*)pos);
}
@ -1344,8 +1348,9 @@ BufferOffset Assembler::as_movt(Register dest, Imm16 imm, Condition c) {
return writeInst(EncodeMovT(dest, imm, c));
}
/* static */ void Assembler::as_movt_patch(Register dest, Imm16 imm,
Condition c, Instruction* pos) {
/* static */
void Assembler::as_movt_patch(Register dest, Imm16 imm, Condition c,
Instruction* pos) {
WriteInstStatic(EncodeMovT(dest, imm, c), (uint32_t*)pos);
}
@ -1428,9 +1433,9 @@ BufferOffset Assembler::as_dtr(LoadStore ls, int size, Index mode, Register rt,
return writeInst(EncodeDtr(ls, size, mode, rt, addr, c));
}
/* static */ void Assembler::as_dtr_patch(LoadStore ls, int size, Index mode,
Register rt, DTRAddr addr,
Condition c, uint32_t* dest) {
/* static */
void Assembler::as_dtr_patch(LoadStore ls, int size, Index mode, Register rt,
DTRAddr addr, Condition c, uint32_t* dest) {
WriteInstStatic(EncodeDtr(ls, size, mode, rt, addr, c), dest);
}
@ -1594,8 +1599,8 @@ BufferOffset Assembler::as_Imm32Pool(Register dest, uint32_t value,
return offs;
}
/* static */ void Assembler::WritePoolEntry(Instruction* addr, Condition c,
uint32_t data) {
/* static */
void Assembler::WritePoolEntry(Instruction* addr, Condition c, uint32_t data) {
MOZ_ASSERT(addr->is<InstLDR>());
*addr->as<InstLDR>()->dest() = data;
MOZ_ASSERT(addr->extractCond() == c);
@ -1954,8 +1959,8 @@ BufferOffset Assembler::writeVFPInst(vfp_size sz, uint32_t blob) {
return writeInst(VfpTag | sz | blob);
}
/* static */ void Assembler::WriteVFPInstStatic(vfp_size sz, uint32_t blob,
uint32_t* dest) {
/* static */
void Assembler::WriteVFPInstStatic(vfp_size sz, uint32_t blob, uint32_t* dest) {
MOZ_ASSERT((sz & blob) == 0);
MOZ_ASSERT((VfpTag & blob) == 0);
WriteInstStatic(VfpTag | sz | blob, dest);
@ -2146,9 +2151,9 @@ BufferOffset Assembler::as_vdtr(
return writeVFPInst(sz, EncodeVdtr(ls, vd, addr, c));
}
/* static */ void Assembler::as_vdtr_patch(LoadStore ls, VFPRegister vd,
VFPAddr addr, Condition c,
uint32_t* dest) {
/* static */
void Assembler::as_vdtr_patch(LoadStore ls, VFPRegister vd, VFPAddr addr,
Condition c, uint32_t* dest) {
vfp_size sz = vd.isDouble() ? IsDouble : IsSingle;
WriteVFPInstStatic(sz, EncodeVdtr(ls, vd, addr, c), dest);
}
@ -2794,8 +2799,9 @@ SecondScratchRegisterScope::SecondScratchRegisterScope(MacroAssembler& masm)
#ifdef JS_DISASM_ARM
/* static */ void Assembler::disassembleInstruction(const Instruction* i,
DisasmBuffer& buffer) {
/* static */
void Assembler::disassembleInstruction(const Instruction* i,
DisasmBuffer& buffer) {
disasm::NameConverter converter;
disasm::Disassembler dasm(converter);
uint8_t* loc = reinterpret_cast<uint8_t*>(const_cast<uint32_t*>(i->raw()));

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

@ -1036,7 +1036,8 @@ static void FlushICacheLocked(SimulatorProcess::ICacheMap& i_cache,
}
}
/* static */ void SimulatorProcess::checkICacheLocked(SimInstruction* instr) {
/* static */
void SimulatorProcess::checkICacheLocked(SimInstruction* instr) {
intptr_t address = reinterpret_cast<intptr_t>(instr);
void* page = reinterpret_cast<void*>(address & (~CachePage::kPageMask));
void* line = reinterpret_cast<void*>(address & (~CachePage::kLineMask));
@ -1075,7 +1076,8 @@ void Simulator::setLastDebuggerInput(char* input) {
lastDebuggerInput_ = input;
}
/* static */ void SimulatorProcess::FlushICache(void* start_addr, size_t size) {
/* static */
void SimulatorProcess::FlushICache(void* start_addr, size_t size) {
JitSpewCont(JitSpew_CacheFlush, "[%p %zx]", start_addr, size);
if (!ICacheCheckingDisableCount) {
AutoLockSimulatorCache als;
@ -1241,8 +1243,9 @@ SimulatorProcess::~SimulatorProcess() {
}
}
/* static */ void* Simulator::RedirectNativeFunction(void* nativeFunction,
ABIFunctionType type) {
/* static */
void* Simulator::RedirectNativeFunction(void* nativeFunction,
ABIFunctionType type) {
Redirection* redirection = Redirection::Get(nativeFunction, type);
return redirection->addressOfSwiInstruction();
}

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

@ -601,8 +601,9 @@ void Assembler::TraceJumpRelocations(JSTracer* trc, JitCode* code,
}
}
/* static */ void Assembler::TraceDataRelocations(JSTracer* trc, JitCode* code,
CompactBufferReader& reader) {
/* static */
void Assembler::TraceDataRelocations(JSTracer* trc, JitCode* code,
CompactBufferReader& reader) {
uint8_t* buffer = code->raw();
while (reader.more()) {

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

@ -161,8 +161,9 @@ static void TraceOneDataRelocation(JSTracer* trc, Instruction* inst) {
}
}
/* static */ void Assembler::TraceDataRelocations(JSTracer* trc, JitCode* code,
CompactBufferReader& reader) {
/* static */
void Assembler::TraceDataRelocations(JSTracer* trc, JitCode* code,
CompactBufferReader& reader) {
while (reader.more()) {
size_t offset = reader.readUnsigned();
Instruction* inst = (Instruction*)(code->raw() + offset);

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

@ -1114,7 +1114,8 @@ static void FlushICacheLocked(SimulatorProcess::ICacheMap& i_cache,
}
}
/* static */ void SimulatorProcess::checkICacheLocked(SimInstruction* instr) {
/* static */
void SimulatorProcess::checkICacheLocked(SimInstruction* instr) {
intptr_t address = reinterpret_cast<intptr_t>(instr);
void* page = reinterpret_cast<void*>(address & (~CachePage::kPageMask));
void* line = reinterpret_cast<void*>(address & (~CachePage::kLineMask));
@ -1147,7 +1148,8 @@ bool SimulatorProcess::ICacheHasher::match(const Key& k, const Lookup& l) {
return k == l;
}
/* static */ void SimulatorProcess::FlushICache(void* start_addr, size_t size) {
/* static */
void SimulatorProcess::FlushICache(void* start_addr, size_t size) {
if (!ICacheCheckingDisableCount) {
AutoLockSimulatorCache als;
js::jit::FlushICacheLocked(icache(), start_addr, size);
@ -1299,8 +1301,9 @@ SimulatorProcess::~SimulatorProcess() {
}
}
/* static */ void* Simulator::RedirectNativeFunction(void* nativeFunction,
ABIFunctionType type) {
/* static */
void* Simulator::RedirectNativeFunction(void* nativeFunction,
ABIFunctionType type) {
Redirection* redirection = Redirection::Get(nativeFunction, type);
return redirection->addressOfSwiInstruction();
}

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

@ -135,8 +135,9 @@ static void TraceOneDataRelocation(JSTracer* trc, Instruction* inst) {
}
}
/* static */ void Assembler::TraceDataRelocations(JSTracer* trc, JitCode* code,
CompactBufferReader& reader) {
/* static */
void Assembler::TraceDataRelocations(JSTracer* trc, JitCode* code,
CompactBufferReader& reader) {
while (reader.more()) {
size_t offset = reader.readUnsigned();
Instruction* inst = (Instruction*)(code->raw() + offset);

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

@ -1141,7 +1141,8 @@ static void FlushICacheLocked(SimulatorProcess::ICacheMap& i_cache,
}
}
/* static */ void SimulatorProcess::checkICacheLocked(SimInstruction* instr) {
/* static */
void SimulatorProcess::checkICacheLocked(SimInstruction* instr) {
intptr_t address = reinterpret_cast<intptr_t>(instr);
void* page = reinterpret_cast<void*>(address & (~CachePage::kPageMask));
void* line = reinterpret_cast<void*>(address & (~CachePage::kLineMask));
@ -1174,7 +1175,8 @@ bool SimulatorProcess::ICacheHasher::match(const Key& k, const Lookup& l) {
return k == l;
}
/* static */ void SimulatorProcess::FlushICache(void* start_addr, size_t size) {
/* static */
void SimulatorProcess::FlushICache(void* start_addr, size_t size) {
if (!ICacheCheckingDisableCount) {
AutoLockSimulatorCache als;
js::jit::FlushICacheLocked(icache(), start_addr, size);
@ -1326,8 +1328,9 @@ SimulatorProcess::~SimulatorProcess() {
}
}
/* static */ void* Simulator::RedirectNativeFunction(void* nativeFunction,
ABIFunctionType type) {
/* static */
void* Simulator::RedirectNativeFunction(void* nativeFunction,
ABIFunctionType type) {
Redirection* redirection = Redirection::Get(nativeFunction, type);
return redirection->addressOfSwiInstruction();
}

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

@ -36,8 +36,9 @@ void AssemblerX86Shared::copyDataRelocationTable(uint8_t* dest) {
}
}
/* static */ void AssemblerX86Shared::TraceDataRelocations(
JSTracer* trc, JitCode* code, CompactBufferReader& reader) {
/* static */
void AssemblerX86Shared::TraceDataRelocations(JSTracer* trc, JitCode* code,
CompactBufferReader& reader) {
while (reader.more()) {
size_t offset = reader.readUnsigned();
MOZ_ASSERT(offset >= sizeof(void*) && offset <= code->instructionsSize());

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

@ -546,7 +546,8 @@ static bool exn_toSource(JSContext* cx, unsigned argc, Value* vp) {
return true;
}
/* static */ JSObject* ErrorObject::createProto(JSContext* cx, JSProtoKey key) {
/* static */
JSObject* ErrorObject::createProto(JSContext* cx, JSProtoKey key) {
JSExnType type = ExnTypeFromProtoKey(key);
if (type == JSEXN_ERR) {
@ -564,8 +565,8 @@ static bool exn_toSource(JSContext* cx, unsigned argc, Value* vp) {
cx, &ErrorObject::protoClasses[type], protoProto);
}
/* static */ JSObject* ErrorObject::createConstructor(JSContext* cx,
JSProtoKey key) {
/* static */
JSObject* ErrorObject::createConstructor(JSContext* cx, JSProtoKey key) {
JSExnType type = ExnTypeFromProtoKey(key);
RootedObject ctor(cx);

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

@ -162,8 +162,9 @@ JS_FRIEND_API bool js::AppendUnique(JSContext* cx, AutoIdVector& base,
return base.appendAll(uniqueOthers);
}
/* static */ bool Proxy::getPrototype(JSContext* cx, HandleObject proxy,
MutableHandleObject proto) {
/* static */
bool Proxy::getPrototype(JSContext* cx, HandleObject proxy,
MutableHandleObject proto) {
MOZ_ASSERT(proxy->hasDynamicPrototype());
if (!CheckRecursionLimit(cx)) {
return false;
@ -171,9 +172,9 @@ JS_FRIEND_API bool js::AppendUnique(JSContext* cx, AutoIdVector& base,
return proxy->as<ProxyObject>().handler()->getPrototype(cx, proxy, proto);
}
/* static */ bool Proxy::setPrototype(JSContext* cx, HandleObject proxy,
HandleObject proto,
ObjectOpResult& result) {
/* static */
bool Proxy::setPrototype(JSContext* cx, HandleObject proxy, HandleObject proto,
ObjectOpResult& result) {
MOZ_ASSERT(proxy->hasDynamicPrototype());
if (!CheckRecursionLimit(cx)) {
return false;
@ -182,10 +183,10 @@ JS_FRIEND_API bool js::AppendUnique(JSContext* cx, AutoIdVector& base,
result);
}
/* static */ bool Proxy::getPrototypeIfOrdinary(JSContext* cx,
HandleObject proxy,
bool* isOrdinary,
MutableHandleObject proto) {
/* static */
bool Proxy::getPrototypeIfOrdinary(JSContext* cx, HandleObject proxy,
bool* isOrdinary,
MutableHandleObject proto) {
if (!CheckRecursionLimit(cx)) {
return false;
}
@ -193,9 +194,9 @@ JS_FRIEND_API bool js::AppendUnique(JSContext* cx, AutoIdVector& base,
cx, proxy, isOrdinary, proto);
}
/* static */ bool Proxy::setImmutablePrototype(JSContext* cx,
HandleObject proxy,
bool* succeeded) {
/* static */
bool Proxy::setImmutablePrototype(JSContext* cx, HandleObject proxy,
bool* succeeded) {
if (!CheckRecursionLimit(cx)) {
return false;
}
@ -203,8 +204,9 @@ JS_FRIEND_API bool js::AppendUnique(JSContext* cx, AutoIdVector& base,
return handler->setImmutablePrototype(cx, proxy, succeeded);
}
/* static */ bool Proxy::preventExtensions(JSContext* cx, HandleObject proxy,
ObjectOpResult& result) {
/* static */
bool Proxy::preventExtensions(JSContext* cx, HandleObject proxy,
ObjectOpResult& result) {
if (!CheckRecursionLimit(cx)) {
return false;
}
@ -212,8 +214,8 @@ JS_FRIEND_API bool js::AppendUnique(JSContext* cx, AutoIdVector& base,
return handler->preventExtensions(cx, proxy, result);
}
/* static */ bool Proxy::isExtensible(JSContext* cx, HandleObject proxy,
bool* extensible) {
/* static */
bool Proxy::isExtensible(JSContext* cx, HandleObject proxy, bool* extensible) {
if (!CheckRecursionLimit(cx)) {
return false;
}
@ -612,9 +614,9 @@ bool Proxy::boxedValue_unbox(JSContext* cx, HandleObject proxy,
JSObject* const TaggedProto::LazyProto = reinterpret_cast<JSObject*>(0x1);
/* static */ bool Proxy::getElements(JSContext* cx, HandleObject proxy,
uint32_t begin, uint32_t end,
ElementAdder* adder) {
/* static */
bool Proxy::getElements(JSContext* cx, HandleObject proxy, uint32_t begin,
uint32_t end, ElementAdder* adder) {
if (!CheckRecursionLimit(cx)) {
return false;
}
@ -632,7 +634,8 @@ JSObject* const TaggedProto::LazyProto = reinterpret_cast<JSObject*>(0x1);
return handler->getElements(cx, proxy, begin, end, adder);
}
/* static */ void Proxy::trace(JSTracer* trc, JSObject* proxy) {
/* static */
void Proxy::trace(JSTracer* trc, JSObject* proxy) {
const BaseProxyHandler* handler = proxy->as<ProxyObject>().handler();
handler->trace(trc, proxy);
}
@ -663,12 +666,13 @@ static bool proxy_DeleteProperty(JSContext* cx, HandleObject obj, HandleId id,
return SuppressDeletedProperty(cx, obj, id); // XXX is this necessary?
}
/* static */ void ProxyObject::traceEdgeToTarget(JSTracer* trc,
ProxyObject* obj) {
/* static */
void ProxyObject::traceEdgeToTarget(JSTracer* trc, ProxyObject* obj) {
TraceCrossCompartmentEdge(trc, obj, obj->slotOfPrivate(), "proxy target");
}
/* static */ void ProxyObject::trace(JSTracer* trc, JSObject* obj) {
/* static */
void ProxyObject::trace(JSTracer* trc, JSObject* obj) {
ProxyObject* proxy = &obj->as<ProxyObject>();
TraceEdge(trc, proxy->shapePtr(), "ProxyObject_shape");

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

@ -166,8 +166,8 @@ static bool IsCompatiblePropertyDescriptor(JSContext* cx, bool extensible,
}
// Get the [[ProxyHandler]] of a scripted proxy.
/* static */ JSObject* ScriptedProxyHandler::handlerObject(
const JSObject* proxy) {
/* static */
JSObject* ScriptedProxyHandler::handlerObject(const JSObject* proxy) {
MOZ_ASSERT(proxy->as<ProxyObject>().handler() ==
&ScriptedProxyHandler::singleton);
return proxy->as<ProxyObject>()

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

@ -380,8 +380,8 @@ static bool osfile_writeTypedArrayToFile(JSContext* cx, unsigned argc,
return true;
}
/* static */ RCFile* RCFile::create(JSContext* cx, const char* filename,
const char* mode) {
/* static */
RCFile* RCFile::create(JSContext* cx, const char* filename, const char* mode) {
FILE* fp = fopen(filename, mode);
if (!fp) {
return nullptr;

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

@ -14,9 +14,11 @@ using namespace js;
MOZ_THREAD_LOCAL(js::Mutex::MutexVector*) js::Mutex::HeldMutexStack;
/* static */ bool js::Mutex::Init() { return HeldMutexStack.init(); }
/* static */
bool js::Mutex::Init() { return HeldMutexStack.init(); }
/* static */ void js::Mutex::ShutDown() {
/* static */
void js::Mutex::ShutDown() {
js_delete(HeldMutexStack.get());
HeldMutexStack.set(nullptr);
}

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

@ -102,7 +102,8 @@ static bool MatchJSScript(JSScript* script, const char* pattern) {
return result != nullptr;
}
/* static */ bool StructuredSpewer::enabled(JSScript* script) {
/* static */
bool StructuredSpewer::enabled(JSScript* script) {
// We cannot call getenv under record/replay.
if (mozilla::recordreplay::IsRecordingOrReplaying()) {
return false;
@ -139,8 +140,9 @@ void StructuredSpewer::startObject(JSContext* cx, const JSScript* script,
json.endObject();
}
/* static */ void StructuredSpewer::spew(JSContext* cx, SpewChannel channel,
const char* fmt, ...) {
/* static */
void StructuredSpewer::spew(JSContext* cx, SpewChannel channel, const char* fmt,
...) {
// Because we don't have a script here, use the singleton's
// filter to determine if the channel is active.
if (!cx->spewer().filter().enabled(channel)) {

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

@ -24,13 +24,15 @@ using namespace js;
using JS::AutoStableStringChars;
/* static */ size_t RareArgumentsData::bytesRequired(size_t numActuals) {
/* static */
size_t RareArgumentsData::bytesRequired(size_t numActuals) {
size_t extraBytes = NumWordsForBitArrayOfLength(numActuals) * sizeof(size_t);
return offsetof(RareArgumentsData, deletedBits_) + extraBytes;
}
/* static */ RareArgumentsData* RareArgumentsData::create(
JSContext* cx, ArgumentsObject* obj) {
/* static */
RareArgumentsData* RareArgumentsData::create(JSContext* cx,
ArgumentsObject* obj) {
size_t bytes = RareArgumentsData::bytesRequired(obj->initialLength());
uint8_t* data = AllocateObjectBuffer<uint8_t>(cx, obj, bytes);
@ -80,8 +82,10 @@ static void CopyStackFrameArguments(const AbstractFramePtr frame,
}
}
/* static */ void ArgumentsObject::MaybeForwardToCallObject(
AbstractFramePtr frame, ArgumentsObject* obj, ArgumentsData* data) {
/* static */
void ArgumentsObject::MaybeForwardToCallObject(AbstractFramePtr frame,
ArgumentsObject* obj,
ArgumentsData* data) {
JSScript* script = frame.script();
if (frame.callee()->needsCallObject() && script->argumentsAliasesFormals()) {
obj->initFixedSlot(MAYBE_CALL_SLOT, ObjectValue(frame.callObj()));
@ -93,9 +97,11 @@ static void CopyStackFrameArguments(const AbstractFramePtr frame,
}
}
/* static */ void ArgumentsObject::MaybeForwardToCallObject(
jit::JitFrameLayout* frame, HandleObject callObj, ArgumentsObject* obj,
ArgumentsData* data) {
/* static */
void ArgumentsObject::MaybeForwardToCallObject(jit::JitFrameLayout* frame,
HandleObject callObj,
ArgumentsObject* obj,
ArgumentsData* data) {
JSFunction* callee = jit::CalleeTokenToFunction(frame->calleeToken());
JSScript* script = callee->nonLazyScript();
if (callee->needsCallObject() && script->argumentsAliasesFormals()) {
@ -263,10 +269,9 @@ ArgumentsObject* Realm::getOrCreateArgumentsTemplateObject(JSContext* cx,
}
template <typename CopyArgs>
/* static */ ArgumentsObject* ArgumentsObject::create(JSContext* cx,
HandleFunction callee,
unsigned numActuals,
CopyArgs& copy) {
/* static */
ArgumentsObject* ArgumentsObject::create(JSContext* cx, HandleFunction callee,
unsigned numActuals, CopyArgs& copy) {
bool mapped = callee->nonLazyScript()->hasMappedArgsObj();
ArgumentsObject* templateObj =
cx->realm()->getOrCreateArgumentsTemplateObject(cx, mapped);
@ -369,9 +374,11 @@ ArgumentsObject* ArgumentsObject::createForIon(JSContext* cx,
return create(cx, callee, frame->numActualArgs(), copy);
}
/* static */ ArgumentsObject* ArgumentsObject::finishForIonPure(
JSContext* cx, jit::JitFrameLayout* frame, JSObject* scopeChain,
ArgumentsObject* obj) {
/* static */
ArgumentsObject* ArgumentsObject::finishForIonPure(JSContext* cx,
jit::JitFrameLayout* frame,
JSObject* scopeChain,
ArgumentsObject* obj) {
// JIT code calls this directly (no callVM), because it's faster, so we're
// not allowed to GC in here.
AutoUnsafeCallWithABI unsafe;
@ -415,10 +422,9 @@ ArgumentsObject* ArgumentsObject::createForIon(JSContext* cx,
return obj;
}
/* static */ bool ArgumentsObject::obj_delProperty(JSContext* cx,
HandleObject obj,
HandleId id,
ObjectOpResult& result) {
/* static */
bool ArgumentsObject::obj_delProperty(JSContext* cx, HandleObject obj,
HandleId id, ObjectOpResult& result) {
ArgumentsObject& argsobj = obj->as<ArgumentsObject>();
if (JSID_IS_INT(id)) {
unsigned arg = unsigned(JSID_TO_INT(id));
@ -438,8 +444,9 @@ ArgumentsObject* ArgumentsObject::createForIon(JSContext* cx,
return result.succeed();
}
/* static */ bool ArgumentsObject::obj_mayResolve(const JSAtomState& names,
jsid id, JSObject*) {
/* static */
bool ArgumentsObject::obj_mayResolve(const JSAtomState& names, jsid id,
JSObject*) {
// Arguments might resolve indexes, Symbol.iterator, or length/callee.
if (JSID_IS_ATOM(id)) {
JSAtom* atom = JSID_TO_ATOM(id);
@ -543,8 +550,8 @@ static bool DefineArgumentsIterator(JSContext* cx,
JSPROP_RESOLVING);
}
/* static */ bool ArgumentsObject::reifyLength(JSContext* cx,
Handle<ArgumentsObject*> obj) {
/* static */
bool ArgumentsObject::reifyLength(JSContext* cx, Handle<ArgumentsObject*> obj) {
if (obj->hasOverriddenLength()) {
return true;
}
@ -559,8 +566,9 @@ static bool DefineArgumentsIterator(JSContext* cx,
return true;
}
/* static */ bool ArgumentsObject::reifyIterator(JSContext* cx,
Handle<ArgumentsObject*> obj) {
/* static */
bool ArgumentsObject::reifyIterator(JSContext* cx,
Handle<ArgumentsObject*> obj) {
if (obj->hasOverriddenIterator()) {
return true;
}
@ -573,10 +581,9 @@ static bool DefineArgumentsIterator(JSContext* cx,
return true;
}
/* static */ bool MappedArgumentsObject::obj_resolve(JSContext* cx,
HandleObject obj,
HandleId id,
bool* resolvedp) {
/* static */
bool MappedArgumentsObject::obj_resolve(JSContext* cx, HandleObject obj,
HandleId id, bool* resolvedp) {
Rooted<MappedArgumentsObject*> argsobj(cx, &obj->as<MappedArgumentsObject>());
if (JSID_IS_SYMBOL(id) &&
@ -623,8 +630,8 @@ static bool DefineArgumentsIterator(JSContext* cx,
return true;
}
/* static */ bool MappedArgumentsObject::obj_enumerate(JSContext* cx,
HandleObject obj) {
/* static */
bool MappedArgumentsObject::obj_enumerate(JSContext* cx, HandleObject obj) {
Rooted<MappedArgumentsObject*> argsobj(cx, &obj->as<MappedArgumentsObject>());
RootedId id(cx);
@ -657,9 +664,11 @@ static bool DefineArgumentsIterator(JSContext* cx,
}
// ES 2017 draft 9.4.4.2
/* static */ bool MappedArgumentsObject::obj_defineProperty(
JSContext* cx, HandleObject obj, HandleId id,
Handle<PropertyDescriptor> desc, ObjectOpResult& result) {
/* static */
bool MappedArgumentsObject::obj_defineProperty(JSContext* cx, HandleObject obj,
HandleId id,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result) {
// Step 1.
Rooted<MappedArgumentsObject*> argsobj(cx, &obj->as<MappedArgumentsObject>());
@ -794,10 +803,9 @@ static bool UnmappedArgSetter(JSContext* cx, HandleObject obj, HandleId id,
NativeDefineDataProperty(cx, argsobj, id, v, attrs, result);
}
/* static */ bool UnmappedArgumentsObject::obj_resolve(JSContext* cx,
HandleObject obj,
HandleId id,
bool* resolvedp) {
/* static */
bool UnmappedArgumentsObject::obj_resolve(JSContext* cx, HandleObject obj,
HandleId id, bool* resolvedp) {
Rooted<UnmappedArgumentsObject*> argsobj(cx,
&obj->as<UnmappedArgumentsObject>());
@ -857,8 +865,8 @@ static bool UnmappedArgSetter(JSContext* cx, HandleObject obj, HandleId id,
return true;
}
/* static */ bool UnmappedArgumentsObject::obj_enumerate(JSContext* cx,
HandleObject obj) {
/* static */
bool UnmappedArgumentsObject::obj_enumerate(JSContext* cx, HandleObject obj) {
Rooted<UnmappedArgumentsObject*> argsobj(cx,
&obj->as<UnmappedArgumentsObject>());
@ -907,7 +915,8 @@ void ArgumentsObject::trace(JSTracer* trc, JSObject* obj) {
}
}
/* static */ size_t ArgumentsObject::objectMoved(JSObject* dst, JSObject* src) {
/* static */
size_t ArgumentsObject::objectMoved(JSObject* dst, JSObject* src) {
ArgumentsObject* ndst = &dst->as<ArgumentsObject>();
const ArgumentsObject* nsrc = &src->as<ArgumentsObject>();
MOZ_ASSERT(ndst->data() == nsrc->data());

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

@ -463,8 +463,9 @@ static uint8_t* NewCopiedBufferContents(JSContext* cx,
return dataCopy;
}
/* static */ void ArrayBufferObject::detach(JSContext* cx,
Handle<ArrayBufferObject*> buffer) {
/* static */
void ArrayBufferObject::detach(JSContext* cx,
Handle<ArrayBufferObject*> buffer) {
cx->check(buffer);
MOZ_ASSERT(!buffer->isPreparedForAsmJS());
@ -683,7 +684,8 @@ class js::WasmArrayRawBuffer {
#endif // WASM_HUGE_MEMORY
};
/* static */ WasmArrayRawBuffer* WasmArrayRawBuffer::Allocate(
/* static */
WasmArrayRawBuffer* WasmArrayRawBuffer::Allocate(
uint32_t numBytes, const Maybe<uint32_t>& maxSize) {
MOZ_RELEASE_ASSERT(numBytes <= ArrayBufferObject::MaxBufferByteLength);
@ -715,7 +717,8 @@ class js::WasmArrayRawBuffer {
return rawBuf;
}
/* static */ void WasmArrayRawBuffer::Release(void* mem) {
/* static */
void WasmArrayRawBuffer::Release(void* mem) {
WasmArrayRawBuffer* header =
(WasmArrayRawBuffer*)((uint8_t*)mem - sizeof(WasmArrayRawBuffer));
@ -1029,7 +1032,8 @@ static void CheckStealPreconditions(Handle<ArrayBufferObject*> buffer,
"asm.js-prepared buffers don't have detachable/stealable data");
}
/* static */ bool ArrayBufferObject::wasmGrowToSizeInPlace(
/* static */
bool ArrayBufferObject::wasmGrowToSizeInPlace(
uint32_t newSize, HandleArrayBufferObject oldBuf,
MutableHandleArrayBufferObject newBuf, JSContext* cx) {
CheckStealPreconditions(oldBuf, cx);
@ -1073,7 +1077,8 @@ static void CheckStealPreconditions(Handle<ArrayBufferObject*> buffer,
}
#ifndef WASM_HUGE_MEMORY
/* static */ bool ArrayBufferObject::wasmMovingGrowToSize(
/* static */
bool ArrayBufferObject::wasmMovingGrowToSize(
uint32_t newSize, HandleArrayBufferObject oldBuf,
MutableHandleArrayBufferObject newBuf, JSContext* cx) {
// On failure, do not throw and ensure that the original buffer is
@ -1403,7 +1408,8 @@ ArrayBufferObject::extractStructuredCloneContents(
return BufferContents::createFailed();
}
/* static */ void ArrayBufferObject::addSizeOfExcludingThis(
/* static */
void ArrayBufferObject::addSizeOfExcludingThis(
JSObject* obj, mozilla::MallocSizeOf mallocSizeOf, JS::ClassInfo* info) {
ArrayBufferObject& buffer = AsArrayBuffer(obj);
switch (buffer.bufferKind()) {
@ -1443,13 +1449,16 @@ ArrayBufferObject::extractStructuredCloneContents(
}
}
/* static */ void ArrayBufferObject::finalize(FreeOp* fop, JSObject* obj) {
/* static */
void ArrayBufferObject::finalize(FreeOp* fop, JSObject* obj) {
obj->as<ArrayBufferObject>().releaseData(fop);
}
/* static */ void ArrayBufferObject::copyData(
Handle<ArrayBufferObject*> toBuffer, uint32_t toIndex,
Handle<ArrayBufferObject*> fromBuffer, uint32_t fromIndex, uint32_t count) {
/* static */
void ArrayBufferObject::copyData(Handle<ArrayBufferObject*> toBuffer,
uint32_t toIndex,
Handle<ArrayBufferObject*> fromBuffer,
uint32_t fromIndex, uint32_t count) {
MOZ_ASSERT(toBuffer->byteLength() >= count);
MOZ_ASSERT(toBuffer->byteLength() >= toIndex + count);
MOZ_ASSERT(fromBuffer->byteLength() >= fromIndex);
@ -1459,8 +1468,8 @@ ArrayBufferObject::extractStructuredCloneContents(
fromBuffer->dataPointer() + fromIndex, count);
}
/* static */ size_t ArrayBufferObject::objectMoved(JSObject* obj,
JSObject* old) {
/* static */
size_t ArrayBufferObject::objectMoved(JSObject* obj, JSObject* old) {
ArrayBufferObject& dst = obj->as<ArrayBufferObject>();
const ArrayBufferObject& src = old->as<ArrayBufferObject>();
@ -1568,8 +1577,8 @@ void InnerViewTable::removeViews(ArrayBufferObject* buffer) {
map.remove(p);
}
/* static */ bool InnerViewTable::sweepEntry(JSObject** pkey,
ViewVector& views) {
/* static */
bool InnerViewTable::sweepEntry(JSObject** pkey, ViewVector& views) {
if (IsAboutToBeFinalizedUnbarriered(pkey)) {
return true;
}

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

@ -22,8 +22,8 @@ using namespace js;
* a custom tracer to move the object's data pointer if its owner was moved and
* stores its data inline.
*/
/* static */ void ArrayBufferViewObject::trace(JSTracer* trc,
JSObject* objArg) {
/* static */
void ArrayBufferViewObject::trace(JSTracer* trc, JSObject* objArg) {
NativeObject* obj = &objArg->as<NativeObject>();
HeapSlot& bufSlot = obj->getFixedSlotRef(BUFFER_SLOT);
TraceEdge(trc, &bufSlot, "ArrayBufferViewObject.buffer");
@ -72,7 +72,8 @@ void ArrayBufferViewObject::setDataPointerUnshared(uint8_t* data) {
setPrivate(data);
}
/* static */ ArrayBufferObjectMaybeShared* ArrayBufferViewObject::bufferObject(
/* static */
ArrayBufferObjectMaybeShared* ArrayBufferViewObject::bufferObject(
JSContext* cx, Handle<ArrayBufferViewObject*> thisObject) {
if (thisObject->is<TypedArrayObject>()) {
Rooted<TypedArrayObject*> typedArray(cx,

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

@ -21,8 +21,9 @@ using namespace js;
using mozilla::Maybe;
/* static */ bool GlobalObject::initAsyncFunction(
JSContext* cx, Handle<GlobalObject*> global) {
/* static */
bool GlobalObject::initAsyncFunction(JSContext* cx,
Handle<GlobalObject*> global) {
if (global->getReservedSlot(ASYNC_FUNCTION_PROTO).isObject()) {
return true;
}

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

@ -65,8 +65,9 @@ JSObject* js::CreateAsyncFromSyncIterator(JSContext* cx, HandleObject iter,
}
// Async Iteration proposal 11.1.3.1 steps 2-4.
/* static */ JSObject* AsyncFromSyncIteratorObject::create(
JSContext* cx, HandleObject iter, HandleValue nextMethod) {
/* static */
JSObject* AsyncFromSyncIteratorObject::create(JSContext* cx, HandleObject iter,
HandleValue nextMethod) {
// Step 2.
RootedObject proto(cx,
GlobalObject::getOrCreateAsyncFromSyncIteratorPrototype(
@ -162,8 +163,9 @@ static AsyncGeneratorObject* OrdinaryCreateFromConstructorAsynGen(
return NewObjectWithGivenProto<AsyncGeneratorObject>(cx, proto);
}
/* static */ AsyncGeneratorObject* AsyncGeneratorObject::create(
JSContext* cx, HandleFunction asyncGen) {
/* static */
AsyncGeneratorObject* AsyncGeneratorObject::create(JSContext* cx,
HandleFunction asyncGen) {
MOZ_ASSERT(asyncGen->isAsync() && asyncGen->isGenerator());
AsyncGeneratorObject* asyncGenObj =
@ -186,7 +188,8 @@ static AsyncGeneratorObject* OrdinaryCreateFromConstructorAsynGen(
return asyncGenObj;
}
/* static */ AsyncGeneratorRequest* AsyncGeneratorObject::createRequest(
/* static */
AsyncGeneratorRequest* AsyncGeneratorObject::createRequest(
JSContext* cx, Handle<AsyncGeneratorObject*> asyncGenObj,
CompletionKind completionKind, HandleValue completionValue,
Handle<PromiseObject*> promise) {
@ -232,7 +235,8 @@ static AsyncGeneratorObject* OrdinaryCreateFromConstructorAsynGen(
return queue->append(cx, requestVal);
}
/* static */ AsyncGeneratorRequest* AsyncGeneratorObject::dequeueRequest(
/* static */
AsyncGeneratorRequest* AsyncGeneratorObject::dequeueRequest(
JSContext* cx, Handle<AsyncGeneratorObject*> asyncGenObj) {
if (asyncGenObj->isSingleQueue()) {
AsyncGeneratorRequest* request = asyncGenObj->singleQueueRequest();
@ -244,7 +248,8 @@ static AsyncGeneratorObject* OrdinaryCreateFromConstructorAsynGen(
return &queue->popFirstAs<AsyncGeneratorRequest>(cx);
}
/* static */ AsyncGeneratorRequest* AsyncGeneratorObject::peekRequest(
/* static */
AsyncGeneratorRequest* AsyncGeneratorObject::peekRequest(
Handle<AsyncGeneratorObject*> asyncGenObj) {
if (asyncGenObj->isSingleQueue()) {
return asyncGenObj->singleQueueRequest();
@ -258,7 +263,8 @@ const Class AsyncGeneratorRequest::class_ = {
JSCLASS_HAS_RESERVED_SLOTS(AsyncGeneratorRequest::Slots)};
// Async Iteration proposal 11.4.3.1.
/* static */ AsyncGeneratorRequest* AsyncGeneratorRequest::create(
/* static */
AsyncGeneratorRequest* AsyncGeneratorRequest::create(
JSContext* cx, CompletionKind completionKind, HandleValue completionValue,
Handle<PromiseObject*> promise) {
AsyncGeneratorRequest* request =

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

@ -405,8 +405,8 @@ void Compartment::traceOutgoingCrossCompartmentWrappers(JSTracer* trc) {
}
}
/* static */ void Compartment::traceIncomingCrossCompartmentEdgesForZoneGC(
JSTracer* trc) {
/* static */
void Compartment::traceIncomingCrossCompartmentEdgesForZoneGC(JSTracer* trc) {
gcstats::AutoPhase ap(trc->runtime()->gc.stats(),
gcstats::PhaseKind::MARK_CCWS);
MOZ_ASSERT(JS::RuntimeHeapIsMajorCollecting());
@ -447,8 +447,8 @@ bool CrossCompartmentKey::needsSweep() {
return applyToWrapped(needsSweep) || applyToDebugger(needsSweep);
}
/* static */ void Compartment::fixupCrossCompartmentWrappersAfterMovingGC(
JSTracer* trc) {
/* static */
void Compartment::fixupCrossCompartmentWrappersAfterMovingGC(JSTracer* trc) {
MOZ_ASSERT(trc->runtime()->gc.isHeapCompacting());
for (CompartmentsIter comp(trc->runtime()); !comp.done(); comp.next()) {

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

@ -520,7 +520,8 @@ bool js::InitDateTimeState() {
return true;
}
/* static */ void js::FinishDateTimeState() {
/* static */
void js::FinishDateTimeState() {
js_delete(IcuTimeZoneState);
IcuTimeZoneState = nullptr;

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -35,8 +35,8 @@ using namespace js;
using mozilla::Maybe;
using mozilla::Nothing;
/* static */ DebuggerMemory* DebuggerMemory::create(JSContext* cx,
Debugger* dbg) {
/* static */
DebuggerMemory* DebuggerMemory::create(JSContext* cx, Debugger* dbg) {
Value memoryProtoValue =
dbg->object->getReservedSlot(Debugger::JSSLOT_DEBUG_MEMORY_PROTO);
RootedObject memoryProto(cx, &memoryProtoValue.toObject());
@ -58,8 +58,8 @@ Debugger* DebuggerMemory::getDebugger() {
return Debugger::fromJSObject(&dbgVal.toObject());
}
/* static */ bool DebuggerMemory::construct(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool DebuggerMemory::construct(JSContext* cx, unsigned argc, Value* vp) {
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_NO_CONSTRUCTOR,
"Debugger.Source");
return false;
@ -68,9 +68,9 @@ Debugger* DebuggerMemory::getDebugger() {
/* static */ const Class DebuggerMemory::class_ = {
"Memory", JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_COUNT)};
/* static */ DebuggerMemory* DebuggerMemory::checkThis(JSContext* cx,
CallArgs& args,
const char* fnName) {
/* static */
DebuggerMemory* DebuggerMemory::checkThis(JSContext* cx, CallArgs& args,
const char* fnName) {
const Value& thisValue = args.thisv();
if (!thisValue.isObject()) {
@ -127,9 +127,9 @@ static bool undefined(CallArgs& args) {
return true;
}
/* static */ bool DebuggerMemory::setTrackingAllocationSites(JSContext* cx,
unsigned argc,
Value* vp) {
/* static */
bool DebuggerMemory::setTrackingAllocationSites(JSContext* cx, unsigned argc,
Value* vp) {
THIS_DEBUGGER_MEMORY(cx, argc, vp, "(set trackingAllocationSites)", args,
memory);
if (!args.requireAtLeast(cx, "(set trackingAllocationSites)", 1)) {
@ -161,18 +161,18 @@ static bool undefined(CallArgs& args) {
return undefined(args);
}
/* static */ bool DebuggerMemory::getTrackingAllocationSites(JSContext* cx,
unsigned argc,
Value* vp) {
/* static */
bool DebuggerMemory::getTrackingAllocationSites(JSContext* cx, unsigned argc,
Value* vp) {
THIS_DEBUGGER_MEMORY(cx, argc, vp, "(get trackingAllocationSites)", args,
memory);
args.rval().setBoolean(memory->getDebugger()->trackingAllocationSites);
return true;
}
/* static */ bool DebuggerMemory::drainAllocationsLog(JSContext* cx,
unsigned argc,
Value* vp) {
/* static */
bool DebuggerMemory::drainAllocationsLog(JSContext* cx, unsigned argc,
Value* vp) {
THIS_DEBUGGER_MEMORY(cx, argc, vp, "drainAllocationsLog", args, memory);
Debugger* dbg = memory->getDebugger();
@ -256,18 +256,18 @@ static bool undefined(CallArgs& args) {
return true;
}
/* static */ bool DebuggerMemory::getMaxAllocationsLogLength(JSContext* cx,
unsigned argc,
Value* vp) {
/* static */
bool DebuggerMemory::getMaxAllocationsLogLength(JSContext* cx, unsigned argc,
Value* vp) {
THIS_DEBUGGER_MEMORY(cx, argc, vp, "(get maxAllocationsLogLength)", args,
memory);
args.rval().setInt32(memory->getDebugger()->maxAllocationsLogLength);
return true;
}
/* static */ bool DebuggerMemory::setMaxAllocationsLogLength(JSContext* cx,
unsigned argc,
Value* vp) {
/* static */
bool DebuggerMemory::setMaxAllocationsLogLength(JSContext* cx, unsigned argc,
Value* vp) {
THIS_DEBUGGER_MEMORY(cx, argc, vp, "(set maxAllocationsLogLength)", args,
memory);
if (!args.requireAtLeast(cx, "(set maxAllocationsLogLength)", 1)) {
@ -297,16 +297,20 @@ static bool undefined(CallArgs& args) {
return true;
}
/* static */ bool DebuggerMemory::getAllocationSamplingProbability(
JSContext* cx, unsigned argc, Value* vp) {
/* static */
bool DebuggerMemory::getAllocationSamplingProbability(JSContext* cx,
unsigned argc,
Value* vp) {
THIS_DEBUGGER_MEMORY(cx, argc, vp, "(get allocationSamplingProbability)",
args, memory);
args.rval().setDouble(memory->getDebugger()->allocationSamplingProbability);
return true;
}
/* static */ bool DebuggerMemory::setAllocationSamplingProbability(
JSContext* cx, unsigned argc, Value* vp) {
/* static */
bool DebuggerMemory::setAllocationSamplingProbability(JSContext* cx,
unsigned argc,
Value* vp) {
THIS_DEBUGGER_MEMORY(cx, argc, vp, "(set allocationSamplingProbability)",
args, memory);
if (!args.requireAtLeast(cx, "(set allocationSamplingProbability)", 1)) {
@ -344,26 +348,26 @@ static bool undefined(CallArgs& args) {
return true;
}
/* static */ bool DebuggerMemory::getAllocationsLogOverflowed(JSContext* cx,
unsigned argc,
Value* vp) {
/* static */
bool DebuggerMemory::getAllocationsLogOverflowed(JSContext* cx, unsigned argc,
Value* vp) {
THIS_DEBUGGER_MEMORY(cx, argc, vp, "(get allocationsLogOverflowed)", args,
memory);
args.rval().setBoolean(memory->getDebugger()->allocationsLogOverflowed);
return true;
}
/* static */ bool DebuggerMemory::getOnGarbageCollection(JSContext* cx,
unsigned argc,
Value* vp) {
/* static */
bool DebuggerMemory::getOnGarbageCollection(JSContext* cx, unsigned argc,
Value* vp) {
THIS_DEBUGGER_MEMORY(cx, argc, vp, "(get onGarbageCollection)", args, memory);
return Debugger::getHookImpl(cx, args, *memory->getDebugger(),
Debugger::OnGarbageCollection);
}
/* static */ bool DebuggerMemory::setOnGarbageCollection(JSContext* cx,
unsigned argc,
Value* vp) {
/* static */
bool DebuggerMemory::setOnGarbageCollection(JSContext* cx, unsigned argc,
Value* vp) {
THIS_DEBUGGER_MEMORY(cx, argc, vp, "(set onGarbageCollection)", args, memory);
return Debugger::setHookImpl(cx, args, *memory->getDebugger(),
Debugger::OnGarbageCollection);

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

@ -226,9 +226,11 @@ const Class CallObject::class_ = {
/*****************************************************************************/
/* static */ VarEnvironmentObject* VarEnvironmentObject::create(
JSContext* cx, HandleShape shape, HandleObject enclosing,
gc::InitialHeap heap) {
/* static */
VarEnvironmentObject* VarEnvironmentObject::create(JSContext* cx,
HandleShape shape,
HandleObject enclosing,
gc::InitialHeap heap) {
MOZ_ASSERT(shape->getObjectClass() == &class_);
RootedObjectGroup group(
@ -254,8 +256,10 @@ const Class CallObject::class_ = {
return env;
}
/* static */ VarEnvironmentObject* VarEnvironmentObject::create(
JSContext* cx, HandleScope scope, AbstractFramePtr frame) {
/* static */
VarEnvironmentObject* VarEnvironmentObject::create(JSContext* cx,
HandleScope scope,
AbstractFramePtr frame) {
#ifdef DEBUG
if (frame.isEvalFrame()) {
MOZ_ASSERT(scope->is<EvalScope>() && scope == frame.script()->bodyScope());
@ -283,7 +287,8 @@ const Class CallObject::class_ = {
return env;
}
/* static */ VarEnvironmentObject* VarEnvironmentObject::createHollowForDebug(
/* static */
VarEnvironmentObject* VarEnvironmentObject::createHollowForDebug(
JSContext* cx, Handle<VarScope*> scope) {
MOZ_ASSERT(!scope->hasEnvironment());
@ -346,7 +351,8 @@ const Class ModuleEnvironmentObject::class_ = {
JS_NULL_CLASS_EXT,
&ModuleEnvironmentObject::objectOps_};
/* static */ ModuleEnvironmentObject* ModuleEnvironmentObject::create(
/* static */
ModuleEnvironmentObject* ModuleEnvironmentObject::create(
JSContext* cx, HandleModuleObject module) {
RootedScript script(cx, module->script());
RootedShape shape(cx,
@ -435,7 +441,8 @@ void ModuleEnvironmentObject::fixEnclosingEnvironmentAfterCompartmentMerge(
setEnclosingEnvironment(&global.lexicalEnvironment());
}
/* static */ bool ModuleEnvironmentObject::lookupProperty(
/* static */
bool ModuleEnvironmentObject::lookupProperty(
JSContext* cx, HandleObject obj, HandleId id, MutableHandleObject objp,
MutableHandle<PropertyResult> propp) {
const IndirectBindingMap& bindings =
@ -457,10 +464,9 @@ void ModuleEnvironmentObject::fixEnclosingEnvironmentAfterCompartmentMerge(
return true;
}
/* static */ bool ModuleEnvironmentObject::hasProperty(JSContext* cx,
HandleObject obj,
HandleId id,
bool* foundp) {
/* static */
bool ModuleEnvironmentObject::hasProperty(JSContext* cx, HandleObject obj,
HandleId id, bool* foundp) {
if (obj->as<ModuleEnvironmentObject>().importBindings().has(id)) {
*foundp = true;
return true;
@ -470,11 +476,10 @@ void ModuleEnvironmentObject::fixEnclosingEnvironmentAfterCompartmentMerge(
return NativeHasProperty(cx, self, id, foundp);
}
/* static */ bool ModuleEnvironmentObject::getProperty(JSContext* cx,
HandleObject obj,
HandleValue receiver,
HandleId id,
MutableHandleValue vp) {
/* static */
bool ModuleEnvironmentObject::getProperty(JSContext* cx, HandleObject obj,
HandleValue receiver, HandleId id,
MutableHandleValue vp) {
const IndirectBindingMap& bindings =
obj->as<ModuleEnvironmentObject>().importBindings();
Shape* shape;
@ -488,9 +493,11 @@ void ModuleEnvironmentObject::fixEnclosingEnvironmentAfterCompartmentMerge(
return NativeGetProperty(cx, self, receiver, id, vp);
}
/* static */ bool ModuleEnvironmentObject::setProperty(
JSContext* cx, HandleObject obj, HandleId id, HandleValue v,
HandleValue receiver, JS::ObjectOpResult& result) {
/* static */
bool ModuleEnvironmentObject::setProperty(JSContext* cx, HandleObject obj,
HandleId id, HandleValue v,
HandleValue receiver,
JS::ObjectOpResult& result) {
RootedModuleEnvironmentObject self(cx, &obj->as<ModuleEnvironmentObject>());
if (self->importBindings().has(id)) {
return result.failReadOnly();
@ -499,7 +506,8 @@ void ModuleEnvironmentObject::fixEnclosingEnvironmentAfterCompartmentMerge(
return NativeSetProperty<Qualified>(cx, self, id, v, receiver, result);
}
/* static */ bool ModuleEnvironmentObject::getOwnPropertyDescriptor(
/* static */
bool ModuleEnvironmentObject::getOwnPropertyDescriptor(
JSContext* cx, HandleObject obj, HandleId id,
MutableHandle<PropertyDescriptor> desc) {
const IndirectBindingMap& bindings =
@ -519,14 +527,17 @@ void ModuleEnvironmentObject::fixEnclosingEnvironmentAfterCompartmentMerge(
return NativeGetOwnPropertyDescriptor(cx, self, id, desc);
}
/* static */ bool ModuleEnvironmentObject::deleteProperty(
JSContext* cx, HandleObject obj, HandleId id, ObjectOpResult& result) {
/* static */
bool ModuleEnvironmentObject::deleteProperty(JSContext* cx, HandleObject obj,
HandleId id,
ObjectOpResult& result) {
return result.failCantDelete();
}
/* static */ bool ModuleEnvironmentObject::newEnumerate(
JSContext* cx, HandleObject obj, AutoIdVector& properties,
bool enumerableOnly) {
/* static */
bool ModuleEnvironmentObject::newEnumerate(JSContext* cx, HandleObject obj,
AutoIdVector& properties,
bool enumerableOnly) {
RootedModuleEnvironmentObject self(cx, &obj->as<ModuleEnvironmentObject>());
const IndirectBindingMap& bs(self->importBindings());
@ -553,7 +564,8 @@ const Class WasmInstanceEnvironmentObject::class_ = {
"WasmInstance",
JSCLASS_HAS_RESERVED_SLOTS(WasmInstanceEnvironmentObject::RESERVED_SLOTS)};
/* static */ WasmInstanceEnvironmentObject*
/* static */
WasmInstanceEnvironmentObject*
WasmInstanceEnvironmentObject::createHollowForDebug(
JSContext* cx, Handle<WasmInstanceScope*> scope) {
RootedObjectGroup group(
@ -589,10 +601,9 @@ const Class WasmFunctionCallObject::class_ = {
"WasmCall",
JSCLASS_HAS_RESERVED_SLOTS(WasmFunctionCallObject::RESERVED_SLOTS)};
/* static */ WasmFunctionCallObject*
WasmFunctionCallObject::createHollowForDebug(JSContext* cx,
HandleObject enclosing,
Handle<WasmFunctionScope*> scope) {
/* static */
WasmFunctionCallObject* WasmFunctionCallObject::createHollowForDebug(
JSContext* cx, HandleObject enclosing, Handle<WasmFunctionScope*> scope) {
RootedObjectGroup group(
cx, ObjectGroup::defaultNewGroup(cx, &class_, TaggedProto(nullptr)));
if (!group) {
@ -792,7 +803,8 @@ const Class WithEnvironmentObject::class_ = {
JS_NULL_CLASS_EXT,
&WithEnvironmentObjectOps};
/* static */ NonSyntacticVariablesObject* NonSyntacticVariablesObject::create(
/* static */
NonSyntacticVariablesObject* NonSyntacticVariablesObject::create(
JSContext* cx) {
Rooted<NonSyntacticVariablesObject*> obj(
cx, NewObjectWithNullTaggedProto<NonSyntacticVariablesObject>(
@ -862,10 +874,10 @@ bool js::CreateNonSyntacticEnvironmentChain(JSContext* cx,
/*****************************************************************************/
/* static */ LexicalEnvironmentObject*
LexicalEnvironmentObject::createTemplateObject(JSContext* cx, HandleShape shape,
HandleObject enclosing,
gc::InitialHeap heap) {
/* static */
LexicalEnvironmentObject* LexicalEnvironmentObject::createTemplateObject(
JSContext* cx, HandleShape shape, HandleObject enclosing,
gc::InitialHeap heap) {
MOZ_ASSERT(shape->getObjectClass() == &LexicalEnvironmentObject::class_);
RootedObjectGroup group(
@ -895,7 +907,8 @@ LexicalEnvironmentObject::createTemplateObject(JSContext* cx, HandleShape shape,
return env;
}
/* static */ LexicalEnvironmentObject* LexicalEnvironmentObject::create(
/* static */
LexicalEnvironmentObject* LexicalEnvironmentObject::create(
JSContext* cx, Handle<LexicalScope*> scope, HandleObject enclosing,
gc::InitialHeap heap) {
cx->check(enclosing);
@ -919,13 +932,15 @@ LexicalEnvironmentObject::createTemplateObject(JSContext* cx, HandleShape shape,
return env;
}
/* static */ LexicalEnvironmentObject* LexicalEnvironmentObject::create(
/* static */
LexicalEnvironmentObject* LexicalEnvironmentObject::create(
JSContext* cx, Handle<LexicalScope*> scope, AbstractFramePtr frame) {
RootedObject enclosing(cx, frame.environmentChain());
return create(cx, scope, enclosing, gc::DefaultHeap);
}
/* static */ LexicalEnvironmentObject* LexicalEnvironmentObject::createGlobal(
/* static */
LexicalEnvironmentObject* LexicalEnvironmentObject::createGlobal(
JSContext* cx, Handle<GlobalObject*> global) {
MOZ_ASSERT(global);
@ -949,10 +964,9 @@ LexicalEnvironmentObject::createTemplateObject(JSContext* cx, HandleShape shape,
return env;
}
/* static */ LexicalEnvironmentObject*
LexicalEnvironmentObject::createNonSyntactic(JSContext* cx,
HandleObject enclosing,
HandleObject thisv) {
/* static */
LexicalEnvironmentObject* LexicalEnvironmentObject::createNonSyntactic(
JSContext* cx, HandleObject enclosing, HandleObject thisv) {
MOZ_ASSERT(enclosing);
MOZ_ASSERT(!IsSyntacticEnvironment(enclosing));
@ -973,9 +987,9 @@ LexicalEnvironmentObject::createNonSyntactic(JSContext* cx,
return env;
}
/* static */ LexicalEnvironmentObject*
LexicalEnvironmentObject::createHollowForDebug(JSContext* cx,
Handle<LexicalScope*> scope) {
/* static */
LexicalEnvironmentObject* LexicalEnvironmentObject::createHollowForDebug(
JSContext* cx, Handle<LexicalScope*> scope) {
MOZ_ASSERT(!scope->hasEnvironment());
RootedShape shape(cx, LexicalScope::getEmptyExtensibleEnvironmentShape(cx));
@ -1012,7 +1026,8 @@ LexicalEnvironmentObject::createHollowForDebug(JSContext* cx,
return env;
}
/* static */ LexicalEnvironmentObject* LexicalEnvironmentObject::clone(
/* static */
LexicalEnvironmentObject* LexicalEnvironmentObject::clone(
JSContext* cx, Handle<LexicalEnvironmentObject*> env) {
Rooted<LexicalScope*> scope(cx, &env->scope());
RootedObject enclosing(cx, &env->enclosingEnvironment());
@ -1032,7 +1047,8 @@ LexicalEnvironmentObject::createHollowForDebug(JSContext* cx,
return copy;
}
/* static */ LexicalEnvironmentObject* LexicalEnvironmentObject::recreate(
/* static */
LexicalEnvironmentObject* LexicalEnvironmentObject::recreate(
JSContext* cx, Handle<LexicalEnvironmentObject*> env) {
Rooted<LexicalScope*> scope(cx, &env->scope());
RootedObject enclosing(cx, &env->enclosingEnvironment());
@ -1068,9 +1084,12 @@ const Class LexicalEnvironmentObject::class_ = {
JS_NULL_CLASS_EXT,
JS_NULL_OBJECT_OPS};
/* static */ NamedLambdaObject* NamedLambdaObject::create(
JSContext* cx, HandleFunction callee, HandleFunction func,
HandleObject enclosing, gc::InitialHeap heap) {
/* static */
NamedLambdaObject* NamedLambdaObject::create(JSContext* cx,
HandleFunction callee,
HandleFunction func,
HandleObject enclosing,
gc::InitialHeap heap) {
MOZ_ASSERT(callee->isNamedLambda());
RootedScope scope(cx, callee->nonLazyScript()->maybeNamedLambdaScope());
MOZ_ASSERT(scope && scope->environmentShape());
@ -1094,24 +1113,28 @@ const Class LexicalEnvironmentObject::class_ = {
return static_cast<NamedLambdaObject*>(obj);
}
/* static */ NamedLambdaObject* NamedLambdaObject::createTemplateObject(
/* static */
NamedLambdaObject* NamedLambdaObject::createTemplateObject(
JSContext* cx, HandleFunction callee, gc::InitialHeap heap) {
return create(cx, callee, callee, nullptr, heap);
}
/* static */ NamedLambdaObject* NamedLambdaObject::create(
JSContext* cx, AbstractFramePtr frame) {
/* static */
NamedLambdaObject* NamedLambdaObject::create(JSContext* cx,
AbstractFramePtr frame) {
RootedFunction fun(cx, frame.callee());
RootedObject enclosing(cx, frame.environmentChain());
return create(cx, fun, fun, enclosing, gc::DefaultHeap);
}
/* static */ size_t NamedLambdaObject::lambdaSlot() {
/* static */
size_t NamedLambdaObject::lambdaSlot() {
// Named lambda environments have exactly one name.
return JSSLOT_FREE(&LexicalEnvironmentObject::class_);
}
/* static */ RuntimeLexicalErrorObject* RuntimeLexicalErrorObject::create(
/* static */
RuntimeLexicalErrorObject* RuntimeLexicalErrorObject::create(
JSContext* cx, HandleObject enclosing, unsigned errorNumber) {
RuntimeLexicalErrorObject* obj =
NewObjectWithNullTaggedProto<RuntimeLexicalErrorObject>(
@ -1342,12 +1365,14 @@ bool EnvironmentIter::hasNonSyntacticEnvironmentObject() const {
return false;
}
/* static */ HashNumber MissingEnvironmentKey::hash(MissingEnvironmentKey ek) {
/* static */
HashNumber MissingEnvironmentKey::hash(MissingEnvironmentKey ek) {
return size_t(ek.frame_.raw()) ^ size_t(ek.scope_);
}
/* static */ bool MissingEnvironmentKey::match(MissingEnvironmentKey ek1,
MissingEnvironmentKey ek2) {
/* static */
bool MissingEnvironmentKey::match(MissingEnvironmentKey ek1,
MissingEnvironmentKey ek2) {
return ek1.frame_ == ek2.frame_ && ek1.scope_ == ek2.scope_;
}
@ -2335,8 +2360,10 @@ bool JSObject::is<js::DebugEnvironmentProxy>() const {
const char DebugEnvironmentProxyHandler::family = 0;
const DebugEnvironmentProxyHandler DebugEnvironmentProxyHandler::singleton;
/* static */ DebugEnvironmentProxy* DebugEnvironmentProxy::create(
JSContext* cx, EnvironmentObject& env, HandleObject enclosing) {
/* static */
DebugEnvironmentProxy* DebugEnvironmentProxy::create(JSContext* cx,
EnvironmentObject& env,
HandleObject enclosing) {
MOZ_ASSERT(env.realm() == cx->realm());
MOZ_ASSERT(!enclosing->is<EnvironmentObject>());
@ -2380,7 +2407,8 @@ bool DebugEnvironmentProxy::isForDeclarative() const {
e.is<WasmFunctionCallObject>() || e.is<LexicalEnvironmentObject>();
}
/* static */ bool DebugEnvironmentProxy::getMaybeSentinelValue(
/* static */
bool DebugEnvironmentProxy::getMaybeSentinelValue(
JSContext* cx, Handle<DebugEnvironmentProxy*> env, HandleId id,
MutableHandleValue vp) {
return DebugEnvironmentProxyHandler::singleton.getMaybeSentinelValue(cx, env,
@ -2516,7 +2544,8 @@ DebugEnvironments* DebugEnvironments::ensureRealmData(JSContext* cx) {
return realm->debugEnvs();
}
/* static */ DebugEnvironmentProxy* DebugEnvironments::hasDebugEnvironment(
/* static */
DebugEnvironmentProxy* DebugEnvironments::hasDebugEnvironment(
JSContext* cx, EnvironmentObject& env) {
DebugEnvironments* envs = env.realm()->debugEnvs();
if (!envs) {
@ -2531,7 +2560,8 @@ DebugEnvironments* DebugEnvironments::ensureRealmData(JSContext* cx) {
return nullptr;
}
/* static */ bool DebugEnvironments::addDebugEnvironment(
/* static */
bool DebugEnvironments::addDebugEnvironment(
JSContext* cx, Handle<EnvironmentObject*> env,
Handle<DebugEnvironmentProxy*> debugEnv) {
MOZ_ASSERT(cx->realm() == env->realm());
@ -2549,7 +2579,8 @@ DebugEnvironments* DebugEnvironments::ensureRealmData(JSContext* cx) {
return envs->proxiedEnvs.add(cx, env, debugEnv);
}
/* static */ DebugEnvironmentProxy* DebugEnvironments::hasDebugEnvironment(
/* static */
DebugEnvironmentProxy* DebugEnvironments::hasDebugEnvironment(
JSContext* cx, const EnvironmentIter& ei) {
MOZ_ASSERT(!ei.hasSyntacticEnvironment());
@ -2566,7 +2597,8 @@ DebugEnvironments* DebugEnvironments::ensureRealmData(JSContext* cx) {
return nullptr;
}
/* static */ bool DebugEnvironments::addDebugEnvironment(
/* static */
bool DebugEnvironments::addDebugEnvironment(
JSContext* cx, const EnvironmentIter& ei,
Handle<DebugEnvironmentProxy*> debugEnv) {
MOZ_ASSERT(!ei.hasSyntacticEnvironment());
@ -2607,7 +2639,8 @@ DebugEnvironments* DebugEnvironments::ensureRealmData(JSContext* cx) {
return true;
}
/* static */ void DebugEnvironments::takeFrameSnapshot(
/* static */
void DebugEnvironments::takeFrameSnapshot(
JSContext* cx, Handle<DebugEnvironmentProxy*> debugEnv,
AbstractFramePtr frame) {
/*
@ -2717,8 +2750,8 @@ DebugEnvironments* DebugEnvironments::ensureRealmData(JSContext* cx) {
debugEnv->initSnapshot(*snapshot);
}
/* static */ void DebugEnvironments::onPopCall(JSContext* cx,
AbstractFramePtr frame) {
/* static */
void DebugEnvironments::onPopCall(JSContext* cx, AbstractFramePtr frame) {
cx->check(frame);
DebugEnvironments* envs = cx->realm()->debugEnvs();
@ -2932,8 +2965,9 @@ LiveEnvironmentVal* DebugEnvironments::hasLiveEnvironment(
return nullptr;
}
/* static */ void DebugEnvironments::unsetPrevUpToDateUntil(
JSContext* cx, AbstractFramePtr until) {
/* static */
void DebugEnvironments::unsetPrevUpToDateUntil(JSContext* cx,
AbstractFramePtr until) {
// This are two exceptions where fp->prevUpToDate() is cleared without
// popping the frame. When a frame is rematerialized or has its
// debuggeeness toggled off->on, all frames younger than the frame must
@ -2960,9 +2994,9 @@ LiveEnvironmentVal* DebugEnvironments::hasLiveEnvironment(
}
}
/* static */ void DebugEnvironments::forwardLiveFrame(JSContext* cx,
AbstractFramePtr from,
AbstractFramePtr to) {
/* static */
void DebugEnvironments::forwardLiveFrame(JSContext* cx, AbstractFramePtr from,
AbstractFramePtr to) {
DebugEnvironments* envs = cx->realm()->debugEnvs();
if (!envs) {
return;
@ -2985,8 +3019,8 @@ LiveEnvironmentVal* DebugEnvironments::hasLiveEnvironment(
}
}
/* static */ void DebugEnvironments::traceLiveFrame(JSTracer* trc,
AbstractFramePtr frame) {
/* static */
void DebugEnvironments::traceLiveFrame(JSTracer* trc, AbstractFramePtr frame) {
for (MissingEnvironmentMap::Enum e(missingEnvs); !e.empty(); e.popFront()) {
if (e.front().key().frame() == frame) {
TraceEdge(trc, &e.front().value(), "debug-env-live-frame-missing-env");

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

@ -26,8 +26,9 @@
using namespace js;
/* static */ Shape* js::ErrorObject::assignInitialShape(
JSContext* cx, Handle<ErrorObject*> obj) {
/* static */
Shape* js::ErrorObject::assignInitialShape(JSContext* cx,
Handle<ErrorObject*> obj) {
MOZ_ASSERT(obj->empty());
if (!NativeObject::addDataProperty(cx, obj, cx->names().fileName,
@ -42,14 +43,12 @@ using namespace js;
COLUMNNUMBER_SLOT, 0);
}
/* static */ bool js::ErrorObject::init(JSContext* cx, Handle<ErrorObject*> obj,
JSExnType type,
UniquePtr<JSErrorReport> errorReport,
HandleString fileName,
HandleObject stack, uint32_t sourceId,
uint32_t lineNumber,
uint32_t columnNumber,
HandleString message) {
/* static */
bool js::ErrorObject::init(JSContext* cx, Handle<ErrorObject*> obj,
JSExnType type, UniquePtr<JSErrorReport> errorReport,
HandleString fileName, HandleObject stack,
uint32_t sourceId, uint32_t lineNumber,
uint32_t columnNumber, HandleString message) {
AssertObjectIsSavedFrameOrWrapper(cx, stack);
cx->check(obj, stack);
@ -114,12 +113,14 @@ using namespace js;
return true;
}
/* static */ ErrorObject* js::ErrorObject::create(
JSContext* cx, JSExnType errorType, HandleObject stack,
HandleString fileName, uint32_t sourceId,
uint32_t lineNumber, uint32_t columnNumber,
UniquePtr<JSErrorReport> report, HandleString message,
HandleObject protoArg /* = nullptr */) {
/* static */
ErrorObject* js::ErrorObject::create(JSContext* cx, JSExnType errorType,
HandleObject stack, HandleString fileName,
uint32_t sourceId, uint32_t lineNumber,
uint32_t columnNumber,
UniquePtr<JSErrorReport> report,
HandleString message,
HandleObject protoArg /* = nullptr */) {
AssertObjectIsSavedFrameOrWrapper(cx, stack);
RootedObject proto(cx, protoArg);
@ -244,15 +245,15 @@ static bool FindErrorInstanceOrPrototype(JSContext* cx, HandleObject obj,
static MOZ_ALWAYS_INLINE bool IsObject(HandleValue v) { return v.isObject(); }
/* static */ bool js::ErrorObject::getStack(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool js::ErrorObject::getStack(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
// We accept any object here, because of poor-man's subclassing of Error.
return CallNonGenericMethod<IsObject, getStack_impl>(cx, args);
}
/* static */ bool js::ErrorObject::getStack_impl(JSContext* cx,
const CallArgs& args) {
/* static */
bool js::ErrorObject::getStack_impl(JSContext* cx, const CallArgs& args) {
RootedObject thisObj(cx, &args.thisv().toObject());
RootedObject obj(cx);
@ -298,15 +299,15 @@ static MOZ_ALWAYS_INLINE bool IsObject(HandleValue v) { return v.isObject(); }
return true;
}
/* static */ bool js::ErrorObject::setStack(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool js::ErrorObject::setStack(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
// We accept any object here, because of poor-man's subclassing of Error.
return CallNonGenericMethod<IsObject, setStack_impl>(cx, args);
}
/* static */ bool js::ErrorObject::setStack_impl(JSContext* cx,
const CallArgs& args) {
/* static */
bool js::ErrorObject::setStack_impl(JSContext* cx, const CallArgs& args) {
RootedObject thisObj(cx, &args.thisv().toObject());
if (!args.requireAtLeast(cx, "(set stack)", 1)) {

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

@ -432,8 +432,8 @@ JS_FRIEND_API jsbytecode* ProfilingStackFrame::pc() const {
return script ? script->offsetToPC(pcOffsetIfJS_) : nullptr;
}
/* static */ int32_t ProfilingStackFrame::pcToOffset(JSScript* aScript,
jsbytecode* aPc) {
/* static */
int32_t ProfilingStackFrame::pcToOffset(JSScript* aScript, jsbytecode* aPc) {
return aPc ? aScript->pcToOffset(aPc) : NullPCOffset;
}

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

@ -239,8 +239,8 @@ JSObject* js::NewSingletonObjectWithFunctionPrototype(
return obj;
}
/* static */ bool GlobalObject::initGenerators(JSContext* cx,
Handle<GlobalObject*> global) {
/* static */
bool GlobalObject::initGenerators(JSContext* cx, Handle<GlobalObject*> global) {
if (global->getReservedSlot(GENERATOR_OBJECT_PROTO).isObject()) {
return true;
}

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

@ -88,8 +88,8 @@ TypedObjectModuleObject& js::GlobalObject::getTypedObjectModule() const {
return v.toObject().as<TypedObjectModuleObject>();
}
/* static */ bool GlobalObject::skipDeselectedConstructor(JSContext* cx,
JSProtoKey key) {
/* static */
bool GlobalObject::skipDeselectedConstructor(JSContext* cx, JSProtoKey key) {
switch (key) {
case JSProto_WebAssembly:
return !wasm::HasSupport(cx);
@ -114,10 +114,10 @@ TypedObjectModuleObject& js::GlobalObject::getTypedObjectModule() const {
}
}
/* static*/ bool GlobalObject::resolveConstructor(JSContext* cx,
Handle<GlobalObject*> global,
JSProtoKey key,
IfClassIsDisabled mode) {
/* static*/
bool GlobalObject::resolveConstructor(JSContext* cx,
Handle<GlobalObject*> global,
JSProtoKey key, IfClassIsDisabled mode) {
MOZ_ASSERT(key != JSProto_Null);
MOZ_ASSERT(!global->isStandardClassResolved(key));
MOZ_ASSERT(cx->compartment() == global->compartment());
@ -316,8 +316,10 @@ TypedObjectModuleObject& js::GlobalObject::getTypedObjectModule() const {
//
// Refactoring global object creation code to support this approach is a
// challenge for another day.
/* static */ bool GlobalObject::maybeResolveGlobalThis(
JSContext* cx, Handle<GlobalObject*> global, bool* resolved) {
/* static */
bool GlobalObject::maybeResolveGlobalThis(JSContext* cx,
Handle<GlobalObject*> global,
bool* resolved) {
if (global->getSlot(GLOBAL_THIS_RESOLVED).isUndefined()) {
RootedValue v(cx, ObjectValue(*ToWindowProxyIfWindow(global)));
if (!DefineDataProperty(cx, global, cx->names().globalThis, v,
@ -332,10 +334,10 @@ TypedObjectModuleObject& js::GlobalObject::getTypedObjectModule() const {
return true;
}
/* static */ JSObject* GlobalObject::createObject(JSContext* cx,
Handle<GlobalObject*> global,
unsigned slot,
ObjectInitOp init) {
/* static */
JSObject* GlobalObject::createObject(JSContext* cx,
Handle<GlobalObject*> global,
unsigned slot, ObjectInitOp init) {
if (global->zone()->createdForHelperThread()) {
return createOffThreadObject(cx, global, slot);
}
@ -368,8 +370,10 @@ inline int32_t GlobalObject::OffThreadPlaceholderObject::getSlotIndex() const {
return getReservedSlot(SlotIndexSlot).toInt32();
}
/* static */ bool GlobalObject::resolveOffThreadConstructor(
JSContext* cx, Handle<GlobalObject*> global, JSProtoKey key) {
/* static */
bool GlobalObject::resolveOffThreadConstructor(JSContext* cx,
Handle<GlobalObject*> global,
JSProtoKey key) {
// Don't resolve constructors for off-thread parse globals. Instead create a
// placeholder object for the prototype which we can use to find the real
// prototype when the off-thread compartment is merged back into the target
@ -404,8 +408,10 @@ inline int32_t GlobalObject::OffThreadPlaceholderObject::getSlotIndex() const {
return true;
}
/* static */ JSObject* GlobalObject::createOffThreadObject(
JSContext* cx, Handle<GlobalObject*> global, unsigned slot) {
/* static */
JSObject* GlobalObject::createOffThreadObject(JSContext* cx,
Handle<GlobalObject*> global,
unsigned slot) {
// Don't create prototype objects for off-thread parse globals. Instead
// create a placeholder object which we can use to find the real prototype
// when the off-thread compartment is merged back into the target
@ -431,9 +437,11 @@ JSObject* GlobalObject::getPrototypeForOffThreadPlaceholder(JSObject* obj) {
return &getSlot(placeholder->getSlotIndex()).toObject();
}
/* static */ bool GlobalObject::initBuiltinConstructor(
JSContext* cx, Handle<GlobalObject*> global, JSProtoKey key,
HandleObject ctor, HandleObject proto) {
/* static */
bool GlobalObject::initBuiltinConstructor(JSContext* cx,
Handle<GlobalObject*> global,
JSProtoKey key, HandleObject ctor,
HandleObject proto) {
MOZ_ASSERT(!global->empty()); // reserved slots already allocated
MOZ_ASSERT(key != JSProto_Null);
MOZ_ASSERT(ctor);
@ -457,7 +465,8 @@ static bool ThrowTypeError(JSContext* cx, unsigned argc, Value* vp) {
return false;
}
/* static */ JSObject* GlobalObject::getOrCreateThrowTypeError(
/* static */
JSObject* GlobalObject::getOrCreateThrowTypeError(
JSContext* cx, Handle<GlobalObject*> global) {
Value v = global->getReservedSlot(THROWTYPEERROR);
if (v.isObject()) {
@ -553,9 +562,11 @@ GlobalObject* GlobalObject::createInternal(JSContext* cx, const Class* clasp) {
return global;
}
/* static */ GlobalObject* GlobalObject::new_(
JSContext* cx, const Class* clasp, JSPrincipals* principals,
JS::OnNewGlobalHookOption hookOption, const JS::RealmOptions& options) {
/* static */
GlobalObject* GlobalObject::new_(JSContext* cx, const Class* clasp,
JSPrincipals* principals,
JS::OnNewGlobalHookOption hookOption,
const JS::RealmOptions& options) {
MOZ_ASSERT(!cx->isExceptionPending());
MOZ_ASSERT_IF(cx->zone(), !cx->zone()->isAtomsZone());
@ -592,9 +603,9 @@ GlobalScope& GlobalObject::emptyGlobalScope() const {
return static_cast<Scope*>(v.toGCThing())->as<GlobalScope>();
}
/* static */ bool GlobalObject::getOrCreateEval(JSContext* cx,
Handle<GlobalObject*> global,
MutableHandleObject eval) {
/* static */
bool GlobalObject::getOrCreateEval(JSContext* cx, Handle<GlobalObject*> global,
MutableHandleObject eval) {
if (!getOrCreateObjectPrototype(cx, global)) {
return false;
}
@ -607,8 +618,9 @@ bool GlobalObject::valueIsEval(const Value& val) {
return eval.isObject() && eval == val;
}
/* static */ bool GlobalObject::initStandardClasses(
JSContext* cx, Handle<GlobalObject*> global) {
/* static */
bool GlobalObject::initStandardClasses(JSContext* cx,
Handle<GlobalObject*> global) {
/* Define a top-level property 'undefined' with the undefined value. */
if (!DefineDataProperty(
cx, global, cx->names().undefined, UndefinedHandleValue,
@ -665,9 +677,10 @@ static bool InitBareBuiltinCtor(JSContext* cx, Handle<GlobalObject*> global,
* Even those are only created as bare constructors without any properties
* or functions.
*/
/* static */ bool GlobalObject::initSelfHostingBuiltins(
JSContext* cx, Handle<GlobalObject*> global,
const JSFunctionSpec* builtins) {
/* static */
bool GlobalObject::initSelfHostingBuiltins(JSContext* cx,
Handle<GlobalObject*> global,
const JSFunctionSpec* builtins) {
// Define a top-level property 'undefined' with the undefined value.
if (!DefineDataProperty(cx, global, cx->names().undefined,
UndefinedHandleValue,
@ -708,8 +721,9 @@ static bool InitBareBuiltinCtor(JSContext* cx, Handle<GlobalObject*> global,
DefineFunctions(cx, global, builtins, AsIntrinsic);
}
/* static */ bool GlobalObject::isRuntimeCodeGenEnabled(
JSContext* cx, HandleValue code, Handle<GlobalObject*> global) {
/* static */
bool GlobalObject::isRuntimeCodeGenEnabled(JSContext* cx, HandleValue code,
Handle<GlobalObject*> global) {
HeapSlot& v = global->getSlotRef(RUNTIME_CODEGEN_ENABLED);
if (v.isUndefined()) {
/*
@ -730,9 +744,11 @@ static bool InitBareBuiltinCtor(JSContext* cx, Handle<GlobalObject*> global,
return !v.isFalse();
}
/* static */ JSFunction* GlobalObject::createConstructor(
JSContext* cx, Native ctor, JSAtom* nameArg, unsigned length,
gc::AllocKind kind, const JSJitInfo* jitInfo) {
/* static */
JSFunction* GlobalObject::createConstructor(JSContext* cx, Native ctor,
JSAtom* nameArg, unsigned length,
gc::AllocKind kind,
const JSJitInfo* jitInfo) {
RootedAtom name(cx, nameArg);
JSFunction* fun = NewNativeConstructor(cx, ctor, length, name, kind);
if (!fun) {
@ -759,8 +775,10 @@ static NativeObject* CreateBlankProto(JSContext* cx, const Class* clasp,
return blankProto;
}
/* static */ NativeObject* GlobalObject::createBlankPrototype(
JSContext* cx, Handle<GlobalObject*> global, const Class* clasp) {
/* static */
NativeObject* GlobalObject::createBlankPrototype(JSContext* cx,
Handle<GlobalObject*> global,
const Class* clasp) {
RootedObject objectProto(cx, getOrCreateObjectPrototype(cx, global));
if (!objectProto) {
return nullptr;
@ -769,8 +787,10 @@ static NativeObject* CreateBlankProto(JSContext* cx, const Class* clasp,
return CreateBlankProto(cx, clasp, objectProto);
}
/* static */ NativeObject* GlobalObject::createBlankPrototypeInheriting(
JSContext* cx, const Class* clasp, HandleObject proto) {
/* static */
NativeObject* GlobalObject::createBlankPrototypeInheriting(JSContext* cx,
const Class* clasp,
HandleObject proto) {
return CreateBlankProto(cx, clasp, proto);
}
@ -856,7 +876,8 @@ GlobalObject::DebuggerVector* GlobalObject::getDebuggers() const {
return debuggers;
}
/* static */ NativeObject* GlobalObject::getOrCreateForOfPICObject(
/* static */
NativeObject* GlobalObject::getOrCreateForOfPICObject(
JSContext* cx, Handle<GlobalObject*> global) {
cx->check(global);
NativeObject* forOfPIC = global->getForOfPICObject();
@ -876,8 +897,9 @@ bool GlobalObject::hasRegExpStatics() const {
return !getSlot(REGEXP_STATICS).isUndefined();
}
/* static */ RegExpStatics* GlobalObject::getRegExpStatics(
JSContext* cx, Handle<GlobalObject*> global) {
/* static */
RegExpStatics* GlobalObject::getRegExpStatics(JSContext* cx,
Handle<GlobalObject*> global) {
MOZ_ASSERT(cx);
RegExpStaticsObject* resObj = nullptr;
const Value& val = global->getSlot(REGEXP_STATICS);
@ -902,8 +924,9 @@ RegExpStatics* GlobalObject::getAlreadyCreatedRegExpStatics() const {
val.toObject().as<RegExpStaticsObject>().getPrivate(/* nfixed = */ 1));
}
/* static */ NativeObject* GlobalObject::getIntrinsicsHolder(
JSContext* cx, Handle<GlobalObject*> global) {
/* static */
NativeObject* GlobalObject::getIntrinsicsHolder(JSContext* cx,
Handle<GlobalObject*> global) {
Value slot = global->getReservedSlot(INTRINSICS);
MOZ_ASSERT(slot.isUndefined() || slot.isObject());
@ -935,10 +958,12 @@ RegExpStatics* GlobalObject::getAlreadyCreatedRegExpStatics() const {
return intrinsicsHolder;
}
/* static */ bool GlobalObject::getSelfHostedFunction(
JSContext* cx, Handle<GlobalObject*> global,
HandlePropertyName selfHostedName, HandleAtom name, unsigned nargs,
MutableHandleValue funVal) {
/* static */
bool GlobalObject::getSelfHostedFunction(JSContext* cx,
Handle<GlobalObject*> global,
HandlePropertyName selfHostedName,
HandleAtom name, unsigned nargs,
MutableHandleValue funVal) {
bool exists = false;
if (!GlobalObject::maybeGetIntrinsicValue(cx, global, selfHostedName, funVal,
&exists)) {
@ -983,10 +1008,11 @@ RegExpStatics* GlobalObject::getAlreadyCreatedRegExpStatics() const {
return GlobalObject::addIntrinsicValue(cx, global, selfHostedName, funVal);
}
/* static */ bool GlobalObject::addIntrinsicValue(JSContext* cx,
Handle<GlobalObject*> global,
HandlePropertyName name,
HandleValue value) {
/* static */
bool GlobalObject::addIntrinsicValue(JSContext* cx,
Handle<GlobalObject*> global,
HandlePropertyName name,
HandleValue value) {
RootedNativeObject holder(cx, GlobalObject::getIntrinsicsHolder(cx, global));
if (!holder) {
return false;
@ -1011,8 +1037,9 @@ RegExpStatics* GlobalObject::getAlreadyCreatedRegExpStatics() const {
return true;
}
/* static */ bool GlobalObject::ensureModulePrototypesCreated(
JSContext* cx, Handle<GlobalObject*> global) {
/* static */
bool GlobalObject::ensureModulePrototypesCreated(JSContext* cx,
Handle<GlobalObject*> global) {
return getOrCreateModulePrototype(cx, global) &&
getOrCreateImportEntryPrototype(cx, global) &&
getOrCreateExportEntryPrototype(cx, global) &&

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

@ -793,8 +793,9 @@ NativeIterator::NativeIterator(JSContext* cx,
MOZ_ASSERT(!*hadError);
}
/* static */ bool IteratorHashPolicy::match(PropertyIteratorObject* obj,
const Lookup& lookup) {
/* static */
bool IteratorHashPolicy::match(PropertyIteratorObject* obj,
const Lookup& lookup) {
NativeIterator* ni = obj->getNativeIterator();
if (ni->guardKey() != lookup.key || ni->guardCount() != lookup.numGuards) {
return false;
@ -1501,8 +1502,9 @@ bool js::SuppressDeletedElement(JSContext* cx, HandleObject obj,
static const JSFunctionSpec iterator_proto_methods[] = {
JS_SELF_HOSTED_SYM_FN(iterator, "IteratorIdentity", 0, 0), JS_FS_END};
/* static */ bool GlobalObject::initIteratorProto(
JSContext* cx, Handle<GlobalObject*> global) {
/* static */
bool GlobalObject::initIteratorProto(JSContext* cx,
Handle<GlobalObject*> global) {
if (global->getReservedSlot(ITERATOR_PROTO).isObject()) {
return true;
}
@ -1518,8 +1520,9 @@ static const JSFunctionSpec iterator_proto_methods[] = {
return true;
}
/* static */ bool GlobalObject::initArrayIteratorProto(
JSContext* cx, Handle<GlobalObject*> global) {
/* static */
bool GlobalObject::initArrayIteratorProto(JSContext* cx,
Handle<GlobalObject*> global) {
if (global->getReservedSlot(ARRAY_ITERATOR_PROTO).isObject()) {
return true;
}
@ -1544,8 +1547,9 @@ static const JSFunctionSpec iterator_proto_methods[] = {
return true;
}
/* static */ bool GlobalObject::initStringIteratorProto(
JSContext* cx, Handle<GlobalObject*> global) {
/* static */
bool GlobalObject::initStringIteratorProto(JSContext* cx,
Handle<GlobalObject*> global) {
if (global->getReservedSlot(STRING_ITERATOR_PROTO).isObject()) {
return true;
}
@ -1570,8 +1574,9 @@ static const JSFunctionSpec iterator_proto_methods[] = {
return true;
}
/* static */ bool GlobalObject::initRegExpStringIteratorProto(
JSContext* cx, Handle<GlobalObject*> global) {
/* static */
bool GlobalObject::initRegExpStringIteratorProto(JSContext* cx,
Handle<GlobalObject*> global) {
if (global->getReservedSlot(REGEXP_STRING_ITERATOR_PROTO).isObject()) {
return true;
}

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

@ -1235,8 +1235,9 @@ bool JSFunction::isDerivedClassConstructor() {
return derived;
}
/* static */ bool JSFunction::getLength(JSContext* cx, HandleFunction fun,
uint16_t* length) {
/* static */
bool JSFunction::getLength(JSContext* cx, HandleFunction fun,
uint16_t* length) {
MOZ_ASSERT(!fun->isBoundFunction());
if (fun->isInterpretedLazy() && !getOrCreateScript(cx, fun)) {
return false;
@ -1246,9 +1247,9 @@ bool JSFunction::isDerivedClassConstructor() {
return true;
}
/* static */ bool JSFunction::getUnresolvedLength(JSContext* cx,
HandleFunction fun,
MutableHandleValue v) {
/* static */
bool JSFunction::getUnresolvedLength(JSContext* cx, HandleFunction fun,
MutableHandleValue v) {
MOZ_ASSERT(!IsInternalFunctionObject(*fun));
MOZ_ASSERT(!fun->hasResolvedLength());
@ -1285,9 +1286,9 @@ JSAtom* JSFunction::infallibleGetUnresolvedName(JSContext* cx) {
return cx->names().empty;
}
/* static */ bool JSFunction::getUnresolvedName(JSContext* cx,
HandleFunction fun,
MutableHandleString v) {
/* static */
bool JSFunction::getUnresolvedName(JSContext* cx, HandleFunction fun,
MutableHandleString v) {
if (fun->isBoundFunction()) {
JSLinearString* name = JSFunction::getBoundFunctionName(cx, fun);
if (!name) {
@ -1302,8 +1303,9 @@ JSAtom* JSFunction::infallibleGetUnresolvedName(JSContext* cx) {
return true;
}
/* static */ JSLinearString* JSFunction::getBoundFunctionName(
JSContext* cx, HandleFunction fun) {
/* static */
JSLinearString* JSFunction::getBoundFunctionName(JSContext* cx,
HandleFunction fun) {
MOZ_ASSERT(fun->isBoundFunction());
JSAtom* name = fun->explicitName();
@ -1408,10 +1410,10 @@ static JSAtom* AppendBoundFunctionPrefix(JSContext* cx, JSString* str) {
return sb.finishAtom();
}
/* static */ bool JSFunction::finishBoundFunctionInit(JSContext* cx,
HandleFunction bound,
HandleObject targetObj,
int32_t argCount) {
/* static */
bool JSFunction::finishBoundFunctionInit(JSContext* cx, HandleFunction bound,
HandleObject targetObj,
int32_t argCount) {
bound->setIsBoundFunction();
MOZ_ASSERT(bound->getBoundFunctionTarget() == targetObj);
@ -1534,8 +1536,9 @@ static JSAtom* AppendBoundFunctionPrefix(JSContext* cx, JSString* str) {
return true;
}
/* static */ bool JSFunction::createScriptForLazilyInterpretedFunction(
JSContext* cx, HandleFunction fun) {
/* static */
bool JSFunction::createScriptForLazilyInterpretedFunction(JSContext* cx,
HandleFunction fun) {
MOZ_ASSERT(fun->isInterpretedLazy());
MOZ_ASSERT(cx->compartment() == fun->compartment());

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

@ -1235,18 +1235,19 @@ JSObject* js::CreateThisForFunction(JSContext* cx, HandleFunction callee,
return obj;
}
/* static */ bool JSObject::nonNativeSetProperty(JSContext* cx,
HandleObject obj, HandleId id,
HandleValue v,
HandleValue receiver,
ObjectOpResult& result) {
/* static */
bool JSObject::nonNativeSetProperty(JSContext* cx, HandleObject obj,
HandleId id, HandleValue v,
HandleValue receiver,
ObjectOpResult& result) {
return obj->getOpsSetProperty()(cx, obj, id, v, receiver, result);
}
/* static */ bool JSObject::nonNativeSetElement(JSContext* cx, HandleObject obj,
uint32_t index, HandleValue v,
HandleValue receiver,
ObjectOpResult& result) {
/* static */
bool JSObject::nonNativeSetElement(JSContext* cx, HandleObject obj,
uint32_t index, HandleValue v,
HandleValue receiver,
ObjectOpResult& result) {
RootedId id(cx);
if (!IndexToId(cx, index, &id)) {
return false;
@ -1711,10 +1712,9 @@ template XDRResult js::XDRObjectLiteral(XDRState<XDR_ENCODE>* xdr,
template XDRResult js::XDRObjectLiteral(XDRState<XDR_DECODE>* xdr,
MutableHandleObject obj);
/* static */ bool NativeObject::fillInAfterSwap(JSContext* cx,
HandleNativeObject obj,
const AutoValueVector& values,
void* priv) {
/* static */
bool NativeObject::fillInAfterSwap(JSContext* cx, HandleNativeObject obj,
const AutoValueVector& values, void* priv) {
// This object has just been swapped with some other object, and its shape
// no longer reflects its allocated size. Correct this information and
// fill the slots in with the specified values.
@ -2222,7 +2222,8 @@ static bool SetProto(JSContext* cx, HandleObject obj,
return true;
}
/* static */ bool JSObject::changeToSingleton(JSContext* cx, HandleObject obj) {
/* static */
bool JSObject::changeToSingleton(JSContext* cx, HandleObject obj) {
MOZ_ASSERT(!obj->isSingleton());
MarkObjectGroupUnknownProperties(cx, obj->group());
@ -4120,9 +4121,9 @@ static JSAtom* displayAtomFromObjectGroup(ObjectGroup& group) {
return script->function()->displayAtom();
}
/* static */ bool JSObject::constructorDisplayAtom(JSContext* cx,
js::HandleObject obj,
js::MutableHandleAtom name) {
/* static */
bool JSObject::constructorDisplayAtom(JSContext* cx, js::HandleObject obj,
js::MutableHandleAtom name) {
ObjectGroup* g = JSObject::getGroup(cx, obj);
if (!g) {
return false;
@ -4243,10 +4244,10 @@ bool js::Unbox(JSContext* cx, HandleObject obj, MutableHandleValue vp) {
}
#ifdef DEBUG
/* static */ void JSObject::debugCheckNewObject(ObjectGroup* group,
Shape* shape,
js::gc::AllocKind allocKind,
js::gc::InitialHeap heap) {
/* static */
void JSObject::debugCheckNewObject(ObjectGroup* group, Shape* shape,
js::gc::AllocKind allocKind,
js::gc::InitialHeap heap) {
const js::Class* clasp = group->clasp();
MOZ_ASSERT(clasp != &ArrayObject::class_);

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

@ -544,10 +544,11 @@ static XDRResult XDRScope(XDRState<mode>* xdr, js::PrivateScriptData* data,
}
template <XDRMode mode>
/* static */ XDRResult js::PrivateScriptData::XDR(
XDRState<mode>* xdr, HandleScript script,
HandleScriptSourceObject sourceObject, HandleScope scriptEnclosingScope,
HandleFunction fun) {
/* static */
XDRResult js::PrivateScriptData::XDR(XDRState<mode>* xdr, HandleScript script,
HandleScriptSourceObject sourceObject,
HandleScope scriptEnclosingScope,
HandleFunction fun) {
uint32_t nconsts = 0;
uint32_t nobjects = 0;
uint32_t nscopes = 0;
@ -673,8 +674,8 @@ template <XDRMode mode>
}
template <XDRMode mode>
/* static */ XDRResult SharedScriptData::XDR(XDRState<mode>* xdr,
HandleScript script) {
/* static */
XDRResult SharedScriptData::XDR(XDRState<mode>* xdr, HandleScript script) {
uint32_t natoms = 0;
uint32_t codeLength = 0;
uint32_t noteLength = 0;
@ -728,11 +729,13 @@ template <XDRMode mode>
}
template
/* static */ XDRResult
/* static */
XDRResult
SharedScriptData::XDR(XDRState<XDR_ENCODE>* xdr, HandleScript script);
template
/* static */ XDRResult
/* static */
XDRResult
SharedScriptData::XDR(XDRState<XDR_DECODE>* xdr, HandleScript script);
template <XDRMode mode>
@ -1499,7 +1502,8 @@ ScriptSourceObject* ScriptSourceObject::unwrappedCanonical() const {
return &UncheckedUnwrap(obj)->as<ScriptSourceObject>();
}
/* static */ bool ScriptSourceObject::initFromOptions(
/* static */
bool ScriptSourceObject::initFromOptions(
JSContext* cx, HandleScriptSourceObject source,
const ReadOnlyCompileOptions& options) {
cx->releaseCheck(source);
@ -1542,9 +1546,11 @@ ScriptSourceObject* ScriptSourceObject::unwrappedCanonical() const {
return true;
}
/* static */ bool ScriptSourceObject::initElementProperties(
JSContext* cx, HandleScriptSourceObject source, HandleObject element,
HandleString elementAttrName) {
/* static */
bool ScriptSourceObject::initElementProperties(JSContext* cx,
HandleScriptSourceObject source,
HandleObject element,
HandleString elementAttrName) {
MOZ_ASSERT(source->isCanonical());
RootedValue elementValue(cx, ObjectOrNullValue(element));
@ -1577,8 +1583,8 @@ void ScriptSourceObject::setPrivate(JSRuntime* rt, const Value& value) {
rt->addRefScriptPrivate(value);
}
/* static */ bool JSScript::loadSource(JSContext* cx, ScriptSource* ss,
bool* worked) {
/* static */
bool JSScript::loadSource(JSContext* cx, ScriptSource* ss, bool* worked) {
MOZ_ASSERT(!ss->hasSourceText());
*worked = false;
if (!cx->runtime()->sourceHook.ref() || !ss->sourceRetrievable()) {
@ -1603,8 +1609,8 @@ void ScriptSourceObject::setPrivate(JSRuntime* rt, const Value& value) {
return true;
}
/* static */ JSFlatString* JSScript::sourceData(JSContext* cx,
HandleScript script) {
/* static */
JSFlatString* JSScript::sourceData(JSContext* cx, HandleScript script) {
MOZ_ASSERT(script->scriptSource()->hasSourceText());
return script->scriptSource()->substring(cx, script->sourceStart(),
script->sourceEnd());
@ -2445,9 +2451,10 @@ XDRResult ScriptSource::xdrUncompressedSource<XDR_ENCODE>(
} // namespace js
template <XDRMode mode>
/* static */ XDRResult ScriptSource::XDR(
XDRState<mode>* xdr, const mozilla::Maybe<JS::CompileOptions>& options,
MutableHandle<ScriptSourceHolder> holder) {
/* static */
XDRResult ScriptSource::XDR(XDRState<mode>* xdr,
const mozilla::Maybe<JS::CompileOptions>& options,
MutableHandle<ScriptSourceHolder> holder) {
JSContext* cx = xdr->cx();
ScriptSource* ss = nullptr;
@ -3022,9 +3029,11 @@ static void DefaultInitializeElements(void* arrayPtr, size_t length) {
}
}
/* static */ size_t PrivateScriptData::AllocationSize(
uint32_t nscopes, uint32_t nconsts, uint32_t nobjects, uint32_t ntrynotes,
uint32_t nscopenotes, uint32_t nresumeoffsets) {
/* static */
size_t PrivateScriptData::AllocationSize(uint32_t nscopes, uint32_t nconsts,
uint32_t nobjects, uint32_t ntrynotes,
uint32_t nscopenotes,
uint32_t nresumeoffsets) {
size_t size = sizeof(PrivateScriptData);
if (nconsts) {
@ -3184,10 +3193,13 @@ PrivateScriptData::PrivateScriptData(uint32_t nscopes_, uint32_t nconsts,
nresumeoffsets) == cursor);
}
/* static */ PrivateScriptData* PrivateScriptData::new_(
JSContext* cx, uint32_t nscopes, uint32_t nconsts, uint32_t nobjects,
uint32_t ntrynotes, uint32_t nscopenotes, uint32_t nresumeoffsets,
uint32_t* dataSize) {
/* static */
PrivateScriptData* PrivateScriptData::new_(JSContext* cx, uint32_t nscopes,
uint32_t nconsts, uint32_t nobjects,
uint32_t ntrynotes,
uint32_t nscopenotes,
uint32_t nresumeoffsets,
uint32_t* dataSize) {
// Compute size including trailing arrays
size_t size = AllocationSize(nscopes, nconsts, nobjects, ntrynotes,
nscopenotes, nresumeoffsets);
@ -3246,11 +3258,10 @@ JSScript::JSScript(JS::Realm* realm, uint8_t* stubEntry,
setSourceObject(sourceObject);
}
/* static */ JSScript* JSScript::New(JSContext* cx,
HandleScriptSourceObject sourceObject,
uint32_t sourceStart, uint32_t sourceEnd,
uint32_t toStringStart,
uint32_t toStringEnd) {
/* static */
JSScript* JSScript::New(JSContext* cx, HandleScriptSourceObject sourceObject,
uint32_t sourceStart, uint32_t sourceEnd,
uint32_t toStringStart, uint32_t toStringEnd) {
void* script = Allocate<JSScript>(cx);
if (!script) {
return nullptr;
@ -3278,10 +3289,11 @@ static bool ShouldTrackRecordReplayProgress(JSScript* script) {
mozilla::recordreplay::ShouldUpdateProgressCounter(script->filename());
}
/* static */ JSScript* JSScript::Create(
JSContext* cx, const ReadOnlyCompileOptions& options,
HandleScriptSourceObject sourceObject, uint32_t sourceStart,
uint32_t sourceEnd, uint32_t toStringStart, uint32_t toStringEnd) {
/* static */
JSScript* JSScript::Create(JSContext* cx, const ReadOnlyCompileOptions& options,
HandleScriptSourceObject sourceObject,
uint32_t sourceStart, uint32_t sourceEnd,
uint32_t toStringStart, uint32_t toStringEnd) {
RootedScript script(cx, JSScript::New(cx, sourceObject, sourceStart,
sourceEnd, toStringStart, toStringEnd));
if (!script) {
@ -3364,10 +3376,12 @@ bool JSScript::initScriptName(JSContext* cx) {
return true;
}
/* static */ bool JSScript::createPrivateScriptData(
JSContext* cx, HandleScript script, uint32_t nscopes, uint32_t nconsts,
uint32_t nobjects, uint32_t ntrynotes, uint32_t nscopenotes,
uint32_t nresumeoffsets) {
/* static */
bool JSScript::createPrivateScriptData(JSContext* cx, HandleScript script,
uint32_t nscopes, uint32_t nconsts,
uint32_t nobjects, uint32_t ntrynotes,
uint32_t nscopenotes,
uint32_t nresumeoffsets) {
cx->check(script);
uint32_t dataSize;
@ -3384,8 +3398,9 @@ bool JSScript::initScriptName(JSContext* cx) {
return true;
}
/* static */ bool JSScript::initFunctionPrototype(
JSContext* cx, HandleScript script, HandleFunction functionProto) {
/* static */
bool JSScript::initFunctionPrototype(JSContext* cx, HandleScript script,
HandleFunction functionProto) {
uint32_t numScopes = 1;
uint32_t numConsts = 0;
uint32_t numObjects = 0;
@ -3435,8 +3450,9 @@ static void InitAtomMap(frontend::AtomIndexMap& indices, GCPtrAtom* atoms) {
}
}
/* static */ void JSScript::initFromFunctionBox(HandleScript script,
frontend::FunctionBox* funbox) {
/* static */
void JSScript::initFromFunctionBox(HandleScript script,
frontend::FunctionBox* funbox) {
JSFunction* fun = funbox->function();
if (fun->isInterpretedLazy()) {
fun->setUnlazifiedScript(script);
@ -3485,7 +3501,8 @@ static void InitAtomMap(frontend::AtomIndexMap& indices, GCPtrAtom* atoms) {
(fun->needsCallObject() || fun->needsNamedLambdaEnvironment()));
}
/* static */ void JSScript::initFromModuleContext(HandleScript script) {
/* static */
void JSScript::initFromModuleContext(HandleScript script) {
script->setFlag(ImmutableFlags::IsModule);
// Since modules are only run once, mark the script so that initializers
@ -3494,8 +3511,9 @@ static void InitAtomMap(frontend::AtomIndexMap& indices, GCPtrAtom* atoms) {
MOZ_ASSERT(!script->hasRunOnce());
}
/* static */ bool JSScript::fullyInitFromEmitter(
JSContext* cx, HandleScript script, frontend::BytecodeEmitter* bce) {
/* static */
bool JSScript::fullyInitFromEmitter(JSContext* cx, HandleScript script,
frontend::BytecodeEmitter* bce) {
/* The counts of indexed things must be checked during code generation. */
MOZ_ASSERT(bce->atomIndices->count() <= INDEX_LIMIT);
MOZ_ASSERT(bce->objectList.length <= INDEX_LIMIT);
@ -4012,9 +4030,9 @@ static JSObject* CloneInnerInterpretedFunction(
return clone;
}
/* static */ bool PrivateScriptData::Clone(
JSContext* cx, HandleScript src, HandleScript dst,
MutableHandle<GCVector<Scope*>> scopes) {
/* static */
bool PrivateScriptData::Clone(JSContext* cx, HandleScript src, HandleScript dst,
MutableHandle<GCVector<Scope*>> scopes) {
PrivateScriptData* srcData = src->data_;
uint32_t nscopes = srcData->scopes().size();
uint32_t nconsts = srcData->hasConsts() ? srcData->consts().size() : 0;
@ -4688,8 +4706,8 @@ void js::SetFrameArgumentsObject(JSContext* cx, AbstractFramePtr frame,
}
}
/* static */ bool JSScript::argumentsOptimizationFailed(JSContext* cx,
HandleScript script) {
/* static */
bool JSScript::argumentsOptimizationFailed(JSContext* cx, HandleScript script) {
MOZ_ASSERT(script->functionNonDelazifying());
MOZ_ASSERT(script->analyzedArgsUsage());
MOZ_ASSERT(script->argumentsHasVarBinding());
@ -4845,10 +4863,12 @@ uint64_t LazyScript::packedFieldsForXDR() const {
return packedFields;
}
/* static */ LazyScript* LazyScript::CreateRaw(
JSContext* cx, HandleFunction fun, HandleScriptSourceObject sourceObject,
uint64_t packedFields, uint32_t sourceStart, uint32_t sourceEnd,
uint32_t toStringStart, uint32_t lineno, uint32_t column) {
/* static */
LazyScript* LazyScript::CreateRaw(JSContext* cx, HandleFunction fun,
HandleScriptSourceObject sourceObject,
uint64_t packedFields, uint32_t sourceStart,
uint32_t sourceEnd, uint32_t toStringStart,
uint32_t lineno, uint32_t column) {
cx->check(fun);
MOZ_ASSERT(sourceObject);
@ -4885,12 +4905,14 @@ uint64_t LazyScript::packedFieldsForXDR() const {
sourceEnd, toStringStart, lineno, column);
}
/* static */ LazyScript* LazyScript::Create(
JSContext* cx, HandleFunction fun, HandleScriptSourceObject sourceObject,
const frontend::AtomVector& closedOverBindings,
Handle<GCVector<JSFunction*, 8>> innerFunctions, uint32_t sourceStart,
uint32_t sourceEnd, uint32_t toStringStart, uint32_t lineno,
uint32_t column, frontend::ParseGoal parseGoal) {
/* static */
LazyScript* LazyScript::Create(JSContext* cx, HandleFunction fun,
HandleScriptSourceObject sourceObject,
const frontend::AtomVector& closedOverBindings,
Handle<GCVector<JSFunction*, 8>> innerFunctions,
uint32_t sourceStart, uint32_t sourceEnd,
uint32_t toStringStart, uint32_t lineno,
uint32_t column, frontend::ParseGoal parseGoal) {
union {
PackedView p;
uint64_t packedFields;
@ -4937,7 +4959,8 @@ uint64_t LazyScript::packedFieldsForXDR() const {
return res;
}
/* static */ LazyScript* LazyScript::CreateForXDR(
/* static */
LazyScript* LazyScript::CreateForXDR(
JSContext* cx, HandleFunction fun, HandleScript script,
HandleScope enclosingScope, HandleScriptSourceObject sourceObject,
uint64_t packedFields, uint32_t sourceStart, uint32_t sourceEnd,

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

@ -58,8 +58,8 @@ static uint32_t HashStringChars(JSString* s) {
return hash;
}
/* static */ HashNumber InefficientNonFlatteningStringHashPolicy::hash(
const Lookup& l) {
/* static */
HashNumber InefficientNonFlatteningStringHashPolicy::hash(const Lookup& l) {
return l->hasLatin1Chars() ? HashStringChars<Latin1Char>(l)
: HashStringChars<char16_t>(l);
}
@ -98,8 +98,9 @@ static bool EqualStringsPure(JSString* s1, JSString* s2) {
return EqualChars(c1, c2, s1->length());
}
/* static */ bool InefficientNonFlatteningStringHashPolicy::match(
const JSString* const& k, const Lookup& l) {
/* static */
bool InefficientNonFlatteningStringHashPolicy::match(const JSString* const& k,
const Lookup& l) {
// We can't use js::EqualStrings, because that flattens our strings.
JSString* s1 = const_cast<JSString*>(k);
if (k->hasLatin1Chars()) {

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

@ -73,8 +73,9 @@ bool NativeObject::canHaveNonEmptyElements() {
#endif // DEBUG
/* static */ void ObjectElements::ConvertElementsToDoubles(
JSContext* cx, uintptr_t elementsPtr) {
/* static */
void ObjectElements::ConvertElementsToDoubles(JSContext* cx,
uintptr_t elementsPtr) {
/*
* This function has an otherwise unused JSContext argument so that it can
* be called directly from Ion code. Only arrays can have their dense
@ -99,8 +100,8 @@ bool NativeObject::canHaveNonEmptyElements() {
header->setShouldConvertDoubleElements();
}
/* static */ bool ObjectElements::MakeElementsCopyOnWrite(JSContext* cx,
NativeObject* obj) {
/* static */
bool ObjectElements::MakeElementsCopyOnWrite(JSContext* cx, NativeObject* obj) {
static_assert(sizeof(HeapSlot) >= sizeof(GCPtrObject),
"there must be enough room for the owner object pointer at "
"the end of the elements");
@ -120,8 +121,8 @@ bool NativeObject::canHaveNonEmptyElements() {
return true;
}
/* static */ bool ObjectElements::PreventExtensions(JSContext* cx,
NativeObject* obj) {
/* static */
bool ObjectElements::PreventExtensions(JSContext* cx, NativeObject* obj) {
if (!obj->maybeCopyElementsForWrite(cx)) {
return false;
}
@ -137,8 +138,9 @@ bool NativeObject::canHaveNonEmptyElements() {
return true;
}
/* static */ void ObjectElements::FreezeOrSeal(JSContext* cx, NativeObject* obj,
IntegrityLevel level) {
/* static */
void ObjectElements::FreezeOrSeal(JSContext* cx, NativeObject* obj,
IntegrityLevel level) {
MOZ_ASSERT_IF(level == IntegrityLevel::Frozen && obj->is<ArrayObject>(),
!obj->as<ArrayObject>().lengthIsWritable());
MOZ_ASSERT(!obj->denseElementsAreCopyOnWrite());
@ -163,7 +165,8 @@ static mozilla::Atomic<bool, mozilla::Relaxed,
mozilla::recordreplay::Behavior::DontPreserve>
gShapeConsistencyChecksEnabled(false);
/* static */ void js::NativeObject::enableShapeConsistencyChecks() {
/* static */
void js::NativeObject::enableShapeConsistencyChecks() {
gShapeConsistencyChecksEnabled = true;
}
@ -416,8 +419,9 @@ bool NativeObject::growSlots(JSContext* cx, uint32_t oldCount,
return true;
}
/* static */ bool NativeObject::growSlotsPure(JSContext* cx, NativeObject* obj,
uint32_t newCount) {
/* static */
bool NativeObject::growSlotsPure(JSContext* cx, NativeObject* obj,
uint32_t newCount) {
// IC code calls this directly.
AutoUnsafeCallWithABI unsafe;
@ -428,8 +432,8 @@ bool NativeObject::growSlots(JSContext* cx, uint32_t oldCount,
return true;
}
/* static */ bool NativeObject::addDenseElementPure(JSContext* cx,
NativeObject* obj) {
/* static */
bool NativeObject::addDenseElementPure(JSContext* cx, NativeObject* obj) {
// IC code calls this directly.
AutoUnsafeCallWithABI unsafe;
@ -516,7 +520,8 @@ bool NativeObject::willBeSparseElements(uint32_t requiredCapacity,
return true;
}
/* static */ DenseElementResult NativeObject::maybeDensifySparseElements(
/* static */
DenseElementResult NativeObject::maybeDensifySparseElements(
JSContext* cx, HandleNativeObject obj) {
/*
* Wait until after the object goes into dictionary mode, which must happen
@ -781,9 +786,11 @@ bool NativeObject::tryUnshiftDenseElements(uint32_t count) {
// Note: the structure and behavior of this method follow along with
// UnboxedArrayObject::chooseCapacityIndex. Changes to the allocation strategy
// in one should generally be matched by the other.
/* static */ bool NativeObject::goodElementsAllocationAmount(
JSContext* cx, uint32_t reqCapacity, uint32_t length,
uint32_t* goodAmount) {
/* static */
bool NativeObject::goodElementsAllocationAmount(JSContext* cx,
uint32_t reqCapacity,
uint32_t length,
uint32_t* goodAmount) {
if (reqCapacity > MAX_DENSE_ELEMENTS_COUNT) {
ReportOutOfMemory(cx);
return false;
@ -1006,8 +1013,8 @@ void NativeObject::shrinkElements(JSContext* cx, uint32_t reqCapacity) {
getElementsHeader()->capacity = newCapacity;
}
/* static */ bool NativeObject::CopyElementsForWrite(JSContext* cx,
NativeObject* obj) {
/* static */
bool NativeObject::CopyElementsForWrite(JSContext* cx, NativeObject* obj) {
MOZ_ASSERT(obj->denseElementsAreCopyOnWrite());
MOZ_ASSERT(obj->isExtensible());
@ -1046,9 +1053,9 @@ void NativeObject::shrinkElements(JSContext* cx, uint32_t reqCapacity) {
return true;
}
/* static */ bool NativeObject::allocDictionarySlot(JSContext* cx,
HandleNativeObject obj,
uint32_t* slotp) {
/* static */
bool NativeObject::allocDictionarySlot(JSContext* cx, HandleNativeObject obj,
uint32_t* slotp) {
MOZ_ASSERT(obj->inDictionaryMode());
uint32_t slot = obj->slotSpan();
@ -1121,11 +1128,10 @@ void NativeObject::freeSlot(JSContext* cx, uint32_t slot) {
setSlot(slot, UndefinedValue());
}
/* static */ Shape* NativeObject::addDataProperty(JSContext* cx,
HandleNativeObject obj,
HandlePropertyName name,
uint32_t slot,
unsigned attrs) {
/* static */
Shape* NativeObject::addDataProperty(JSContext* cx, HandleNativeObject obj,
HandlePropertyName name, uint32_t slot,
unsigned attrs) {
MOZ_ASSERT(!(attrs & (JSPROP_GETTER | JSPROP_SETTER)));
RootedId id(cx, NameToId(name));
return addDataProperty(cx, obj, id, slot, attrs);
@ -1379,13 +1385,15 @@ static MOZ_ALWAYS_INLINE bool ReshapeForShadowedProp(JSContext* cx,
return true;
}
/* static */ bool NativeObject::reshapeForShadowedProp(JSContext* cx,
HandleNativeObject obj) {
/* static */
bool NativeObject::reshapeForShadowedProp(JSContext* cx,
HandleNativeObject obj) {
return generateOwnShape(cx, obj);
}
/* static */ bool NativeObject::reshapeForProtoMutation(
JSContext* cx, HandleNativeObject obj) {
/* static */
bool NativeObject::reshapeForProtoMutation(JSContext* cx,
HandleNativeObject obj) {
return generateOwnShape(cx, obj);
}

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

@ -109,7 +109,8 @@ void ObjectGroup::setAddendum(AddendumKind kind, void* addendum,
addendum_ = addendum;
}
/* static */ bool ObjectGroup::useSingletonForClone(JSFunction* fun) {
/* static */
bool ObjectGroup::useSingletonForClone(JSFunction* fun) {
if (!fun->isInterpreted()) {
return false;
}
@ -164,9 +165,9 @@ void ObjectGroup::setAddendum(AddendumKind kind, void* addendum,
return end - begin <= 100;
}
/* static */ bool ObjectGroup::useSingletonForNewObject(JSContext* cx,
JSScript* script,
jsbytecode* pc) {
/* static */
bool ObjectGroup::useSingletonForNewObject(JSContext* cx, JSScript* script,
jsbytecode* pc) {
/*
* Make a heuristic guess at a use of JSOP_NEW that the constructed object
* should have a fresh group. We do this when the NEW is immediately
@ -199,9 +200,10 @@ void ObjectGroup::setAddendum(AddendumKind kind, void* addendum,
return false;
}
/* static */ bool ObjectGroup::useSingletonForAllocationSite(JSScript* script,
jsbytecode* pc,
JSProtoKey key) {
/* static */
bool ObjectGroup::useSingletonForAllocationSite(JSScript* script,
jsbytecode* pc,
JSProtoKey key) {
/*
* Objects created outside loops in global and eval scripts should have
* singleton types. For now this is only done for plain objects, but not
@ -249,8 +251,9 @@ bool GlobalObject::shouldSplicePrototype() {
return staticPrototype() == nullptr;
}
/* static */ bool JSObject::splicePrototype(JSContext* cx, HandleObject obj,
Handle<TaggedProto> proto) {
/* static */
bool JSObject::splicePrototype(JSContext* cx, HandleObject obj,
Handle<TaggedProto> proto) {
MOZ_ASSERT(cx->compartment() == obj->compartment());
/*
@ -294,8 +297,8 @@ bool GlobalObject::shouldSplicePrototype() {
return true;
}
/* static */ ObjectGroup* JSObject::makeLazyGroup(JSContext* cx,
HandleObject obj) {
/* static */
ObjectGroup* JSObject::makeLazyGroup(JSContext* cx, HandleObject obj) {
MOZ_ASSERT(obj->hasLazyGroup());
MOZ_ASSERT(cx->compartment() == obj->compartment());
@ -336,10 +339,10 @@ bool GlobalObject::shouldSplicePrototype() {
return group;
}
/* static */ bool JSObject::setNewGroupUnknown(JSContext* cx,
ObjectGroupRealm& realm,
const js::Class* clasp,
JS::HandleObject obj) {
/* static */
bool JSObject::setNewGroupUnknown(JSContext* cx, ObjectGroupRealm& realm,
const js::Class* clasp,
JS::HandleObject obj) {
ObjectGroup::setDefaultNewGroupUnknown(cx, realm, clasp, obj);
return JSObject::setFlags(cx, obj, BaseShape::NEW_GROUP_UNKNOWN);
}
@ -472,10 +475,10 @@ MOZ_ALWAYS_INLINE ObjectGroup* ObjectGroupRealm::DefaultNewGroupCache::lookup(
return nullptr;
}
/* static */ ObjectGroup* ObjectGroup::defaultNewGroup(JSContext* cx,
const Class* clasp,
TaggedProto proto,
JSObject* associated) {
/* static */
ObjectGroup* ObjectGroup::defaultNewGroup(JSContext* cx, const Class* clasp,
TaggedProto proto,
JSObject* associated) {
MOZ_ASSERT_IF(associated, proto.isObject());
MOZ_ASSERT_IF(proto.isObject(),
cx->isInsideCurrentCompartment(proto.toObject()));
@ -628,10 +631,11 @@ MOZ_ALWAYS_INLINE ObjectGroup* ObjectGroupRealm::DefaultNewGroupCache::lookup(
return group;
}
/* static */ ObjectGroup* ObjectGroup::lazySingletonGroup(JSContext* cx,
ObjectGroup* oldGroup,
const Class* clasp,
TaggedProto proto) {
/* static */
ObjectGroup* ObjectGroup::lazySingletonGroup(JSContext* cx,
ObjectGroup* oldGroup,
const Class* clasp,
TaggedProto proto) {
ObjectGroupRealm& realm = oldGroup ? ObjectGroupRealm::get(oldGroup)
: ObjectGroupRealm::getForNewObject(cx);
@ -674,9 +678,11 @@ MOZ_ALWAYS_INLINE ObjectGroup* ObjectGroupRealm::DefaultNewGroupCache::lookup(
return group;
}
/* static */ void ObjectGroup::setDefaultNewGroupUnknown(
JSContext* cx, ObjectGroupRealm& realm, const Class* clasp,
HandleObject obj) {
/* static */
void ObjectGroup::setDefaultNewGroupUnknown(JSContext* cx,
ObjectGroupRealm& realm,
const Class* clasp,
HandleObject obj) {
// If the object already has a new group, mark that group as unknown.
ObjectGroupRealm::NewTable* table = realm.defaultNewTable;
if (table) {
@ -691,9 +697,9 @@ MOZ_ALWAYS_INLINE ObjectGroup* ObjectGroupRealm::DefaultNewGroupCache::lookup(
}
#ifdef DEBUG
/* static */ bool ObjectGroup::hasDefaultNewGroup(JSObject* proto,
const Class* clasp,
ObjectGroup* group) {
/* static */
bool ObjectGroup::hasDefaultNewGroup(JSObject* proto, const Class* clasp,
ObjectGroup* group) {
ObjectGroupRealm::NewTable* table =
ObjectGroupRealm::get(group).defaultNewTable;
@ -732,8 +738,8 @@ inline const Class* GetClassForProtoKey(JSProtoKey key) {
}
}
/* static */ ObjectGroup* ObjectGroup::defaultNewGroup(JSContext* cx,
JSProtoKey key) {
/* static */
ObjectGroup* ObjectGroup::defaultNewGroup(JSContext* cx, JSProtoKey key) {
JSObject* proto = nullptr;
if (key != JSProto_Null) {
proto = GlobalObject::getOrCreatePrototype(cx, key);
@ -797,11 +803,10 @@ static inline TypeSet::Type GetValueTypeForTable(const Value& v) {
return type;
}
/* static */ ArrayObject* ObjectGroup::newArrayObject(JSContext* cx,
const Value* vp,
size_t length,
NewObjectKind newKind,
NewArrayKind arrayKind) {
/* static */
ArrayObject* ObjectGroup::newArrayObject(JSContext* cx, const Value* vp,
size_t length, NewObjectKind newKind,
NewArrayKind arrayKind) {
MOZ_ASSERT(newKind != SingletonObject);
// If we are making a copy on write array, don't try to adjust the group as
@ -1180,10 +1185,10 @@ PlainObject* js::NewPlainObjectWithProperties(JSContext* cx,
return obj;
}
/* static */ JSObject* ObjectGroup::newPlainObject(JSContext* cx,
IdValuePair* properties,
size_t nproperties,
NewObjectKind newKind) {
/* static */
JSObject* ObjectGroup::newPlainObject(JSContext* cx, IdValuePair* properties,
size_t nproperties,
NewObjectKind newKind) {
// Watch for simple cases where we don't try to reuse plain object groups.
if (newKind == SingletonObject || nproperties == 0 ||
nproperties >= PropertyTree::MAX_HEIGHT) {
@ -1446,7 +1451,8 @@ class ObjectGroupRealm::AllocationSiteTable
explicit AllocationSiteTable(Zone* zone) : Base(zone) {}
};
/* static */ ObjectGroup* ObjectGroup::allocationSiteGroup(
/* static */
ObjectGroup* ObjectGroup::allocationSiteGroup(
JSContext* cx, JSScript* scriptArg, jsbytecode* pc, JSProtoKey kind,
HandleObject protoArg /* = nullptr */) {
MOZ_ASSERT(!useSingletonForAllocationSite(scriptArg, pc, kind));
@ -1543,8 +1549,10 @@ void ObjectGroupRealm::replaceAllocationSiteGroup(JSScript* script,
}
}
/* static */ ObjectGroup* ObjectGroup::callingAllocationSiteGroup(
JSContext* cx, JSProtoKey key, HandleObject proto) {
/* static */
ObjectGroup* ObjectGroup::callingAllocationSiteGroup(JSContext* cx,
JSProtoKey key,
HandleObject proto) {
MOZ_ASSERT_IF(proto, key == JSProto_Array);
jsbytecode* pc;
@ -1558,11 +1566,11 @@ void ObjectGroupRealm::replaceAllocationSiteGroup(JSScript* script,
return defaultNewGroup(cx, key);
}
/* static */ bool ObjectGroup::setAllocationSiteObjectGroup(JSContext* cx,
HandleScript script,
jsbytecode* pc,
HandleObject obj,
bool singleton) {
/* static */
bool ObjectGroup::setAllocationSiteObjectGroup(JSContext* cx,
HandleScript script,
jsbytecode* pc, HandleObject obj,
bool singleton) {
JSProtoKey key = JSCLASS_CACHED_PROTO_KEY(obj->getClass());
MOZ_ASSERT(key != JSProto_Null);
MOZ_ASSERT(singleton == useSingletonForAllocationSite(script, pc, key));
@ -1587,8 +1595,10 @@ void ObjectGroupRealm::replaceAllocationSiteGroup(JSScript* script,
return true;
}
/* static */ ArrayObject* ObjectGroup::getOrFixupCopyOnWriteObject(
JSContext* cx, HandleScript script, jsbytecode* pc) {
/* static */
ArrayObject* ObjectGroup::getOrFixupCopyOnWriteObject(JSContext* cx,
HandleScript script,
jsbytecode* pc) {
// Make sure that the template object for script/pc has a type indicating
// that the object and its copies have copy on write elements.
RootedArrayObject obj(
@ -1624,8 +1634,9 @@ void ObjectGroupRealm::replaceAllocationSiteGroup(JSScript* script,
return obj;
}
/* static */ ArrayObject* ObjectGroup::getCopyOnWriteObject(JSScript* script,
jsbytecode* pc) {
/* static */
ArrayObject* ObjectGroup::getCopyOnWriteObject(JSScript* script,
jsbytecode* pc) {
// getOrFixupCopyOnWriteObject should already have been called for
// script/pc, ensuring that the template object has a group with the
// COPY_ON_WRITE flag. We don't assert this here, due to a corner case
@ -1638,10 +1649,9 @@ void ObjectGroupRealm::replaceAllocationSiteGroup(JSScript* script,
return obj;
}
/* static */ bool ObjectGroup::findAllocationSite(JSContext* cx,
const ObjectGroup* group,
JSScript** script,
uint32_t* offset) {
/* static */
bool ObjectGroup::findAllocationSite(JSContext* cx, const ObjectGroup* group,
JSScript** script, uint32_t* offset) {
*script = nullptr;
*offset = 0;
@ -1813,7 +1823,8 @@ void ObjectGroupRealm::clearTables() {
defaultNewGroupCache.purge();
}
/* static */ bool ObjectGroupRealm::PlainObjectTableSweepPolicy::needsSweep(
/* static */
bool ObjectGroupRealm::PlainObjectTableSweepPolicy::needsSweep(
PlainObjectKey* key, PlainObjectEntry* entry) {
if (!(JS::GCPolicy<PlainObjectKey>::needsSweep(key) ||
entry->needsSweep(key->nproperties))) {

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

@ -321,8 +321,9 @@ const Class ForOfPIC::class_ = {
"ForOfPIC", JSCLASS_HAS_PRIVATE | JSCLASS_BACKGROUND_FINALIZE,
&ForOfPICClassOps};
/* static */ NativeObject* js::ForOfPIC::createForOfPICObject(
JSContext* cx, Handle<GlobalObject*> global) {
/* static */
NativeObject* js::ForOfPIC::createForOfPICObject(JSContext* cx,
Handle<GlobalObject*> global) {
cx->check(global);
NativeObject* obj = NewNativeObjectWithGivenProto(cx, &ForOfPIC::class_,
nullptr, TenuredObject);

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

@ -45,10 +45,10 @@ static gc::AllocKind GetProxyGCObjectKind(const Class* clasp,
return kind;
}
/* static */ ProxyObject* ProxyObject::New(JSContext* cx,
const BaseProxyHandler* handler,
HandleValue priv, TaggedProto proto_,
const ProxyOptions& options) {
/* static */
ProxyObject* ProxyObject::New(JSContext* cx, const BaseProxyHandler* handler,
HandleValue priv, TaggedProto proto_,
const ProxyOptions& options) {
Rooted<TaggedProto> proto(cx, proto_);
const Class* clasp = options.clasp();

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

@ -100,8 +100,9 @@ bool VectorMatchPairs::allocOrExpandArray(size_t pairCount) {
/* RegExpObject */
/* static */ RegExpShared* RegExpObject::getShared(
JSContext* cx, Handle<RegExpObject*> regexp) {
/* static */
RegExpShared* RegExpObject::getShared(JSContext* cx,
Handle<RegExpObject*> regexp) {
if (regexp->hasShared()) {
return regexp->sharedRef();
}
@ -109,8 +110,8 @@ bool VectorMatchPairs::allocOrExpandArray(size_t pairCount) {
return createShared(cx, regexp);
}
/* static */ bool RegExpObject::isOriginalFlagGetter(JSNative native,
RegExpFlag* mask) {
/* static */
bool RegExpObject::isOriginalFlagGetter(JSNative native, RegExpFlag* mask) {
if (native == regexp_global) {
*mask = GlobalFlag;
return true;
@ -135,7 +136,8 @@ bool VectorMatchPairs::allocOrExpandArray(size_t pairCount) {
return false;
}
/* static */ void RegExpObject::trace(JSTracer* trc, JSObject* obj) {
/* static */
void RegExpObject::trace(JSTracer* trc, JSObject* obj) {
obj->as<RegExpObject>().trace(trc);
}
@ -270,8 +272,9 @@ RegExpObject* RegExpObject::create(JSContext* cx, HandleAtom source,
return regexp;
}
/* static */ RegExpShared* RegExpObject::createShared(
JSContext* cx, Handle<RegExpObject*> regexp) {
/* static */
RegExpShared* RegExpObject::createShared(JSContext* cx,
Handle<RegExpObject*> regexp) {
MOZ_ASSERT(!regexp->hasShared());
RootedAtom source(cx, regexp->getSource());
RegExpShared* shared =
@ -514,10 +517,9 @@ JSFlatString* RegExpObject::toString(JSContext* cx) const {
}
#ifdef DEBUG
/* static */ bool RegExpShared::dumpBytecode(JSContext* cx,
MutableHandleRegExpShared re,
bool match_only,
HandleLinearString input) {
/* static */
bool RegExpShared::dumpBytecode(JSContext* cx, MutableHandleRegExpShared re,
bool match_only, HandleLinearString input) {
CompilationMode mode = match_only ? MatchOnly : Normal;
if (!RegExpShared::compileIfNecessary(cx, re, input, mode, ForceByteCode)) {
return false;
@ -827,10 +829,9 @@ JSFlatString* RegExpObject::toString(JSContext* cx) const {
return true;
}
/* static */ bool RegExpObject::dumpBytecode(JSContext* cx,
Handle<RegExpObject*> regexp,
bool match_only,
HandleLinearString input) {
/* static */
bool RegExpObject::dumpBytecode(JSContext* cx, Handle<RegExpObject*> regexp,
bool match_only, HandleLinearString input) {
RootedRegExpShared shared(cx, getShared(cx, regexp));
if (!shared) {
return false;
@ -922,11 +923,10 @@ void RegExpShared::finalize(FreeOp* fop) {
tables.~JitCodeTables();
}
/* static */ bool RegExpShared::compile(JSContext* cx,
MutableHandleRegExpShared re,
HandleLinearString input,
CompilationMode mode,
ForceByteCodeEnum force) {
/* static */
bool RegExpShared::compile(JSContext* cx, MutableHandleRegExpShared re,
HandleLinearString input, CompilationMode mode,
ForceByteCodeEnum force) {
TraceLoggerThread* logger = TraceLoggerForCurrentThread(cx);
AutoTraceLog logCompile(logger, TraceLogger_IrregexpCompile);
@ -934,9 +934,10 @@ void RegExpShared::finalize(FreeOp* fop) {
return compile(cx, re, pattern, input, mode, force);
}
/* static */ bool RegExpShared::compile(
JSContext* cx, MutableHandleRegExpShared re, HandleAtom pattern,
HandleLinearString input, CompilationMode mode, ForceByteCodeEnum force) {
/* static */
bool RegExpShared::compile(JSContext* cx, MutableHandleRegExpShared re,
HandleAtom pattern, HandleLinearString input,
CompilationMode mode, ForceByteCodeEnum force) {
if (!re->ignoreCase() && !StringHasRegExpMetaChars(pattern)) {
re->canStringMatch = true;
}
@ -991,20 +992,24 @@ void RegExpShared::finalize(FreeOp* fop) {
return true;
}
/* static */ bool RegExpShared::compileIfNecessary(JSContext* cx,
MutableHandleRegExpShared re,
HandleLinearString input,
CompilationMode mode,
ForceByteCodeEnum force) {
/* static */
bool RegExpShared::compileIfNecessary(JSContext* cx,
MutableHandleRegExpShared re,
HandleLinearString input,
CompilationMode mode,
ForceByteCodeEnum force) {
if (re->isCompiled(mode, input->hasLatin1Chars(), force)) {
return true;
}
return compile(cx, re, input, mode, force);
}
/* static */ RegExpRunStatus RegExpShared::execute(
JSContext* cx, MutableHandleRegExpShared re, HandleLinearString input,
size_t start, VectorMatchPairs* matches, size_t* endIndex) {
/* static */
RegExpRunStatus RegExpShared::execute(JSContext* cx,
MutableHandleRegExpShared re,
HandleLinearString input, size_t start,
VectorMatchPairs* matches,
size_t* endIndex) {
MOZ_ASSERT_IF(matches, !endIndex);
MOZ_ASSERT_IF(!matches, endIndex);
TraceLoggerThread* logger = TraceLoggerForCurrentThread(cx);

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

@ -64,7 +64,8 @@ using mozilla::PodZero;
using mozilla::PositiveInfinity;
/* static */ MOZ_THREAD_LOCAL(JSContext*) js::TlsContext;
/* static */ Atomic<size_t> JSRuntime::liveRuntimesCount;
/* static */
Atomic<size_t> JSRuntime::liveRuntimesCount;
Atomic<JS::LargeAllocationFailureCallback> js::OnLargeAllocationFailure;
namespace js {

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

@ -281,15 +281,18 @@ class MutableWrappedPtrOperations<SavedFrame::Lookup, Wrapper>
}
};
/* static */ bool SavedFrame::HashPolicy::hasHash(const Lookup& l) {
/* static */
bool SavedFrame::HashPolicy::hasHash(const Lookup& l) {
return SavedFramePtrHasher::hasHash(l.parent);
}
/* static */ bool SavedFrame::HashPolicy::ensureHash(const Lookup& l) {
/* static */
bool SavedFrame::HashPolicy::ensureHash(const Lookup& l) {
return SavedFramePtrHasher::ensureHash(l.parent);
}
/* static */ HashNumber SavedFrame::HashPolicy::hash(const Lookup& lookup) {
/* static */
HashNumber SavedFrame::HashPolicy::hash(const Lookup& lookup) {
JS::AutoCheckCannotGC nogc;
// Assume that we can take line mod 2^32 without losing anything of
// interest. If that assumption changes, we'll just need to start with 0
@ -300,8 +303,8 @@ class MutableWrappedPtrOperations<SavedFrame::Lookup, Wrapper>
JSPrincipalsPtrHasher::hash(lookup.principals));
}
/* static */ bool SavedFrame::HashPolicy::match(SavedFrame* existing,
const Lookup& lookup) {
/* static */
bool SavedFrame::HashPolicy::match(SavedFrame* existing, const Lookup& lookup) {
MOZ_ASSERT(existing);
if (existing->getLine() != lookup.line) {
@ -338,13 +341,14 @@ class MutableWrappedPtrOperations<SavedFrame::Lookup, Wrapper>
return true;
}
/* static */ void SavedFrame::HashPolicy::rekey(Key& key, const Key& newKey) {
/* static */
void SavedFrame::HashPolicy::rekey(Key& key, const Key& newKey) {
key = newKey;
}
/* static */ bool SavedFrame::finishSavedFrameInit(JSContext* cx,
HandleObject ctor,
HandleObject proto) {
/* static */
bool SavedFrame::finishSavedFrameInit(JSContext* cx, HandleObject ctor,
HandleObject proto) {
return FreezeObject(cx, proto);
}
@ -400,7 +404,8 @@ const Class SavedFrame::protoClass_ = {
JS_PSG("parent", SavedFrame::parentProperty, 0),
JS_PS_END};
/* static */ void SavedFrame::finalize(FreeOp* fop, JSObject* obj) {
/* static */
void SavedFrame::finalize(FreeOp* fop, JSObject* obj) {
MOZ_ASSERT(fop->onMainThread());
JSPrincipals* p = obj->as<SavedFrame>().getPrincipals();
if (p) {
@ -534,7 +539,8 @@ void SavedFrame::initFromLookup(JSContext* cx,
initPrincipals(lookup.principals());
}
/* static */ SavedFrame* SavedFrame::create(JSContext* cx) {
/* static */
SavedFrame* SavedFrame::create(JSContext* cx) {
RootedGlobalObject global(cx, cx->global());
cx->check(global);
@ -575,8 +581,8 @@ uint32_t SavedFrame::wasmBytecodeOffset() {
return getLine();
}
/* static */ bool SavedFrame::construct(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool SavedFrame::construct(JSContext* cx, unsigned argc, Value* vp) {
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_NO_CONSTRUCTOR,
"SavedFrame");
return false;
@ -1092,8 +1098,8 @@ JS_PUBLIC_API bool IsUnwrappedSavedFrame(JSObject* obj) {
namespace js {
/* static */ bool SavedFrame::sourceProperty(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool SavedFrame::sourceProperty(JSContext* cx, unsigned argc, Value* vp) {
THIS_SAVEDFRAME(cx, argc, vp, "(get source)", args, frame);
JSPrincipals* principals = cx->realm()->principals();
RootedString source(cx);
@ -1109,8 +1115,8 @@ namespace js {
return true;
}
/* static */ bool SavedFrame::sourceIdProperty(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool SavedFrame::sourceIdProperty(JSContext* cx, unsigned argc, Value* vp) {
THIS_SAVEDFRAME(cx, argc, vp, "(get sourceId)", args, frame);
JSPrincipals* principals = cx->realm()->principals();
uint32_t sourceId;
@ -1123,8 +1129,8 @@ namespace js {
return true;
}
/* static */ bool SavedFrame::lineProperty(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool SavedFrame::lineProperty(JSContext* cx, unsigned argc, Value* vp) {
THIS_SAVEDFRAME(cx, argc, vp, "(get line)", args, frame);
JSPrincipals* principals = cx->realm()->principals();
uint32_t line;
@ -1137,8 +1143,8 @@ namespace js {
return true;
}
/* static */ bool SavedFrame::columnProperty(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool SavedFrame::columnProperty(JSContext* cx, unsigned argc, Value* vp) {
THIS_SAVEDFRAME(cx, argc, vp, "(get column)", args, frame);
JSPrincipals* principals = cx->realm()->principals();
uint32_t column;
@ -1151,9 +1157,9 @@ namespace js {
return true;
}
/* static */ bool SavedFrame::functionDisplayNameProperty(JSContext* cx,
unsigned argc,
Value* vp) {
/* static */
bool SavedFrame::functionDisplayNameProperty(JSContext* cx, unsigned argc,
Value* vp) {
THIS_SAVEDFRAME(cx, argc, vp, "(get functionDisplayName)", args, frame);
JSPrincipals* principals = cx->realm()->principals();
RootedString name(cx);
@ -1170,8 +1176,8 @@ namespace js {
return true;
}
/* static */ bool SavedFrame::asyncCauseProperty(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool SavedFrame::asyncCauseProperty(JSContext* cx, unsigned argc, Value* vp) {
THIS_SAVEDFRAME(cx, argc, vp, "(get asyncCause)", args, frame);
JSPrincipals* principals = cx->realm()->principals();
RootedString asyncCause(cx);
@ -1188,8 +1194,8 @@ namespace js {
return true;
}
/* static */ bool SavedFrame::asyncParentProperty(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool SavedFrame::asyncParentProperty(JSContext* cx, unsigned argc, Value* vp) {
THIS_SAVEDFRAME(cx, argc, vp, "(get asyncParent)", args, frame);
JSPrincipals* principals = cx->realm()->principals();
RootedObject asyncParent(cx);
@ -1201,8 +1207,8 @@ namespace js {
return true;
}
/* static */ bool SavedFrame::parentProperty(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool SavedFrame::parentProperty(JSContext* cx, unsigned argc, Value* vp) {
THIS_SAVEDFRAME(cx, argc, vp, "(get parent)", args, frame);
JSPrincipals* principals = cx->realm()->principals();
RootedObject parent(cx);
@ -1214,8 +1220,8 @@ namespace js {
return true;
}
/* static */ bool SavedFrame::toStringMethod(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool SavedFrame::toStringMethod(JSContext* cx, unsigned argc, Value* vp) {
THIS_SAVEDFRAME(cx, argc, vp, "toString", args, frame);
JSPrincipals* principals = cx->realm()->principals();
RootedString string(cx);
@ -1806,9 +1812,10 @@ JSObject* SavedStacks::MetadataBuilder::build(
const SavedStacks::MetadataBuilder SavedStacks::metadataBuilder;
/* static */ ReconstructedSavedFramePrincipals
ReconstructedSavedFramePrincipals::IsSystem;
/* static */ ReconstructedSavedFramePrincipals
/* static */
ReconstructedSavedFramePrincipals ReconstructedSavedFramePrincipals::IsSystem;
/* static */
ReconstructedSavedFramePrincipals
ReconstructedSavedFramePrincipals::IsNotSystem;
UniqueChars BuildUTF8StackString(JSContext* cx, JSPrincipals* principals,

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

@ -260,7 +260,8 @@ static void DeleteScopeData(ConcreteScopeData* data) {
}
template <typename ConcreteScope, XDRMode mode>
/* static */ XDRResult Scope::XDRSizedBindingNames(
/* static */
XDRResult Scope::XDRSizedBindingNames(
XDRState<mode>* xdr, Handle<ConcreteScope*> scope,
MutableHandle<typename ConcreteScope::Data*> data) {
MOZ_ASSERT(!data);
@ -301,8 +302,9 @@ template <typename ConcreteScope, XDRMode mode>
return Ok();
}
/* static */ Scope* Scope::create(JSContext* cx, ScopeKind kind,
HandleScope enclosing, HandleShape envShape) {
/* static */
Scope* Scope::create(JSContext* cx, ScopeKind kind, HandleScope enclosing,
HandleShape envShape) {
Scope* scope = Allocate<Scope>(cx);
if (scope) {
new (scope) Scope(kind, enclosing, envShape);
@ -311,7 +313,8 @@ template <typename ConcreteScope, XDRMode mode>
}
template <typename ConcreteScope>
/* static */ ConcreteScope* Scope::create(
/* static */
ConcreteScope* Scope::create(
JSContext* cx, ScopeKind kind, HandleScope enclosing, HandleShape envShape,
MutableHandle<UniquePtr<typename ConcreteScope::Data>> data) {
Scope* scope = create(cx, kind, enclosing, envShape);
@ -364,8 +367,8 @@ Shape* Scope::maybeCloneEnvironmentShape(JSContext* cx) {
return environmentShape_;
}
/* static */ Scope* Scope::clone(JSContext* cx, HandleScope scope,
HandleScope enclosing) {
/* static */
Scope* Scope::clone(JSContext* cx, HandleScope scope, HandleScope enclosing) {
RootedShape envShape(cx);
if (scope->environmentShape()) {
envShape = scope->maybeCloneEnvironmentShape(cx);
@ -493,7 +496,8 @@ uint32_t LexicalScope::firstFrameSlot() const {
return 0;
}
/* static */ uint32_t LexicalScope::nextFrameSlot(Scope* scope) {
/* static */
uint32_t LexicalScope::nextFrameSlot(Scope* scope) {
for (ScopeIter si(scope); si; si++) {
switch (si.kind()) {
case ScopeKind::Function:
@ -530,10 +534,10 @@ uint32_t LexicalScope::firstFrameSlot() const {
MOZ_CRASH("Not an enclosing intra-frame Scope");
}
/* static */ LexicalScope* LexicalScope::create(JSContext* cx, ScopeKind kind,
Handle<Data*> data,
uint32_t firstFrameSlot,
HandleScope enclosing) {
/* static */
LexicalScope* LexicalScope::create(JSContext* cx, ScopeKind kind,
Handle<Data*> data, uint32_t firstFrameSlot,
HandleScope enclosing) {
MOZ_ASSERT(data,
"LexicalScopes should not be created if there are no bindings.");
@ -547,9 +551,11 @@ uint32_t LexicalScope::firstFrameSlot() const {
return createWithData(cx, kind, &copy, firstFrameSlot, enclosing);
}
/* static */ LexicalScope* LexicalScope::createWithData(
JSContext* cx, ScopeKind kind, MutableHandle<UniquePtr<Data>> data,
uint32_t firstFrameSlot, HandleScope enclosing) {
/* static */
LexicalScope* LexicalScope::createWithData(JSContext* cx, ScopeKind kind,
MutableHandle<UniquePtr<Data>> data,
uint32_t firstFrameSlot,
HandleScope enclosing) {
bool isNamedLambda =
kind == ScopeKind::NamedLambda || kind == ScopeKind::StrictNamedLambda;
@ -574,16 +580,16 @@ uint32_t LexicalScope::firstFrameSlot() const {
return scope;
}
/* static */ Shape* LexicalScope::getEmptyExtensibleEnvironmentShape(
JSContext* cx) {
/* static */
Shape* LexicalScope::getEmptyExtensibleEnvironmentShape(JSContext* cx) {
const Class* cls = &LexicalEnvironmentObject::class_;
return EmptyEnvironmentShape(cx, cls, JSSLOT_FREE(cls), BaseShape::DELEGATE);
}
template <XDRMode mode>
/* static */ XDRResult LexicalScope::XDR(XDRState<mode>* xdr, ScopeKind kind,
HandleScope enclosing,
MutableHandleScope scope) {
/* static */
XDRResult LexicalScope::XDR(XDRState<mode>* xdr, ScopeKind kind,
HandleScope enclosing, MutableHandleScope scope) {
JSContext* cx = xdr->cx();
Rooted<Data*> data(cx);
@ -624,12 +630,14 @@ template <XDRMode mode>
}
template
/* static */ XDRResult
/* static */
XDRResult
LexicalScope::XDR(XDRState<XDR_ENCODE>* xdr, ScopeKind kind,
HandleScope enclosing, MutableHandleScope scope);
template
/* static */ XDRResult
/* static */
XDRResult
LexicalScope::XDR(XDRState<XDR_DECODE>* xdr, ScopeKind kind,
HandleScope enclosing, MutableHandleScope scope);
@ -644,9 +652,11 @@ Zone* FunctionScope::Data::zone() const {
return canonicalFunction ? canonicalFunction->zone() : nullptr;
}
/* static */ FunctionScope* FunctionScope::create(
JSContext* cx, Handle<Data*> dataArg, bool hasParameterExprs,
bool needsEnvironment, HandleFunction fun, HandleScope enclosing) {
/* static */
FunctionScope* FunctionScope::create(JSContext* cx, Handle<Data*> dataArg,
bool hasParameterExprs,
bool needsEnvironment, HandleFunction fun,
HandleScope enclosing) {
// The data that's passed in is from the frontend and is LifoAlloc'd.
// Copy it now that we're creating a permanent VM scope.
Rooted<UniquePtr<Data>> data(
@ -660,7 +670,8 @@ Zone* FunctionScope::Data::zone() const {
enclosing);
}
/* static */ FunctionScope* FunctionScope::createWithData(
/* static */
FunctionScope* FunctionScope::createWithData(
JSContext* cx, MutableHandle<UniquePtr<Data>> data, bool hasParameterExprs,
bool needsEnvironment, HandleFunction fun, HandleScope enclosing) {
MOZ_ASSERT(data);
@ -702,22 +713,23 @@ JSScript* FunctionScope::script() const {
return canonicalFunction()->nonLazyScript();
}
/* static */ bool FunctionScope::isSpecialName(JSContext* cx, JSAtom* name) {
/* static */
bool FunctionScope::isSpecialName(JSContext* cx, JSAtom* name) {
return name == cx->names().arguments || name == cx->names().dotThis ||
name == cx->names().dotGenerator;
}
/* static */ Shape* FunctionScope::getEmptyEnvironmentShape(
JSContext* cx, bool hasParameterExprs) {
/* static */
Shape* FunctionScope::getEmptyEnvironmentShape(JSContext* cx,
bool hasParameterExprs) {
const Class* cls = &CallObject::class_;
uint32_t shapeFlags = FunctionScopeEnvShapeFlags(hasParameterExprs);
return EmptyEnvironmentShape(cx, cls, JSSLOT_FREE(cls), shapeFlags);
}
/* static */ FunctionScope* FunctionScope::clone(JSContext* cx,
Handle<FunctionScope*> scope,
HandleFunction fun,
HandleScope enclosing) {
/* static */
FunctionScope* FunctionScope::clone(JSContext* cx, Handle<FunctionScope*> scope,
HandleFunction fun, HandleScope enclosing) {
MOZ_ASSERT(fun != scope->canonicalFunction());
// FunctionScope::Data has GCManagedDeletePolicy because it contains a
@ -745,10 +757,9 @@ JSScript* FunctionScope::script() const {
}
template <XDRMode mode>
/* static */ XDRResult FunctionScope::XDR(XDRState<mode>* xdr,
HandleFunction fun,
HandleScope enclosing,
MutableHandleScope scope) {
/* static */
XDRResult FunctionScope::XDR(XDRState<mode>* xdr, HandleFunction fun,
HandleScope enclosing, MutableHandleScope scope) {
JSContext* cx = xdr->cx();
Rooted<Data*> data(cx);
MOZ_TRY(XDRSizedBindingNames<FunctionScope>(xdr, scope.as<FunctionScope>(),
@ -797,12 +808,14 @@ template <XDRMode mode>
}
template
/* static */ XDRResult
/* static */
XDRResult
FunctionScope::XDR(XDRState<XDR_ENCODE>* xdr, HandleFunction fun,
HandleScope enclosing, MutableHandleScope scope);
template
/* static */ XDRResult
/* static */
XDRResult
FunctionScope::XDR(XDRState<XDR_DECODE>* xdr, HandleFunction fun,
HandleScope enclosing, MutableHandleScope scope);
@ -819,11 +832,10 @@ static UniquePtr<VarScope::Data> NewEmptyVarScopeData(JSContext* cx,
return data;
}
/* static */ VarScope* VarScope::create(JSContext* cx, ScopeKind kind,
Handle<Data*> dataArg,
uint32_t firstFrameSlot,
bool needsEnvironment,
HandleScope enclosing) {
/* static */
VarScope* VarScope::create(JSContext* cx, ScopeKind kind, Handle<Data*> dataArg,
uint32_t firstFrameSlot, bool needsEnvironment,
HandleScope enclosing) {
// The data that's passed in is from the frontend and is LifoAlloc'd.
// Copy it now that we're creating a permanent VM scope.
Rooted<UniquePtr<Data>> data(
@ -837,9 +849,12 @@ static UniquePtr<VarScope::Data> NewEmptyVarScopeData(JSContext* cx,
enclosing);
}
/* static */ VarScope* VarScope::createWithData(
JSContext* cx, ScopeKind kind, MutableHandle<UniquePtr<Data>> data,
uint32_t firstFrameSlot, bool needsEnvironment, HandleScope enclosing) {
/* static */
VarScope* VarScope::createWithData(JSContext* cx, ScopeKind kind,
MutableHandle<UniquePtr<Data>> data,
uint32_t firstFrameSlot,
bool needsEnvironment,
HandleScope enclosing) {
MOZ_ASSERT(data);
RootedShape envShape(cx);
@ -863,7 +878,8 @@ static UniquePtr<VarScope::Data> NewEmptyVarScopeData(JSContext* cx,
return Scope::create<VarScope>(cx, kind, enclosing, envShape, data);
}
/* static */ Shape* VarScope::getEmptyEnvironmentShape(JSContext* cx) {
/* static */
Shape* VarScope::getEmptyEnvironmentShape(JSContext* cx) {
const Class* cls = &VarEnvironmentObject::class_;
return EmptyEnvironmentShape(cx, cls, JSSLOT_FREE(cls),
VarScopeEnvShapeFlags);
@ -877,9 +893,9 @@ uint32_t VarScope::firstFrameSlot() const {
}
template <XDRMode mode>
/* static */ XDRResult VarScope::XDR(XDRState<mode>* xdr, ScopeKind kind,
HandleScope enclosing,
MutableHandleScope scope) {
/* static */
XDRResult VarScope::XDR(XDRState<mode>* xdr, ScopeKind kind,
HandleScope enclosing, MutableHandleScope scope) {
JSContext* cx = xdr->cx();
Rooted<Data*> data(cx);
MOZ_TRY(XDRSizedBindingNames<VarScope>(xdr, scope.as<VarScope>(), &data));
@ -922,17 +938,20 @@ template <XDRMode mode>
}
template
/* static */ XDRResult
/* static */
XDRResult
VarScope::XDR(XDRState<XDR_ENCODE>* xdr, ScopeKind kind,
HandleScope enclosing, MutableHandleScope scope);
template
/* static */ XDRResult
/* static */
XDRResult
VarScope::XDR(XDRState<XDR_DECODE>* xdr, ScopeKind kind,
HandleScope enclosing, MutableHandleScope scope);
/* static */ GlobalScope* GlobalScope::create(JSContext* cx, ScopeKind kind,
Handle<Data*> dataArg) {
/* static */
GlobalScope* GlobalScope::create(JSContext* cx, ScopeKind kind,
Handle<Data*> dataArg) {
// The data that's passed in is from the frontend and is LifoAlloc'd.
// Copy it now that we're creating a permanent VM scope.
Rooted<UniquePtr<Data>> data(cx, dataArg
@ -945,8 +964,9 @@ template
return createWithData(cx, kind, &data);
}
/* static */ GlobalScope* GlobalScope::createWithData(
JSContext* cx, ScopeKind kind, MutableHandle<UniquePtr<Data>> data) {
/* static */
GlobalScope* GlobalScope::createWithData(JSContext* cx, ScopeKind kind,
MutableHandle<UniquePtr<Data>> data) {
MOZ_ASSERT(data);
// The global scope has no environment shape. Its environment is the
@ -956,9 +976,9 @@ template
return Scope::create<GlobalScope>(cx, kind, nullptr, nullptr, data);
}
/* static */ GlobalScope* GlobalScope::clone(JSContext* cx,
Handle<GlobalScope*> scope,
ScopeKind kind) {
/* static */
GlobalScope* GlobalScope::clone(JSContext* cx, Handle<GlobalScope*> scope,
ScopeKind kind) {
Rooted<Data*> dataOriginal(cx, &scope->as<GlobalScope>().data());
Rooted<UniquePtr<Data>> dataClone(
cx, CopyScopeData<GlobalScope>(cx, dataOriginal));
@ -970,8 +990,9 @@ template
}
template <XDRMode mode>
/* static */ XDRResult GlobalScope::XDR(XDRState<mode>* xdr, ScopeKind kind,
MutableHandleScope scope) {
/* static */
XDRResult GlobalScope::XDR(XDRState<mode>* xdr, ScopeKind kind,
MutableHandleScope scope) {
MOZ_ASSERT((mode == XDR_DECODE) == !scope);
JSContext* cx = xdr->cx();
@ -1005,25 +1026,27 @@ template <XDRMode mode>
}
template
/* static */ XDRResult
/* static */
XDRResult
GlobalScope::XDR(XDRState<XDR_ENCODE>* xdr, ScopeKind kind,
MutableHandleScope scope);
template
/* static */ XDRResult
/* static */
XDRResult
GlobalScope::XDR(XDRState<XDR_DECODE>* xdr, ScopeKind kind,
MutableHandleScope scope);
/* static */ WithScope* WithScope::create(JSContext* cx,
HandleScope enclosing) {
/* static */
WithScope* WithScope::create(JSContext* cx, HandleScope enclosing) {
Scope* scope = Scope::create(cx, ScopeKind::With, enclosing, nullptr);
return static_cast<WithScope*>(scope);
}
template <XDRMode mode>
/* static */ XDRResult WithScope::XDR(XDRState<mode>* xdr,
HandleScope enclosing,
MutableHandleScope scope) {
/* static */
XDRResult WithScope::XDR(XDRState<mode>* xdr, HandleScope enclosing,
MutableHandleScope scope) {
JSContext* cx = xdr->cx();
if (mode == XDR_DECODE) {
@ -1037,21 +1060,23 @@ template <XDRMode mode>
}
template
/* static */ XDRResult
/* static */
XDRResult
WithScope::XDR(XDRState<XDR_ENCODE>* xdr, HandleScope enclosing,
MutableHandleScope scope);
template
/* static */ XDRResult
/* static */
XDRResult
WithScope::XDR(XDRState<XDR_DECODE>* xdr, HandleScope enclosing,
MutableHandleScope scope);
static const uint32_t EvalScopeEnvShapeFlags =
BaseShape::QUALIFIED_VAROBJ | BaseShape::DELEGATE;
/* static */ EvalScope* EvalScope::create(JSContext* cx, ScopeKind scopeKind,
Handle<Data*> dataArg,
HandleScope enclosing) {
/* static */
EvalScope* EvalScope::create(JSContext* cx, ScopeKind scopeKind,
Handle<Data*> dataArg, HandleScope enclosing) {
// The data that's passed in is from the frontend and is LifoAlloc'd.
// Copy it now that we're creating a permanent VM scope.
Rooted<UniquePtr<Data>> data(cx, dataArg
@ -1064,9 +1089,10 @@ static const uint32_t EvalScopeEnvShapeFlags =
return createWithData(cx, scopeKind, &data, enclosing);
}
/* static */ EvalScope* EvalScope::createWithData(
JSContext* cx, ScopeKind scopeKind, MutableHandle<UniquePtr<Data>> data,
HandleScope enclosing) {
/* static */
EvalScope* EvalScope::createWithData(JSContext* cx, ScopeKind scopeKind,
MutableHandle<UniquePtr<Data>> data,
HandleScope enclosing) {
MOZ_ASSERT(data);
RootedShape envShape(cx);
@ -1091,7 +1117,8 @@ static const uint32_t EvalScopeEnvShapeFlags =
return Scope::create<EvalScope>(cx, scopeKind, enclosing, envShape, data);
}
/* static */ Scope* EvalScope::nearestVarScopeForDirectEval(Scope* scope) {
/* static */
Scope* EvalScope::nearestVarScopeForDirectEval(Scope* scope) {
for (ScopeIter si(scope); si; si++) {
switch (si.kind()) {
case ScopeKind::Function:
@ -1107,16 +1134,17 @@ static const uint32_t EvalScopeEnvShapeFlags =
return nullptr;
}
/* static */ Shape* EvalScope::getEmptyEnvironmentShape(JSContext* cx) {
/* static */
Shape* EvalScope::getEmptyEnvironmentShape(JSContext* cx) {
const Class* cls = &VarEnvironmentObject::class_;
return EmptyEnvironmentShape(cx, cls, JSSLOT_FREE(cls),
EvalScopeEnvShapeFlags);
}
template <XDRMode mode>
/* static */ XDRResult EvalScope::XDR(XDRState<mode>* xdr, ScopeKind kind,
HandleScope enclosing,
MutableHandleScope scope) {
/* static */
XDRResult EvalScope::XDR(XDRState<mode>* xdr, ScopeKind kind,
HandleScope enclosing, MutableHandleScope scope) {
JSContext* cx = xdr->cx();
Rooted<Data*> data(cx);
@ -1144,12 +1172,14 @@ template <XDRMode mode>
}
template
/* static */ XDRResult
/* static */
XDRResult
EvalScope::XDR(XDRState<XDR_ENCODE>* xdr, ScopeKind kind,
HandleScope enclosing, MutableHandleScope scope);
template
/* static */ XDRResult
/* static */
XDRResult
EvalScope::XDR(XDRState<XDR_DECODE>* xdr, ScopeKind kind,
HandleScope enclosing, MutableHandleScope scope);
@ -1161,10 +1191,10 @@ Zone* ModuleScope::Data::zone() const {
return module ? module->zone() : nullptr;
}
/* static */ ModuleScope* ModuleScope::create(JSContext* cx,
Handle<Data*> dataArg,
HandleModuleObject module,
HandleScope enclosing) {
/* static */
ModuleScope* ModuleScope::create(JSContext* cx, Handle<Data*> dataArg,
HandleModuleObject module,
HandleScope enclosing) {
Rooted<UniquePtr<Data>> data(cx, dataArg
? CopyScopeData<ModuleScope>(cx, dataArg)
: NewEmptyScopeData<ModuleScope>(cx));
@ -1175,9 +1205,11 @@ Zone* ModuleScope::Data::zone() const {
return createWithData(cx, &data, module, enclosing);
}
/* static */ ModuleScope* ModuleScope::createWithData(
JSContext* cx, MutableHandle<UniquePtr<Data>> data,
HandleModuleObject module, HandleScope enclosing) {
/* static */
ModuleScope* ModuleScope::createWithData(JSContext* cx,
MutableHandle<UniquePtr<Data>> data,
HandleModuleObject module,
HandleScope enclosing) {
MOZ_ASSERT(data);
MOZ_ASSERT(enclosing->is<GlobalScope>());
@ -1208,7 +1240,8 @@ Zone* ModuleScope::Data::zone() const {
data);
}
/* static */ Shape* ModuleScope::getEmptyEnvironmentShape(JSContext* cx) {
/* static */
Shape* ModuleScope::getEmptyEnvironmentShape(JSContext* cx) {
const Class* cls = &ModuleEnvironmentObject::class_;
return EmptyEnvironmentShape(cx, cls, JSSLOT_FREE(cls),
ModuleScopeEnvShapeFlags);
@ -1245,8 +1278,9 @@ static void InitializeNextTrailingName(const Rooted<UniquePtr<Data>>& data,
data->length++;
}
/* static */ WasmInstanceScope* WasmInstanceScope::create(
JSContext* cx, WasmInstanceObject* instance) {
/* static */
WasmInstanceScope* WasmInstanceScope::create(JSContext* cx,
WasmInstanceObject* instance) {
// WasmInstanceScope::Data has GCManagedDeletePolicy because it contains a
// GCPtr. Destruction of |data| below may trigger calls into the GC.
@ -1295,7 +1329,8 @@ static void InitializeNextTrailingName(const Rooted<UniquePtr<Data>>& data,
/* envShape = */ nullptr, &data);
}
/* static */ Shape* WasmInstanceScope::getEmptyEnvironmentShape(JSContext* cx) {
/* static */
Shape* WasmInstanceScope::getEmptyEnvironmentShape(JSContext* cx) {
const Class* cls = &WasmInstanceEnvironmentObject::class_;
return EmptyEnvironmentShape(cx, cls, JSSLOT_FREE(cls),
WasmInstanceEnvShapeFlags);
@ -1306,9 +1341,10 @@ static void InitializeNextTrailingName(const Rooted<UniquePtr<Data>>& data,
static const uint32_t WasmFunctionEnvShapeFlags =
BaseShape::NOT_EXTENSIBLE | BaseShape::DELEGATE;
/* static */ WasmFunctionScope* WasmFunctionScope::create(JSContext* cx,
HandleScope enclosing,
uint32_t funcIndex) {
/* static */
WasmFunctionScope* WasmFunctionScope::create(JSContext* cx,
HandleScope enclosing,
uint32_t funcIndex) {
MOZ_ASSERT(enclosing->is<WasmInstanceScope>());
Rooted<WasmFunctionScope*> wasmFunctionScope(cx);
@ -1348,7 +1384,8 @@ static const uint32_t WasmFunctionEnvShapeFlags =
/* envShape = */ nullptr, &data);
}
/* static */ Shape* WasmFunctionScope::getEmptyEnvironmentShape(JSContext* cx) {
/* static */
Shape* WasmFunctionScope::getEmptyEnvironmentShape(JSContext* cx) {
const Class* cls = &WasmFunctionCallObject::class_;
return EmptyEnvironmentShape(cx, cls, JSSLOT_FREE(cls),
WasmFunctionEnvShapeFlags);

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

@ -154,7 +154,8 @@ void Shape::handoffTableTo(Shape* shape) {
shape->base_ = nbase;
}
/* static */ bool Shape::hashify(JSContext* cx, Shape* shape) {
/* static */
bool Shape::hashify(JSContext* cx, Shape* shape) {
MOZ_ASSERT(!shape->hasTable());
if (!shape->ensureOwnBaseShape(cx)) {
@ -175,7 +176,8 @@ void Shape::handoffTableTo(Shape* shape) {
return true;
}
/* static */ bool Shape::cachify(JSContext* cx, Shape* shape) {
/* static */
bool Shape::cachify(JSContext* cx, Shape* shape) {
MOZ_ASSERT(!shape->hasTable() && !shape->hasIC());
if (!shape->ensureOwnBaseShape(cx)) {
@ -316,10 +318,9 @@ void ShapeTable::checkAfterMovingGC() {
#endif
/* static */ Shape* Shape::replaceLastProperty(JSContext* cx,
StackBaseShape& base,
TaggedProto proto,
HandleShape shape) {
/* static */
Shape* Shape::replaceLastProperty(JSContext* cx, StackBaseShape& base,
TaggedProto proto, HandleShape shape) {
MOZ_ASSERT(!shape->inDictionary());
if (!shape->parent) {
@ -446,8 +447,8 @@ void ShapeTable::checkAfterMovingGC() {
return shape;
}
/* static */ bool js::NativeObject::toDictionaryMode(JSContext* cx,
HandleNativeObject obj) {
/* static */
bool js::NativeObject::toDictionaryMode(JSContext* cx, HandleNativeObject obj) {
MOZ_ASSERT(!obj->inDictionaryMode());
MOZ_ASSERT(cx->isInsideCurrentCompartment(obj));
@ -617,7 +618,8 @@ static void AssertValidPropertyOp(NativeObject* obj, GetterOp getter,
#endif
}
/* static */ Shape* NativeObject::addAccessorPropertyInternal(
/* static */
Shape* NativeObject::addAccessorPropertyInternal(
JSContext* cx, HandleNativeObject obj, HandleId id, GetterOp getter,
SetterOp setter, unsigned attrs, ShapeTable* table,
ShapeTable::Entry* entry, const AutoKeepShapeCaches& keep) {
@ -658,10 +660,13 @@ static void AssertValidPropertyOp(NativeObject* obj, GetterOp getter,
return shape;
}
/* static */ Shape* NativeObject::addDataPropertyInternal(
JSContext* cx, HandleNativeObject obj, HandleId id, uint32_t slot,
unsigned attrs, ShapeTable* table, ShapeTable::Entry* entry,
const AutoKeepShapeCaches& keep) {
/* static */
Shape* NativeObject::addDataPropertyInternal(JSContext* cx,
HandleNativeObject obj,
HandleId id, uint32_t slot,
unsigned attrs, ShapeTable* table,
ShapeTable::Entry* entry,
const AutoKeepShapeCaches& keep) {
AutoCheckShapeConsistency check(obj);
// The slot, if any, must be a reserved slot.
@ -726,8 +731,10 @@ static MOZ_ALWAYS_INLINE Shape* PropertyTreeReadBarrier(Shape* parent,
return nullptr;
}
/* static */ Shape* NativeObject::addEnumerableDataProperty(
JSContext* cx, HandleNativeObject obj, HandleId id) {
/* static */
Shape* NativeObject::addEnumerableDataProperty(JSContext* cx,
HandleNativeObject obj,
HandleId id) {
// Like addProperty(Internal), but optimized for the common case of adding a
// new enumerable data property.
@ -930,8 +937,10 @@ static void AssertValidArrayIndex(NativeObject* obj, jsid id) {
#endif
}
/* static */ bool NativeObject::maybeToDictionaryModeForPut(
JSContext* cx, HandleNativeObject obj, MutableHandleShape shape) {
/* static */
bool NativeObject::maybeToDictionaryModeForPut(JSContext* cx,
HandleNativeObject obj,
MutableHandleShape shape) {
// Overwriting a non-last property requires switching to dictionary mode.
// The shape tree is shared immutable, and we can't removeProperty and then
// addAccessorPropertyInternal because a failure under add would lose data.
@ -952,9 +961,9 @@ static void AssertValidArrayIndex(NativeObject* obj, jsid id) {
return true;
}
/* static */ Shape* NativeObject::putDataProperty(JSContext* cx,
HandleNativeObject obj,
HandleId id, unsigned attrs) {
/* static */
Shape* NativeObject::putDataProperty(JSContext* cx, HandleNativeObject obj,
HandleId id, unsigned attrs) {
MOZ_ASSERT(!JSID_IS_VOID(id));
AutoCheckShapeConsistency check(obj);
@ -1065,9 +1074,10 @@ static void AssertValidArrayIndex(NativeObject* obj, jsid id) {
return shape;
}
/* static */ Shape* NativeObject::putAccessorProperty(
JSContext* cx, HandleNativeObject obj, HandleId id, GetterOp getter,
SetterOp setter, unsigned attrs) {
/* static */
Shape* NativeObject::putAccessorProperty(JSContext* cx, HandleNativeObject obj,
HandleId id, GetterOp getter,
SetterOp setter, unsigned attrs) {
MOZ_ASSERT(!JSID_IS_VOID(id));
AutoCheckShapeConsistency check(obj);
@ -1184,9 +1194,10 @@ static void AssertValidArrayIndex(NativeObject* obj, jsid id) {
return shape;
}
/* static */ Shape* NativeObject::changeProperty(
JSContext* cx, HandleNativeObject obj, HandleShape shape, unsigned attrs,
GetterOp getter, SetterOp setter) {
/* static */
Shape* NativeObject::changeProperty(JSContext* cx, HandleNativeObject obj,
HandleShape shape, unsigned attrs,
GetterOp getter, SetterOp setter) {
MOZ_ASSERT(obj->containsPure(shape));
AutoCheckShapeConsistency check(obj);
@ -1210,9 +1221,9 @@ static void AssertValidArrayIndex(NativeObject* obj, jsid id) {
return putAccessorProperty(cx, obj, propid, getter, setter, attrs);
}
/* static */ bool NativeObject::removeProperty(JSContext* cx,
HandleNativeObject obj,
jsid id_) {
/* static */
bool NativeObject::removeProperty(JSContext* cx, HandleNativeObject obj,
jsid id_) {
RootedId id(cx, id_);
AutoKeepShapeCaches keep(cx);
@ -1341,7 +1352,8 @@ static void AssertValidArrayIndex(NativeObject* obj, jsid id) {
return true;
}
/* static */ void NativeObject::clear(JSContext* cx, HandleNativeObject obj) {
/* static */
void NativeObject::clear(JSContext* cx, HandleNativeObject obj) {
Shape* shape = obj->lastProperty();
MOZ_ASSERT(obj->inDictionaryMode() == shape->inDictionary());
@ -1360,9 +1372,9 @@ static void AssertValidArrayIndex(NativeObject* obj, jsid id) {
obj->checkShapeConsistency();
}
/* static */ bool NativeObject::rollbackProperties(JSContext* cx,
HandleNativeObject obj,
uint32_t slotSpan) {
/* static */
bool NativeObject::rollbackProperties(JSContext* cx, HandleNativeObject obj,
uint32_t slotSpan) {
/*
* Remove properties from this object until it has a matching slot span.
* The object cannot have escaped in a way which would prevent safe
@ -1387,9 +1399,12 @@ static void AssertValidArrayIndex(NativeObject* obj, jsid id) {
return true;
}
/* static */ Shape* NativeObject::replaceWithNewEquivalentShape(
JSContext* cx, HandleNativeObject obj, Shape* oldShape, Shape* newShape,
bool accessorShape) {
/* static */
Shape* NativeObject::replaceWithNewEquivalentShape(JSContext* cx,
HandleNativeObject obj,
Shape* oldShape,
Shape* newShape,
bool accessorShape) {
MOZ_ASSERT(cx->isInsideCurrentZone(oldShape));
MOZ_ASSERT_IF(oldShape != obj->lastProperty(),
obj->inDictionaryMode() &&
@ -1447,9 +1462,9 @@ static void AssertValidArrayIndex(NativeObject* obj, jsid id) {
return newShape;
}
/* static */ bool JSObject::setFlags(JSContext* cx, HandleObject obj,
BaseShape::Flag flags,
GenerateShape generateShape) {
/* static */
bool JSObject::setFlags(JSContext* cx, HandleObject obj, BaseShape::Flag flags,
GenerateShape generateShape) {
MOZ_ASSERT(cx->compartment() == obj->compartment());
if (obj->hasAllFlags(flags)) {
@ -1491,8 +1506,9 @@ static void AssertValidArrayIndex(NativeObject* obj, jsid id) {
return true;
}
/* static */ bool NativeObject::clearFlag(JSContext* cx, HandleNativeObject obj,
BaseShape::Flag flag) {
/* static */
bool NativeObject::clearFlag(JSContext* cx, HandleNativeObject obj,
BaseShape::Flag flag) {
MOZ_ASSERT(obj->lastProperty()->getObjectFlags() & flag);
if (!obj->inDictionaryMode()) {
@ -1512,8 +1528,9 @@ static void AssertValidArrayIndex(NativeObject* obj, jsid id) {
return true;
}
/* static */ Shape* Shape::setObjectFlags(JSContext* cx, BaseShape::Flag flags,
TaggedProto proto, Shape* last) {
/* static */
Shape* Shape::setObjectFlags(JSContext* cx, BaseShape::Flag flags,
TaggedProto proto, Shape* last) {
if ((last->getObjectFlags() & flags) == flags) {
return last;
}
@ -1528,8 +1545,8 @@ static void AssertValidArrayIndex(NativeObject* obj, jsid id) {
inline BaseShape::BaseShape(const StackBaseShape& base)
: clasp_(base.clasp), flags(base.flags), slotSpan_(0), unowned_(nullptr) {}
/* static */ void BaseShape::copyFromUnowned(BaseShape& dest,
UnownedBaseShape& src) {
/* static */
void BaseShape::copyFromUnowned(BaseShape& dest, UnownedBaseShape& src) {
dest.clasp_ = src.clasp_;
dest.slotSpan_ = src.slotSpan_;
dest.unowned_ = &src;
@ -1549,8 +1566,8 @@ inline void BaseShape::adoptUnowned(UnownedBaseShape* other) {
assertConsistency();
}
/* static */ UnownedBaseShape* BaseShape::getUnowned(JSContext* cx,
StackBaseShape& base) {
/* static */
UnownedBaseShape* BaseShape::getUnowned(JSContext* cx, StackBaseShape& base) {
auto& table = cx->zone()->baseShapes();
auto p = MakeDependentAddPtr(cx, table, base);
@ -2108,11 +2125,10 @@ void Shape::dumpSubtree(int level, js::GenericPrinter& out) const {
#endif
/* static */ Shape* EmptyShape::getInitialShape(JSContext* cx,
const Class* clasp,
TaggedProto proto,
size_t nfixed,
uint32_t objectFlags) {
/* static */
Shape* EmptyShape::getInitialShape(JSContext* cx, const Class* clasp,
TaggedProto proto, size_t nfixed,
uint32_t objectFlags) {
MOZ_ASSERT_IF(proto.isObject(),
cx->isInsideCurrentCompartment(proto.toObject()));
@ -2146,11 +2162,10 @@ void Shape::dumpSubtree(int level, js::GenericPrinter& out) const {
return shape;
}
/* static */ Shape* EmptyShape::getInitialShape(JSContext* cx,
const Class* clasp,
TaggedProto proto,
gc::AllocKind kind,
uint32_t objectFlags) {
/* static */
Shape* EmptyShape::getInitialShape(JSContext* cx, const Class* clasp,
TaggedProto proto, gc::AllocKind kind,
uint32_t objectFlags) {
return getInitialShape(cx, clasp, proto, GetGCKindSlots(kind, clasp),
objectFlags);
}
@ -2188,9 +2203,9 @@ void NewObjectCache::invalidateEntriesForShape(JSContext* cx, HandleShape shape,
}
}
/* static */ void EmptyShape::insertInitialShape(JSContext* cx,
HandleShape shape,
HandleObject proto) {
/* static */
void EmptyShape::insertInitialShape(JSContext* cx, HandleShape shape,
HandleObject proto) {
using Lookup = InitialShapeEntry::Lookup;
Lookup lookup(shape->getObjectClass(), TaggedProto(proto),
shape->numFixedSlots(), shape->getObjectFlags());

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

@ -296,7 +296,8 @@ uint32_t SharedArrayBufferObject::wasmBoundsCheckLimit() const {
}
#endif
/* static */ void SharedArrayBufferObject::addSizeOfExcludingThis(
/* static */
void SharedArrayBufferObject::addSizeOfExcludingThis(
JSObject* obj, mozilla::MallocSizeOf mallocSizeOf, JS::ClassInfo* info) {
// Divide the buffer size by the refcount to get the fraction of the buffer
// owned by this thread. It's conceivable that the refcount might change in
@ -309,7 +310,8 @@ uint32_t SharedArrayBufferObject::wasmBoundsCheckLimit() const {
buf.byteLength() / buf.rawBufferObject()->refcount();
}
/* static */ void SharedArrayBufferObject::copyData(
/* static */
void SharedArrayBufferObject::copyData(
Handle<SharedArrayBufferObject*> toBuffer, uint32_t toIndex,
Handle<SharedArrayBufferObject*> fromBuffer, uint32_t fromIndex,
uint32_t count) {

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

@ -129,8 +129,8 @@ const char16_t JS::ubi::Concrete<JSString>::concreteTypeName[] = u"JSString";
#if defined(DEBUG) || defined(JS_JITSPEW)
template <typename CharT>
/*static */ void JSString::dumpChars(const CharT* s, size_t n,
js::GenericPrinter& out) {
/*static */
void JSString::dumpChars(const CharT* s, size_t n, js::GenericPrinter& out) {
if (n == SIZE_MAX) {
n = 0;
while (s[n]) {
@ -1018,8 +1018,9 @@ bool js::StringEqualsAscii(JSLinearString* str, const char* asciiBytes) {
}
template <typename CharT>
/* static */ bool JSFlatString::isIndexSlow(const CharT* s, size_t length,
uint32_t* indexp) {
/* static */
bool JSFlatString::isIndexSlow(const CharT* s, size_t length,
uint32_t* indexp) {
CharT ch = *s;
if (!IsAsciiDigit(ch)) {
@ -1196,7 +1197,8 @@ void StaticStrings::trace(JSTracer* trc) {
}
template <typename CharT>
/* static */ bool StaticStrings::isStatic(const CharT* chars, size_t length) {
/* static */
bool StaticStrings::isStatic(const CharT* chars, size_t length) {
switch (length) {
case 1: {
char16_t c = chars[0];
@ -1218,7 +1220,8 @@ template <typename CharT>
}
}
/* static */ bool StaticStrings::isStatic(JSAtom* atom) {
/* static */
bool StaticStrings::isStatic(JSAtom* atom) {
AutoCheckCannotGC nogc;
return atom->hasLatin1Chars()
? isStatic(atom->latin1Chars(nogc), atom->length())
@ -2017,8 +2020,8 @@ static bool FillWithRepresentatives(JSContext* cx, HandleArrayObject array,
return true;
}
/* static */ bool JSString::fillWithRepresentatives(JSContext* cx,
HandleArrayObject array) {
/* static */
bool JSString::fillWithRepresentatives(JSContext* cx, HandleArrayObject array) {
uint32_t index = 0;
auto CheckTwoByte = [](JSString* str) { return str->hasTwoByteChars(); };

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

@ -132,7 +132,8 @@ static UniqueChars MakeStringCopy(const char* s) {
return UniqueChars(copy);
}
/* static */ UniqueChars TypeSet::TypeString(const TypeSet::Type type) {
/* static */
UniqueChars TypeSet::TypeString(const TypeSet::Type type) {
if (type.isPrimitive() || type.isUnknown() || type.isAnyObject()) {
return MakeStringCopy(NonObjectTypeString(type));
}
@ -151,7 +152,8 @@ static UniqueChars MakeStringCopy(const char* s) {
return MakeStringCopy(buf);
}
/* static */ UniqueChars TypeSet::ObjectGroupString(const ObjectGroup* group) {
/* static */
UniqueChars TypeSet::ObjectGroupString(const ObjectGroup* group) {
return TypeString(TypeSet::ObjectType(group));
}
@ -847,7 +849,8 @@ void TypeSet::print(FILE* fp) {
}
}
/* static */ void TypeSet::readBarrier(const TypeSet* types) {
/* static */
void TypeSet::readBarrier(const TypeSet* types) {
if (types->unknownObject()) {
return;
}
@ -863,7 +866,8 @@ void TypeSet::print(FILE* fp) {
}
}
/* static */ bool TypeSet::IsTypeMarked(JSRuntime* rt, TypeSet::Type* v) {
/* static */
bool TypeSet::IsTypeMarked(JSRuntime* rt, TypeSet::Type* v) {
bool rv;
if (v->isSingletonUnchecked()) {
JSObject* obj = v->singletonNoBarrier();
@ -965,8 +969,8 @@ TemporaryTypeSet* TypeSet::cloneWithoutObjects(LifoAlloc* alloc) {
return res;
}
/* static */ TemporaryTypeSet* TypeSet::unionSets(TypeSet* a, TypeSet* b,
LifoAlloc* alloc) {
/* static */
TemporaryTypeSet* TypeSet::unionSets(TypeSet* a, TypeSet* b, LifoAlloc* alloc) {
TemporaryTypeSet* res = alloc->new_<TemporaryTypeSet>(
a->baseFlags() | b->baseFlags(), static_cast<ObjectKey**>(nullptr));
if (!res) {
@ -989,9 +993,10 @@ TemporaryTypeSet* TypeSet::cloneWithoutObjects(LifoAlloc* alloc) {
return res;
}
/* static */ TemporaryTypeSet* TypeSet::removeSet(TemporaryTypeSet* input,
TemporaryTypeSet* removal,
LifoAlloc* alloc) {
/* static */
TemporaryTypeSet* TypeSet::removeSet(TemporaryTypeSet* input,
TemporaryTypeSet* removal,
LifoAlloc* alloc) {
// Only allow removal of primitives and the "AnyObject" flag.
MOZ_ASSERT(!removal->unknown());
MOZ_ASSERT_IF(!removal->unknownObject(), removal->getObjectCount() == 0);
@ -1019,9 +1024,10 @@ TemporaryTypeSet* TypeSet::cloneWithoutObjects(LifoAlloc* alloc) {
return res;
}
/* static */ TemporaryTypeSet* TypeSet::intersectSets(TemporaryTypeSet* a,
TemporaryTypeSet* b,
LifoAlloc* alloc) {
/* static */
TemporaryTypeSet* TypeSet::intersectSets(TemporaryTypeSet* a,
TemporaryTypeSet* b,
LifoAlloc* alloc) {
TemporaryTypeSet* res;
res = alloc->new_<TemporaryTypeSet>(a->baseFlags() & b->baseFlags(),
static_cast<ObjectKey**>(nullptr));
@ -1183,10 +1189,11 @@ CompilerConstraintList* js::NewCompilerConstraintList(
return alloc.lifoAlloc()->new_<CompilerConstraintList>(alloc);
}
/* static */ bool TypeScript::FreezeTypeSets(
CompilerConstraintList* constraints, JSScript* script,
TemporaryTypeSet** pThisTypes, TemporaryTypeSet** pArgTypes,
TemporaryTypeSet** pBytecodeTypes) {
/* static */
bool TypeScript::FreezeTypeSets(CompilerConstraintList* constraints,
JSScript* script, TemporaryTypeSet** pThisTypes,
TemporaryTypeSet** pArgTypes,
TemporaryTypeSet** pBytecodeTypes) {
LifoAlloc* alloc = constraints->alloc();
AutoSweepTypeScript sweep(script);
TypeScript* typeScript = script->types();
@ -3655,8 +3662,9 @@ bool JSScript::makeTypes(JSContext* cx) {
return true;
}
/* static */ bool JSFunction::setTypeForScriptedFunction(
JSContext* cx, HandleFunction fun, bool singleton /* = false */) {
/* static */
bool JSFunction::setTypeForScriptedFunction(JSContext* cx, HandleFunction fun,
bool singleton /* = false */) {
if (singleton) {
if (!setSingleton(cx, fun)) {
return false;
@ -3758,7 +3766,8 @@ void PreliminaryObjectArrayWithTemplate::trace(JSTracer* trc) {
TraceNullableEdge(trc, &shape_, "PreliminaryObjectArrayWithTemplate_shape");
}
/* static */ void PreliminaryObjectArrayWithTemplate::writeBarrierPre(
/* static */
void PreliminaryObjectArrayWithTemplate::writeBarrierPre(
PreliminaryObjectArrayWithTemplate* objects) {
Shape* shape = objects->shape();
@ -3865,8 +3874,8 @@ void PreliminaryObjectArrayWithTemplate::maybeAnalyze(JSContext* cx,
// Make a TypeNewScript for |group|, and set it up to hold the preliminary
// objects created with the group.
/* static */ bool TypeNewScript::make(JSContext* cx, ObjectGroup* group,
JSFunction* fun) {
/* static */
bool TypeNewScript::make(JSContext* cx, ObjectGroup* group, JSFunction* fun) {
AutoSweepObjectGroup sweep(group);
MOZ_ASSERT(cx->zone()->types.activeAnalysis);
MOZ_ASSERT(!group->newScript(sweep));
@ -3902,8 +3911,10 @@ void PreliminaryObjectArrayWithTemplate::maybeAnalyze(JSContext* cx,
// Make a TypeNewScript with the same initializer list as |newScript| but with
// a new template object.
/* static */ TypeNewScript* TypeNewScript::makeNativeVersion(
JSContext* cx, TypeNewScript* newScript, PlainObject* templateObject) {
/* static */
TypeNewScript* TypeNewScript::makeNativeVersion(JSContext* cx,
TypeNewScript* newScript,
PlainObject* templateObject) {
MOZ_RELEASE_ASSERT(cx->zone()->types.activeAnalysis);
auto nativeNewScript = cx->make_unique<TypeNewScript>();
@ -4352,7 +4363,8 @@ void TypeNewScript::trace(JSTracer* trc) {
TraceNullableEdge(trc, &initializedGroup_, "TypeNewScript_initializedGroup");
}
/* static */ void TypeNewScript::writeBarrierPre(TypeNewScript* newScript) {
/* static */
void TypeNewScript::writeBarrierPre(TypeNewScript* newScript) {
if (JS::RuntimeHeapIsCollecting()) {
return;
}
@ -4690,8 +4702,8 @@ void ObjectGroup::sweep(const AutoSweepObjectGroup& sweep) {
}
}
/* static */ void TypeScript::sweepTypes(const js::AutoSweepTypeScript& sweep,
Zone* zone) {
/* static */
void TypeScript::sweepTypes(const js::AutoSweepTypeScript& sweep, Zone* zone) {
MOZ_ASSERT(typesGeneration() != zone->types.generation);
setTypesGeneration(zone->types.generation);

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

@ -67,12 +67,14 @@ using mozilla::IsAsciiDigit;
* the subclasses.
*/
/* static */ bool TypedArrayObject::is(HandleValue v) {
/* static */
bool TypedArrayObject::is(HandleValue v) {
return v.isObject() && v.toObject().is<TypedArrayObject>();
}
/* static */ bool TypedArrayObject::ensureHasBuffer(
JSContext* cx, Handle<TypedArrayObject*> tarray) {
/* static */
bool TypedArrayObject::ensureHasBuffer(JSContext* cx,
Handle<TypedArrayObject*> tarray) {
if (tarray->hasBuffer()) {
return true;
}
@ -141,8 +143,8 @@ void TypedArrayObject::finalize(FreeOp* fop, JSObject* obj) {
}
}
/* static */ size_t TypedArrayObject::objectMoved(JSObject* obj,
JSObject* old) {
/* static */
size_t TypedArrayObject::objectMoved(JSObject* obj, JSObject* old) {
TypedArrayObject* newObj = &obj->as<TypedArrayObject>();
const TypedArrayObject* oldObj = &old->as<TypedArrayObject>();
MOZ_ASSERT(newObj->elementsRaw() == oldObj->elementsRaw());
@ -1435,9 +1437,10 @@ static bool GetTemplateObjectForNative(JSContext* cx, const CallArgs& args,
return true;
}
/* static */ bool TypedArrayObject::GetTemplateObjectForNative(
JSContext* cx, Native native, const CallArgs& args,
MutableHandleObject res) {
/* static */
bool TypedArrayObject::GetTemplateObjectForNative(JSContext* cx, Native native,
const CallArgs& args,
MutableHandleObject res) {
MOZ_ASSERT(!res);
#define CHECK_TYPED_ARRAY_CONSTRUCTOR(T, N) \
if (native == &TypedArrayObjectTemplate<T>::class_constructor) { \
@ -1469,8 +1472,8 @@ bool BufferGetterImpl(JSContext* cx, const CallArgs& args) {
return true;
}
/*static*/ bool js::TypedArray_bufferGetter(JSContext* cx, unsigned argc,
Value* vp) {
/*static*/
bool js::TypedArray_bufferGetter(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod<TypedArrayObject::is, BufferGetterImpl>(cx, args);
}
@ -1550,8 +1553,8 @@ static inline bool SetFromNonTypedArray(JSContext* cx,
// 22.2.3.23 %TypedArray%.prototype.set ( overloaded [ , offset ] )
// 22.2.3.23.1 %TypedArray%.prototype.set ( array [ , offset ] )
// 22.2.3.23.2 %TypedArray%.prototype.set( typedArray [ , offset ] )
/* static */ bool TypedArrayObject::set_impl(JSContext* cx,
const CallArgs& args) {
/* static */
bool TypedArrayObject::set_impl(JSContext* cx, const CallArgs& args) {
MOZ_ASSERT(TypedArrayObject::is(args.thisv()));
// Steps 1-5 (Validation performed as part of CallNonGenericMethod).
@ -1722,8 +1725,8 @@ static inline bool SetFromNonTypedArray(JSContext* cx,
return true;
}
/* static */ bool TypedArrayObject::set(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool TypedArrayObject::set(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod<TypedArrayObject::is, TypedArrayObject::set_impl>(
cx, args);
@ -2032,11 +2035,13 @@ const Class TypedArrayObject::protoClasses[Scalar::MaxTypedArrayViewType] = {
#undef IMPL_TYPED_ARRAY_PROTO_CLASS
};
/* static */ bool TypedArrayObject::isOriginalLengthGetter(Native native) {
/* static */
bool TypedArrayObject::isOriginalLengthGetter(Native native) {
return native == TypedArray_lengthGetter;
}
/* static */ bool TypedArrayObject::isOriginalByteOffsetGetter(Native native) {
/* static */
bool TypedArrayObject::isOriginalByteOffsetGetter(Native native) {
return native == TypedArray_byteOffsetGetter;
}

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

@ -65,8 +65,9 @@ void UnboxedLayout::setNewScript(TypeNewScript* newScript,
// be cleared.
static const uintptr_t CLEAR_CONSTRUCTOR_CODE_TOKEN = 0x1;
/* static */ bool UnboxedLayout::makeConstructorCode(JSContext* cx,
HandleObjectGroup group) {
/* static */
bool UnboxedLayout::makeConstructorCode(JSContext* cx,
HandleObjectGroup group) {
gc::AutoSuppressGC suppress(cx);
using namespace jit;
@ -499,7 +500,8 @@ void UnboxedPlainObject::trace(JSTracer* trc, JSObject* obj) {
MOZ_ASSERT(*(list + 1) == -1);
}
/* static */ UnboxedExpandoObject* UnboxedPlainObject::ensureExpando(
/* static */
UnboxedExpandoObject* UnboxedPlainObject::ensureExpando(
JSContext* cx, Handle<UnboxedPlainObject*> obj) {
if (obj->maybeExpando()) {
return obj->maybeExpando();
@ -590,8 +592,8 @@ static PlainObject* MakeReplacementTemplateObject(JSContext* cx,
return obj;
}
/* static */ bool UnboxedLayout::makeNativeGroup(JSContext* cx,
ObjectGroup* group) {
/* static */
bool UnboxedLayout::makeNativeGroup(JSContext* cx, ObjectGroup* group) {
MOZ_ASSERT(cx->realm() == group->realm());
AutoEnterAnalysis enter(cx);
@ -737,8 +739,9 @@ static PlainObject* MakeReplacementTemplateObject(JSContext* cx,
return true;
}
/* static */ NativeObject* UnboxedPlainObject::convertToNative(JSContext* cx,
JSObject* obj) {
/* static */
NativeObject* UnboxedPlainObject::convertToNative(JSContext* cx,
JSObject* obj) {
// This function returns the original object (instead of bool) to make sure
// Ion's LConvertUnboxedObjectToNative works correctly. If we return bool
// and use defineReuseInput, the object register is not preserved across the
@ -912,9 +915,11 @@ UnboxedPlainObject* UnboxedPlainObject::create(JSContext* cx,
return uobj;
}
/* static */ JSObject* UnboxedPlainObject::createWithProperties(
JSContext* cx, HandleObjectGroup group, NewObjectKind newKind,
IdValuePair* properties) {
/* static */
JSObject* UnboxedPlainObject::createWithProperties(JSContext* cx,
HandleObjectGroup group,
NewObjectKind newKind,
IdValuePair* properties) {
MOZ_ASSERT(newKind == GenericObject || newKind == TenuredObject);
{
@ -978,7 +983,8 @@ UnboxedPlainObject* UnboxedPlainObject::create(JSContext* cx,
return obj;
}
/* static */ bool UnboxedPlainObject::obj_lookupProperty(
/* static */
bool UnboxedPlainObject::obj_lookupProperty(
JSContext* cx, HandleObject obj, HandleId id, MutableHandleObject objp,
MutableHandle<PropertyResult> propp) {
if (obj->as<UnboxedPlainObject>().containsUnboxedOrExpandoProperty(cx, id)) {
@ -997,9 +1003,11 @@ UnboxedPlainObject* UnboxedPlainObject::create(JSContext* cx,
return LookupProperty(cx, proto, id, objp, propp);
}
/* static */ bool UnboxedPlainObject::obj_defineProperty(
JSContext* cx, HandleObject obj, HandleId id,
Handle<PropertyDescriptor> desc, ObjectOpResult& result) {
/* static */
bool UnboxedPlainObject::obj_defineProperty(JSContext* cx, HandleObject obj,
HandleId id,
Handle<PropertyDescriptor> desc,
ObjectOpResult& result) {
const UnboxedLayout& layout = obj->as<UnboxedPlainObject>().layout();
if (const UnboxedLayout::Property* property = layout.lookup(id)) {
@ -1033,10 +1041,9 @@ UnboxedPlainObject* UnboxedPlainObject::create(JSContext* cx,
return DefineProperty(cx, expando, id, desc, result);
}
/* static */ bool UnboxedPlainObject::obj_hasProperty(JSContext* cx,
HandleObject obj,
HandleId id,
bool* foundp) {
/* static */
bool UnboxedPlainObject::obj_hasProperty(JSContext* cx, HandleObject obj,
HandleId id, bool* foundp) {
if (obj->as<UnboxedPlainObject>().containsUnboxedOrExpandoProperty(cx, id)) {
*foundp = true;
return true;
@ -1051,11 +1058,10 @@ UnboxedPlainObject* UnboxedPlainObject::create(JSContext* cx,
return HasProperty(cx, proto, id, foundp);
}
/* static */ bool UnboxedPlainObject::obj_getProperty(JSContext* cx,
HandleObject obj,
HandleValue receiver,
HandleId id,
MutableHandleValue vp) {
/* static */
bool UnboxedPlainObject::obj_getProperty(JSContext* cx, HandleObject obj,
HandleValue receiver, HandleId id,
MutableHandleValue vp) {
const UnboxedLayout& layout = obj->as<UnboxedPlainObject>().layout();
if (const UnboxedLayout::Property* property = layout.lookup(id)) {
@ -1080,9 +1086,11 @@ UnboxedPlainObject* UnboxedPlainObject::create(JSContext* cx,
return GetProperty(cx, proto, receiver, id, vp);
}
/* static */ bool UnboxedPlainObject::obj_setProperty(
JSContext* cx, HandleObject obj, HandleId id, HandleValue v,
HandleValue receiver, ObjectOpResult& result) {
/* static */
bool UnboxedPlainObject::obj_setProperty(JSContext* cx, HandleObject obj,
HandleId id, HandleValue v,
HandleValue receiver,
ObjectOpResult& result) {
const UnboxedLayout& layout = obj->as<UnboxedPlainObject>().layout();
if (const UnboxedLayout::Property* property = layout.lookup(id)) {
@ -1114,7 +1122,8 @@ UnboxedPlainObject* UnboxedPlainObject::create(JSContext* cx,
return SetPropertyOnProto(cx, obj, id, v, receiver, result);
}
/* static */ bool UnboxedPlainObject::obj_getOwnPropertyDescriptor(
/* static */
bool UnboxedPlainObject::obj_getOwnPropertyDescriptor(
JSContext* cx, HandleObject obj, HandleId id,
MutableHandle<PropertyDescriptor> desc) {
const UnboxedLayout& layout = obj->as<UnboxedPlainObject>().layout();
@ -1144,18 +1153,20 @@ UnboxedPlainObject* UnboxedPlainObject::create(JSContext* cx,
return true;
}
/* static */ bool UnboxedPlainObject::obj_deleteProperty(
JSContext* cx, HandleObject obj, HandleId id, ObjectOpResult& result) {
/* static */
bool UnboxedPlainObject::obj_deleteProperty(JSContext* cx, HandleObject obj,
HandleId id,
ObjectOpResult& result) {
if (!convertToNative(cx, obj)) {
return false;
}
return DeleteProperty(cx, obj, id, result);
}
/* static */ bool UnboxedPlainObject::newEnumerate(JSContext* cx,
HandleObject obj,
AutoIdVector& properties,
bool enumerableOnly) {
/* static */
bool UnboxedPlainObject::newEnumerate(JSContext* cx, HandleObject obj,
AutoIdVector& properties,
bool enumerableOnly) {
// Ignore expando properties here, they are special-cased by the property
// enumeration code.

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

@ -108,8 +108,8 @@ static uint32_t RoundupCodeLength(uint32_t codeLength) {
return JS_ROUNDUP(codeLength, ExecutableCodePageSize);
}
/* static */ UniqueCodeBytes CodeSegment::AllocateCodeBytes(
uint32_t codeLength) {
/* static */
UniqueCodeBytes CodeSegment::AllocateCodeBytes(uint32_t codeLength) {
if (codeLength > MaxCodeBytesPerProcess) {
return nullptr;
}
@ -337,8 +337,9 @@ ModuleSegment::ModuleSegment(Tier tier, UniqueCodeBytes codeBytes,
tier_(tier),
trapCode_(base() + linkData.trapOffset) {}
/* static */ UniqueModuleSegment ModuleSegment::create(
Tier tier, MacroAssembler& masm, const LinkData& linkData) {
/* static */
UniqueModuleSegment ModuleSegment::create(Tier tier, MacroAssembler& masm,
const LinkData& linkData) {
uint32_t codeLength = masm.bytesNeeded();
UniqueCodeBytes codeBytes = AllocateCodeBytes(codeLength);
@ -353,8 +354,9 @@ ModuleSegment::ModuleSegment(Tier tier, UniqueCodeBytes codeBytes,
linkData);
}
/* static */ UniqueModuleSegment ModuleSegment::create(
Tier tier, const Bytes& unlinkedBytes, const LinkData& linkData) {
/* static */
UniqueModuleSegment ModuleSegment::create(Tier tier, const Bytes& unlinkedBytes,
const LinkData& linkData) {
uint32_t codeLength = unlinkedBytes.length();
UniqueCodeBytes codeBytes = AllocateCodeBytes(codeLength);

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

@ -674,7 +674,8 @@ const JSFunctionSpec WasmModuleObject::static_methods[] = {
JSPROP_ENUMERATE),
JS_FS_END};
/* static */ void WasmModuleObject::finalize(FreeOp* fop, JSObject* obj) {
/* static */
void WasmModuleObject::finalize(FreeOp* fop, JSObject* obj) {
obj->as<WasmModuleObject>().module().Release();
}
@ -800,8 +801,8 @@ static JSString* UTF8CharsToString(JSContext* cx, const char* chars) {
JS::ConstUTF8CharsZ(chars, strlen(chars)));
}
/* static */ bool WasmModuleObject::imports(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool WasmModuleObject::imports(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
const Module* module;
@ -880,8 +881,8 @@ static JSString* UTF8CharsToString(JSContext* cx, const char* chars) {
return true;
}
/* static */ bool WasmModuleObject::exports(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool WasmModuleObject::exports(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
const Module* module;
@ -953,8 +954,8 @@ static JSString* UTF8CharsToString(JSContext* cx, const char* chars) {
return true;
}
/* static */ bool WasmModuleObject::customSections(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool WasmModuleObject::customSections(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
const Module* module;
@ -1013,9 +1014,9 @@ static JSString* UTF8CharsToString(JSContext* cx, const char* chars) {
return true;
}
/* static */ WasmModuleObject* WasmModuleObject::create(JSContext* cx,
const Module& module,
HandleObject proto) {
/* static */
WasmModuleObject* WasmModuleObject::create(JSContext* cx, const Module& module,
HandleObject proto) {
AutoSetNewObjectMetadata metadata(cx);
auto* obj = NewObjectWithGivenProto<WasmModuleObject>(cx, proto);
if (!obj) {
@ -1088,8 +1089,8 @@ static bool ReportCompileWarnings(JSContext* cx,
return true;
}
/* static */ bool WasmModuleObject::construct(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool WasmModuleObject::construct(JSContext* cx, unsigned argc, Value* vp) {
CallArgs callArgs = CallArgsFromVp(argc, vp);
Log(cx, "sync new Module() started");
@ -1182,15 +1183,17 @@ static bool IsInstance(HandleValue v) {
return v.isObject() && v.toObject().is<WasmInstanceObject>();
}
/* static */ bool WasmInstanceObject::exportsGetterImpl(JSContext* cx,
const CallArgs& args) {
/* static */
bool WasmInstanceObject::exportsGetterImpl(JSContext* cx,
const CallArgs& args) {
args.rval().setObject(
args.thisv().toObject().as<WasmInstanceObject>().exportsObj());
return true;
}
/* static */ bool WasmInstanceObject::exportsGetter(JSContext* cx,
unsigned argc, Value* vp) {
/* static */
bool WasmInstanceObject::exportsGetter(JSContext* cx, unsigned argc,
Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod<IsInstance, exportsGetterImpl>(cx, args);
}
@ -1208,7 +1211,8 @@ bool WasmInstanceObject::isNewborn() const {
return getReservedSlot(INSTANCE_SLOT).isUndefined();
}
/* static */ void WasmInstanceObject::finalize(FreeOp* fop, JSObject* obj) {
/* static */
void WasmInstanceObject::finalize(FreeOp* fop, JSObject* obj) {
fop->delete_(&obj->as<WasmInstanceObject>().exports());
fop->delete_(&obj->as<WasmInstanceObject>().scopes());
fop->delete_(&obj->as<WasmInstanceObject>().indirectGlobals());
@ -1217,7 +1221,8 @@ bool WasmInstanceObject::isNewborn() const {
}
}
/* static */ void WasmInstanceObject::trace(JSTracer* trc, JSObject* obj) {
/* static */
void WasmInstanceObject::trace(JSTracer* trc, JSObject* obj) {
WasmInstanceObject& instanceObj = obj->as<WasmInstanceObject>();
instanceObj.exports().trace(trc);
instanceObj.indirectGlobals().trace(trc);
@ -1226,7 +1231,8 @@ bool WasmInstanceObject::isNewborn() const {
}
}
/* static */ WasmInstanceObject* WasmInstanceObject::create(
/* static */
WasmInstanceObject* WasmInstanceObject::create(
JSContext* cx, SharedCode code, const DataSegmentVector& dataSegments,
const ElemSegmentVector& elemSegments, UniqueTlsData tlsData,
HandleWasmMemoryObject memory, SharedTableVector&& tables,
@ -1347,8 +1353,8 @@ static bool Instantiate(JSContext* cx, const Module& module,
globalObjs.get(), instanceProto, instanceObj);
}
/* static */ bool WasmInstanceObject::construct(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool WasmInstanceObject::construct(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
Log(cx, "sync new Instance() started");
@ -1464,7 +1470,8 @@ static bool EnsureLazyEntryStub(const Instance& instance,
return stubs2->createOne(funcExportIndex, codeTier);
}
/* static */ bool WasmInstanceObject::getExportedFunction(
/* static */
bool WasmInstanceObject::getExportedFunction(
JSContext* cx, HandleWasmInstanceObject instanceObj, uint32_t funcIndex,
MutableHandleFunction fun) {
if (ExportMap::Ptr p = instanceObj->exports().lookup(funcIndex)) {
@ -1555,7 +1562,8 @@ const CodeRange& WasmInstanceObject::getExportedFunctionCodeRange(
return metadata.codeRange(metadata.lookupFuncExport(funcIndex));
}
/* static */ WasmInstanceScope* WasmInstanceObject::getScope(
/* static */
WasmInstanceScope* WasmInstanceObject::getScope(
JSContext* cx, HandleWasmInstanceObject instanceObj) {
if (!instanceObj->getReservedSlot(INSTANCE_SCOPE_SLOT).isUndefined()) {
return (WasmInstanceScope*)instanceObj->getReservedSlot(INSTANCE_SCOPE_SLOT)
@ -1574,7 +1582,8 @@ const CodeRange& WasmInstanceObject::getExportedFunctionCodeRange(
return instanceScope;
}
/* static */ WasmFunctionScope* WasmInstanceObject::getFunctionScope(
/* static */
WasmFunctionScope* WasmInstanceObject::getFunctionScope(
JSContext* cx, HandleWasmInstanceObject instanceObj, uint32_t funcIndex) {
if (ScopeMap::Ptr p = instanceObj->scopes().lookup(funcIndex)) {
return p->value();
@ -1656,14 +1665,16 @@ const Class WasmMemoryObject::class_ = {
JSCLASS_FOREGROUND_FINALIZE,
&WasmMemoryObject::classOps_};
/* static */ void WasmMemoryObject::finalize(FreeOp* fop, JSObject* obj) {
/* static */
void WasmMemoryObject::finalize(FreeOp* fop, JSObject* obj) {
WasmMemoryObject& memory = obj->as<WasmMemoryObject>();
if (memory.hasObservers()) {
fop->delete_(&memory.observers());
}
}
/* static */ WasmMemoryObject* WasmMemoryObject::create(
/* static */
WasmMemoryObject* WasmMemoryObject::create(
JSContext* cx, HandleArrayBufferObjectMaybeShared buffer,
HandleObject proto) {
AutoSetNewObjectMetadata metadata(cx);
@ -1677,8 +1688,8 @@ const Class WasmMemoryObject::class_ = {
return obj;
}
/* static */ bool WasmMemoryObject::construct(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool WasmMemoryObject::construct(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
if (!ThrowIfNotConstructing(cx, args, "Memory")) {
@ -1725,8 +1736,8 @@ static bool IsMemory(HandleValue v) {
return v.isObject() && v.toObject().is<WasmMemoryObject>();
}
/* static */ bool WasmMemoryObject::bufferGetterImpl(JSContext* cx,
const CallArgs& args) {
/* static */
bool WasmMemoryObject::bufferGetterImpl(JSContext* cx, const CallArgs& args) {
RootedWasmMemoryObject memoryObj(
cx, &args.thisv().toObject().as<WasmMemoryObject>());
RootedArrayBufferObjectMaybeShared buffer(cx, &memoryObj->buffer());
@ -1758,8 +1769,8 @@ static bool IsMemory(HandleValue v) {
return true;
}
/* static */ bool WasmMemoryObject::bufferGetter(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool WasmMemoryObject::bufferGetter(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod<IsMemory, bufferGetterImpl>(cx, args);
}
@ -1768,8 +1779,8 @@ const JSPropertySpec WasmMemoryObject::properties[] = {
JS_PSG("buffer", WasmMemoryObject::bufferGetter, JSPROP_ENUMERATE),
JS_PS_END};
/* static */ bool WasmMemoryObject::growImpl(JSContext* cx,
const CallArgs& args) {
/* static */
bool WasmMemoryObject::growImpl(JSContext* cx, const CallArgs& args) {
RootedWasmMemoryObject memory(
cx, &args.thisv().toObject().as<WasmMemoryObject>());
@ -1794,8 +1805,8 @@ const JSPropertySpec WasmMemoryObject::properties[] = {
return true;
}
/* static */ bool WasmMemoryObject::grow(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool WasmMemoryObject::grow(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod<IsMemory, growImpl>(cx, args);
}
@ -1878,8 +1889,9 @@ bool WasmMemoryObject::addMovingGrowObserver(JSContext* cx,
return true;
}
/* static */ uint32_t WasmMemoryObject::growShared(
HandleWasmMemoryObject memory, uint32_t delta) {
/* static */
uint32_t WasmMemoryObject::growShared(HandleWasmMemoryObject memory,
uint32_t delta) {
SharedArrayRawBuffer* rawBuf = memory->sharedArrayRawBuffer();
SharedArrayRawBuffer::Lock lock(rawBuf);
@ -1907,8 +1919,9 @@ bool WasmMemoryObject::addMovingGrowObserver(JSContext* cx,
return oldNumPages;
}
/* static */ uint32_t WasmMemoryObject::grow(HandleWasmMemoryObject memory,
uint32_t delta, JSContext* cx) {
/* static */
uint32_t WasmMemoryObject::grow(HandleWasmMemoryObject memory, uint32_t delta,
JSContext* cx) {
if (memory->isShared()) {
return growShared(memory, delta);
}
@ -2000,23 +2013,25 @@ bool WasmTableObject::isNewborn() const {
return getReservedSlot(TABLE_SLOT).isUndefined();
}
/* static */ void WasmTableObject::finalize(FreeOp* fop, JSObject* obj) {
/* static */
void WasmTableObject::finalize(FreeOp* fop, JSObject* obj) {
WasmTableObject& tableObj = obj->as<WasmTableObject>();
if (!tableObj.isNewborn()) {
tableObj.table().Release();
}
}
/* static */ void WasmTableObject::trace(JSTracer* trc, JSObject* obj) {
/* static */
void WasmTableObject::trace(JSTracer* trc, JSObject* obj) {
WasmTableObject& tableObj = obj->as<WasmTableObject>();
if (!tableObj.isNewborn()) {
tableObj.table().tracePrivate(trc);
}
}
/* static */ WasmTableObject* WasmTableObject::create(JSContext* cx,
const Limits& limits,
TableKind tableKind) {
/* static */
WasmTableObject* WasmTableObject::create(JSContext* cx, const Limits& limits,
TableKind tableKind) {
RootedObject proto(cx,
&cx->global()->getPrototype(JSProto_WasmTable).toObject());
@ -2042,8 +2057,8 @@ bool WasmTableObject::isNewborn() const {
return obj;
}
/* static */ bool WasmTableObject::construct(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool WasmTableObject::construct(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
if (!ThrowIfNotConstructing(cx, args, "Table")) {
@ -2128,15 +2143,15 @@ static bool IsTable(HandleValue v) {
return v.isObject() && v.toObject().is<WasmTableObject>();
}
/* static */ bool WasmTableObject::lengthGetterImpl(JSContext* cx,
const CallArgs& args) {
/* static */
bool WasmTableObject::lengthGetterImpl(JSContext* cx, const CallArgs& args) {
args.rval().setNumber(
args.thisv().toObject().as<WasmTableObject>().table().length());
return true;
}
/* static */ bool WasmTableObject::lengthGetter(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool WasmTableObject::lengthGetter(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod<IsTable, lengthGetterImpl>(cx, args);
}
@ -2160,8 +2175,8 @@ static bool ToTableIndex(JSContext* cx, HandleValue v, const Table& table,
return true;
}
/* static */ bool WasmTableObject::getImpl(JSContext* cx,
const CallArgs& args) {
/* static */
bool WasmTableObject::getImpl(JSContext* cx, const CallArgs& args) {
RootedWasmTableObject tableObj(
cx, &args.thisv().toObject().as<WasmTableObject>());
const Table& table = tableObj->table();
@ -2205,8 +2220,8 @@ static bool ToTableIndex(JSContext* cx, HandleValue v, const Table& table,
return true;
}
/* static */ bool WasmTableObject::get(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool WasmTableObject::get(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod<IsTable, getImpl>(cx, args);
}
@ -2236,8 +2251,8 @@ static void TableFunctionFill(JSContext* cx, Table* table, HandleFunction value,
}
}
/* static */ bool WasmTableObject::setImpl(JSContext* cx,
const CallArgs& args) {
/* static */
bool WasmTableObject::setImpl(JSContext* cx, const CallArgs& args) {
RootedWasmTableObject tableObj(
cx, &args.thisv().toObject().as<WasmTableObject>());
Table& table = tableObj->table();
@ -2288,14 +2303,14 @@ static void TableFunctionFill(JSContext* cx, Table* table, HandleFunction value,
return true;
}
/* static */ bool WasmTableObject::set(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool WasmTableObject::set(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod<IsTable, setImpl>(cx, args);
}
/* static */ bool WasmTableObject::growImpl(JSContext* cx,
const CallArgs& args) {
/* static */
bool WasmTableObject::growImpl(JSContext* cx, const CallArgs& args) {
RootedWasmTableObject table(cx,
&args.thisv().toObject().as<WasmTableObject>());
@ -2373,8 +2388,8 @@ static void TableFunctionFill(JSContext* cx, Table* table, HandleFunction value,
return true;
}
/* static */ bool WasmTableObject::grow(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool WasmTableObject::grow(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod<IsTable, growImpl>(cx, args);
}
@ -2411,7 +2426,8 @@ const Class WasmGlobalObject::class_ = {
JSCLASS_BACKGROUND_FINALIZE,
&WasmGlobalObject::classOps_};
/* static */ void WasmGlobalObject::trace(JSTracer* trc, JSObject* obj) {
/* static */
void WasmGlobalObject::trace(JSTracer* trc, JSObject* obj) {
WasmGlobalObject* global = reinterpret_cast<WasmGlobalObject*>(obj);
if (global->isNewborn()) {
// This can happen while we're allocating the object, in which case
@ -2442,16 +2458,17 @@ const Class WasmGlobalObject::class_ = {
}
}
/* static */ void WasmGlobalObject::finalize(FreeOp*, JSObject* obj) {
/* static */
void WasmGlobalObject::finalize(FreeOp*, JSObject* obj) {
WasmGlobalObject* global = reinterpret_cast<WasmGlobalObject*>(obj);
if (!global->isNewborn()) {
js_delete(global->cell());
}
}
/* static */ WasmGlobalObject* WasmGlobalObject::create(JSContext* cx,
HandleVal hval,
bool isMutable) {
/* static */
WasmGlobalObject* WasmGlobalObject::create(JSContext* cx, HandleVal hval,
bool isMutable) {
RootedObject proto(
cx, &cx->global()->getPrototype(JSProto_WasmGlobal).toObject());
@ -2516,8 +2533,8 @@ const Class WasmGlobalObject::class_ = {
return obj;
}
/* static */ bool WasmGlobalObject::construct(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool WasmGlobalObject::construct(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
if (!ThrowIfNotConstructing(cx, args, "Global")) {
@ -2630,8 +2647,8 @@ static bool IsGlobal(HandleValue v) {
return v.isObject() && v.toObject().is<WasmGlobalObject>();
}
/* static */ bool WasmGlobalObject::valueGetterImpl(JSContext* cx,
const CallArgs& args) {
/* static */
bool WasmGlobalObject::valueGetterImpl(JSContext* cx, const CallArgs& args) {
switch (args.thisv().toObject().as<WasmGlobalObject>().type().code()) {
case ValType::I32:
case ValType::F32:
@ -2651,14 +2668,14 @@ static bool IsGlobal(HandleValue v) {
MOZ_CRASH();
}
/* static */ bool WasmGlobalObject::valueGetter(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool WasmGlobalObject::valueGetter(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod<IsGlobal, valueGetterImpl>(cx, args);
}
/* static */ bool WasmGlobalObject::valueSetterImpl(JSContext* cx,
const CallArgs& args) {
/* static */
bool WasmGlobalObject::valueSetterImpl(JSContext* cx, const CallArgs& args) {
if (!args.requireAtLeast(cx, "WebAssembly.Global setter", 1)) {
return false;
}
@ -2719,8 +2736,8 @@ static bool IsGlobal(HandleValue v) {
return true;
}
/* static */ bool WasmGlobalObject::valueSetter(JSContext* cx, unsigned argc,
Value* vp) {
/* static */
bool WasmGlobalObject::valueSetter(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
return CallNonGenericMethod<IsGlobal, valueSetterImpl>(cx, args);
}

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

@ -181,7 +181,8 @@ void Module::testingBlockOnTier2Complete() const {
}
}
/* virtual */ size_t Module::serializedSize(const LinkData& linkData) const {
/* virtual */
size_t Module::serializedSize(const LinkData& linkData) const {
JS::BuildIdCharVector buildId;
{
AutoEnterOOMUnsafeRegion oom;
@ -197,8 +198,9 @@ void Module::testingBlockOnTier2Complete() const {
SerializedVectorSize(customSections_) + code_->serializedSize();
}
/* virtual */ void Module::serialize(const LinkData& linkData, uint8_t* begin,
size_t size) const {
/* virtual */
void Module::serialize(const LinkData& linkData, uint8_t* begin,
size_t size) const {
MOZ_RELEASE_ASSERT(!metadata().debugEnabled);
MOZ_RELEASE_ASSERT(code_->hasTier(Tier::Serialized));
@ -222,9 +224,9 @@ void Module::testingBlockOnTier2Complete() const {
MOZ_RELEASE_ASSERT(cursor == begin + size);
}
/* static */ MutableModule Module::deserialize(const uint8_t* begin,
size_t size,
Metadata* maybeMetadata) {
/* static */
MutableModule Module::deserialize(const uint8_t* begin, size_t size,
Metadata* maybeMetadata) {
MutableMetadata metadata(maybeMetadata);
if (!metadata) {
metadata = js_new<Metadata>();
@ -318,7 +320,8 @@ void Module::serialize(const LinkData& linkData,
listener.storeOptimizedEncoding(bytes.begin(), bytes.length());
}
/* virtual */ JSObject* Module::createObject(JSContext* cx) {
/* virtual */
JSObject* Module::createObject(JSContext* cx) {
if (!GlobalObject::ensureConstructor(cx, cx->global(), JSProto_WebAssembly)) {
return nullptr;
}
@ -443,11 +446,12 @@ RefPtr<JS::WasmModule> wasm::DeserializeModule(PRFileDesc* bytecodeFile,
return RefPtr<JS::WasmModule>(const_cast<Module*>(module.get()));
}
/* virtual */ void Module::addSizeOfMisc(MallocSizeOf mallocSizeOf,
Metadata::SeenSet* seenMetadata,
ShareableBytes::SeenSet* seenBytes,
Code::SeenSet* seenCode, size_t* code,
size_t* data) const {
/* virtual */
void Module::addSizeOfMisc(MallocSizeOf mallocSizeOf,
Metadata::SeenSet* seenMetadata,
ShareableBytes::SeenSet* seenBytes,
Code::SeenSet* seenCode, size_t* code,
size_t* data) const {
code_->addSizeOfMiscIfNotSeen(mallocSizeOf, seenMetadata, seenCode, code,
data);
*data += mallocSizeOf(this) +

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

@ -51,8 +51,9 @@ Table::Table(JSContext* cx, const TableDesc& desc,
MOZ_ASSERT(kind_ == TableKind::AnyRef);
}
/* static */ SharedTable Table::create(JSContext* cx, const TableDesc& desc,
HandleWasmTableObject maybeObject) {
/* static */
SharedTable Table::create(JSContext* cx, const TableDesc& desc,
HandleWasmTableObject maybeObject) {
switch (desc.kind) {
case TableKind::AnyFunction:
case TableKind::TypedFunction: {

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

@ -300,7 +300,8 @@ static unsigned EncodeImmediateType(ValType vt) {
MOZ_CRASH("bad ValType");
}
/* static */ bool FuncTypeIdDesc::isGlobal(const FuncType& funcType) {
/* static */
bool FuncTypeIdDesc::isGlobal(const FuncType& funcType) {
unsigned numTypes =
(funcType.ret() == ExprType::Void ? 0 : 1) + (funcType.args().length());
if (numTypes > sMaxTypes) {
@ -321,8 +322,9 @@ static unsigned EncodeImmediateType(ValType vt) {
return false;
}
/* static */ FuncTypeIdDesc FuncTypeIdDesc::global(const FuncType& funcType,
uint32_t globalDataOffset) {
/* static */
FuncTypeIdDesc FuncTypeIdDesc::global(const FuncType& funcType,
uint32_t globalDataOffset) {
MOZ_ASSERT(isGlobal(funcType));
return FuncTypeIdDesc(FuncTypeIdDescKind::Global, globalDataOffset);
}
@ -333,8 +335,8 @@ static ImmediateType LengthToBits(uint32_t length) {
return length;
}
/* static */ FuncTypeIdDesc FuncTypeIdDesc::immediate(
const FuncType& funcType) {
/* static */
FuncTypeIdDesc FuncTypeIdDesc::immediate(const FuncType& funcType) {
ImmediateType immediate = ImmediateBit;
uint32_t shift = sTagBits;
@ -620,7 +622,8 @@ size_t wasm::ComputeMappedSize(uint32_t maxSize) {
#endif // WASM_HUGE_MEMORY
/* static */ DebugFrame* DebugFrame::from(Frame* fp) {
/* static */
DebugFrame* DebugFrame::from(Frame* fp) {
MOZ_ASSERT(fp->tls->instance->code().metadata().debugEnabled);
auto* df =
reinterpret_cast<DebugFrame*>((uint8_t*)fp - DebugFrame::offsetOfFrame());

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

@ -249,7 +249,8 @@ AsyncScriptCompiler::OnStreamComplete(nsIIncrementalStreamLoader* aLoader,
namespace mozilla {
namespace dom {
/* static */ already_AddRefed<Promise> ChromeUtils::CompileScript(
/* static */
already_AddRefed<Promise> ChromeUtils::CompileScript(
GlobalObject& aGlobal, const nsAString& aURL,
const CompileScriptOptionsDictionary& aOptions, ErrorResult& aRv) {
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());

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

@ -954,8 +954,9 @@ JSScript* ScriptPreloader::WaitForCachedScript(JSContext* cx,
return script->GetJSScript(cx);
}
/* static */ void ScriptPreloader::OffThreadDecodeCallback(
JS::OffThreadToken* token, void* context) {
/* static */
void ScriptPreloader::OffThreadDecodeCallback(JS::OffThreadToken* token,
void* context) {
auto cache = static_cast<ScriptPreloader*>(context);
cache->mMonitor.AssertNotCurrentThreadOwns();

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

@ -1409,8 +1409,8 @@ size_t mozJSComponentLoader::ModuleEntry::SizeOfIncludingThis(
return n;
}
/* static */ already_AddRefed<nsIFactory>
mozJSComponentLoader::ModuleEntry::GetFactory(
/* static */
already_AddRefed<nsIFactory> mozJSComponentLoader::ModuleEntry::GetFactory(
const mozilla::Module& module, const mozilla::Module::CIDEntry& entry) {
const ModuleEntry& self = static_cast<const ModuleEntry&>(module);
MOZ_ASSERT(self.getfactoryobj, "Handing out an uninitialized module?");

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

@ -994,7 +994,8 @@ XPCJSContext::XPCJSContext()
gTlsContext.set(this);
}
/* static */ XPCJSContext* XPCJSContext::Get() { return gTlsContext.get(); }
/* static */
XPCJSContext* XPCJSContext::Get() { return gTlsContext.get(); }
#ifdef XP_WIN
static size_t GetWindowsStackSize() {

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

@ -221,8 +221,8 @@ RealmPrivate::RealmPrivate(JS::Realm* realm) : scriptability(realm) {
mozilla::PodArrayZero(wrapperDenialWarnings);
}
/* static */ void RealmPrivate::Init(HandleObject aGlobal,
const SiteIdentifier& aSite) {
/* static */
void RealmPrivate::Init(HandleObject aGlobal, const SiteIdentifier& aSite) {
MOZ_ASSERT(aGlobal);
DebugOnly<const js::Class*> clasp = js::GetObjectClass(aGlobal);
MOZ_ASSERT(clasp->flags &
@ -604,8 +604,9 @@ bool CompartmentOriginInfo::IsSameOrigin(nsIPrincipal* aOther) const {
return mOrigin->FastEquals(aOther);
}
/* static */ bool CompartmentOriginInfo::Subsumes(JS::Compartment* aCompA,
JS::Compartment* aCompB) {
/* static */
bool CompartmentOriginInfo::Subsumes(JS::Compartment* aCompA,
JS::Compartment* aCompB) {
CompartmentPrivate* apriv = CompartmentPrivate::Get(aCompA);
CompartmentPrivate* bpriv = CompartmentPrivate::Get(aCompB);
MOZ_ASSERT(apriv);
@ -613,8 +614,9 @@ bool CompartmentOriginInfo::IsSameOrigin(nsIPrincipal* aOther) const {
return apriv->originInfo.mOrigin->FastSubsumes(bpriv->originInfo.mOrigin);
}
/* static */ bool CompartmentOriginInfo::SubsumesIgnoringFPD(
JS::Compartment* aCompA, JS::Compartment* aCompB) {
/* static */
bool CompartmentOriginInfo::SubsumesIgnoringFPD(JS::Compartment* aCompA,
JS::Compartment* aCompB) {
CompartmentPrivate* apriv = CompartmentPrivate::Get(aCompA);
CompartmentPrivate* bpriv = CompartmentPrivate::Get(aCompB);
MOZ_ASSERT(apriv);
@ -815,9 +817,9 @@ void xpc_UnmarkSkippableJSHolders() {
}
}
/* static */ void XPCJSRuntime::GCSliceCallback(JSContext* cx,
JS::GCProgress progress,
const JS::GCDescription& desc) {
/* static */
void XPCJSRuntime::GCSliceCallback(JSContext* cx, JS::GCProgress progress,
const JS::GCDescription& desc) {
XPCJSRuntime* self = nsXPConnect::GetRuntimeInstance();
if (!self) {
return;
@ -830,7 +832,8 @@ void xpc_UnmarkSkippableJSHolders() {
}
}
/* static */ void XPCJSRuntime::DoCycleCollectionCallback(JSContext* cx) {
/* static */
void XPCJSRuntime::DoCycleCollectionCallback(JSContext* cx) {
// The GC has detected that a CC at this point would collect a tremendous
// amount of garbage that is being revivified unnecessarily.
NS_DispatchToCurrentThread(
@ -854,9 +857,9 @@ void XPCJSRuntime::CustomGCCallback(JSGCStatus status) {
}
}
/* static */ void XPCJSRuntime::FinalizeCallback(JSFreeOp* fop,
JSFinalizeStatus status,
void* data) {
/* static */
void XPCJSRuntime::FinalizeCallback(JSFreeOp* fop, JSFinalizeStatus status,
void* data) {
XPCJSRuntime* self = nsXPConnect::GetRuntimeInstance();
if (!self) {
return;
@ -959,8 +962,8 @@ void XPCJSRuntime::CustomGCCallback(JSGCStatus status) {
}
}
/* static */ void XPCJSRuntime::WeakPointerZonesCallback(JSContext* cx,
void* data) {
/* static */
void XPCJSRuntime::WeakPointerZonesCallback(JSContext* cx, void* data) {
// Called before each sweeping slice -- after processing any final marking
// triggered by barriers -- to clear out any references to things that are
// about to be finalized and update any pointers to moved GC things.
@ -972,8 +975,10 @@ void XPCJSRuntime::CustomGCCallback(JSGCStatus status) {
XPCWrappedNativeScope::UpdateWeakPointersInAllScopesAfterGC();
}
/* static */ void XPCJSRuntime::WeakPointerCompartmentCallback(
JSContext* cx, JS::Compartment* comp, void* data) {
/* static */
void XPCJSRuntime::WeakPointerCompartmentCallback(JSContext* cx,
JS::Compartment* comp,
void* data) {
// Called immediately after the ZoneGroup weak pointer callback, but only
// once for each compartment that is being swept.
CompartmentPrivate* xpcComp = CompartmentPrivate::Get(comp);

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

@ -603,7 +603,8 @@ void XPC_WN_NoHelper_Finalize(js::FreeOp* fop, JSObject* obj) {
* should mark any JS objects held by |wrapper| as members.
*/
/* static */ void XPCWrappedNative::Trace(JSTracer* trc, JSObject* obj) {
/* static */
void XPCWrappedNative::Trace(JSTracer* trc, JSObject* obj) {
const js::Class* clazz = js::GetObjectClass(obj);
if (clazz->flags & JSCLASS_DOM_GLOBAL) {
mozilla::dom::TraceProtoAndIfaceCache(trc, obj);

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

@ -243,13 +243,15 @@ JSObject* WrapperFactory::WaiveXray(JSContext* cx, JSObject* objArg) {
return waiver;
}
/* static */ bool WrapperFactory::AllowWaiver(JS::Compartment* target,
JS::Compartment* origin) {
/* static */
bool WrapperFactory::AllowWaiver(JS::Compartment* target,
JS::Compartment* origin) {
return CompartmentPrivate::Get(target)->allowWaivers &&
CompartmentOriginInfo::Subsumes(target, origin);
}
/* static */ bool WrapperFactory::AllowWaiver(JSObject* wrapper) {
/* static */
bool WrapperFactory::AllowWaiver(JSObject* wrapper) {
MOZ_ASSERT(js::IsCrossCompartmentWrapper(wrapper));
return AllowWaiver(js::GetObjectCompartment(wrapper),
js::GetObjectCompartment(js::UncheckedUnwrap(wrapper)));

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

@ -1476,7 +1476,8 @@ const JSClass* XrayTraits::getExpandoClass(JSContext* cx,
static const size_t JSSLOT_XRAY_HOLDER = 0;
/* static */ JSObject* XrayTraits::getHolder(JSObject* wrapper) {
/* static */
JSObject* XrayTraits::getHolder(JSObject* wrapper) {
MOZ_ASSERT(WrapperFactory::IsXrayWrapper(wrapper));
js::Value v = js::GetProxyReservedSlot(wrapper, JSSLOT_XRAY_HOLDER);
return v.isObject() ? &v.toObject() : nullptr;