Backed out 8 changesets (bug 1522837) for buffer-full-inspect-buffer-during-callback.html failures a=backout

Backed out changeset 2bd187c04fd9 (bug 1522837)
Backed out changeset 47c7f936579b (bug 1522837)
Backed out changeset 8fb361192757 (bug 1522837)
Backed out changeset 877d383189f4 (bug 1522837)
Backed out changeset 814aa7e78267 (bug 1522837)
Backed out changeset 2d7be3f59c9d (bug 1522837)
Backed out changeset 893db1319f23 (bug 1522837)
Backed out changeset 3eeb76f0f5d8 (bug 1522837)
This commit is contained in:
Bogdan Tara 2019-02-02 01:34:58 +02:00
Родитель 34253a9d78
Коммит add2612cc6
7 изменённых файлов: 159 добавлений и 353 удалений

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

@ -371,36 +371,6 @@ MethodStatus BaselineCompiler::compile() {
return Method_Compiled;
}
template <>
void BaselineCompilerCodeGen::loadScript(Register dest) {
masm.movePtr(ImmGCPtr(handler.script()), dest);
}
template <>
void BaselineInterpreterCodeGen::loadScript(Register dest) {
// TODO(bug 1522394): consider adding interpreterScript to BaselineFrame once
// we are able to run benchmarks.
masm.loadPtr(frame.addressOfCalleeToken(), dest);
Label notFunction, done;
masm.branchTestPtr(Assembler::NonZero, dest, Imm32(CalleeTokenScriptBit),
&notFunction);
{
// CalleeToken_Function or CalleeToken_FunctionConstructing.
masm.andPtr(Imm32(uint32_t(CalleeTokenMask)), dest);
masm.loadPtr(Address(dest, JSFunction::offsetOfScript()), dest);
masm.jump(&done);
}
masm.bind(&notFunction);
{
// CalleeToken_Script.
masm.andPtr(Imm32(uint32_t(CalleeTokenMask)), dest);
}
masm.bind(&done);
}
template <>
void BaselineCompilerCodeGen::emitInitializeLocals() {
// Initialize all locals to |undefined|. Lexical bindings are temporal
@ -443,22 +413,7 @@ void BaselineCompilerCodeGen::emitInitializeLocals() {
template <>
void BaselineInterpreterCodeGen::emitInitializeLocals() {
// Push |undefined| for all locals.
Register scratch = R0.scratchReg();
loadScript(scratch);
masm.load32(Address(scratch, JSScript::offsetOfNfixed()), scratch);
Label top, done;
masm.bind(&top);
masm.branchTest32(Assembler::Zero, scratch, scratch, &done);
{
masm.pushValue(UndefinedValue());
masm.sub32(Imm32(1), scratch);
masm.jump(&top);
}
masm.bind(&done);
MOZ_CRASH("NYI: interpreter emitInitializeLocals");
}
// On input:
@ -552,8 +507,7 @@ void BaselineCodeGen<Handler>::prepareVMCall() {
template <>
void BaselineCompilerCodeGen::storeFrameSizeAndPushDescriptor(
uint32_t frameBaseSize, uint32_t argSize, const Address& frameSizeAddr,
Register scratch1, Register scratch2) {
uint32_t frameBaseSize, uint32_t argSize, const Address& frameSizeAddr) {
uint32_t frameVals = frame.nlocals() + frame.stackDepth();
uint32_t frameFullSize = frameBaseSize + (frameVals * sizeof(Value));
@ -566,22 +520,22 @@ void BaselineCompilerCodeGen::storeFrameSizeAndPushDescriptor(
template <>
void BaselineInterpreterCodeGen::storeFrameSizeAndPushDescriptor(
uint32_t frameBaseSize, uint32_t argSize, const Address& frameSizeAddr,
Register scratch1, Register scratch2) {
// scratch1 = FramePointer + BaselineFrame::FramePointerOffset - StackPointer.
masm.computeEffectiveAddress(
Address(BaselineFrameReg, BaselineFrame::FramePointerOffset), scratch1);
masm.subStackPtrFrom(scratch1);
uint32_t frameBaseSize, uint32_t argSize, const Address& frameSizeAddr) {
MOZ_CRASH("NYI: interpreter storeFrameSizeAndPushDescriptor");
}
// Store the frame size without VMFunction arguments. Use
// computeEffectiveAddress instead of sub32 to avoid an extra move.
masm.computeEffectiveAddress(Address(scratch1, -int32_t(argSize)), scratch2);
masm.store32(scratch2, frameSizeAddr);
template <>
void BaselineCompilerCodeGen::computeFullFrameSize(uint32_t frameBaseSize,
Register dest) {
uint32_t frameVals = frame.nlocals() + frame.stackDepth();
uint32_t frameFullSize = frameBaseSize + (frameVals * sizeof(Value));
masm.move32(Imm32(frameFullSize), dest);
}
// Push frame descriptor based on the full frame size.
masm.makeFrameDescriptor(scratch1, FrameType::BaselineJS,
ExitFrameLayout::Size());
masm.push(scratch1);
template <>
void BaselineInterpreterCodeGen::computeFullFrameSize(uint32_t frameBaseSize,
Register dest) {
MOZ_CRASH("NYI: interpreter computeFullFrameSize");
}
template <typename Handler>
@ -618,29 +572,29 @@ bool BaselineCodeGen<Handler>::callVM(const VMFunction& fun,
uint32_t frameBaseSize =
BaselineFrame::FramePointerOffset + BaselineFrame::Size();
if (phase == POST_INITIALIZE) {
storeFrameSizeAndPushDescriptor(frameBaseSize, argSize, frameSizeAddress,
R0.scratchReg(), R1.scratchReg());
storeFrameSizeAndPushDescriptor(frameBaseSize, argSize, frameSizeAddress);
} else {
MOZ_ASSERT(phase == CHECK_OVER_RECURSED);
Label done, pushedFrameLocals;
Label afterWrite;
Label writePostInitialize;
// If OVER_RECURSED is set, then frame locals haven't been pushed yet.
masm.branchTest32(Assembler::Zero, frame.addressOfFlags(),
Imm32(BaselineFrame::OVER_RECURSED), &pushedFrameLocals);
{
masm.store32(Imm32(frameBaseSize), frameSizeAddress);
uint32_t descriptor =
MakeFrameDescriptor(frameBaseSize + argSize, FrameType::BaselineJS,
ExitFrameLayout::Size());
masm.push(Imm32(descriptor));
masm.jump(&done);
}
masm.bind(&pushedFrameLocals);
{
storeFrameSizeAndPushDescriptor(frameBaseSize, argSize, frameSizeAddress,
R0.scratchReg(), R1.scratchReg());
}
masm.bind(&done);
Imm32(BaselineFrame::OVER_RECURSED),
&writePostInitialize);
masm.move32(Imm32(frameBaseSize), ICTailCallReg);
masm.jump(&afterWrite);
masm.bind(&writePostInitialize);
computeFullFrameSize(frameBaseSize, ICTailCallReg);
masm.bind(&afterWrite);
masm.store32(ICTailCallReg, frameSizeAddress);
masm.add32(Imm32(argSize), ICTailCallReg);
masm.makeFrameDescriptor(ICTailCallReg, FrameType::BaselineJS,
ExitFrameLayout::Size());
masm.push(ICTailCallReg);
}
MOZ_ASSERT(fun.expectTailCall == NonTailCall);
// Perform the call.
@ -728,6 +682,16 @@ void BaselineInterpreterCodeGen::emitIsDebuggeeCheck() {
MOZ_CRASH("NYI: interpreter emitIsDebuggeeCheck");
}
template <>
void BaselineCompilerCodeGen::loadScript(Register dest) {
masm.movePtr(ImmGCPtr(handler.script()), dest);
}
template <>
void BaselineInterpreterCodeGen::loadScript(Register dest) {
MOZ_CRASH("NYI: interpreter loadScript");
}
template <>
void BaselineCompilerCodeGen::subtractScriptSlotsSize(Register reg,
Register scratch) {
@ -738,14 +702,7 @@ void BaselineCompilerCodeGen::subtractScriptSlotsSize(Register reg,
template <>
void BaselineInterpreterCodeGen::subtractScriptSlotsSize(Register reg,
Register scratch) {
// reg = reg - script->nslots() * sizeof(Value)
MOZ_ASSERT(reg != scratch);
loadScript(scratch);
masm.load32(Address(scratch, JSScript::offsetOfNslots()), scratch);
static_assert(sizeof(Value) == 8,
"shift by 3 below assumes Value is 8 bytes");
masm.lshiftPtr(Imm32(3), scratch);
masm.subPtr(scratch, reg);
MOZ_CRASH("NYI: interpreter subtractScriptSlotsSize");
}
template <>
@ -755,13 +712,7 @@ void BaselineCompilerCodeGen::loadGlobalLexicalEnvironment(Register dest) {
template <>
void BaselineInterpreterCodeGen::loadGlobalLexicalEnvironment(Register dest) {
// TODO(bug 1522394): consider storing a pointer to the global lexical in
// Realm to eliminate some dependent loads and unboxing.
masm.loadPtr(AbsoluteAddress(cx->addressOfRealm()), dest);
masm.loadPtr(Address(dest, Realm::offsetOfActiveGlobal()), dest);
masm.loadPtr(Address(dest, NativeObject::offsetOfSlots()), dest);
Address lexicalSlot(dest, GlobalObject::offsetOfLexicalEnvironmentSlot());
masm.unboxObject(lexicalSlot, dest);
MOZ_CRASH("NYI: interpreter loadGlobalLexicalEnvironment");
}
template <>
@ -785,22 +736,17 @@ void BaselineCompilerCodeGen::loadGlobalThisValue(ValueOperand dest) {
template <>
void BaselineInterpreterCodeGen::loadGlobalThisValue(ValueOperand dest) {
Register scratch = dest.scratchReg();
loadGlobalLexicalEnvironment(scratch);
static constexpr size_t SlotOffset =
LexicalEnvironmentObject::offsetOfThisValueOrScopeSlot();
masm.loadValue(Address(scratch, SlotOffset), dest);
MOZ_CRASH("NYI: interpreter loadGlobalThisValue");
}
template <>
void BaselineCompilerCodeGen::pushScriptArg(Register scratch) {
void BaselineCompilerCodeGen::pushScriptArg() {
pushArg(ImmGCPtr(handler.script()));
}
template <>
void BaselineInterpreterCodeGen::pushScriptArg(Register scratch) {
loadScript(scratch);
pushArg(scratch);
void BaselineInterpreterCodeGen::pushScriptArg() {
MOZ_CRASH("NYI: interpreter pushScriptArg");
}
template <>
@ -834,6 +780,9 @@ void BaselineCompilerCodeGen::pushScriptObjectArg(ScriptObjectType type) {
case ScriptObjectType::Function:
pushArg(ImmGCPtr(script->getFunction(handler.pc())));
return;
case ScriptObjectType::ObjectLiteral:
pushArg(ImmGCPtr(script->getObject(handler.pc())));
return;
}
MOZ_CRASH("Unexpected object type");
}
@ -990,7 +939,7 @@ bool BaselineCompilerCodeGen::initEnvironmentChain() {
prepareVMCall();
pushScriptArg(R2.scratchReg());
pushScriptArg();
masm.loadPtr(frame.addressOfEnvironmentChain(), R0.scratchReg());
pushArg(R0.scratchReg());
@ -2049,52 +1998,51 @@ bool BaselineInterpreterCodeGen::emit_JSOP_SYMBOL() {
MOZ_CRASH("NYI: interpreter JSOP_SYMBOL");
}
JSObject* BaselineCompilerHandler::maybeNoCloneSingletonObject() {
Realm* realm = script()->realm();
if (realm->creationOptions().cloneSingletons()) {
return nullptr;
}
typedef JSObject* (*DeepCloneObjectLiteralFn)(JSContext*, HandleObject,
NewObjectKind);
static const VMFunction DeepCloneObjectLiteralInfo =
FunctionInfo<DeepCloneObjectLiteralFn>(DeepCloneObjectLiteral,
"DeepCloneObjectLiteral");
realm->behaviors().setSingletonsAsValues();
return script()->getObject(pc());
}
template <>
bool BaselineCompilerCodeGen::emit_JSOP_OBJECT() {
if (cx->realm()->creationOptions().cloneSingletons()) {
prepareVMCall();
typedef JSObject* (*SingletonObjectLiteralFn)(JSContext*, HandleScript,
jsbytecode*);
static const VMFunction SingletonObjectLiteralInfo =
FunctionInfo<SingletonObjectLiteralFn>(SingletonObjectLiteralOperation,
"SingletonObjectLiteralOperation");
pushArg(ImmWord(TenuredObject));
pushScriptObjectArg(ScriptObjectType::ObjectLiteral);
template <typename Handler>
bool BaselineCodeGen<Handler>::emit_JSOP_OBJECT() {
// If we know we don't have to clone the object literal, just push it
// directly. Note that the interpreter always does the VM call; that's fine
// because this op is only used in run-once code.
if (JSObject* obj = handler.maybeNoCloneSingletonObject()) {
frame.push(ObjectValue(*obj));
if (!callVM(DeepCloneObjectLiteralInfo)) {
return false;
}
// Box and push return value.
masm.tagValue(JSVAL_TYPE_OBJECT, ReturnReg, R0);
frame.push(R0);
return true;
}
prepareVMCall();
pushBytecodePCArg();
pushScriptArg(R2.scratchReg());
if (!callVM(SingletonObjectLiteralInfo)) {
return false;
}
// Box and push return value.
masm.tagValue(JSVAL_TYPE_OBJECT, ReturnReg, R0);
frame.push(R0);
cx->realm()->behaviors().setSingletonsAsValues();
frame.push(ObjectValue(*handler.script()->getObject(handler.pc())));
return true;
}
template <>
bool BaselineInterpreterCodeGen::emit_JSOP_OBJECT() {
MOZ_CRASH("NYI: interpreter JSOP_OBJECT");
}
template <>
bool BaselineCompilerCodeGen::emit_JSOP_CALLSITEOBJ() {
RootedScript script(cx, handler.script());
JSObject* cso = ProcessCallSiteObjOperation(cx, script, handler.pc());
if (!cso) {
JSScript* script = handler.script();
jsbytecode* pc = handler.pc();
RootedObject cso(cx, script->getObject(pc));
RootedObject raw(cx, script->getObject(GET_UINT32_INDEX(pc) + 1));
if (!cso || !raw) {
return false;
}
if (!ProcessCallSiteObjOperation(cx, cso, raw)) {
return false;
}
@ -2102,27 +2050,9 @@ bool BaselineCompilerCodeGen::emit_JSOP_CALLSITEOBJ() {
return true;
}
typedef ArrayObject* (*ProcessCallSiteObjFn)(JSContext*, HandleScript,
jsbytecode*);
static const VMFunction ProcessCallSiteObjInfo =
FunctionInfo<ProcessCallSiteObjFn>(ProcessCallSiteObjOperation,
"ProcessCallSiteObjOperation");
template <>
bool BaselineInterpreterCodeGen::emit_JSOP_CALLSITEOBJ() {
prepareVMCall();
pushBytecodePCArg();
pushScriptArg(R2.scratchReg());
if (!callVM(ProcessCallSiteObjInfo)) {
return false;
}
// Box and push return value.
masm.tagValue(JSVAL_TYPE_OBJECT, ReturnReg, R0);
frame.push(R0);
return true;
MOZ_CRASH("NYI: interpreter JSOP_CALLSITEOBJ");
}
typedef JSObject* (*CloneRegExpObjectFn)(JSContext*, Handle<RegExpObject*>);
@ -2444,9 +2374,6 @@ const VMFunction NewArrayCopyOnWriteInfo = FunctionInfo<NewArrayCopyOnWriteFn>(
template <>
bool BaselineCompilerCodeGen::emit_JSOP_NEWARRAY_COPYONWRITE() {
// This is like the interpreter implementation, but we can call
// getOrFixupCopyOnWriteObject at compile-time.
RootedScript scriptRoot(cx, handler.script());
JSObject* obj =
ObjectGroup::getOrFixupCopyOnWriteObject(cx, scriptRoot, handler.pc());
@ -2469,27 +2396,9 @@ bool BaselineCompilerCodeGen::emit_JSOP_NEWARRAY_COPYONWRITE() {
return true;
}
typedef ArrayObject* (*NewArrayCopyOnWriteOperationFn)(JSContext*, HandleScript,
jsbytecode*);
const VMFunction NewArrayCopyOnWriteOperationInfo =
FunctionInfo<NewArrayCopyOnWriteOperationFn>(
NewArrayCopyOnWriteOperation, "NewArrayCopyOnWriteOperation");
template <>
bool BaselineInterpreterCodeGen::emit_JSOP_NEWARRAY_COPYONWRITE() {
prepareVMCall();
pushBytecodePCArg();
pushScriptArg(R2.scratchReg());
if (!callVM(NewArrayCopyOnWriteOperationInfo)) {
return false;
}
// Box and push return value.
masm.tagValue(JSVAL_TYPE_OBJECT, ReturnReg, R0);
frame.push(R0);
return true;
MOZ_CRASH("NYI: interpreter JSOP_NEWARRAY_COPYONWRITE");
}
template <>
@ -3312,35 +3221,9 @@ bool BaselineCompilerCodeGen::emit_JSOP_GETIMPORT() {
return true;
}
typedef bool (*GetImportOperationFn)(JSContext*, HandleObject, HandleScript,
jsbytecode*, MutableHandleValue);
static const VMFunction GetImportOperationInfo =
FunctionInfo<GetImportOperationFn>(GetImportOperation,
"GetImportOperation");
template <>
bool BaselineInterpreterCodeGen::emit_JSOP_GETIMPORT() {
frame.syncStack(0);
masm.loadPtr(frame.addressOfEnvironmentChain(), R0.scratchReg());
prepareVMCall();
pushBytecodePCArg();
pushScriptArg(R2.scratchReg());
pushArg(R0.scratchReg());
if (!callVM(GetImportOperationInfo)) {
return false;
}
// Enter the type monitor IC.
if (!emitNextIC()) {
return false;
}
frame.push(R0);
return true;
MOZ_CRASH("NYI: interpreter JSOP_GETIMPORT");
}
template <typename Handler>
@ -3368,7 +3251,7 @@ bool BaselineCodeGen<Handler>::emit_JSOP_SETINTRINSIC() {
pushArg(R0);
pushBytecodePCArg();
pushScriptArg(R2.scratchReg());
pushScriptArg();
return callVM(SetIntrinsicInfo);
}
@ -3386,7 +3269,7 @@ bool BaselineCodeGen<Handler>::emit_JSOP_DEFVAR() {
prepareVMCall();
pushBytecodePCArg();
pushScriptArg(R2.scratchReg());
pushScriptArg();
pushArg(R0.scratchReg());
return callVM(DefVarInfo);
@ -3408,7 +3291,7 @@ bool BaselineCodeGen<Handler>::emitDefLexical(JSOp op) {
prepareVMCall();
pushBytecodePCArg();
pushScriptArg(R2.scratchReg());
pushScriptArg();
pushArg(R0.scratchReg());
return callVM(DefLexicalInfo);
@ -3439,7 +3322,7 @@ bool BaselineCodeGen<Handler>::emit_JSOP_DEFFUN() {
pushArg(R0.scratchReg());
pushArg(R1.scratchReg());
pushScriptArg(R2.scratchReg());
pushScriptArg();
return callVM(DefFunOperationInfo);
}
@ -5601,7 +5484,9 @@ bool BaselineCodeGen<Handler>::emit_JSOP_INITHOMEOBJECT() {
template <>
bool BaselineCompilerCodeGen::emit_JSOP_BUILTINPROTO() {
// The builtin prototype is a constant for a given global.
JSObject* builtin = BuiltinProtoOperation(cx, handler.pc());
JSProtoKey key = static_cast<JSProtoKey>(GET_UINT8(handler.pc()));
MOZ_ASSERT(key < JSProto_LIMIT);
JSObject* builtin = GlobalObject::getOrCreatePrototype(cx, key);
if (!builtin) {
return false;
}
@ -5609,24 +5494,9 @@ bool BaselineCompilerCodeGen::emit_JSOP_BUILTINPROTO() {
return true;
}
typedef JSObject* (*BuiltinProtoOperationFn)(JSContext*, jsbytecode*);
static const VMFunction BuiltinProtoOperationInfo =
FunctionInfo<BuiltinProtoOperationFn>(BuiltinProtoOperation,
"BuiltinProtoOperation");
template <>
bool BaselineInterpreterCodeGen::emit_JSOP_BUILTINPROTO() {
prepareVMCall();
pushBytecodePCArg();
if (!callVM(BuiltinProtoOperationInfo)) {
return false;
}
masm.tagValue(JSVAL_TYPE_OBJECT, ReturnReg, R0);
frame.push(R0);
return true;
MOZ_CRASH("NYI: interpreter JSOP_BUILTINPROTO");
}
typedef JSObject* (*ObjectWithProtoOperationFn)(JSContext*, HandleValue);
@ -5692,7 +5562,7 @@ bool BaselineCodeGen<Handler>::emit_JSOP_CLASSCONSTRUCTOR() {
prepareVMCall();
pushArg(ImmPtr(nullptr));
pushBytecodePCArg();
pushScriptArg(R2.scratchReg());
pushScriptArg();
if (!callVM(MakeDefaultConstructorInfo)) {
return false;
}
@ -5711,7 +5581,7 @@ bool BaselineCodeGen<Handler>::emit_JSOP_DERIVEDCONSTRUCTOR() {
prepareVMCall();
pushArg(R0.scratchReg());
pushBytecodePCArg();
pushScriptArg(R2.scratchReg());
pushScriptArg();
if (!callVM(MakeDefaultConstructorInfo)) {
return false;
}
@ -5728,9 +5598,6 @@ static const VMFunction GetOrCreateModuleMetaObjectInfo =
template <>
bool BaselineCompilerCodeGen::emit_JSOP_IMPORTMETA() {
// Note: this is like the interpreter implementation, but optimized a bit by
// calling GetModuleObjectForScript at compile-time.
RootedModuleObject module(cx, GetModuleObjectForScript(handler.script()));
MOZ_ASSERT(module);
@ -5747,24 +5614,9 @@ bool BaselineCompilerCodeGen::emit_JSOP_IMPORTMETA() {
return true;
}
typedef JSObject* (*ImportMetaOperationFn)(JSContext*, HandleScript);
static const VMFunction ImportMetaOperationInfo =
FunctionInfo<ImportMetaOperationFn>(ImportMetaOperation,
"ImportMetaOperation");
template <>
bool BaselineInterpreterCodeGen::emit_JSOP_IMPORTMETA() {
prepareVMCall();
pushScriptArg(R2.scratchReg());
if (!callVM(ImportMetaOperationInfo)) {
return false;
}
masm.tagValue(JSVAL_TYPE_OBJECT, ReturnReg, R0);
frame.push(R0);
return true;
MOZ_CRASH("NYI: interpreter JSOP_IMPORTMETA");
}
typedef JSObject* (*StartDynamicModuleImportFn)(JSContext*, HandleScript,
@ -5780,7 +5632,7 @@ bool BaselineCodeGen<Handler>::emit_JSOP_DYNAMIC_IMPORT() {
prepareVMCall();
pushArg(R0);
pushScriptArg(R2.scratchReg());
pushScriptArg();
if (!callVM(StartDynamicModuleImportInfo)) {
return false;
}

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

@ -303,14 +303,14 @@ class BaselineCodeGen {
}
// Pushes the current script as argument for a VM function.
void pushScriptArg(Register scratch);
void pushScriptArg();
// Pushes the bytecode pc as argument for a VM function.
void pushBytecodePCArg();
// Pushes a name/object/scope associated with the current bytecode op (and
// stored in the script) as argument for a VM function.
enum class ScriptObjectType { RegExp, Function };
enum class ScriptObjectType { RegExp, Function, ObjectLiteral };
void pushScriptObjectArg(ScriptObjectType type);
void pushScriptNameArg();
void pushScriptScopeArg();
@ -341,8 +341,8 @@ class BaselineCodeGen {
void prepareVMCall();
void storeFrameSizeAndPushDescriptor(uint32_t frameBaseSize, uint32_t argSize,
const Address& frameSizeAddr,
Register scratch1, Register scratch2);
const Address& frameSizeAddr);
void computeFullFrameSize(uint32_t frameBaseSize, Register dest);
enum CallVMPhase { POST_INITIALIZE, CHECK_OVER_RECURSED };
bool callVM(const VMFunction& fun, CallVMPhase phase = POST_INITIALIZE);
@ -553,8 +553,6 @@ class BaselineCompilerHandler {
static const unsigned EARLY_STACK_CHECK_SLOT_COUNT = 128;
return script()->nslots() > EARLY_STACK_CHECK_SLOT_COUNT;
}
JSObject* maybeNoCloneSingletonObject();
};
using BaselineCompilerCodeGen = BaselineCodeGen<BaselineCompilerHandler>;
@ -646,8 +644,6 @@ class BaselineInterpreterHandler {
// The interpreter always does the early stack check because we don't know the
// frame size statically.
bool needsEarlyStackCheck() const { return true; }
JSObject* maybeNoCloneSingletonObject() { return nullptr; }
};
using BaselineInterpreterCodeGen = BaselineCodeGen<BaselineInterpreterHandler>;

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

@ -16,16 +16,13 @@
namespace js {
namespace jit {
struct SafepointSlotEntry;
enum CalleeTokenTag {
CalleeToken_Function = 0x0, // untagged
CalleeToken_FunctionConstructing = 0x1,
CalleeToken_Script = 0x2
};
// Any CalleeToken with this bit set must be CalleeToken_Script.
static const uintptr_t CalleeTokenScriptBit = CalleeToken_Script;
struct SafepointSlotEntry;
static const uintptr_t CalleeTokenMask = ~uintptr_t(0x3);

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

@ -672,30 +672,25 @@ static MOZ_ALWAYS_INLINE bool InitArrayElemOperation(JSContext* cx,
return true;
}
static inline ArrayObject* ProcessCallSiteObjOperation(JSContext* cx,
HandleScript script,
jsbytecode* pc) {
MOZ_ASSERT(*pc == JSOP_CALLSITEOBJ);
RootedArrayObject cso(cx, &script->getObject(pc)->as<ArrayObject>());
if (cso->isExtensible()) {
RootedObject raw(cx, script->getObject(GET_UINT32_INDEX(pc) + 1));
MOZ_ASSERT(raw->is<ArrayObject>());
static MOZ_ALWAYS_INLINE bool ProcessCallSiteObjOperation(JSContext* cx,
HandleObject cso,
HandleObject raw) {
MOZ_ASSERT(cso->is<ArrayObject>());
MOZ_ASSERT(raw->is<ArrayObject>());
if (cso->nonProxyIsExtensible()) {
RootedValue rawValue(cx, ObjectValue(*raw));
if (!DefineDataProperty(cx, cso, cx->names().raw, rawValue, 0)) {
return nullptr;
return false;
}
if (!FreezeObject(cx, raw)) {
return nullptr;
return false;
}
if (!FreezeObject(cx, cso)) {
return nullptr;
return false;
}
}
return cso;
return true;
}
// BigInt proposal 3.2.4 Abstract Relational Comparison

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

@ -243,14 +243,13 @@ static inline bool GetNameOperation(JSContext* cx, InterpreterFrame* fp,
return GetEnvironmentName<GetNameMode::Normal>(cx, envChain, name, vp);
}
bool js::GetImportOperation(JSContext* cx, HandleObject envChain,
HandleScript script, jsbytecode* pc,
MutableHandleValue vp) {
RootedObject env(cx), pobj(cx);
RootedPropertyName name(cx, script->getName(pc));
static inline bool GetImportOperation(JSContext* cx, InterpreterFrame* fp,
jsbytecode* pc, MutableHandleValue vp) {
RootedObject obj(cx, fp->environmentChain()), env(cx), pobj(cx);
RootedPropertyName name(cx, fp->script()->getName(pc));
Rooted<PropertyResult> prop(cx);
MOZ_ALWAYS_TRUE(LookupName(cx, name, envChain, &env, &pobj, &prop));
MOZ_ALWAYS_TRUE(LookupName(cx, name, obj, &env, &pobj, &prop));
MOZ_ASSERT(env && env->is<ModuleEnvironmentObject>());
MOZ_ASSERT(env->as<ModuleEnvironmentObject>().hasImportBinding(name));
return FetchName<GetNameMode::Normal>(cx, env, pobj, name, prop, vp);
@ -3230,8 +3229,7 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx,
CASE(JSOP_GETIMPORT) {
PUSH_NULL();
MutableHandleValue rval = REGS.stackHandleAt(-1);
HandleObject envChain = REGS.fp()->environmentChain();
if (!GetImportOperation(cx, envChain, script, REGS.pc, rval)) {
if (!GetImportOperation(cx, REGS.fp(), REGS.pc, rval)) {
goto error;
}
@ -3292,19 +3290,29 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx,
END_CASE(JSOP_SYMBOL)
CASE(JSOP_OBJECT) {
JSObject* obj = SingletonObjectLiteralOperation(cx, script, REGS.pc);
if (!obj) {
goto error;
ReservedRooted<JSObject*> ref(&rootObject0, script->getObject(REGS.pc));
if (cx->realm()->creationOptions().cloneSingletons()) {
JSObject* obj = DeepCloneObjectLiteral(cx, ref, TenuredObject);
if (!obj) {
goto error;
}
PUSH_OBJECT(*obj);
} else {
cx->realm()->behaviors().setSingletonsAsValues();
PUSH_OBJECT(*ref);
}
PUSH_OBJECT(*obj);
}
END_CASE(JSOP_OBJECT)
CASE(JSOP_CALLSITEOBJ) {
JSObject* cso = ProcessCallSiteObjOperation(cx, script, REGS.pc);
if (!cso) {
ReservedRooted<JSObject*> cso(&rootObject0, script->getObject(REGS.pc));
ReservedRooted<JSObject*> raw(
&rootObject1, script->getObject(GET_UINT32_INDEX(REGS.pc) + 1));
if (!ProcessCallSiteObjOperation(cx, cso, raw)) {
goto error;
}
PUSH_OBJECT(*cso);
}
END_CASE(JSOP_CALLSITEOBJ)
@ -3734,7 +3742,17 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx,
END_CASE(JSOP_NEWARRAY)
CASE(JSOP_NEWARRAY_COPYONWRITE) {
JSObject* obj = NewArrayCopyOnWriteOperation(cx, script, REGS.pc);
ReservedRooted<JSObject*> baseobj(
&rootObject0,
ObjectGroup::getOrFixupCopyOnWriteObject(cx, script, REGS.pc));
if (!baseobj) {
goto error;
}
ReservedRooted<JSObject*> obj(
&rootObject1, NewDenseCopyOnWriteArray(
cx, ((RootedObject&)(baseobj)).as<ArrayObject>(),
gc::DefaultHeap));
if (!obj) {
goto error;
}
@ -4139,7 +4157,9 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx,
END_CASE(JSOP_CHECKCLASSHERITAGE)
CASE(JSOP_BUILTINPROTO) {
JSObject* builtin = BuiltinProtoOperation(cx, REGS.pc);
MOZ_ASSERT(GET_UINT8(REGS.pc) < JSProto_LIMIT);
JSProtoKey key = static_cast<JSProtoKey>(GET_UINT8(REGS.pc));
JSObject* builtin = GlobalObject::getOrCreatePrototype(cx, key);
if (!builtin) {
goto error;
}
@ -4217,7 +4237,11 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx,
END_CASE(JSOP_NEWTARGET)
CASE(JSOP_IMPORTMETA) {
JSObject* metaObject = ImportMetaOperation(cx, script);
ReservedRooted<JSObject*> module(&rootObject0,
GetModuleObjectForScript(script));
MOZ_ASSERT(module);
JSObject* metaObject = GetOrCreateModuleMetaObject(cx, module);
if (!metaObject) {
goto error;
}
@ -4661,34 +4685,6 @@ bool js::DefFunOperation(JSContext* cx, HandleScript script,
return PutProperty(cx, parent, id, rval, script->strict());
}
JSObject* js::SingletonObjectLiteralOperation(JSContext* cx,
HandleScript script,
jsbytecode* pc) {
MOZ_ASSERT(*pc == JSOP_OBJECT);
RootedObject obj(cx, script->getObject(pc));
if (cx->realm()->creationOptions().cloneSingletons()) {
return DeepCloneObjectLiteral(cx, obj, TenuredObject);
}
cx->realm()->behaviors().setSingletonsAsValues();
return obj;
}
JSObject* js::ImportMetaOperation(JSContext* cx, HandleScript script) {
RootedObject module(cx, GetModuleObjectForScript(script));
MOZ_ASSERT(module);
return GetOrCreateModuleMetaObject(cx, module);
}
JSObject* js::BuiltinProtoOperation(JSContext* cx, jsbytecode* pc) {
MOZ_ASSERT(*pc == JSOP_BUILTINPROTO);
MOZ_ASSERT(GET_UINT8(pc) < JSProto_LIMIT);
JSProtoKey key = static_cast<JSProtoKey>(GET_UINT8(pc));
return GlobalObject::getOrCreatePrototype(cx, key);
}
bool js::ThrowMsgOperation(JSContext* cx, const unsigned errorNum) {
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, errorNum);
return false;
@ -5249,20 +5245,6 @@ JSObject* js::NewArrayOperationWithTemplate(JSContext* cx,
return obj;
}
ArrayObject* js::NewArrayCopyOnWriteOperation(JSContext* cx,
HandleScript script,
jsbytecode* pc) {
MOZ_ASSERT(*pc == JSOP_NEWARRAY_COPYONWRITE);
RootedArrayObject baseobj(
cx, ObjectGroup::getOrFixupCopyOnWriteObject(cx, script, pc));
if (!baseobj) {
return nullptr;
}
return NewDenseCopyOnWriteArray(cx, baseobj, gc::DefaultHeap);
}
void js::ReportRuntimeLexicalError(JSContext* cx, unsigned errorNumber,
HandleId id) {
MOZ_ASSERT(errorNumber == JSMSG_UNINITIALIZED_LEXICAL ||

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

@ -498,13 +498,6 @@ bool DefLexicalOperation(JSContext* cx, HandleObject envChain,
bool DefFunOperation(JSContext* cx, HandleScript script, HandleObject envChain,
HandleFunction funArg);
JSObject* SingletonObjectLiteralOperation(JSContext* cx, HandleScript script,
jsbytecode* pc);
JSObject* ImportMetaOperation(JSContext* cx, HandleScript script);
JSObject* BuiltinProtoOperation(JSContext* cx, jsbytecode* pc);
bool ThrowMsgOperation(JSContext* cx, const unsigned errorNum);
bool GetAndClearException(JSContext* cx, MutableHandleValue res);
@ -548,13 +541,6 @@ JSObject* NewArrayOperation(JSContext* cx, HandleScript script, jsbytecode* pc,
JSObject* NewArrayOperationWithTemplate(JSContext* cx,
HandleObject templateObject);
ArrayObject* NewArrayCopyOnWriteOperation(JSContext* cx, HandleScript script,
jsbytecode* pc);
MOZ_MUST_USE bool GetImportOperation(JSContext* cx, HandleObject envChain,
HandleScript script, jsbytecode* pc,
MutableHandleValue vp);
void ReportRuntimeLexicalError(JSContext* cx, unsigned errorNumber,
HandleId id);

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

@ -846,8 +846,6 @@ struct JSContext : public JS::RootingContext,
}
void* addressOfZone() { return &zone_; }
const void* addressOfRealm() const { return &realm_; }
// Futex state, used by Atomics.wait() and Atomics.wake() on the Atomics
// object.
js::FutexThread fx;