зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1630346 - Move PlainObject to vm/PlainObject{,-inl}.h. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D71111
This commit is contained in:
Родитель
aec6359182
Коммит
6c5695fa22
|
@ -36,6 +36,7 @@
|
|||
#include "vm/JSContext.h"
|
||||
#include "vm/JSFunction.h"
|
||||
#include "vm/JSObject.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/SelfHosting.h"
|
||||
#include "vm/Shape.h"
|
||||
#include "vm/ToSource.h" // js::ValueToSource
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
#include "gc/Zone.h"
|
||||
#include "vm/GlobalObject.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
|
||||
#include "vm/JSObject-inl.h"
|
||||
#include "vm/NativeObject-inl.h"
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "vm/JSContext.h"
|
||||
#include "vm/JSObject.h"
|
||||
#include "vm/JSONParser.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
|
||||
#include "builtin/Array-inl.h"
|
||||
#include "builtin/Boolean-inl.h"
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "vm/AsyncIteration.h"
|
||||
#include "vm/EqualityOperations.h" // js::SameValue
|
||||
#include "vm/ModuleBuilder.h" // js::ModuleBuilder
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/PromiseObject.h" // js::PromiseObject
|
||||
#include "vm/SelfHosting.h"
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "vm/EqualityOperations.h" // js::SameValue
|
||||
#include "vm/ErrorObject.h"
|
||||
#include "vm/JSContext.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/RegExpObject.h"
|
||||
#include "vm/ToSource.h" // js::ValueToSource
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
|
||||
namespace js {
|
||||
|
||||
class PlainObject;
|
||||
|
||||
// Object constructor native. Exposed only so the JIT can know its address.
|
||||
MOZ_MUST_USE bool obj_construct(JSContext* cx, unsigned argc, JS::Value* vp);
|
||||
|
||||
|
@ -22,7 +24,7 @@ PlainObject* ObjectCreateImpl(JSContext* cx, HandleObject proto,
|
|||
HandleObjectGroup group = nullptr);
|
||||
|
||||
PlainObject* ObjectCreateWithTemplate(JSContext* cx,
|
||||
HandlePlainObject templateObj);
|
||||
Handle<PlainObject*> templateObj);
|
||||
|
||||
// Object methods exposed so they can be installed in the self-hosting global.
|
||||
MOZ_MUST_USE bool obj_propertyIsEnumerable(JSContext* cx, unsigned argc,
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "vm/Iteration.h"
|
||||
#include "vm/JSContext.h"
|
||||
#include "vm/JSObject.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/PromiseLookup.h" // js::PromiseLookup
|
||||
#include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseSlot_*
|
||||
#include "vm/SelfHosting.h"
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "vm/JSAtom.h"
|
||||
#include "vm/JSObject.h"
|
||||
#include "vm/ModuleBuilder.h" // js::ModuleBuilder
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/RegExpObject.h"
|
||||
|
||||
#include "vm/JSObject-inl.h"
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "js/PropertySpec.h"
|
||||
#include "vm/Interpreter.h"
|
||||
#include "vm/JSContext.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseResolvedWithUndefined
|
||||
#include "vm/SelfHosting.h"
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "js/Symbol.h"
|
||||
#include "js/PropertySpec.h"
|
||||
#include "util/StringBuffer.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/SymbolType.h"
|
||||
|
||||
#include "vm/JSObject-inl.h"
|
||||
|
|
|
@ -79,6 +79,7 @@
|
|||
#include "vm/Iteration.h"
|
||||
#include "vm/JSContext.h"
|
||||
#include "vm/JSObject.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseSlot_*
|
||||
#include "vm/ProxyObject.h"
|
||||
#include "vm/SavedStacks.h"
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "vm/GlobalObject.h"
|
||||
#include "vm/JSFunction.h"
|
||||
#include "vm/JSObject.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/Realm.h"
|
||||
#include "vm/SelfHosting.h"
|
||||
#include "vm/StringType.h"
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "unicode/utypes.h"
|
||||
#include "vm/GlobalObject.h"
|
||||
#include "vm/JSContext.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/Runtime.h"
|
||||
#include "vm/StringType.h"
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "vm/DateTime.h"
|
||||
#include "vm/GlobalObject.h"
|
||||
#include "vm/JSContext.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/Runtime.h"
|
||||
|
||||
#include "vm/JSObject-inl.h"
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include "vm/JSAtom.h"
|
||||
#include "vm/JSContext.h"
|
||||
#include "vm/JSObject.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/StringType.h"
|
||||
|
||||
#include "vm/JSObject-inl.h"
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "unicode/ulistformatter.h"
|
||||
#include "unicode/utypes.h"
|
||||
#include "vm/JSContext.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/Runtime.h" // js::ReportAllocationOverflow
|
||||
#include "vm/SelfHosting.h"
|
||||
#include "vm/StringType.h"
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "util/StringBuffer.h"
|
||||
#include "vm/GlobalObject.h"
|
||||
#include "vm/JSContext.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/Printer.h"
|
||||
#include "vm/StringType.h"
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#include "vm/BigIntType.h"
|
||||
#include "vm/GlobalObject.h"
|
||||
#include "vm/JSContext.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/SelfHosting.h"
|
||||
#include "vm/Stack.h"
|
||||
#include "vm/StringType.h"
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "unicode/utypes.h"
|
||||
#include "vm/GlobalObject.h"
|
||||
#include "vm/JSContext.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/StringType.h"
|
||||
|
||||
#include "vm/JSObject-inl.h"
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "unicode/utypes.h"
|
||||
#include "vm/GlobalObject.h"
|
||||
#include "vm/JSContext.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/Printer.h"
|
||||
#include "vm/StringType.h"
|
||||
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
#include "js/Value.h" // JS::Value
|
||||
#include "vm/JSContext.h" // JSContext
|
||||
#include "vm/JSObject.h" // js::GetPrototypeFromBuiltinConstructor
|
||||
#include "vm/NativeObject.h" // js::PlainObject
|
||||
#include "vm/ObjectOperations.h" // js::GetProperty
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/Runtime.h" // JSAtomState
|
||||
#include "vm/StringType.h" // js::EqualStrings, js::ToString
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "js/PropertySpec.h"
|
||||
#include "vm/Interpreter.h"
|
||||
#include "vm/JSContext.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseResolvedWithUndefined
|
||||
#include "vm/SelfHosting.h"
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include "vm/Compartment-inl.h" // JS::Compartment::wrap
|
||||
#include "vm/JSContext-inl.h" // JSContext::check
|
||||
#include "vm/List-inl.h" // js::ListObject, js::AppendToListInFixedSlot, js::StoreNewListInFixedSlot
|
||||
#include "vm/PlainObject-inl.h" // js::PlainObject::createWithTemplate
|
||||
#include "vm/Realm-inl.h" // JS::Realm
|
||||
|
||||
using JS::BooleanValue;
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "js/Value.h" // JS::Value, JS::UndefinedHandleValue
|
||||
#include "vm/Interpreter.h" // js::GetAndClearException
|
||||
#include "vm/JSContext.h" // JSContext
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseResolvedWithUndefined
|
||||
#include "vm/Runtime.h" // JSRuntime
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include "vm/ArrayBufferViewObject.h" // js::ArrayBufferViewObject
|
||||
#include "vm/JSContext.h" // JSContext, CHECK_THREAD
|
||||
#include "vm/JSObject.h" // JSObject
|
||||
#include "vm/NativeObject.h" // js::PlainObject
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/PromiseObject.h" // js::PromiseObject
|
||||
|
||||
#include "builtin/streams/ReadableStreamReader-inl.h" // js::UnwrapStreamFromReader
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
#include "js/Value.h" // JS::{,Object}Value
|
||||
#include "vm/JSContext.h" // JSContext
|
||||
#include "vm/JSObject.h" // js::GetPrototypeFromBuiltinConstructor
|
||||
#include "vm/NativeObject.h" // js::PlainObject
|
||||
#include "vm/ObjectOperations.h" // js::GetProperty
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/Realm.h" // JS::Realm
|
||||
|
||||
#include "vm/Compartment-inl.h" // js::UnwrapAndTypeCheckThis
|
||||
|
|
|
@ -92,6 +92,7 @@
|
|||
#include "vm/JSObject.h" // for JSObject, RequireObject
|
||||
#include "vm/ObjectGroup.h" // for TenuredObject
|
||||
#include "vm/ObjectOperations.h" // for DefineDataProperty
|
||||
#include "vm/PlainObject.h" // for js::PlainObject
|
||||
#include "vm/PromiseObject.h" // for js::PromiseObject
|
||||
#include "vm/ProxyObject.h" // for ProxyObject, JSObject::is
|
||||
#include "vm/Realm.h" // for AutoRealm, Realm
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "js/Utility.h"
|
||||
#include "vm/GlobalObject.h"
|
||||
#include "vm/JSContext.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/Realm.h"
|
||||
#include "vm/SavedStacks.h"
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
#include "vm/NativeObject.h" // for NativeObject, JSObject::is
|
||||
#include "vm/ObjectGroup.h" // for GenericObject, NewObjectKind
|
||||
#include "vm/ObjectOperations.h" // for DefineProperty
|
||||
#include "vm/PlainObject.h" // for js::PlainObject
|
||||
#include "vm/PromiseObject.h" // for js::PromiseObject
|
||||
#include "vm/Realm.h" // for AutoRealm, ErrorCopier, Realm
|
||||
#include "vm/Runtime.h" // for JSAtomState
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "vm/JSFunction.h" // for JSFunction
|
||||
#include "vm/JSObject.h" // for RequireObject, JSObject
|
||||
#include "vm/ObjectOperations.h" // for DefineDataProperty, HasOwnProperty
|
||||
#include "vm/PlainObject.h" // for js::PlainObject
|
||||
#include "vm/Realm.h" // for AutoRealm
|
||||
#include "vm/Runtime.h" // for JSAtomState, JSRuntime
|
||||
#include "vm/StringType.h" // for NameToId, PropertyName, JSAtom
|
||||
|
|
|
@ -49,6 +49,7 @@
|
|||
#include "gc/Zone-inl.h"
|
||||
#include "vm/GeckoProfiler-inl.h"
|
||||
#include "vm/NativeObject-inl.h"
|
||||
#include "vm/PlainObject-inl.h" // js::PlainObject
|
||||
#include "vm/Realm-inl.h"
|
||||
#include "vm/StringType-inl.h"
|
||||
|
||||
|
|
|
@ -50,6 +50,9 @@ using mozilla::AssertedCast;
|
|||
using mozilla::Maybe;
|
||||
|
||||
namespace js {
|
||||
|
||||
class PlainObject;
|
||||
|
||||
namespace jit {
|
||||
|
||||
BaselineCompilerHandler::BaselineCompilerHandler(JSContext* cx,
|
||||
|
@ -6390,7 +6393,7 @@ bool BaselineCodeGen<Handler>::emit_ObjWithProto() {
|
|||
prepareVMCall();
|
||||
pushArg(R0);
|
||||
|
||||
using Fn = JSObject* (*)(JSContext*, HandleValue);
|
||||
using Fn = PlainObject* (*)(JSContext*, HandleValue);
|
||||
if (!callVM<Fn, js::ObjectWithProtoOperation>()) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "jit/BaselineIC.h"
|
||||
#include "jit/CacheIRSpewer.h"
|
||||
#include "jit/InlinableNatives.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/SelfHosting.h"
|
||||
|
||||
#include "jit/MacroAssembler-inl.h"
|
||||
|
@ -7069,7 +7070,7 @@ void NewObjectIRGenerator::trackAttached(const char* name) {
|
|||
|
||||
AttachDecision NewObjectIRGenerator::tryAttachStub() {
|
||||
AutoAssertNoPendingException aanpe(cx_);
|
||||
if (templateObject_->as<PlainObject>().hasDynamicSlots()) {
|
||||
if (templateObject_->as<NativeObject>().hasDynamicSlots()) {
|
||||
trackAttached(IRGenerator::NotAttached);
|
||||
return AttachDecision::NoAction;
|
||||
}
|
||||
|
|
|
@ -58,6 +58,7 @@
|
|||
#include "vm/AsyncIteration.h"
|
||||
#include "vm/EqualityOperations.h" // js::SameValue
|
||||
#include "vm/MatchPairs.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/RegExpObject.h"
|
||||
#include "vm/RegExpStatics.h"
|
||||
#include "vm/StringType.h"
|
||||
|
@ -13931,7 +13932,7 @@ void CodeGenerator::visitGetPrototypeOf(LGetPrototypeOf* lir) {
|
|||
void CodeGenerator::visitObjectWithProto(LObjectWithProto* lir) {
|
||||
pushArg(ToValue(lir, LObjectWithProto::PrototypeValue));
|
||||
|
||||
using Fn = JSObject* (*)(JSContext*, HandleValue);
|
||||
using Fn = PlainObject* (*)(JSContext*, HandleValue);
|
||||
callVM<Fn, js::ObjectWithProtoOperation>(lir);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "jit/Lowering.h"
|
||||
#include "jit/MIRGraph.h"
|
||||
#include "util/CheckedArithmetic.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/RegExpObject.h"
|
||||
#include "vm/SelfHosting.h"
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
#include "jit/JitAllocPolicy.h"
|
||||
|
||||
namespace js {
|
||||
|
||||
class PlainObject;
|
||||
|
||||
namespace jit {
|
||||
|
||||
class MBasicBlock;
|
||||
|
@ -160,7 +163,7 @@ MCompare* ConvertLinearInequality(TempAllocator& alloc, MBasicBlock* block,
|
|||
|
||||
MOZ_MUST_USE bool AnalyzeNewScriptDefiniteProperties(
|
||||
JSContext* cx, DPAConstraintInfo& constraintInfo, HandleFunction fun,
|
||||
ObjectGroup* group, HandlePlainObject baseobj,
|
||||
ObjectGroup* group, Handle<PlainObject*> baseobj,
|
||||
Vector<TypeNewScriptInitializer>* initializerList);
|
||||
|
||||
MOZ_MUST_USE bool AnalyzeArgumentsUsage(JSContext* cx, JSScript* script);
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "vm/EnvironmentObject.h"
|
||||
#include "vm/Instrumentation.h"
|
||||
#include "vm/Opcodes.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/RegExpStatics.h"
|
||||
#include "vm/SelfHosting.h"
|
||||
#include "vm/TraceLogging.h"
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "vm/ArgumentsObject.h"
|
||||
#include "vm/ArrayBufferObject.h"
|
||||
#include "vm/JSObject.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/ProxyObject.h"
|
||||
#include "vm/SelfHosting.h"
|
||||
#include "vm/SharedArrayObject.h"
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "js/Conversions.h"
|
||||
#include "util/Text.h"
|
||||
#include "util/Unicode.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "wasm/WasmCode.h"
|
||||
|
||||
#include "builtin/Boolean-inl.h"
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "vm/Iteration.h"
|
||||
#include "vm/JSContext.h"
|
||||
#include "vm/JSObject.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/StringType.h"
|
||||
|
||||
#include "vm/Interpreter-inl.h"
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include "jit/TemplateObject.h"
|
||||
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/RegExpObject.h"
|
||||
|
||||
namespace js {
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "vm/ArrayObject.h"
|
||||
#include "vm/EqualityOperations.h" // js::StrictlyEqual
|
||||
#include "vm/Interpreter.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/SelfHosting.h"
|
||||
#include "vm/TraceLogging.h"
|
||||
#include "vm/TypedArrayObject.h"
|
||||
|
|
|
@ -24,6 +24,7 @@ class WithScope;
|
|||
class InlineTypedObject;
|
||||
class AbstractGeneratorObject;
|
||||
class AsyncFunctionGeneratorObject;
|
||||
class PlainObject;
|
||||
class RegExpObject;
|
||||
class TypedArrayObject;
|
||||
|
||||
|
|
|
@ -87,6 +87,7 @@
|
|||
#include "vm/JSFunction.h"
|
||||
#include "vm/JSObject.h"
|
||||
#include "vm/JSScript.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/PromiseObject.h" // js::PromiseObject
|
||||
#include "vm/Runtime.h"
|
||||
#include "vm/SavedStacks.h"
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "vm/FrameIter.h" // js::FrameIter
|
||||
#include "vm/JSContext.h"
|
||||
#include "vm/JSObject.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/Printer.h"
|
||||
#include "vm/PromiseObject.h" // js::PromiseObject
|
||||
#include "vm/Realm.h"
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "vm/EqualityOperations.h" // js::SameValue
|
||||
#include "vm/JSFunction.h"
|
||||
#include "vm/JSObject.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
|
||||
#include "vm/JSObject-inl.h"
|
||||
#include "vm/NativeObject-inl.h"
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "vm/GeneratorObject.h"
|
||||
#include "vm/GlobalObject.h"
|
||||
#include "vm/Interpreter.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/PromiseObject.h" // js::PromiseObject
|
||||
#include "vm/Realm.h"
|
||||
#include "vm/SelfHosting.h"
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "vm/AsyncIteration.h"
|
||||
#include "vm/GlobalObject.h"
|
||||
#include "vm/JSObject.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
|
||||
#include "debugger/DebugAPI-inl.h"
|
||||
#include "vm/ArrayObject-inl.h"
|
||||
|
|
|
@ -50,6 +50,7 @@ namespace js {
|
|||
|
||||
class GlobalScope;
|
||||
class LexicalEnvironmentObject;
|
||||
class PlainObject;
|
||||
class RegExpStatics;
|
||||
class TypeDescr;
|
||||
class TypedObjectModuleObject;
|
||||
|
|
|
@ -49,6 +49,7 @@
|
|||
#include "vm/JSScript.h"
|
||||
#include "vm/Opcodes.h"
|
||||
#include "vm/PIC.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/Printer.h"
|
||||
#include "vm/Scope.h"
|
||||
#include "vm/Shape.h"
|
||||
|
@ -66,6 +67,7 @@
|
|||
#include "vm/JSScript-inl.h"
|
||||
#include "vm/NativeObject-inl.h"
|
||||
#include "vm/ObjectOperations-inl.h"
|
||||
#include "vm/PlainObject-inl.h" // js::CopyInitializerObject
|
||||
#include "vm/Probes-inl.h"
|
||||
#include "vm/Stack-inl.h"
|
||||
|
||||
|
@ -975,7 +977,7 @@ bool js::CheckClassHeritageOperation(JSContext* cx, HandleValue heritage) {
|
|||
return false;
|
||||
}
|
||||
|
||||
JSObject* js::ObjectWithProtoOperation(JSContext* cx, HandleValue val) {
|
||||
PlainObject* js::ObjectWithProtoOperation(JSContext* cx, HandleValue val) {
|
||||
if (!val.isObjectOrNull()) {
|
||||
ReportValueError(cx, JSMSG_NOT_OBJORNULL, -1, val, nullptr);
|
||||
return nullptr;
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
namespace js {
|
||||
|
||||
class EnvironmentIter;
|
||||
class PlainObject;
|
||||
|
||||
/*
|
||||
* Convert null/undefined |thisv| into the current global object for the
|
||||
|
@ -696,7 +697,7 @@ bool Debug_CheckSelfHosted(JSContext* cx, HandleValue v);
|
|||
|
||||
bool CheckClassHeritageOperation(JSContext* cx, HandleValue heritage);
|
||||
|
||||
JSObject* ObjectWithProtoOperation(JSContext* cx, HandleValue proto);
|
||||
PlainObject* ObjectWithProtoOperation(JSContext* cx, HandleValue proto);
|
||||
|
||||
JSObject* FunWithProtoOperation(JSContext* cx, HandleFunction fun,
|
||||
HandleObject parent, HandleObject proto);
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
#include "vm/Compartment-inl.h"
|
||||
#include "vm/JSScript-inl.h"
|
||||
#include "vm/NativeObject-inl.h"
|
||||
#include "vm/PlainObject-inl.h" // js::PlainObject::createWithTemplate
|
||||
#include "vm/ReceiverGuard-inl.h"
|
||||
#include "vm/Stack-inl.h"
|
||||
#include "vm/StringType-inl.h"
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
#include "vm/JSFunction.h"
|
||||
#include "vm/JSObject.h"
|
||||
#include "vm/JSScript.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/Realm.h"
|
||||
#include "vm/Shape.h"
|
||||
#include "vm/StringType.h" // StringToNewUTF8CharsZ
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
#include "vm/JSContext.h"
|
||||
#include "vm/JSObject.h"
|
||||
#include "vm/JSScript.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/SelfHosting.h"
|
||||
#include "vm/Shape.h"
|
||||
#include "vm/SharedImmutableStringsCache.h"
|
||||
|
|
|
@ -75,6 +75,7 @@
|
|||
#include "vm/NativeObject-inl.h"
|
||||
#include "vm/NumberObject-inl.h"
|
||||
#include "vm/ObjectGroup-inl.h"
|
||||
#include "vm/PlainObject-inl.h" // js::CopyInitializerObject
|
||||
#include "vm/Realm-inl.h"
|
||||
#include "vm/Shape-inl.h"
|
||||
#include "vm/StringObject-inl.h"
|
||||
|
|
|
@ -64,6 +64,7 @@
|
|||
#include "vm/JSFunction.h"
|
||||
#include "vm/JSObject.h"
|
||||
#include "vm/Opcodes.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/SelfHosting.h"
|
||||
#include "vm/Shape.h"
|
||||
#include "vm/SharedImmutableStringsCache.h"
|
||||
|
|
|
@ -537,25 +537,6 @@ inline bool NativeObject::isInWholeCellBuffer() const {
|
|||
return nobj;
|
||||
}
|
||||
|
||||
/* static */ inline JS::Result<PlainObject*, JS::OOM&>
|
||||
PlainObject::createWithTemplate(JSContext* cx,
|
||||
Handle<PlainObject*> templateObject) {
|
||||
RootedObjectGroup group(cx, templateObject->group());
|
||||
MOZ_ASSERT(group->clasp() == &PlainObject::class_);
|
||||
|
||||
gc::InitialHeap heap = GetInitialHeap(GenericObject, group);
|
||||
|
||||
RootedShape shape(cx, templateObject->lastProperty());
|
||||
|
||||
gc::AllocKind kind = gc::GetGCObjectKind(shape->numFixedSlots());
|
||||
MOZ_ASSERT(CanChangeToBackgroundAllocKind(kind, shape->getObjectClass()));
|
||||
kind = gc::ForegroundToBackgroundAllocKind(kind);
|
||||
|
||||
return create(cx, kind, heap, shape, group).map([](NativeObject* obj) {
|
||||
return &obj->as<PlainObject>();
|
||||
});
|
||||
}
|
||||
|
||||
MOZ_ALWAYS_INLINE bool NativeObject::updateSlotsForSpan(JSContext* cx,
|
||||
size_t oldSpan,
|
||||
size_t newSpan) {
|
||||
|
@ -623,38 +604,6 @@ inline js::gc::AllocKind NativeObject::allocKindForTenure() const {
|
|||
|
||||
inline js::GlobalObject& NativeObject::global() const { return nonCCWGlobal(); }
|
||||
|
||||
inline js::gc::AllocKind PlainObject::allocKindForTenure() const {
|
||||
using namespace js::gc;
|
||||
AllocKind kind = GetGCObjectFixedSlotsKind(numFixedSlots());
|
||||
MOZ_ASSERT(!IsBackgroundFinalized(kind));
|
||||
MOZ_ASSERT(CanChangeToBackgroundAllocKind(kind, getClass()));
|
||||
return ForegroundToBackgroundAllocKind(kind);
|
||||
}
|
||||
|
||||
/* Make an object with pregenerated shape from a NEWOBJECT bytecode. */
|
||||
static inline PlainObject* CopyInitializerObject(
|
||||
JSContext* cx, HandlePlainObject baseobj,
|
||||
NewObjectKind newKind = GenericObject) {
|
||||
MOZ_ASSERT(!baseobj->inDictionaryMode());
|
||||
|
||||
gc::AllocKind allocKind =
|
||||
gc::GetGCObjectFixedSlotsKind(baseobj->numFixedSlots());
|
||||
allocKind = gc::ForegroundToBackgroundAllocKind(allocKind);
|
||||
MOZ_ASSERT_IF(baseobj->isTenured(),
|
||||
allocKind == baseobj->asTenured().getAllocKind());
|
||||
RootedPlainObject obj(
|
||||
cx, NewBuiltinClassInstance<PlainObject>(cx, allocKind, newKind));
|
||||
if (!obj) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!obj->setLastProperty(cx, baseobj->lastProperty())) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
/*
|
||||
* Call obj's resolve hook.
|
||||
*
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "js/Value.h"
|
||||
#include "util/Memory.h"
|
||||
#include "vm/EqualityOperations.h" // js::SameValue
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/TypedArrayObject.h"
|
||||
|
||||
#include "gc/Nursery-inl.h"
|
||||
|
@ -2945,7 +2946,7 @@ bool js::NativeDeleteProperty(JSContext* cx, HandleNativeObject obj,
|
|||
|
||||
bool js::CopyDataPropertiesNative(JSContext* cx, HandlePlainObject target,
|
||||
HandleNativeObject from,
|
||||
HandlePlainObject excludedItems,
|
||||
Handle<PlainObject*> excludedItems,
|
||||
bool* optimized) {
|
||||
MOZ_ASSERT(
|
||||
!target->isDelegate(),
|
||||
|
|
|
@ -1492,19 +1492,6 @@ class NativeObject : public JSObject {
|
|||
static size_t offsetOfSlots() { return offsetof(NativeObject, slots_); }
|
||||
};
|
||||
|
||||
// Object class for plain native objects created using '{}' object literals,
|
||||
// 'new Object()', 'Object.create', etc.
|
||||
class PlainObject : public NativeObject {
|
||||
public:
|
||||
static const JSClass class_;
|
||||
|
||||
static inline JS::Result<PlainObject*, JS::OOM&> createWithTemplate(
|
||||
JSContext* cx, Handle<PlainObject*> templateObject);
|
||||
|
||||
/* Return the allocKind we would use if we were to tenure this object. */
|
||||
inline js::gc::AllocKind allocKindForTenure() const;
|
||||
};
|
||||
|
||||
inline void NativeObject::privateWriteBarrierPre(void** oldval) {
|
||||
JS::shadow::Zone* shadowZone = this->shadowZoneFromAnyThread();
|
||||
if (shadowZone->needsIncrementalBarrier() && *oldval &&
|
||||
|
@ -1652,12 +1639,6 @@ bool IsPackedArray(JSObject* obj);
|
|||
extern void AddPropertyTypesAfterProtoChange(JSContext* cx, NativeObject* obj,
|
||||
ObjectGroup* oldGroup);
|
||||
|
||||
// Specializations of 7.3.23 CopyDataProperties(...) for NativeObjects.
|
||||
extern bool CopyDataPropertiesNative(JSContext* cx, HandlePlainObject target,
|
||||
HandleNativeObject from,
|
||||
HandlePlainObject excludedItems,
|
||||
bool* optimized);
|
||||
|
||||
// Initialize an object's reserved slot with a private value pointing to
|
||||
// malloc-allocated memory and associate the memory with the object.
|
||||
//
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "vm/ErrorObject.h"
|
||||
#include "vm/GlobalObject.h"
|
||||
#include "vm/JSObject.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/RegExpObject.h"
|
||||
#include "vm/Shape.h"
|
||||
#include "vm/TaggedProto.h"
|
||||
|
|
|
@ -28,6 +28,7 @@ class AutoClearTypeInferenceStateOnOOM;
|
|||
class AutoSweepObjectGroup;
|
||||
class CompilerConstraintList;
|
||||
class ObjectGroupRealm;
|
||||
class PlainObject;
|
||||
|
||||
namespace gc {
|
||||
void MergeRealms(JS::Realm* source, JS::Realm* target);
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
* vim: set ts=8 sts=2 et sw=2 tw=80:
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef vm_PlainObject_inl_h
|
||||
#define vm_PlainObject_inl_h
|
||||
|
||||
#include "vm/PlainObject.h"
|
||||
|
||||
#include "mozilla/Assertions.h" // MOZ_ASSERT, MOZ_ASSERT_IF
|
||||
|
||||
#include "gc/Allocator.h" // js::gc::InitialHeap
|
||||
#include "js/RootingAPI.h" // JS::Handle, JS::Rooted
|
||||
#include "vm/NativeObject.h" // js::NativeObject::create
|
||||
#include "vm/ObjectGroup.h" // js::ObjectGroup, js::GenericObject
|
||||
#include "vm/Shape.h" // js::Shape
|
||||
|
||||
#include "gc/ObjectKind-inl.h" // js::gc::GetGCObjectKind
|
||||
#include "vm/JSObject-inl.h" // js::GetInitialHeap, js::NewBuiltinClassInstance
|
||||
|
||||
/* static */ inline JS::Result<js::PlainObject*, JS::OOM&>
|
||||
js::PlainObject::createWithTemplate(JSContext* cx,
|
||||
JS::Handle<PlainObject*> templateObject) {
|
||||
JS::Rooted<ObjectGroup*> group(cx, templateObject->group());
|
||||
MOZ_ASSERT(group->clasp() == &PlainObject::class_);
|
||||
|
||||
gc::InitialHeap heap = GetInitialHeap(GenericObject, group);
|
||||
|
||||
JS::Rooted<Shape*> shape(cx, templateObject->lastProperty());
|
||||
|
||||
gc::AllocKind kind = gc::GetGCObjectKind(shape->numFixedSlots());
|
||||
MOZ_ASSERT(gc::CanChangeToBackgroundAllocKind(kind, shape->getObjectClass()));
|
||||
kind = gc::ForegroundToBackgroundAllocKind(kind);
|
||||
|
||||
return NativeObject::create(cx, kind, heap, shape, group)
|
||||
.map([](NativeObject* obj) { return &obj->as<PlainObject>(); });
|
||||
}
|
||||
|
||||
inline js::gc::AllocKind js::PlainObject::allocKindForTenure() const {
|
||||
gc::AllocKind kind = gc::GetGCObjectFixedSlotsKind(numFixedSlots());
|
||||
MOZ_ASSERT(!gc::IsBackgroundFinalized(kind));
|
||||
MOZ_ASSERT(gc::CanChangeToBackgroundAllocKind(kind, getClass()));
|
||||
return gc::ForegroundToBackgroundAllocKind(kind);
|
||||
}
|
||||
|
||||
namespace js {
|
||||
|
||||
/* Make an object with pregenerated shape from a NEWOBJECT bytecode. */
|
||||
static inline PlainObject* CopyInitializerObject(
|
||||
JSContext* cx, JS::Handle<PlainObject*> baseobj,
|
||||
NewObjectKind newKind = GenericObject) {
|
||||
MOZ_ASSERT(!baseobj->inDictionaryMode());
|
||||
|
||||
gc::AllocKind allocKind =
|
||||
gc::GetGCObjectFixedSlotsKind(baseobj->numFixedSlots());
|
||||
allocKind = gc::ForegroundToBackgroundAllocKind(allocKind);
|
||||
MOZ_ASSERT_IF(baseobj->isTenured(),
|
||||
allocKind == baseobj->asTenured().getAllocKind());
|
||||
JS::Rooted<PlainObject*> obj(
|
||||
cx, NewBuiltinClassInstance<PlainObject>(cx, allocKind, newKind));
|
||||
if (!obj) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!obj->setLastProperty(cx, baseobj->lastProperty())) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
} // namespace js
|
||||
|
||||
#endif // vm_PlainObject_inl_h
|
|
@ -0,0 +1,41 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
* vim: set ts=8 sts=2 et sw=2 tw=80:
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef vm_PlainObject_h
|
||||
#define vm_PlainObject_h
|
||||
|
||||
#include "gc/AllocKind.h" // js::gc::AllocKind
|
||||
#include "js/Class.h" // JSClass
|
||||
#include "js/Result.h" // JS::OOM, JS::Result
|
||||
#include "js/RootingAPI.h" // JS::Handle
|
||||
#include "vm/NativeObject.h" // js::NativeObject
|
||||
|
||||
struct JS_PUBLIC_API JSContext;
|
||||
|
||||
namespace js {
|
||||
|
||||
// Object class for plain native objects created using '{}' object literals,
|
||||
// 'new Object()', 'Object.create', etc.
|
||||
class PlainObject : public NativeObject {
|
||||
public:
|
||||
static const JSClass class_;
|
||||
|
||||
static inline JS::Result<PlainObject*, JS::OOM&> createWithTemplate(
|
||||
JSContext* cx, JS::Handle<PlainObject*> templateObject);
|
||||
|
||||
/* Return the allocKind we would use if we were to tenure this object. */
|
||||
inline gc::AllocKind allocKindForTenure() const;
|
||||
};
|
||||
|
||||
// Specializations of 7.3.23 CopyDataProperties(...) for NativeObjects.
|
||||
extern bool CopyDataPropertiesNative(JSContext* cx,
|
||||
JS::Handle<PlainObject*> target,
|
||||
JS::Handle<NativeObject*> from,
|
||||
JS::Handle<PlainObject*> excludedItems,
|
||||
bool* optimized);
|
||||
} // namespace js
|
||||
|
||||
#endif // vm_PlainObject_h
|
|
@ -25,6 +25,7 @@
|
|||
#include "vm/ArrayBufferObject.h"
|
||||
#include "vm/Compartment.h"
|
||||
#include "vm/NativeObject.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/PromiseLookup.h" // js::PromiseLookup
|
||||
#include "vm/ReceiverGuard.h"
|
||||
#include "vm/RegExpShared.h"
|
||||
|
|
|
@ -73,6 +73,7 @@
|
|||
#include "vm/JSFunction.h"
|
||||
#include "vm/JSObject.h"
|
||||
#include "vm/PIC.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/Printer.h"
|
||||
#include "vm/Realm.h"
|
||||
#include "vm/RegExpObject.h"
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
#include "js/Wrapper.h"
|
||||
#include "vm/BigIntType.h"
|
||||
#include "vm/JSContext.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/RegExpObject.h"
|
||||
#include "vm/SavedFrame.h"
|
||||
#include "vm/SharedArrayObject.h"
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "vm/NativeObject.h"
|
||||
#include "vm/NumberObject.h"
|
||||
#include "vm/ObjectGroup.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/Shape.h"
|
||||
#include "vm/SharedArrayObject.h"
|
||||
#include "vm/StringObject.h"
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include "vm/JSObject.h"
|
||||
#include "vm/JSScript.h"
|
||||
#include "vm/Opcodes.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/Printer.h"
|
||||
#include "vm/Shape.h"
|
||||
#include "vm/Time.h"
|
||||
|
|
|
@ -35,6 +35,7 @@ class TypeConstraint;
|
|||
class TypeZone;
|
||||
class CompilerConstraintList;
|
||||
class HeapTypeSetKey;
|
||||
class PlainObject;
|
||||
|
||||
namespace jit {
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "js/CharacterEncoding.h"
|
||||
#include "util/Text.h"
|
||||
#include "vm/JSContext.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/Printer.h"
|
||||
#include "vm/Realm.h"
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "util/StringBuffer.h"
|
||||
#include "util/Text.h"
|
||||
#include "vm/BigIntType.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "wasm/WasmBuiltins.h"
|
||||
#include "wasm/WasmModule.h"
|
||||
#include "wasm/WasmStubs.h"
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include "util/Text.h"
|
||||
#include "vm/ErrorObject.h"
|
||||
#include "vm/Interpreter.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "vm/PromiseObject.h" // js::PromiseObject
|
||||
#include "vm/StringType.h"
|
||||
#include "vm/Warnings.h" // js::WarnNumberASCII
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "jit/JitOptions.h"
|
||||
#include "js/BuildId.h" // JS::BuildIdCharVector
|
||||
#include "threading/LockGuard.h"
|
||||
#include "vm/PlainObject.h" // js::PlainObject
|
||||
#include "wasm/WasmBaselineCompile.h"
|
||||
#include "wasm/WasmCompile.h"
|
||||
#include "wasm/WasmInstance.h"
|
||||
|
|
Загрузка…
Ссылка в новой задаче