Bug 1273863 - TraceLogger: Trace the name of vm calls, r=bbouvier

This commit is contained in:
Hannes Verschore 2016-06-21 13:52:11 +02:00
parent ecdad783a4
commit 1de914e6dd
8 changed files with 316 additions and 137 deletions

View File

@ -173,7 +173,8 @@ CodeGenerator::~CodeGenerator()
} }
typedef bool (*StringToNumberFn)(ExclusiveContext*, JSString*, double*); typedef bool (*StringToNumberFn)(ExclusiveContext*, JSString*, double*);
static const VMFunction StringToNumberInfo = FunctionInfo<StringToNumberFn>(StringToNumber); static const VMFunction StringToNumberInfo =
FunctionInfo<StringToNumberFn>(StringToNumber, "StringToNumber");
void void
CodeGenerator::visitValueToInt32(LValueToInt32* lir) CodeGenerator::visitValueToInt32(LValueToInt32* lir)
@ -852,7 +853,8 @@ CodeGenerator::emitIntToString(Register input, Register output, Label* ool)
} }
typedef JSFlatString* (*IntToStringFn)(ExclusiveContext*, int); typedef JSFlatString* (*IntToStringFn)(ExclusiveContext*, int);
static const VMFunction IntToStringInfo = FunctionInfo<IntToStringFn>(Int32ToString<CanGC>); static const VMFunction IntToStringInfo =
FunctionInfo<IntToStringFn>(Int32ToString<CanGC>, "Int32ToString");
void void
CodeGenerator::visitIntToString(LIntToString* lir) CodeGenerator::visitIntToString(LIntToString* lir)
@ -869,7 +871,8 @@ CodeGenerator::visitIntToString(LIntToString* lir)
} }
typedef JSString* (*DoubleToStringFn)(ExclusiveContext*, double); typedef JSString* (*DoubleToStringFn)(ExclusiveContext*, double);
static const VMFunction DoubleToStringInfo = FunctionInfo<DoubleToStringFn>(NumberToString<CanGC>); static const VMFunction DoubleToStringInfo =
FunctionInfo<DoubleToStringFn>(NumberToString<CanGC>, "NumberToString");
void void
CodeGenerator::visitDoubleToString(LDoubleToString* lir) CodeGenerator::visitDoubleToString(LDoubleToString* lir)
@ -889,7 +892,8 @@ CodeGenerator::visitDoubleToString(LDoubleToString* lir)
} }
typedef JSString* (*PrimitiveToStringFn)(JSContext*, HandleValue); typedef JSString* (*PrimitiveToStringFn)(JSContext*, HandleValue);
static const VMFunction PrimitiveToStringInfo = FunctionInfo<PrimitiveToStringFn>(ToStringSlow); static const VMFunction PrimitiveToStringInfo =
FunctionInfo<PrimitiveToStringFn>(ToStringSlow, "ToStringSlow");
void void
CodeGenerator::visitValueToString(LValueToString* lir) CodeGenerator::visitValueToString(LValueToString* lir)
@ -984,7 +988,8 @@ CodeGenerator::visitValueToString(LValueToString* lir)
} }
typedef JSObject* (*ToObjectFn)(JSContext*, HandleValue, bool); typedef JSObject* (*ToObjectFn)(JSContext*, HandleValue, bool);
static const VMFunction ToObjectInfo = FunctionInfo<ToObjectFn>(ToObjectSlow); static const VMFunction ToObjectInfo =
FunctionInfo<ToObjectFn>(ToObjectSlow, "ToObjectSlow");
void void
CodeGenerator::visitValueToObjectOrNull(LValueToObjectOrNull* lir) CodeGenerator::visitValueToObjectOrNull(LValueToObjectOrNull* lir)
@ -1007,7 +1012,7 @@ CodeGenerator::visitValueToObjectOrNull(LValueToObjectOrNull* lir)
typedef JSObject* (*CloneRegExpObjectFn)(JSContext*, JSObject*); typedef JSObject* (*CloneRegExpObjectFn)(JSContext*, JSObject*);
static const VMFunction CloneRegExpObjectInfo = static const VMFunction CloneRegExpObjectInfo =
FunctionInfo<CloneRegExpObjectFn>(CloneRegExpObject); FunctionInfo<CloneRegExpObjectFn>(CloneRegExpObject, "CloneRegExpObject");
void void
CodeGenerator::visitRegExp(LRegExp* lir) CodeGenerator::visitRegExp(LRegExp* lir)
@ -1728,7 +1733,8 @@ class OutOfLineRegExpMatcher : public OutOfLineCodeBase<CodeGenerator>
typedef bool (*RegExpMatcherRawFn)(JSContext* cx, HandleObject regexp, HandleString input, typedef bool (*RegExpMatcherRawFn)(JSContext* cx, HandleObject regexp, HandleString input,
int32_t lastIndex, int32_t lastIndex,
MatchPairs* pairs, MutableHandleValue output); MatchPairs* pairs, MutableHandleValue output);
static const VMFunction RegExpMatcherRawInfo = FunctionInfo<RegExpMatcherRawFn>(RegExpMatcherRaw); static const VMFunction RegExpMatcherRawInfo =
FunctionInfo<RegExpMatcherRawFn>(RegExpMatcherRaw, "RegExpMatcherRaw");
void void
CodeGenerator::visitOutOfLineRegExpMatcher(OutOfLineRegExpMatcher* ool) CodeGenerator::visitOutOfLineRegExpMatcher(OutOfLineRegExpMatcher* ool)
@ -1884,7 +1890,8 @@ class OutOfLineRegExpSearcher : public OutOfLineCodeBase<CodeGenerator>
typedef bool (*RegExpSearcherRawFn)(JSContext* cx, HandleObject regexp, HandleString input, typedef bool (*RegExpSearcherRawFn)(JSContext* cx, HandleObject regexp, HandleString input,
int32_t lastIndex, int32_t lastIndex,
MatchPairs* pairs, int32_t* result); MatchPairs* pairs, int32_t* result);
static const VMFunction RegExpSearcherRawInfo = FunctionInfo<RegExpSearcherRawFn>(RegExpSearcherRaw); static const VMFunction RegExpSearcherRawInfo =
FunctionInfo<RegExpSearcherRawFn>(RegExpSearcherRaw, "RegExpSearcherRaw");
void void
CodeGenerator::visitOutOfLineRegExpSearcher(OutOfLineRegExpSearcher* ool) CodeGenerator::visitOutOfLineRegExpSearcher(OutOfLineRegExpSearcher* ool)
@ -2030,7 +2037,8 @@ class OutOfLineRegExpTester : public OutOfLineCodeBase<CodeGenerator>
typedef bool (*RegExpTesterRawFn)(JSContext* cx, HandleObject regexp, HandleString input, typedef bool (*RegExpTesterRawFn)(JSContext* cx, HandleObject regexp, HandleString input,
int32_t lastIndex, int32_t* result); int32_t lastIndex, int32_t* result);
static const VMFunction RegExpTesterRawInfo = FunctionInfo<RegExpTesterRawFn>(RegExpTesterRaw); static const VMFunction RegExpTesterRawInfo =
FunctionInfo<RegExpTesterRawFn>(RegExpTesterRaw, "RegExpTesterRaw");
void void
CodeGenerator::visitOutOfLineRegExpTester(OutOfLineRegExpTester* ool) CodeGenerator::visitOutOfLineRegExpTester(OutOfLineRegExpTester* ool)
@ -2239,7 +2247,8 @@ FindFirstDollarIndex(MacroAssembler& masm, Register str, Register len, Register
} }
typedef bool (*GetFirstDollarIndexRawFn)(JSContext*, HandleString, int32_t*); typedef bool (*GetFirstDollarIndexRawFn)(JSContext*, HandleString, int32_t*);
static const VMFunction GetFirstDollarIndexRawInfo = FunctionInfo<GetFirstDollarIndexRawFn>(GetFirstDollarIndexRaw); static const VMFunction GetFirstDollarIndexRawInfo =
FunctionInfo<GetFirstDollarIndexRawFn>(GetFirstDollarIndexRaw, "GetFirstDollarIndexRaw");
void void
CodeGenerator::visitGetFirstDollarIndex(LGetFirstDollarIndex* ins) CodeGenerator::visitGetFirstDollarIndex(LGetFirstDollarIndex* ins)
@ -2271,8 +2280,10 @@ CodeGenerator::visitGetFirstDollarIndex(LGetFirstDollarIndex* ins)
} }
typedef JSString* (*StringReplaceFn)(JSContext*, HandleString, HandleString, HandleString); typedef JSString* (*StringReplaceFn)(JSContext*, HandleString, HandleString, HandleString);
static const VMFunction StringFlatReplaceInfo = FunctionInfo<StringReplaceFn>(js::str_flat_replace_string); static const VMFunction StringFlatReplaceInfo =
static const VMFunction StringReplaceInfo = FunctionInfo<StringReplaceFn>(StringReplace); FunctionInfo<StringReplaceFn>(js::str_flat_replace_string, "str_flat_replace_string");
static const VMFunction StringReplaceInfo =
FunctionInfo<StringReplaceFn>(StringReplace, "StringReplace");
void void
CodeGenerator::visitStringReplace(LStringReplace* lir) CodeGenerator::visitStringReplace(LStringReplace* lir)
@ -2418,7 +2429,7 @@ CodeGenerator::visitNullarySharedStub(LNullarySharedStub* lir)
} }
typedef JSObject* (*LambdaFn)(JSContext*, HandleFunction, HandleObject); typedef JSObject* (*LambdaFn)(JSContext*, HandleFunction, HandleObject);
static const VMFunction LambdaInfo = FunctionInfo<LambdaFn>(js::Lambda); static const VMFunction LambdaInfo = FunctionInfo<LambdaFn>(js::Lambda, "Lambda");
void void
CodeGenerator::visitLambdaForSingleton(LLambdaForSingleton* lir) CodeGenerator::visitLambdaForSingleton(LLambdaForSingleton* lir)
@ -2475,7 +2486,8 @@ class OutOfLineLambdaArrow : public OutOfLineCodeBase<CodeGenerator>
}; };
typedef JSObject* (*LambdaArrowFn)(JSContext*, HandleFunction, HandleObject, HandleValue); typedef JSObject* (*LambdaArrowFn)(JSContext*, HandleFunction, HandleObject, HandleValue);
static const VMFunction LambdaArrowInfo = FunctionInfo<LambdaArrowFn>(js::LambdaArrow); static const VMFunction LambdaArrowInfo =
FunctionInfo<LambdaArrowFn>(js::LambdaArrow, "LambdaArrow");
void void
CodeGenerator::visitOutOfLineLambdaArrow(OutOfLineLambdaArrow* ool) CodeGenerator::visitOutOfLineLambdaArrow(OutOfLineLambdaArrow* ool)
@ -2630,7 +2642,8 @@ class OutOfLineInterruptCheckImplicit : public OutOfLineCodeBase<CodeGenerator>
}; };
typedef bool (*InterruptCheckFn)(JSContext*); typedef bool (*InterruptCheckFn)(JSContext*);
static const VMFunction InterruptCheckInfo = FunctionInfo<InterruptCheckFn>(InterruptCheck); static const VMFunction InterruptCheckInfo =
FunctionInfo<InterruptCheckFn>(InterruptCheck, "InterruptCheck");
void void
CodeGenerator::visitOutOfLineInterruptCheckImplicit(OutOfLineInterruptCheckImplicit* ool) CodeGenerator::visitOutOfLineInterruptCheckImplicit(OutOfLineInterruptCheckImplicit* ool)
@ -2712,7 +2725,7 @@ CodeGenerator::visitTableSwitchV(LTableSwitchV* ins)
typedef JSObject* (*DeepCloneObjectLiteralFn)(JSContext*, HandleObject, NewObjectKind); typedef JSObject* (*DeepCloneObjectLiteralFn)(JSContext*, HandleObject, NewObjectKind);
static const VMFunction DeepCloneObjectLiteralInfo = static const VMFunction DeepCloneObjectLiteralInfo =
FunctionInfo<DeepCloneObjectLiteralFn>(DeepCloneObjectLiteral); FunctionInfo<DeepCloneObjectLiteralFn>(DeepCloneObjectLiteral, "DeepCloneObjectLiteral");
void void
CodeGenerator::visitCloneLiteral(LCloneLiteral* lir) CodeGenerator::visitCloneLiteral(LCloneLiteral* lir)
@ -3223,7 +3236,8 @@ CodeGenerator::visitElements(LElements* lir)
typedef bool (*ConvertElementsToDoublesFn)(JSContext*, uintptr_t); typedef bool (*ConvertElementsToDoublesFn)(JSContext*, uintptr_t);
static const VMFunction ConvertElementsToDoublesInfo = static const VMFunction ConvertElementsToDoublesInfo =
FunctionInfo<ConvertElementsToDoublesFn>(ObjectElements::ConvertElementsToDoubles); FunctionInfo<ConvertElementsToDoublesFn>(ObjectElements::ConvertElementsToDoubles,
"ObjectElements::ConvertElementsToDoubles");
void void
CodeGenerator::visitConvertElementsToDoubles(LConvertElementsToDoubles* lir) CodeGenerator::visitConvertElementsToDoubles(LConvertElementsToDoubles* lir)
@ -3268,7 +3282,8 @@ CodeGenerator::visitMaybeToDoubleElement(LMaybeToDoubleElement* lir)
typedef bool (*CopyElementsForWriteFn)(ExclusiveContext*, NativeObject*); typedef bool (*CopyElementsForWriteFn)(ExclusiveContext*, NativeObject*);
static const VMFunction CopyElementsForWriteInfo = static const VMFunction CopyElementsForWriteInfo =
FunctionInfo<CopyElementsForWriteFn>(NativeObject::CopyElementsForWrite); FunctionInfo<CopyElementsForWriteFn>(NativeObject::CopyElementsForWrite,
"NativeObject::CopyElementsForWrite");
void void
CodeGenerator::visitMaybeCopyElementsForWrite(LMaybeCopyElementsForWrite* lir) CodeGenerator::visitMaybeCopyElementsForWrite(LMaybeCopyElementsForWrite* lir)
@ -3835,7 +3850,7 @@ CodeGenerator::visitCallDOMNative(LCallDOMNative* call)
typedef bool (*GetIntrinsicValueFn)(JSContext* cx, HandlePropertyName, MutableHandleValue); typedef bool (*GetIntrinsicValueFn)(JSContext* cx, HandlePropertyName, MutableHandleValue);
static const VMFunction GetIntrinsicValueInfo = static const VMFunction GetIntrinsicValueInfo =
FunctionInfo<GetIntrinsicValueFn>(GetIntrinsicValue); FunctionInfo<GetIntrinsicValueFn>(GetIntrinsicValue, "GetIntrinsicValue");
void void
CodeGenerator::visitCallGetIntrinsicValue(LCallGetIntrinsicValue* lir) CodeGenerator::visitCallGetIntrinsicValue(LCallGetIntrinsicValue* lir)
@ -3845,7 +3860,8 @@ CodeGenerator::visitCallGetIntrinsicValue(LCallGetIntrinsicValue* lir)
} }
typedef bool (*InvokeFunctionFn)(JSContext*, HandleObject, bool, uint32_t, Value*, MutableHandleValue); typedef bool (*InvokeFunctionFn)(JSContext*, HandleObject, bool, uint32_t, Value*, MutableHandleValue);
static const VMFunction InvokeFunctionInfo = FunctionInfo<InvokeFunctionFn>(InvokeFunction); static const VMFunction InvokeFunctionInfo =
FunctionInfo<InvokeFunctionFn>(InvokeFunction, "InvokeFunction");
void void
CodeGenerator::emitCallInvokeFunction(LInstruction* call, Register calleereg, CodeGenerator::emitCallInvokeFunction(LInstruction* call, Register calleereg,
@ -3961,7 +3977,8 @@ CodeGenerator::visitCallGeneric(LCallGeneric* call)
typedef bool (*InvokeFunctionShuffleFn)(JSContext*, HandleObject, uint32_t, uint32_t, Value*, typedef bool (*InvokeFunctionShuffleFn)(JSContext*, HandleObject, uint32_t, uint32_t, Value*,
MutableHandleValue); MutableHandleValue);
static const VMFunction InvokeFunctionShuffleInfo = static const VMFunction InvokeFunctionShuffleInfo =
FunctionInfo<InvokeFunctionShuffleFn>(InvokeFunctionShuffleNewTarget); FunctionInfo<InvokeFunctionShuffleFn>(InvokeFunctionShuffleNewTarget,
"InvokeFunctionShuffleNewTarget");
void void
CodeGenerator::emitCallInvokeFunctionShuffleNewTarget(LCallKnown* call, Register calleeReg, CodeGenerator::emitCallInvokeFunctionShuffleNewTarget(LCallKnown* call, Register calleeReg,
uint32_t numFormals, uint32_t unusedStack) uint32_t numFormals, uint32_t unusedStack)
@ -4409,7 +4426,8 @@ CodeGenerator::visitApplyArrayGeneric(LApplyArrayGeneric* apply)
} }
typedef bool (*ArraySpliceDenseFn)(JSContext*, HandleObject, uint32_t, uint32_t); typedef bool (*ArraySpliceDenseFn)(JSContext*, HandleObject, uint32_t, uint32_t);
static const VMFunction ArraySpliceDenseInfo = FunctionInfo<ArraySpliceDenseFn>(ArraySpliceDense); static const VMFunction ArraySpliceDenseInfo =
FunctionInfo<ArraySpliceDenseFn>(ArraySpliceDense, "ArraySpliceDense");
void void
CodeGenerator::visitArraySplice(LArraySplice* lir) CodeGenerator::visitArraySplice(LArraySplice* lir)
@ -4472,7 +4490,8 @@ CodeGenerator::visitGetDynamicName(LGetDynamicName* lir)
typedef bool (*DirectEvalSFn)(JSContext*, HandleObject, HandleScript, HandleValue, typedef bool (*DirectEvalSFn)(JSContext*, HandleObject, HandleScript, HandleValue,
HandleString, jsbytecode*, MutableHandleValue); HandleString, jsbytecode*, MutableHandleValue);
static const VMFunction DirectEvalStringInfo = FunctionInfo<DirectEvalSFn>(DirectEvalStringFromIon); static const VMFunction DirectEvalStringInfo =
FunctionInfo<DirectEvalSFn>(DirectEvalStringFromIon, "DirectEvalStringFromIon");
void void
CodeGenerator::visitCallDirectEval(LCallDirectEval* lir) CodeGenerator::visitCallDirectEval(LCallDirectEval* lir)
@ -4602,7 +4621,7 @@ CodeGenerator::visitCheckOverRecursed(LCheckOverRecursed* lir)
} }
typedef bool (*DefVarFn)(JSContext*, HandlePropertyName, unsigned, HandleObject); typedef bool (*DefVarFn)(JSContext*, HandlePropertyName, unsigned, HandleObject);
static const VMFunction DefVarInfo = FunctionInfo<DefVarFn>(DefVar); static const VMFunction DefVarInfo = FunctionInfo<DefVarFn>(DefVar, "DefVar");
void void
CodeGenerator::visitDefVar(LDefVar* lir) CodeGenerator::visitDefVar(LDefVar* lir)
@ -4617,7 +4636,8 @@ CodeGenerator::visitDefVar(LDefVar* lir)
} }
typedef bool (*DefLexicalFn)(JSContext*, HandlePropertyName, unsigned); typedef bool (*DefLexicalFn)(JSContext*, HandlePropertyName, unsigned);
static const VMFunction DefLexicalInfo = FunctionInfo<DefLexicalFn>(DefGlobalLexical); static const VMFunction DefLexicalInfo =
FunctionInfo<DefLexicalFn>(DefGlobalLexical, "DefGlobalLexical");
void void
CodeGenerator::visitDefLexical(LDefLexical* lir) CodeGenerator::visitDefLexical(LDefLexical* lir)
@ -4629,7 +4649,8 @@ CodeGenerator::visitDefLexical(LDefLexical* lir)
} }
typedef bool (*DefFunOperationFn)(JSContext*, HandleScript, HandleObject, HandleFunction); typedef bool (*DefFunOperationFn)(JSContext*, HandleScript, HandleObject, HandleFunction);
static const VMFunction DefFunOperationInfo = FunctionInfo<DefFunOperationFn>(DefFunOperation); static const VMFunction DefFunOperationInfo =
FunctionInfo<DefFunOperationFn>(DefFunOperation, "DefFunOperation");
void void
CodeGenerator::visitDefFun(LDefFun* lir) CodeGenerator::visitDefFun(LDefFun* lir)
@ -4645,7 +4666,7 @@ CodeGenerator::visitDefFun(LDefFun* lir)
typedef bool (*CheckOverRecursedFn)(JSContext*); typedef bool (*CheckOverRecursedFn)(JSContext*);
static const VMFunction CheckOverRecursedInfo = static const VMFunction CheckOverRecursedInfo =
FunctionInfo<CheckOverRecursedFn>(CheckOverRecursed); FunctionInfo<CheckOverRecursedFn>(CheckOverRecursed, "CheckOverRecursed");
void void
CodeGenerator::visitCheckOverRecursedFailure(CheckOverRecursedFailure* ool) CodeGenerator::visitCheckOverRecursedFailure(CheckOverRecursedFailure* ool)
@ -5133,7 +5154,7 @@ class OutOfLineNewArray : public OutOfLineCodeBase<CodeGenerator>
typedef JSObject* (*NewArrayOperationFn)(JSContext*, HandleScript, jsbytecode*, uint32_t, typedef JSObject* (*NewArrayOperationFn)(JSContext*, HandleScript, jsbytecode*, uint32_t,
NewObjectKind); NewObjectKind);
static const VMFunction NewArrayOperationInfo = static const VMFunction NewArrayOperationInfo =
FunctionInfo<NewArrayOperationFn>(NewArrayOperation); FunctionInfo<NewArrayOperationFn>(NewArrayOperation, "NewArrayOperation");
static JSObject* static JSObject*
NewArrayWithGroup(JSContext* cx, uint32_t length, HandleObjectGroup group, NewArrayWithGroup(JSContext* cx, uint32_t length, HandleObjectGroup group,
@ -5148,7 +5169,8 @@ NewArrayWithGroup(JSContext* cx, uint32_t length, HandleObjectGroup group,
} }
typedef JSObject* (*NewArrayWithGroupFn)(JSContext*, uint32_t, HandleObjectGroup, bool); typedef JSObject* (*NewArrayWithGroupFn)(JSContext*, uint32_t, HandleObjectGroup, bool);
static const VMFunction NewArrayWithGroupInfo = FunctionInfo<NewArrayWithGroupFn>(NewArrayWithGroup); static const VMFunction NewArrayWithGroupInfo =
FunctionInfo<NewArrayWithGroupFn>(NewArrayWithGroup, "NewArrayWithGroup");
void void
CodeGenerator::visitNewArrayCallVM(LNewArray* lir) CodeGenerator::visitNewArrayCallVM(LNewArray* lir)
@ -5186,7 +5208,7 @@ typedef JSObject* (*NewDerivedTypedObjectFn)(JSContext*,
HandleObject owner, HandleObject owner,
int32_t offset); int32_t offset);
static const VMFunction CreateDerivedTypedObjInfo = static const VMFunction CreateDerivedTypedObjInfo =
FunctionInfo<NewDerivedTypedObjectFn>(CreateDerivedTypedObj); FunctionInfo<NewDerivedTypedObjectFn>(CreateDerivedTypedObj, "CreateDerivedTypedObj");
void void
CodeGenerator::visitNewDerivedTypedObject(LNewDerivedTypedObject* lir) CodeGenerator::visitNewDerivedTypedObject(LNewDerivedTypedObject* lir)
@ -5290,7 +5312,7 @@ CodeGenerator::visitNewArrayCopyOnWrite(LNewArrayCopyOnWrite* lir)
typedef JSObject* (*ArrayConstructorOneArgFn)(JSContext*, HandleObjectGroup, int32_t length); typedef JSObject* (*ArrayConstructorOneArgFn)(JSContext*, HandleObjectGroup, int32_t length);
static const VMFunction ArrayConstructorOneArgInfo = static const VMFunction ArrayConstructorOneArgInfo =
FunctionInfo<ArrayConstructorOneArgFn>(ArrayConstructorOneArg); FunctionInfo<ArrayConstructorOneArgFn>(ArrayConstructorOneArg, "ArrayConstructorOneArg");
void void
CodeGenerator::visitNewArrayDynamicLength(LNewArrayDynamicLength* lir) CodeGenerator::visitNewArrayDynamicLength(LNewArrayDynamicLength* lir)
@ -5365,14 +5387,16 @@ class OutOfLineNewObject : public OutOfLineCodeBase<CodeGenerator>
typedef JSObject* (*NewInitObjectWithTemplateFn)(JSContext*, HandleObject); typedef JSObject* (*NewInitObjectWithTemplateFn)(JSContext*, HandleObject);
static const VMFunction NewInitObjectWithTemplateInfo = static const VMFunction NewInitObjectWithTemplateInfo =
FunctionInfo<NewInitObjectWithTemplateFn>(NewObjectOperationWithTemplate); FunctionInfo<NewInitObjectWithTemplateFn>(NewObjectOperationWithTemplate,
"NewObjectOperationWithTemplate");
typedef JSObject* (*NewInitObjectFn)(JSContext*, HandleScript, jsbytecode* pc, NewObjectKind); typedef JSObject* (*NewInitObjectFn)(JSContext*, HandleScript, jsbytecode* pc, NewObjectKind);
static const VMFunction NewInitObjectInfo = FunctionInfo<NewInitObjectFn>(NewObjectOperation); static const VMFunction NewInitObjectInfo =
FunctionInfo<NewInitObjectFn>(NewObjectOperation, "NewObjectOperation");
typedef PlainObject* (*ObjectCreateWithTemplateFn)(JSContext*, HandlePlainObject); typedef PlainObject* (*ObjectCreateWithTemplateFn)(JSContext*, HandlePlainObject);
static const VMFunction ObjectCreateWithTemplateInfo = static const VMFunction ObjectCreateWithTemplateInfo =
FunctionInfo<ObjectCreateWithTemplateFn>(ObjectCreateWithTemplate); FunctionInfo<ObjectCreateWithTemplateFn>(ObjectCreateWithTemplate, "ObjectCreateWithTemplate");
void void
CodeGenerator::visitNewObjectVMCall(LNewObject* lir) CodeGenerator::visitNewObjectVMCall(LNewObject* lir)
@ -5529,7 +5553,7 @@ CodeGenerator::visitOutOfLineNewObject(OutOfLineNewObject* ool)
typedef InlineTypedObject* (*NewTypedObjectFn)(JSContext*, Handle<InlineTypedObject*>, gc::InitialHeap); typedef InlineTypedObject* (*NewTypedObjectFn)(JSContext*, Handle<InlineTypedObject*>, gc::InitialHeap);
static const VMFunction NewTypedObjectInfo = static const VMFunction NewTypedObjectInfo =
FunctionInfo<NewTypedObjectFn>(InlineTypedObject::createCopy); FunctionInfo<NewTypedObjectFn>(InlineTypedObject::createCopy, "InlineTypedObject::createCopy");
void void
CodeGenerator::visitNewTypedObject(LNewTypedObject* lir) CodeGenerator::visitNewTypedObject(LNewTypedObject* lir)
@ -5672,7 +5696,8 @@ CodeGenerator::visitSimdUnbox(LSimdUnbox* lir)
typedef js::DeclEnvObject* (*NewDeclEnvObjectFn)(JSContext*, HandleFunction, NewObjectKind); typedef js::DeclEnvObject* (*NewDeclEnvObjectFn)(JSContext*, HandleFunction, NewObjectKind);
static const VMFunction NewDeclEnvObjectInfo = static const VMFunction NewDeclEnvObjectInfo =
FunctionInfo<NewDeclEnvObjectFn>(DeclEnvObject::createTemplateObject); FunctionInfo<NewDeclEnvObjectFn>(DeclEnvObject::createTemplateObject,
"DeclEnvObject::createTemplateObject");
void void
CodeGenerator::visitNewDeclEnvObject(LNewDeclEnvObject* lir) CodeGenerator::visitNewDeclEnvObject(LNewDeclEnvObject* lir)
@ -5696,7 +5721,7 @@ CodeGenerator::visitNewDeclEnvObject(LNewDeclEnvObject* lir)
typedef JSObject* (*NewCallObjectFn)(JSContext*, HandleShape, HandleObjectGroup, uint32_t); typedef JSObject* (*NewCallObjectFn)(JSContext*, HandleShape, HandleObjectGroup, uint32_t);
static const VMFunction NewCallObjectInfo = static const VMFunction NewCallObjectInfo =
FunctionInfo<NewCallObjectFn>(NewCallObject); FunctionInfo<NewCallObjectFn>(NewCallObject, "NewCallObject");
void void
CodeGenerator::visitNewCallObject(LNewCallObject* lir) CodeGenerator::visitNewCallObject(LNewCallObject* lir)
@ -5724,7 +5749,7 @@ CodeGenerator::visitNewCallObject(LNewCallObject* lir)
typedef JSObject* (*NewSingletonCallObjectFn)(JSContext*, HandleShape, uint32_t); typedef JSObject* (*NewSingletonCallObjectFn)(JSContext*, HandleShape, uint32_t);
static const VMFunction NewSingletonCallObjectInfo = static const VMFunction NewSingletonCallObjectInfo =
FunctionInfo<NewSingletonCallObjectFn>(NewSingletonCallObject); FunctionInfo<NewSingletonCallObjectFn>(NewSingletonCallObject, "NewSingletonCallObject");
void void
CodeGenerator::visitNewSingletonCallObject(LNewSingletonCallObject* lir) CodeGenerator::visitNewSingletonCallObject(LNewSingletonCallObject* lir)
@ -5749,7 +5774,8 @@ CodeGenerator::visitNewSingletonCallObject(LNewSingletonCallObject* lir)
} }
typedef JSObject* (*NewStringObjectFn)(JSContext*, HandleString); typedef JSObject* (*NewStringObjectFn)(JSContext*, HandleString);
static const VMFunction NewStringObjectInfo = FunctionInfo<NewStringObjectFn>(NewStringObject); static const VMFunction NewStringObjectInfo =
FunctionInfo<NewStringObjectFn>(NewStringObject, "NewStringObject");
void void
CodeGenerator::visitNewStringObject(LNewStringObject* lir) CodeGenerator::visitNewStringObject(LNewStringObject* lir)
@ -5776,7 +5802,7 @@ CodeGenerator::visitNewStringObject(LNewStringObject* lir)
typedef bool(*InitElemFn)(JSContext* cx, jsbytecode* pc, HandleObject obj, typedef bool(*InitElemFn)(JSContext* cx, jsbytecode* pc, HandleObject obj,
HandleValue id, HandleValue value); HandleValue id, HandleValue value);
static const VMFunction InitElemInfo = static const VMFunction InitElemInfo =
FunctionInfo<InitElemFn>(InitElemOperation); FunctionInfo<InitElemFn>(InitElemOperation, "InitElemOperation");
void void
CodeGenerator::visitInitElem(LInitElem* lir) CodeGenerator::visitInitElem(LInitElem* lir)
@ -5794,7 +5820,7 @@ CodeGenerator::visitInitElem(LInitElem* lir)
typedef bool (*InitElemGetterSetterFn)(JSContext*, jsbytecode*, HandleObject, HandleValue, typedef bool (*InitElemGetterSetterFn)(JSContext*, jsbytecode*, HandleObject, HandleValue,
HandleObject); HandleObject);
static const VMFunction InitElemGetterSetterInfo = static const VMFunction InitElemGetterSetterInfo =
FunctionInfo<InitElemGetterSetterFn>(InitGetterSetterOperation); FunctionInfo<InitElemGetterSetterFn>(InitGetterSetterOperation, "InitGetterSetterOperation");
void void
CodeGenerator::visitInitElemGetterSetter(LInitElemGetterSetter* lir) CodeGenerator::visitInitElemGetterSetter(LInitElemGetterSetter* lir)
@ -5812,7 +5838,7 @@ CodeGenerator::visitInitElemGetterSetter(LInitElemGetterSetter* lir)
typedef bool(*MutatePrototypeFn)(JSContext* cx, HandlePlainObject obj, HandleValue value); typedef bool(*MutatePrototypeFn)(JSContext* cx, HandlePlainObject obj, HandleValue value);
static const VMFunction MutatePrototypeInfo = static const VMFunction MutatePrototypeInfo =
FunctionInfo<MutatePrototypeFn>(MutatePrototype); FunctionInfo<MutatePrototypeFn>(MutatePrototype, "MutatePrototype");
void void
CodeGenerator::visitMutateProto(LMutateProto* lir) CodeGenerator::visitMutateProto(LMutateProto* lir)
@ -5826,7 +5852,7 @@ CodeGenerator::visitMutateProto(LMutateProto* lir)
} }
typedef bool(*InitPropFn)(JSContext*, HandleObject, HandlePropertyName, HandleValue, jsbytecode* pc); typedef bool(*InitPropFn)(JSContext*, HandleObject, HandlePropertyName, HandleValue, jsbytecode* pc);
static const VMFunction InitPropInfo = FunctionInfo<InitPropFn>(InitProp); static const VMFunction InitPropInfo = FunctionInfo<InitPropFn>(InitProp, "InitProp");
void void
CodeGenerator::visitInitProp(LInitProp* lir) CodeGenerator::visitInitProp(LInitProp* lir)
@ -5844,7 +5870,7 @@ CodeGenerator::visitInitProp(LInitProp* lir)
typedef bool(*InitPropGetterSetterFn)(JSContext*, jsbytecode*, HandleObject, HandlePropertyName, typedef bool(*InitPropGetterSetterFn)(JSContext*, jsbytecode*, HandleObject, HandlePropertyName,
HandleObject); HandleObject);
static const VMFunction InitPropGetterSetterInfo = static const VMFunction InitPropGetterSetterInfo =
FunctionInfo<InitPropGetterSetterFn>(InitGetterSetterOperation); FunctionInfo<InitPropGetterSetterFn>(InitGetterSetterOperation, "InitGetterSetterOperation");
void void
CodeGenerator::visitInitPropGetterSetter(LInitPropGetterSetter* lir) CodeGenerator::visitInitPropGetterSetter(LInitPropGetterSetter* lir)
@ -5861,7 +5887,7 @@ CodeGenerator::visitInitPropGetterSetter(LInitPropGetterSetter* lir)
} }
typedef bool (*CreateThisFn)(JSContext* cx, HandleObject callee, HandleObject newTarget, MutableHandleValue rval); typedef bool (*CreateThisFn)(JSContext* cx, HandleObject callee, HandleObject newTarget, MutableHandleValue rval);
static const VMFunction CreateThisInfoCodeGen = FunctionInfo<CreateThisFn>(CreateThis); static const VMFunction CreateThisInfoCodeGen = FunctionInfo<CreateThisFn>(CreateThis, "CreateThis");
void void
CodeGenerator::visitCreateThis(LCreateThis* lir) CodeGenerator::visitCreateThis(LCreateThis* lir)
@ -5892,7 +5918,8 @@ CreateThisForFunctionWithProtoWrapper(JSContext* cx, HandleObject callee, Handle
typedef JSObject* (*CreateThisWithProtoFn)(JSContext* cx, HandleObject callee, typedef JSObject* (*CreateThisWithProtoFn)(JSContext* cx, HandleObject callee,
HandleObject newTarget, HandleObject proto); HandleObject newTarget, HandleObject proto);
static const VMFunction CreateThisWithProtoInfo = static const VMFunction CreateThisWithProtoInfo =
FunctionInfo<CreateThisWithProtoFn>(CreateThisForFunctionWithProtoWrapper); FunctionInfo<CreateThisWithProtoFn>(CreateThisForFunctionWithProtoWrapper,
"CreateThisForFunctionWithProtoWrapper");
void void
CodeGenerator::visitCreateThisWithProto(LCreateThisWithProto* lir) CodeGenerator::visitCreateThisWithProto(LCreateThisWithProto* lir)
@ -5941,7 +5968,8 @@ CodeGenerator::visitCreateThisWithTemplate(LCreateThisWithTemplate* lir)
typedef JSObject* (*NewIonArgumentsObjectFn)(JSContext* cx, JitFrameLayout* frame, HandleObject); typedef JSObject* (*NewIonArgumentsObjectFn)(JSContext* cx, JitFrameLayout* frame, HandleObject);
static const VMFunction NewIonArgumentsObjectInfo = static const VMFunction NewIonArgumentsObjectInfo =
FunctionInfo<NewIonArgumentsObjectFn>((NewIonArgumentsObjectFn) ArgumentsObject::createForIon); FunctionInfo<NewIonArgumentsObjectFn>((NewIonArgumentsObjectFn) ArgumentsObject::createForIon,
"ArgumentsObject::createForIon");
void void
CodeGenerator::visitCreateArgumentsObject(LCreateArgumentsObject* lir) CodeGenerator::visitCreateArgumentsObject(LCreateArgumentsObject* lir)
@ -6053,7 +6081,8 @@ CodeGenerator::visitReturnFromCtor(LReturnFromCtor* lir)
} }
typedef bool (*BoxNonStrictThisFn)(JSContext*, HandleValue, MutableHandleValue); typedef bool (*BoxNonStrictThisFn)(JSContext*, HandleValue, MutableHandleValue);
static const VMFunction BoxNonStrictThisInfo = FunctionInfo<BoxNonStrictThisFn>(BoxNonStrictThis); static const VMFunction BoxNonStrictThisInfo =
FunctionInfo<BoxNonStrictThisFn>(BoxNonStrictThis, "BoxNonStrictThis");
void void
CodeGenerator::visitComputeThis(LComputeThis* lir) CodeGenerator::visitComputeThis(LComputeThis* lir)
@ -6552,12 +6581,12 @@ CodeGenerator::visitModD(LModD* ins)
typedef bool (*BinaryFn)(JSContext*, MutableHandleValue, MutableHandleValue, MutableHandleValue); typedef bool (*BinaryFn)(JSContext*, MutableHandleValue, MutableHandleValue, MutableHandleValue);
static const VMFunction AddInfo = FunctionInfo<BinaryFn>(js::AddValues); static const VMFunction AddInfo = FunctionInfo<BinaryFn>(js::AddValues, "AddValues");
static const VMFunction SubInfo = FunctionInfo<BinaryFn>(js::SubValues); static const VMFunction SubInfo = FunctionInfo<BinaryFn>(js::SubValues, "SubValues");
static const VMFunction MulInfo = FunctionInfo<BinaryFn>(js::MulValues); static const VMFunction MulInfo = FunctionInfo<BinaryFn>(js::MulValues, "MulValues");
static const VMFunction DivInfo = FunctionInfo<BinaryFn>(js::DivValues); static const VMFunction DivInfo = FunctionInfo<BinaryFn>(js::DivValues, "DivValues");
static const VMFunction ModInfo = FunctionInfo<BinaryFn>(js::ModValues); static const VMFunction ModInfo = FunctionInfo<BinaryFn>(js::ModValues, "ModValues");
static const VMFunction UrshInfo = FunctionInfo<BinaryFn>(js::UrshValues); static const VMFunction UrshInfo = FunctionInfo<BinaryFn>(js::UrshValues, "UrshValues");
void void
CodeGenerator::visitBinaryV(LBinaryV* lir) CodeGenerator::visitBinaryV(LBinaryV* lir)
@ -6597,9 +6626,9 @@ CodeGenerator::visitBinaryV(LBinaryV* lir)
typedef bool (*StringCompareFn)(JSContext*, HandleString, HandleString, bool*); typedef bool (*StringCompareFn)(JSContext*, HandleString, HandleString, bool*);
static const VMFunction StringsEqualInfo = static const VMFunction StringsEqualInfo =
FunctionInfo<StringCompareFn>(jit::StringsEqual<true>); FunctionInfo<StringCompareFn>(jit::StringsEqual<true>, "StringsEqual");
static const VMFunction StringsNotEqualInfo = static const VMFunction StringsNotEqualInfo =
FunctionInfo<StringCompareFn>(jit::StringsEqual<false>); FunctionInfo<StringCompareFn>(jit::StringsEqual<false>, "StringsEqual");
void void
CodeGenerator::emitCompareS(LInstruction* lir, JSOp op, Register left, Register right, CodeGenerator::emitCompareS(LInstruction* lir, JSOp op, Register left, Register right,
@ -6657,14 +6686,22 @@ CodeGenerator::visitCompareS(LCompareS* lir)
} }
typedef bool (*CompareFn)(JSContext*, MutableHandleValue, MutableHandleValue, bool*); typedef bool (*CompareFn)(JSContext*, MutableHandleValue, MutableHandleValue, bool*);
static const VMFunction EqInfo = FunctionInfo<CompareFn>(jit::LooselyEqual<true>); static const VMFunction EqInfo =
static const VMFunction NeInfo = FunctionInfo<CompareFn>(jit::LooselyEqual<false>); FunctionInfo<CompareFn>(jit::LooselyEqual<true>, "LooselyEqual");
static const VMFunction StrictEqInfo = FunctionInfo<CompareFn>(jit::StrictlyEqual<true>); static const VMFunction NeInfo =
static const VMFunction StrictNeInfo = FunctionInfo<CompareFn>(jit::StrictlyEqual<false>); FunctionInfo<CompareFn>(jit::LooselyEqual<false>, "LooselyEqual");
static const VMFunction LtInfo = FunctionInfo<CompareFn>(jit::LessThan); static const VMFunction StrictEqInfo =
static const VMFunction LeInfo = FunctionInfo<CompareFn>(jit::LessThanOrEqual); FunctionInfo<CompareFn>(jit::StrictlyEqual<true>, "StrictlyEqual");
static const VMFunction GtInfo = FunctionInfo<CompareFn>(jit::GreaterThan); static const VMFunction StrictNeInfo =
static const VMFunction GeInfo = FunctionInfo<CompareFn>(jit::GreaterThanOrEqual); FunctionInfo<CompareFn>(jit::StrictlyEqual<false>, "StrictlyEqual");
static const VMFunction LtInfo =
FunctionInfo<CompareFn>(jit::LessThan, "LessThan");
static const VMFunction LeInfo =
FunctionInfo<CompareFn>(jit::LessThanOrEqual, "LessThanOrEqual");
static const VMFunction GtInfo =
FunctionInfo<CompareFn>(jit::GreaterThan, "GreaterThan");
static const VMFunction GeInfo =
FunctionInfo<CompareFn>(jit::GreaterThanOrEqual, "GreaterThanOrEqual");
void void
CodeGenerator::visitCompareVM(LCompareVM* lir) CodeGenerator::visitCompareVM(LCompareVM* lir)
@ -6959,7 +6996,8 @@ CodeGenerator::visitIsNullOrLikeUndefinedAndBranchT(LIsNullOrLikeUndefinedAndBra
} }
typedef JSString* (*ConcatStringsFn)(ExclusiveContext*, HandleString, HandleString); typedef JSString* (*ConcatStringsFn)(ExclusiveContext*, HandleString, HandleString);
static const VMFunction ConcatStringsInfo = FunctionInfo<ConcatStringsFn>(ConcatStrings<CanGC>); static const VMFunction ConcatStringsInfo =
FunctionInfo<ConcatStringsFn>(ConcatStrings<CanGC>, "ConcatStrings");
void void
CodeGenerator::emitConcat(LInstruction* lir, Register lhs, Register rhs, Register output) CodeGenerator::emitConcat(LInstruction* lir, Register lhs, Register rhs, Register output)
@ -7127,7 +7165,7 @@ ConcatInlineString(MacroAssembler& masm, Register lhs, Register rhs, Register ou
typedef JSString* (*SubstringKernelFn)(JSContext* cx, HandleString str, int32_t begin, int32_t len); typedef JSString* (*SubstringKernelFn)(JSContext* cx, HandleString str, int32_t begin, int32_t len);
static const VMFunction SubstringKernelInfo = static const VMFunction SubstringKernelInfo =
FunctionInfo<SubstringKernelFn>(SubstringKernel); FunctionInfo<SubstringKernelFn>(SubstringKernel, "SubstringKernel");
void void
CodeGenerator::visitSubstr(LSubstr* lir) CodeGenerator::visitSubstr(LSubstr* lir)
@ -7463,7 +7501,8 @@ JitRuntime::generateLazyLinkStub(JSContext* cx)
} }
typedef bool (*CharCodeAtFn)(JSContext*, HandleString, int32_t, uint32_t*); typedef bool (*CharCodeAtFn)(JSContext*, HandleString, int32_t, uint32_t*);
static const VMFunction CharCodeAtInfo = FunctionInfo<CharCodeAtFn>(jit::CharCodeAt); static const VMFunction CharCodeAtInfo =
FunctionInfo<CharCodeAtFn>(jit::CharCodeAt, "CharCodeAt");
void void
CodeGenerator::visitCharCodeAt(LCharCodeAt* lir) CodeGenerator::visitCharCodeAt(LCharCodeAt* lir)
@ -7481,7 +7520,8 @@ CodeGenerator::visitCharCodeAt(LCharCodeAt* lir)
} }
typedef JSFlatString* (*StringFromCharCodeFn)(JSContext*, int32_t); typedef JSFlatString* (*StringFromCharCodeFn)(JSContext*, int32_t);
static const VMFunction StringFromCharCodeInfo = FunctionInfo<StringFromCharCodeFn>(jit::StringFromCharCode); static const VMFunction StringFromCharCodeInfo =
FunctionInfo<StringFromCharCodeFn>(jit::StringFromCharCode, "StringFromCharCode");
void void
CodeGenerator::visitFromCharCode(LFromCharCode* lir) CodeGenerator::visitFromCharCode(LFromCharCode* lir)
@ -7538,7 +7578,8 @@ CodeGenerator::visitSinCos(LSinCos *lir)
} }
typedef JSObject* (*StringSplitFn)(JSContext*, HandleObjectGroup, HandleString, HandleString, uint32_t); typedef JSObject* (*StringSplitFn)(JSContext*, HandleObjectGroup, HandleString, HandleString, uint32_t);
static const VMFunction StringSplitInfo = FunctionInfo<StringSplitFn>(js::str_split_string); static const VMFunction StringSplitInfo =
FunctionInfo<StringSplitFn>(js::str_split_string, "str_split_string");
void void
CodeGenerator::visitStringSplit(LStringSplit* lir) CodeGenerator::visitStringSplit(LStringSplit* lir)
@ -8003,7 +8044,8 @@ CodeGenerator::visitStoreElementHoleV(LStoreElementHoleV* lir)
typedef bool (*SetDenseOrUnboxedArrayElementFn)(JSContext*, HandleObject, int32_t, typedef bool (*SetDenseOrUnboxedArrayElementFn)(JSContext*, HandleObject, int32_t,
HandleValue, bool strict); HandleValue, bool strict);
static const VMFunction SetDenseOrUnboxedArrayElementInfo = static const VMFunction SetDenseOrUnboxedArrayElementInfo =
FunctionInfo<SetDenseOrUnboxedArrayElementFn>(SetDenseOrUnboxedArrayElement); FunctionInfo<SetDenseOrUnboxedArrayElementFn>(SetDenseOrUnboxedArrayElement,
"SetDenseOrUnboxedArrayElement");
void void
CodeGenerator::visitOutOfLineStoreElementHole(OutOfLineStoreElementHole* ool) CodeGenerator::visitOutOfLineStoreElementHole(OutOfLineStoreElementHole* ool)
@ -8174,9 +8216,11 @@ CodeGenerator::visitStoreUnboxedPointer(LStoreUnboxedPointer* lir)
typedef bool (*ConvertUnboxedObjectToNativeFn)(JSContext*, JSObject*); typedef bool (*ConvertUnboxedObjectToNativeFn)(JSContext*, JSObject*);
static const VMFunction ConvertUnboxedPlainObjectToNativeInfo = static const VMFunction ConvertUnboxedPlainObjectToNativeInfo =
FunctionInfo<ConvertUnboxedObjectToNativeFn>(UnboxedPlainObject::convertToNative); FunctionInfo<ConvertUnboxedObjectToNativeFn>(UnboxedPlainObject::convertToNative,
"UnboxedPlainObject::convertToNative");
static const VMFunction ConvertUnboxedArrayObjectToNativeInfo = static const VMFunction ConvertUnboxedArrayObjectToNativeInfo =
FunctionInfo<ConvertUnboxedObjectToNativeFn>(UnboxedArrayObject::convertToNative); FunctionInfo<ConvertUnboxedObjectToNativeFn>(UnboxedArrayObject::convertToNative,
"UnboxedArrayObject::convertToNative");
void void
CodeGenerator::visitConvertUnboxedObjectToNative(LConvertUnboxedObjectToNative* lir) CodeGenerator::visitConvertUnboxedObjectToNative(LConvertUnboxedObjectToNative* lir)
@ -8194,8 +8238,10 @@ CodeGenerator::visitConvertUnboxedObjectToNative(LConvertUnboxedObjectToNative*
} }
typedef bool (*ArrayPopShiftFn)(JSContext*, HandleObject, MutableHandleValue); typedef bool (*ArrayPopShiftFn)(JSContext*, HandleObject, MutableHandleValue);
static const VMFunction ArrayPopDenseInfo = FunctionInfo<ArrayPopShiftFn>(jit::ArrayPopDense); static const VMFunction ArrayPopDenseInfo =
static const VMFunction ArrayShiftDenseInfo = FunctionInfo<ArrayPopShiftFn>(jit::ArrayShiftDense); FunctionInfo<ArrayPopShiftFn>(jit::ArrayPopDense, "ArrayPopDense");
static const VMFunction ArrayShiftDenseInfo =
FunctionInfo<ArrayPopShiftFn>(jit::ArrayShiftDense, "ArrayShiftDense");
void void
CodeGenerator::emitArrayPopShift(LInstruction* lir, const MArrayPopShift* mir, Register obj, CodeGenerator::emitArrayPopShift(LInstruction* lir, const MArrayPopShift* mir, Register obj,
@ -8333,7 +8379,7 @@ CodeGenerator::visitArrayPopShiftT(LArrayPopShiftT* lir)
typedef bool (*ArrayPushDenseFn)(JSContext*, HandleObject, HandleValue, uint32_t*); typedef bool (*ArrayPushDenseFn)(JSContext*, HandleObject, HandleValue, uint32_t*);
static const VMFunction ArrayPushDenseInfo = static const VMFunction ArrayPushDenseInfo =
FunctionInfo<ArrayPushDenseFn>(jit::ArrayPushDense); FunctionInfo<ArrayPushDenseFn>(jit::ArrayPushDense, "ArrayPushDense");
void void
CodeGenerator::emitArrayPush(LInstruction* lir, const MArrayPush* mir, Register obj, CodeGenerator::emitArrayPush(LInstruction* lir, const MArrayPush* mir, Register obj,
@ -8415,7 +8461,8 @@ CodeGenerator::visitArrayPushT(LArrayPushT* lir)
} }
typedef JSObject* (*ArraySliceDenseFn)(JSContext*, HandleObject, int32_t, int32_t, HandleObject); typedef JSObject* (*ArraySliceDenseFn)(JSContext*, HandleObject, int32_t, int32_t, HandleObject);
static const VMFunction ArraySliceDenseInfo = FunctionInfo<ArraySliceDenseFn>(array_slice_dense); static const VMFunction ArraySliceDenseInfo =
FunctionInfo<ArraySliceDenseFn>(array_slice_dense, "array_slice_dense");
void void
CodeGenerator::visitArraySlice(LArraySlice* lir) CodeGenerator::visitArraySlice(LArraySlice* lir)
@ -8450,7 +8497,7 @@ CodeGenerator::visitArraySlice(LArraySlice* lir)
} }
typedef JSString* (*ArrayJoinFn)(JSContext*, HandleObject, HandleString); typedef JSString* (*ArrayJoinFn)(JSContext*, HandleObject, HandleString);
static const VMFunction ArrayJoinInfo = FunctionInfo<ArrayJoinFn>(jit::ArrayJoin); static const VMFunction ArrayJoinInfo = FunctionInfo<ArrayJoinFn>(jit::ArrayJoin, "ArrayJoin");
void void
CodeGenerator::visitArrayJoin(LArrayJoin* lir) CodeGenerator::visitArrayJoin(LArrayJoin* lir)
@ -8462,7 +8509,8 @@ CodeGenerator::visitArrayJoin(LArrayJoin* lir)
} }
typedef JSObject* (*GetIteratorObjectFn)(JSContext*, HandleObject, uint32_t); typedef JSObject* (*GetIteratorObjectFn)(JSContext*, HandleObject, uint32_t);
static const VMFunction GetIteratorObjectInfo = FunctionInfo<GetIteratorObjectFn>(GetIteratorObject); static const VMFunction GetIteratorObjectInfo =
FunctionInfo<GetIteratorObjectFn>(GetIteratorObject, "GetIteratorObject");
void void
CodeGenerator::visitCallIteratorStart(LCallIteratorStart* lir) CodeGenerator::visitCallIteratorStart(LCallIteratorStart* lir)
@ -8607,7 +8655,8 @@ LoadNativeIterator(MacroAssembler& masm, Register obj, Register dest, Label* fai
} }
typedef bool (*IteratorMoreFn)(JSContext*, HandleObject, MutableHandleValue); typedef bool (*IteratorMoreFn)(JSContext*, HandleObject, MutableHandleValue);
static const VMFunction IteratorMoreInfo = FunctionInfo<IteratorMoreFn>(IteratorMore); static const VMFunction IteratorMoreInfo =
FunctionInfo<IteratorMoreFn>(IteratorMore, "IteratorMore");
void void
CodeGenerator::visitIteratorMore(LIteratorMore* lir) CodeGenerator::visitIteratorMore(LIteratorMore* lir)
@ -8661,7 +8710,8 @@ CodeGenerator::visitIsNoIterAndBranch(LIsNoIterAndBranch* lir)
} }
typedef bool (*CloseIteratorFn)(JSContext*, HandleObject); typedef bool (*CloseIteratorFn)(JSContext*, HandleObject);
static const VMFunction CloseIteratorInfo = FunctionInfo<CloseIteratorFn>(CloseIterator); static const VMFunction CloseIteratorInfo =
FunctionInfo<CloseIteratorFn>(CloseIterator, "CloseIterator");
void void
CodeGenerator::visitIteratorEnd(LIteratorEnd* lir) CodeGenerator::visitIteratorEnd(LIteratorEnd* lir)
@ -8766,7 +8816,7 @@ CodeGenerator:: visitSetFrameArgumentV(LSetFrameArgumentV* lir)
typedef bool (*RunOnceScriptPrologueFn)(JSContext*, HandleScript); typedef bool (*RunOnceScriptPrologueFn)(JSContext*, HandleScript);
static const VMFunction RunOnceScriptPrologueInfo = static const VMFunction RunOnceScriptPrologueInfo =
FunctionInfo<RunOnceScriptPrologueFn>(js::RunOnceScriptPrologue); FunctionInfo<RunOnceScriptPrologueFn>(js::RunOnceScriptPrologue, "RunOnceScriptPrologue");
void void
CodeGenerator::visitRunOncePrologue(LRunOncePrologue* lir) CodeGenerator::visitRunOncePrologue(LRunOncePrologue* lir)
@ -8778,7 +8828,7 @@ CodeGenerator::visitRunOncePrologue(LRunOncePrologue* lir)
typedef JSObject* (*InitRestParameterFn)(JSContext*, uint32_t, Value*, HandleObject, typedef JSObject* (*InitRestParameterFn)(JSContext*, uint32_t, Value*, HandleObject,
HandleObject); HandleObject);
static const VMFunction InitRestParameterInfo = static const VMFunction InitRestParameterInfo =
FunctionInfo<InitRestParameterFn>(InitRestParameter); FunctionInfo<InitRestParameterFn>(InitRestParameter, "InitRestParameter");
void void
CodeGenerator::emitRest(LInstruction* lir, Register array, Register numActuals, CodeGenerator::emitRest(LInstruction* lir, Register array, Register numActuals,
@ -9236,25 +9286,45 @@ CodeGenerator::link(JSContext* cx, CompilerConstraintList* constraints)
} }
#ifdef JS_TRACE_LOGGING #ifdef JS_TRACE_LOGGING
bool TLFailed = false;
TraceLoggerThread* logger = TraceLoggerForMainThread(cx->runtime()); TraceLoggerThread* logger = TraceLoggerForMainThread(cx->runtime());
for (uint32_t i = 0; i < patchableTraceLoggers_.length(); i++) {
Assembler::PatchDataWithValueCheck(CodeLocationLabel(code, patchableTraceLoggers_[i]), for (uint32_t i = 0; i < patchableTLEvents_.length(); i++) {
ImmPtr(logger), // Create an event on the mainthread.
ImmPtr(nullptr)); TraceLoggerEvent event(logger, patchableTLEvents_[i].event);
if (!ionScript->addTraceLoggerEvent(event)) {
TLFailed = true;
break;
}
Assembler::PatchDataWithValueCheck(CodeLocationLabel(code, patchableTLEvents_[i].offset),
ImmPtr((void*) uintptr_t(event.payload()->textId())),
ImmPtr((void*)0));
} }
if (patchableTLScripts_.length() > 0) { if (!TLFailed && patchableTLScripts_.length() > 0) {
MOZ_ASSERT(TraceLogTextIdEnabled(TraceLogger_Scripts)); MOZ_ASSERT(TraceLogTextIdEnabled(TraceLogger_Scripts));
TraceLoggerEvent event(logger, TraceLogger_Scripts, script); TraceLoggerEvent event(logger, TraceLogger_Scripts, script);
ionScript->setTraceLoggerEvent(event); if (!ionScript->addTraceLoggerEvent(event))
uint32_t textId = event.payload()->textId(); TLFailed = true;
for (uint32_t i = 0; i < patchableTLScripts_.length(); i++) { if (!TLFailed) {
Assembler::PatchDataWithValueCheck(CodeLocationLabel(code, patchableTLScripts_[i]), uint32_t textId = event.payload()->textId();
ImmPtr((void*) uintptr_t(textId)), for (uint32_t i = 0; i < patchableTLScripts_.length(); i++) {
ImmPtr((void*)0)); Assembler::PatchDataWithValueCheck(CodeLocationLabel(code, patchableTLScripts_[i]),
ImmPtr((void*) uintptr_t(textId)),
ImmPtr((void*)0));
}
}
}
if (!TLFailed) {
for (uint32_t i = 0; i < patchableTraceLoggers_.length(); i++) {
Assembler::PatchDataWithValueCheck(CodeLocationLabel(code, patchableTraceLoggers_[i]),
ImmPtr(logger),
ImmPtr(nullptr));
} }
} }
#endif #endif
// Patch shared stub IC loads using IC entries // Patch shared stub IC loads using IC entries
for (size_t i = 0; i < sharedStubs_.length(); i++) { for (size_t i = 0; i < sharedStubs_.length(); i++) {
CodeOffset label = sharedStubs_[i].label; CodeOffset label = sharedStubs_[i].label;
@ -9391,7 +9461,7 @@ CodeGenerator::visitOutOfLineUnboxFloatingPoint(OutOfLineUnboxFloatingPoint* ool
} }
typedef JSObject* (*BindVarFn)(JSContext*, HandleObject); typedef JSObject* (*BindVarFn)(JSContext*, HandleObject);
static const VMFunction BindVarInfo = FunctionInfo<BindVarFn>(jit::BindVar); static const VMFunction BindVarInfo = FunctionInfo<BindVarFn>(jit::BindVar, "BindVar");
void void
CodeGenerator::visitCallBindVar(LCallBindVar* lir) CodeGenerator::visitCallBindVar(LCallBindVar* lir)
@ -9401,7 +9471,7 @@ CodeGenerator::visitCallBindVar(LCallBindVar* lir)
} }
typedef bool (*GetPropertyFn)(JSContext*, HandleValue, HandlePropertyName, MutableHandleValue); typedef bool (*GetPropertyFn)(JSContext*, HandleValue, HandlePropertyName, MutableHandleValue);
static const VMFunction GetPropertyInfo = FunctionInfo<GetPropertyFn>(GetProperty); static const VMFunction GetPropertyInfo = FunctionInfo<GetPropertyFn>(GetProperty, "GetProperty");
void void
CodeGenerator::visitCallGetProperty(LCallGetProperty* lir) CodeGenerator::visitCallGetProperty(LCallGetProperty* lir)
@ -9413,8 +9483,10 @@ CodeGenerator::visitCallGetProperty(LCallGetProperty* lir)
} }
typedef bool (*GetOrCallElementFn)(JSContext*, MutableHandleValue, HandleValue, MutableHandleValue); typedef bool (*GetOrCallElementFn)(JSContext*, MutableHandleValue, HandleValue, MutableHandleValue);
static const VMFunction GetElementInfo = FunctionInfo<GetOrCallElementFn>(js::GetElement); static const VMFunction GetElementInfo =
static const VMFunction CallElementInfo = FunctionInfo<GetOrCallElementFn>(js::CallElement); FunctionInfo<GetOrCallElementFn>(js::GetElement, "GetElement");
static const VMFunction CallElementInfo =
FunctionInfo<GetOrCallElementFn>(js::CallElement, "CallElement");
void void
CodeGenerator::visitCallGetElement(LCallGetElement* lir) CodeGenerator::visitCallGetElement(LCallGetElement* lir)
@ -9434,7 +9506,8 @@ CodeGenerator::visitCallGetElement(LCallGetElement* lir)
typedef bool (*SetObjectElementFn)(JSContext*, HandleObject, HandleValue, HandleValue, typedef bool (*SetObjectElementFn)(JSContext*, HandleObject, HandleValue, HandleValue,
bool strict); bool strict);
static const VMFunction SetObjectElementInfo = FunctionInfo<SetObjectElementFn>(SetObjectElement); static const VMFunction SetObjectElementInfo =
FunctionInfo<SetObjectElementFn>(SetObjectElement, "SetObjectElement");
void void
CodeGenerator::visitCallSetElement(LCallSetElement* lir) CodeGenerator::visitCallSetElement(LCallSetElement* lir)
@ -9447,7 +9520,8 @@ CodeGenerator::visitCallSetElement(LCallSetElement* lir)
} }
typedef bool (*InitElementArrayFn)(JSContext*, jsbytecode*, HandleObject, uint32_t, HandleValue); typedef bool (*InitElementArrayFn)(JSContext*, jsbytecode*, HandleObject, uint32_t, HandleValue);
static const VMFunction InitElementArrayInfo = FunctionInfo<InitElementArrayFn>(js::InitElementArray); static const VMFunction InitElementArrayInfo =
FunctionInfo<InitElementArrayFn>(js::InitElementArray, "InitElementArray");
void void
CodeGenerator::visitCallInitElementArray(LCallInitElementArray* lir) CodeGenerator::visitCallInitElementArray(LCallInitElementArray* lir)
@ -9567,7 +9641,7 @@ CodeGenerator::visitGetNameCache(LGetNameCache* ins)
} }
typedef bool (*NameICFn)(JSContext*, HandleScript, size_t, HandleObject, MutableHandleValue); typedef bool (*NameICFn)(JSContext*, HandleScript, size_t, HandleObject, MutableHandleValue);
const VMFunction NameIC::UpdateInfo = FunctionInfo<NameICFn>(NameIC::update); const VMFunction NameIC::UpdateInfo = FunctionInfo<NameICFn>(NameIC::update, "NameIC::update");
void void
CodeGenerator::visitNameIC(OutOfLineUpdateCache* ool, DataPtr<NameIC>& ic) CodeGenerator::visitNameIC(OutOfLineUpdateCache* ool, DataPtr<NameIC>& ic)
@ -9650,7 +9724,8 @@ CodeGenerator::visitGetPropertyCacheT(LGetPropertyCacheT* ins)
typedef bool (*GetPropertyICFn)(JSContext*, HandleScript, size_t, HandleObject, HandleValue, typedef bool (*GetPropertyICFn)(JSContext*, HandleScript, size_t, HandleObject, HandleValue,
MutableHandleValue); MutableHandleValue);
const VMFunction GetPropertyIC::UpdateInfo = FunctionInfo<GetPropertyICFn>(GetPropertyIC::update); const VMFunction GetPropertyIC::UpdateInfo =
FunctionInfo<GetPropertyICFn>(GetPropertyIC::update, "GetPropertyIC::update");
void void
CodeGenerator::visitGetPropertyIC(OutOfLineUpdateCache* ool, DataPtr<GetPropertyIC>& ic) CodeGenerator::visitGetPropertyIC(OutOfLineUpdateCache* ool, DataPtr<GetPropertyIC>& ic)
@ -9691,7 +9766,8 @@ CodeGenerator::visitBindNameCache(LBindNameCache* ins)
} }
typedef JSObject* (*BindNameICFn)(JSContext*, HandleScript, size_t, HandleObject); typedef JSObject* (*BindNameICFn)(JSContext*, HandleScript, size_t, HandleObject);
const VMFunction BindNameIC::UpdateInfo = FunctionInfo<BindNameICFn>(BindNameIC::update); const VMFunction BindNameIC::UpdateInfo =
FunctionInfo<BindNameICFn>(BindNameIC::update, "BindNameIC::update");
void void
CodeGenerator::visitBindNameIC(OutOfLineUpdateCache* ool, DataPtr<BindNameIC>& ic) CodeGenerator::visitBindNameIC(OutOfLineUpdateCache* ool, DataPtr<BindNameIC>& ic)
@ -9711,7 +9787,7 @@ CodeGenerator::visitBindNameIC(OutOfLineUpdateCache* ool, DataPtr<BindNameIC>& i
typedef bool (*SetPropertyFn)(JSContext*, HandleObject, typedef bool (*SetPropertyFn)(JSContext*, HandleObject,
HandlePropertyName, const HandleValue, bool, jsbytecode*); HandlePropertyName, const HandleValue, bool, jsbytecode*);
static const VMFunction SetPropertyInfo = FunctionInfo<SetPropertyFn>(SetProperty); static const VMFunction SetPropertyInfo = FunctionInfo<SetPropertyFn>(SetProperty, "SetProperty");
void void
CodeGenerator::visitCallSetProperty(LCallSetProperty* ins) CodeGenerator::visitCallSetProperty(LCallSetProperty* ins)
@ -9732,9 +9808,9 @@ CodeGenerator::visitCallSetProperty(LCallSetProperty* ins)
typedef bool (*DeletePropertyFn)(JSContext*, HandleValue, HandlePropertyName, bool*); typedef bool (*DeletePropertyFn)(JSContext*, HandleValue, HandlePropertyName, bool*);
static const VMFunction DeletePropertyStrictInfo = static const VMFunction DeletePropertyStrictInfo =
FunctionInfo<DeletePropertyFn>(DeletePropertyJit<true>); FunctionInfo<DeletePropertyFn>(DeletePropertyJit<true>, "DeletePropertyStrictJit");
static const VMFunction DeletePropertyNonStrictInfo = static const VMFunction DeletePropertyNonStrictInfo =
FunctionInfo<DeletePropertyFn>(DeletePropertyJit<false>); FunctionInfo<DeletePropertyFn>(DeletePropertyJit<false>, "DeletePropertyNonStrictJit");
void void
CodeGenerator::visitCallDeleteProperty(LCallDeleteProperty* lir) CodeGenerator::visitCallDeleteProperty(LCallDeleteProperty* lir)
@ -9750,9 +9826,9 @@ CodeGenerator::visitCallDeleteProperty(LCallDeleteProperty* lir)
typedef bool (*DeleteElementFn)(JSContext*, HandleValue, HandleValue, bool*); typedef bool (*DeleteElementFn)(JSContext*, HandleValue, HandleValue, bool*);
static const VMFunction DeleteElementStrictInfo = static const VMFunction DeleteElementStrictInfo =
FunctionInfo<DeleteElementFn>(DeleteElementJit<true>); FunctionInfo<DeleteElementFn>(DeleteElementJit<true>, "DeleteElementStrictJit");
static const VMFunction DeleteElementNonStrictInfo = static const VMFunction DeleteElementNonStrictInfo =
FunctionInfo<DeleteElementFn>(DeleteElementJit<false>); FunctionInfo<DeleteElementFn>(DeleteElementJit<false>, "DeleteElementNonStrictJit");
void void
CodeGenerator::visitCallDeleteElement(LCallDeleteElement* lir) CodeGenerator::visitCallDeleteElement(LCallDeleteElement* lir)
@ -9788,7 +9864,8 @@ CodeGenerator::visitSetPropertyCache(LSetPropertyCache* ins)
typedef bool (*SetPropertyICFn)(JSContext*, HandleScript, size_t, HandleObject, HandleValue, typedef bool (*SetPropertyICFn)(JSContext*, HandleScript, size_t, HandleObject, HandleValue,
HandleValue); HandleValue);
const VMFunction SetPropertyIC::UpdateInfo = FunctionInfo<SetPropertyICFn>(SetPropertyIC::update); const VMFunction SetPropertyIC::UpdateInfo =
FunctionInfo<SetPropertyICFn>(SetPropertyIC::update, "SetPropertyIC::update");
void void
CodeGenerator::visitSetPropertyIC(OutOfLineUpdateCache* ool, DataPtr<SetPropertyIC>& ic) CodeGenerator::visitSetPropertyIC(OutOfLineUpdateCache* ool, DataPtr<SetPropertyIC>& ic)
@ -9808,7 +9885,7 @@ CodeGenerator::visitSetPropertyIC(OutOfLineUpdateCache* ool, DataPtr<SetProperty
} }
typedef bool (*ThrowFn)(JSContext*, HandleValue); typedef bool (*ThrowFn)(JSContext*, HandleValue);
static const VMFunction ThrowInfoCodeGen = FunctionInfo<ThrowFn>(js::Throw); static const VMFunction ThrowInfoCodeGen = FunctionInfo<ThrowFn>(js::Throw, "Throw");
void void
CodeGenerator::visitThrow(LThrow* lir) CodeGenerator::visitThrow(LThrow* lir)
@ -9818,7 +9895,7 @@ CodeGenerator::visitThrow(LThrow* lir)
} }
typedef bool (*BitNotFn)(JSContext*, HandleValue, int* p); typedef bool (*BitNotFn)(JSContext*, HandleValue, int* p);
static const VMFunction BitNotInfo = FunctionInfo<BitNotFn>(BitNot); static const VMFunction BitNotInfo = FunctionInfo<BitNotFn>(BitNot, "BitNot");
void void
CodeGenerator::visitBitNotV(LBitNotV* lir) CodeGenerator::visitBitNotV(LBitNotV* lir)
@ -9828,11 +9905,11 @@ CodeGenerator::visitBitNotV(LBitNotV* lir)
} }
typedef bool (*BitopFn)(JSContext*, HandleValue, HandleValue, int* p); typedef bool (*BitopFn)(JSContext*, HandleValue, HandleValue, int* p);
static const VMFunction BitAndInfo = FunctionInfo<BitopFn>(BitAnd); static const VMFunction BitAndInfo = FunctionInfo<BitopFn>(BitAnd, "BitAnd");
static const VMFunction BitOrInfo = FunctionInfo<BitopFn>(BitOr); static const VMFunction BitOrInfo = FunctionInfo<BitopFn>(BitOr, "BitOr");
static const VMFunction BitXorInfo = FunctionInfo<BitopFn>(BitXor); static const VMFunction BitXorInfo = FunctionInfo<BitopFn>(BitXor, "BitXor");
static const VMFunction BitLhsInfo = FunctionInfo<BitopFn>(BitLsh); static const VMFunction BitLhsInfo = FunctionInfo<BitopFn>(BitLsh, "BitLsh");
static const VMFunction BitRhsInfo = FunctionInfo<BitopFn>(BitRsh); static const VMFunction BitRhsInfo = FunctionInfo<BitopFn>(BitRsh, "BitRsh");
void void
CodeGenerator::visitBitOpV(LBitOpV* lir) CodeGenerator::visitBitOpV(LBitOpV* lir)
@ -10027,7 +10104,7 @@ CodeGenerator::visitOutOfLineTypeOfV(OutOfLineTypeOfV* ool)
typedef bool (*ToIdFn)(JSContext*, HandleScript, jsbytecode*, HandleValue, typedef bool (*ToIdFn)(JSContext*, HandleScript, jsbytecode*, HandleValue,
MutableHandleValue); MutableHandleValue);
static const VMFunction ToIdInfo = FunctionInfo<ToIdFn>(ToIdOperation); static const VMFunction ToIdInfo = FunctionInfo<ToIdFn>(ToIdOperation, "ToIdOperation");
void void
CodeGenerator::visitToIdV(LToIdV* lir) CodeGenerator::visitToIdV(LToIdV* lir)
@ -10485,7 +10562,7 @@ CodeGenerator::visitClampVToUint8(LClampVToUint8* lir)
} }
typedef bool (*OperatorInFn)(JSContext*, HandleValue, HandleObject, bool*); typedef bool (*OperatorInFn)(JSContext*, HandleValue, HandleObject, bool*);
static const VMFunction OperatorInInfo = FunctionInfo<OperatorInFn>(OperatorIn); static const VMFunction OperatorInInfo = FunctionInfo<OperatorInFn>(OperatorIn, "OperatorIn");
void void
CodeGenerator::visitIn(LIn* ins) CodeGenerator::visitIn(LIn* ins)
@ -10497,7 +10574,7 @@ CodeGenerator::visitIn(LIn* ins)
} }
typedef bool (*OperatorInIFn)(JSContext*, uint32_t, HandleObject, bool*); typedef bool (*OperatorInIFn)(JSContext*, uint32_t, HandleObject, bool*);
static const VMFunction OperatorInIInfo = FunctionInfo<OperatorInIFn>(OperatorInI); static const VMFunction OperatorInIInfo = FunctionInfo<OperatorInIFn>(OperatorInI, "OperatorInI");
void void
CodeGenerator::visitInArray(LInArray* lir) CodeGenerator::visitInArray(LInArray* lir)
@ -10587,7 +10664,8 @@ IsDelegateObject(JSContext* cx, HandleObject protoObj, HandleObject obj, bool* r
} }
typedef bool (*IsDelegateObjectFn)(JSContext*, HandleObject, HandleObject, bool*); typedef bool (*IsDelegateObjectFn)(JSContext*, HandleObject, HandleObject, bool*);
static const VMFunction IsDelegateObjectInfo = FunctionInfo<IsDelegateObjectFn>(IsDelegateObject); static const VMFunction IsDelegateObjectInfo =
FunctionInfo<IsDelegateObjectFn>(IsDelegateObject, "IsDelegateObject");
void void
CodeGenerator::emitInstanceOf(LInstruction* ins, JSObject* prototypeObject) CodeGenerator::emitInstanceOf(LInstruction* ins, JSObject* prototypeObject)
@ -10677,7 +10755,7 @@ CodeGenerator::emitInstanceOf(LInstruction* ins, JSObject* prototypeObject)
} }
typedef bool (*HasInstanceFn)(JSContext*, HandleObject, HandleValue, bool*); typedef bool (*HasInstanceFn)(JSContext*, HandleObject, HandleValue, bool*);
static const VMFunction HasInstanceInfo = FunctionInfo<HasInstanceFn>(js::HasInstance); static const VMFunction HasInstanceInfo = FunctionInfo<HasInstanceFn>(js::HasInstance, "HasInstance");
void void
CodeGenerator::visitCallInstanceOf(LCallInstanceOf* ins) CodeGenerator::visitCallInstanceOf(LCallInstanceOf* ins)
@ -11308,10 +11386,11 @@ CodeGenerator::visitAsmThrowUnreachable(LAsmThrowUnreachable* lir)
} }
typedef bool (*RecompileFn)(JSContext*); typedef bool (*RecompileFn)(JSContext*);
static const VMFunction RecompileFnInfo = FunctionInfo<RecompileFn>(Recompile); static const VMFunction RecompileFnInfo = FunctionInfo<RecompileFn>(Recompile, "Recompile");
typedef bool (*ForcedRecompileFn)(JSContext*); typedef bool (*ForcedRecompileFn)(JSContext*);
static const VMFunction ForcedRecompileFnInfo = FunctionInfo<ForcedRecompileFn>(ForcedRecompile); static const VMFunction ForcedRecompileFnInfo =
FunctionInfo<ForcedRecompileFn>(ForcedRecompile, "ForcedRecompile");
void void
CodeGenerator::visitRecompileCheck(LRecompileCheck* ins) CodeGenerator::visitRecompileCheck(LRecompileCheck* ins)
@ -11358,7 +11437,7 @@ CodeGenerator::visitLexicalCheck(LLexicalCheck* ins)
typedef bool (*ThrowRuntimeLexicalErrorFn)(JSContext*, unsigned); typedef bool (*ThrowRuntimeLexicalErrorFn)(JSContext*, unsigned);
static const VMFunction ThrowRuntimeLexicalErrorInfo = static const VMFunction ThrowRuntimeLexicalErrorInfo =
FunctionInfo<ThrowRuntimeLexicalErrorFn>(ThrowRuntimeLexicalError); FunctionInfo<ThrowRuntimeLexicalErrorFn>(ThrowRuntimeLexicalError, "ThrowRuntimeLexicalError");
void void
CodeGenerator::visitThrowRuntimeLexicalError(LThrowRuntimeLexicalError* ins) CodeGenerator::visitThrowRuntimeLexicalError(LThrowRuntimeLexicalError* ins)
@ -11369,7 +11448,8 @@ CodeGenerator::visitThrowRuntimeLexicalError(LThrowRuntimeLexicalError* ins)
typedef bool (*GlobalNameConflictsCheckFromIonFn)(JSContext*, HandleScript); typedef bool (*GlobalNameConflictsCheckFromIonFn)(JSContext*, HandleScript);
static const VMFunction GlobalNameConflictsCheckFromIonInfo = static const VMFunction GlobalNameConflictsCheckFromIonInfo =
FunctionInfo<GlobalNameConflictsCheckFromIonFn>(GlobalNameConflictsCheckFromIon); FunctionInfo<GlobalNameConflictsCheckFromIonFn>(GlobalNameConflictsCheckFromIon,
"GlobalNameConflictsCheckFromIon");
void void
CodeGenerator::visitGlobalNameConflictsCheck(LGlobalNameConflictsCheck* ins) CodeGenerator::visitGlobalNameConflictsCheck(LGlobalNameConflictsCheck* ins)
@ -11443,7 +11523,8 @@ CodeGenerator::visitCheckReturn(LCheckReturn* ins)
} }
typedef bool (*ThrowObjCoercibleFn)(JSContext*, HandleValue); typedef bool (*ThrowObjCoercibleFn)(JSContext*, HandleValue);
static const VMFunction ThrowObjectCoercibleInfo = FunctionInfo<ThrowObjCoercibleFn>(ThrowObjectCoercible); static const VMFunction ThrowObjectCoercibleInfo =
FunctionInfo<ThrowObjCoercibleFn>(ThrowObjectCoercible, "ThrowObjectCoercible");
void void
CodeGenerator::visitCheckObjCoercible(LCheckObjCoercible* ins) CodeGenerator::visitCheckObjCoercible(LCheckObjCoercible* ins)
@ -11459,7 +11540,8 @@ CodeGenerator::visitCheckObjCoercible(LCheckObjCoercible* ins)
} }
typedef bool (*CheckSelfHostedFn)(JSContext*, HandleValue); typedef bool (*CheckSelfHostedFn)(JSContext*, HandleValue);
static const VMFunction CheckSelfHostedInfo = FunctionInfo<CheckSelfHostedFn>(js::Debug_CheckSelfHosted); static const VMFunction CheckSelfHostedInfo =
FunctionInfo<CheckSelfHostedFn>(js::Debug_CheckSelfHosted, "Debug_CheckSelfHosted");
void void
CodeGenerator::visitDebugCheckSelfHosted(LDebugCheckSelfHosted* ins) CodeGenerator::visitDebugCheckSelfHosted(LDebugCheckSelfHosted* ins)

View File

@ -31,6 +31,7 @@ class IonBuilder;
class IonICEntry; class IonICEntry;
typedef Vector<JSObject*, 4, JitAllocPolicy> ObjectVector; typedef Vector<JSObject*, 4, JitAllocPolicy> ObjectVector;
typedef Vector<TraceLoggerEvent, 0, SystemAllocPolicy> TraceLoggerEventVector;
class JitCode : public gc::TenuredCell class JitCode : public gc::TenuredCell
{ {
@ -283,8 +284,8 @@ struct IonScript
// Allocated space for fallback stubs. // Allocated space for fallback stubs.
FallbackICStubSpace fallbackStubSpace_; FallbackICStubSpace fallbackStubSpace_;
// The tracelogger event used to log the start/stop of this IonScript. // TraceLogger events that are baked into the IonScript.
TraceLoggerEvent traceLoggerScriptEvent_; TraceLoggerEventVector traceLoggerEvents_;
private: private:
inline uint8_t* bottomBuffer() { inline uint8_t* bottomBuffer() {
@ -435,8 +436,8 @@ struct IonScript
bool hasProfilingInstrumentation() const { bool hasProfilingInstrumentation() const {
return hasProfilingInstrumentation_; return hasProfilingInstrumentation_;
} }
void setTraceLoggerEvent(TraceLoggerEvent& event) { MOZ_MUST_USE bool addTraceLoggerEvent(TraceLoggerEvent& event) {
traceLoggerScriptEvent_ = event; return traceLoggerEvents_.append(Move(event));
} }
const uint8_t* snapshots() const { const uint8_t* snapshots() const {
return reinterpret_cast<const uint8_t*>(this) + snapshots_; return reinterpret_cast<const uint8_t*>(this) + snapshots_;

View File

@ -48,6 +48,8 @@ enum MaybeTailCall {
NonTailCall NonTailCall
}; };
static const char UnknownVMFunction[] = "Unknown VM call";
// Contains information about a virtual machine function that can be called // Contains information about a virtual machine function that can be called
// from JIT code. Functions described in this manner must conform to a simple // from JIT code. Functions described in this manner must conform to a simple
// protocol: the return type must have a special "failure" value (for example, // protocol: the return type must have a special "failure" value (for example,
@ -68,6 +70,8 @@ struct VMFunction
// Address of the C function. // Address of the C function.
void* wrapped; void* wrapped;
const char* name_;
// Number of arguments expected, excluding JSContext * as an implicit // Number of arguments expected, excluding JSContext * as an implicit
// first argument and an outparam as a possible implicit final argument. // first argument and an outparam as a possible implicit final argument.
uint32_t explicitArgs; uint32_t explicitArgs;
@ -153,6 +157,10 @@ struct VMFunction
return ((argumentPassedInFloatRegs >> explicitArg) & 1) == 1; return ((argumentPassedInFloatRegs >> explicitArg) & 1) == 1;
} }
const char* name() const {
return name_;
}
// Return the stack size consumed by explicit arguments. // Return the stack size consumed by explicit arguments.
size_t explicitStackSlots() const { size_t explicitStackSlots() const {
size_t stackSlots = explicitArgs; size_t stackSlots = explicitArgs;
@ -221,6 +229,7 @@ struct VMFunction
VMFunction() VMFunction()
: wrapped(nullptr), : wrapped(nullptr),
name_(UnknownVMFunction),
explicitArgs(0), explicitArgs(0),
argumentProperties(0), argumentProperties(0),
argumentPassedInFloatRegs(0), argumentPassedInFloatRegs(0),
@ -232,11 +241,12 @@ struct VMFunction
} }
VMFunction(void* wrapped, uint32_t explicitArgs, uint32_t argumentProperties, VMFunction(void* wrapped, const char* name, uint32_t explicitArgs, uint32_t argumentProperties,
uint32_t argumentPassedInFloatRegs, uint64_t argRootTypes, uint32_t argumentPassedInFloatRegs, uint64_t argRootTypes,
DataType outParam, RootType outParamRootType, DataType returnType, DataType outParam, RootType outParamRootType, DataType returnType,
uint32_t extraValuesToPop = 0, MaybeTailCall expectTailCall = NonTailCall) uint32_t extraValuesToPop = 0, MaybeTailCall expectTailCall = NonTailCall)
: wrapped(wrapped), : wrapped(wrapped),
name_(name),
explicitArgs(explicitArgs), explicitArgs(explicitArgs),
argumentProperties(argumentProperties), argumentProperties(argumentProperties),
argumentPassedInFloatRegs(argumentPassedInFloatRegs), argumentPassedInFloatRegs(argumentPassedInFloatRegs),
@ -532,7 +542,7 @@ struct FunctionInfo<R (*)(Context, Args...)> : public VMFunction
return BitMask<TypeToRootType, uint64_t, 3, Args...>::result; return BitMask<TypeToRootType, uint64_t, 3, Args...>::result;
} }
explicit FunctionInfo(pf fun, PopValues extraValuesToPop = PopValues(0)) explicit FunctionInfo(pf fun, PopValues extraValuesToPop = PopValues(0))
: VMFunction(JS_FUNC_TO_DATA_PTR(void*, fun), explicitArgs(), : VMFunction(JS_FUNC_TO_DATA_PTR(void*, fun), UnknownVMFunction, explicitArgs(),
argumentProperties(), argumentPassedInFloatRegs(), argumentProperties(), argumentPassedInFloatRegs(),
argumentRootTypes(), outParam(), outParamRootType(), argumentRootTypes(), outParam(), outParamRootType(),
returnType(), extraValuesToPop.numValues, NonTailCall) returnType(), extraValuesToPop.numValues, NonTailCall)
@ -541,7 +551,24 @@ struct FunctionInfo<R (*)(Context, Args...)> : public VMFunction
} }
explicit FunctionInfo(pf fun, MaybeTailCall expectTailCall, explicit FunctionInfo(pf fun, MaybeTailCall expectTailCall,
PopValues extraValuesToPop = PopValues(0)) PopValues extraValuesToPop = PopValues(0))
: VMFunction(JS_FUNC_TO_DATA_PTR(void*, fun), explicitArgs(), : VMFunction(JS_FUNC_TO_DATA_PTR(void*, fun), UnknownVMFunction, explicitArgs(),
argumentProperties(), argumentPassedInFloatRegs(),
argumentRootTypes(), outParam(), outParamRootType(),
returnType(), extraValuesToPop.numValues, expectTailCall)
{
static_assert(MatchContext<Context>::valid, "Invalid cx type in VMFunction");
}
explicit FunctionInfo(pf fun, const char* name, PopValues extraValuesToPop = PopValues(0))
: VMFunction(JS_FUNC_TO_DATA_PTR(void*, fun), name, explicitArgs(),
argumentProperties(), argumentPassedInFloatRegs(),
argumentRootTypes(), outParam(), outParamRootType(),
returnType(), extraValuesToPop.numValues, NonTailCall)
{
static_assert(MatchContext<Context>::valid, "Invalid cx type in VMFunction");
}
explicit FunctionInfo(pf fun, const char* name, MaybeTailCall expectTailCall,
PopValues extraValuesToPop = PopValues(0))
: VMFunction(JS_FUNC_TO_DATA_PTR(void*, fun), name, explicitArgs(),
argumentProperties(), argumentPassedInFloatRegs(), argumentProperties(), argumentPassedInFloatRegs(),
argumentRootTypes(), outParam(), outParamRootType(), argumentRootTypes(), outParam(), outParamRootType(),
returnType(), extraValuesToPop.numValues, expectTailCall) returnType(), extraValuesToPop.numValues, expectTailCall)

View File

@ -1340,6 +1340,7 @@ CodeGeneratorShared::callVM(const VMFunction& fun, LInstruction* ins, const Regi
#ifdef JS_TRACE_LOGGING #ifdef JS_TRACE_LOGGING
emitTracelogStartEvent(TraceLogger_VM); emitTracelogStartEvent(TraceLogger_VM);
emitTracelogStartEvent(fun.name(), TraceLogger_VMSpecific);
#endif #endif
// Stack is: // Stack is:
@ -1391,6 +1392,7 @@ CodeGeneratorShared::callVM(const VMFunction& fun, LInstruction* ins, const Regi
#ifdef JS_TRACE_LOGGING #ifdef JS_TRACE_LOGGING
emitTracelogStopEvent(TraceLogger_VM); emitTracelogStopEvent(TraceLogger_VM);
emitTracelogStopEvent(fun.name(), TraceLogger_VMSpecific);
#endif #endif
} }
@ -1769,6 +1771,44 @@ CodeGeneratorShared::emitTracelogTree(bool isStart, uint32_t textId)
masm.Pop(logger); masm.Pop(logger);
} }
void
CodeGeneratorShared::emitTracelogTree(bool isStart, const char* text,
TraceLoggerTextId enabledTextId)
{
if (!TraceLogTextIdEnabled(enabledTextId))
return;
Label done;
AllocatableRegisterSet regs(RegisterSet::Volatile());
Register loggerReg = regs.takeAnyGeneral();
Register eventReg = regs.takeAnyGeneral();
masm.Push(loggerReg);
CodeOffset patchLocation = masm.movWithPatch(ImmPtr(nullptr), loggerReg);
masm.propagateOOM(patchableTraceLoggers_.append(patchLocation));
Address enabledAddress(loggerReg, TraceLoggerThread::offsetOfEnabled());
masm.branch32(Assembler::Equal, enabledAddress, Imm32(0), &done);
masm.Push(eventReg);
PatchableTLEvent patchEvent(masm.movWithPatch(ImmWord(0), eventReg), text);
masm.propagateOOM(patchableTLEvents_.append(Move(patchEvent)));
if (isStart)
masm.tracelogStartId(loggerReg, eventReg);
else
masm.tracelogStopId(loggerReg, eventReg);
masm.Pop(eventReg);
masm.bind(&done);
masm.Pop(loggerReg);
}
#endif #endif
} // namespace jit } // namespace jit

View File

@ -108,7 +108,15 @@ class CodeGeneratorShared : public LElementVisitor
Vector<PatchableBackedgeInfo, 0, SystemAllocPolicy> patchableBackedges_; Vector<PatchableBackedgeInfo, 0, SystemAllocPolicy> patchableBackedges_;
#ifdef JS_TRACE_LOGGING #ifdef JS_TRACE_LOGGING
struct PatchableTLEvent {
CodeOffset offset;
const char* event;
PatchableTLEvent(CodeOffset offset, const char* event)
: offset(offset), event(event)
{}
};
js::Vector<CodeOffset, 0, SystemAllocPolicy> patchableTraceLoggers_; js::Vector<CodeOffset, 0, SystemAllocPolicy> patchableTraceLoggers_;
js::Vector<PatchableTLEvent, 0, SystemAllocPolicy> patchableTLEvents_;
js::Vector<CodeOffset, 0, SystemAllocPolicy> patchableTLScripts_; js::Vector<CodeOffset, 0, SystemAllocPolicy> patchableTLScripts_;
#endif #endif
@ -495,6 +503,7 @@ class CodeGeneratorShared : public LElementVisitor
protected: protected:
void emitTracelogScript(bool isStart); void emitTracelogScript(bool isStart);
void emitTracelogTree(bool isStart, uint32_t textId); void emitTracelogTree(bool isStart, uint32_t textId);
void emitTracelogTree(bool isStart, const char* text, TraceLoggerTextId enabledTextId);
public: public:
void emitTracelogScriptStart() { void emitTracelogScriptStart() {
@ -509,6 +518,15 @@ class CodeGeneratorShared : public LElementVisitor
void emitTracelogStopEvent(uint32_t textId) { void emitTracelogStopEvent(uint32_t textId) {
emitTracelogTree(/* isStart =*/ false, textId); emitTracelogTree(/* isStart =*/ false, textId);
} }
// Log an arbitrary text. The TraceloggerTextId is used to toggle the
// logging on and off.
// Note: the text is not copied and need to be kept alive until linking.
void emitTracelogStartEvent(const char* text, TraceLoggerTextId enabledTextId) {
emitTracelogTree(/* isStart =*/ true, text, enabledTextId);
}
void emitTracelogStopEvent(const char* text, TraceLoggerTextId enabledTextId) {
emitTracelogTree(/* isStart =*/ false, text, enabledTextId);
}
#endif #endif
void emitTracelogIonStart() { void emitTracelogIonStart() {
#ifdef JS_TRACE_LOGGING #ifdef JS_TRACE_LOGGING

View File

@ -668,6 +668,8 @@ TraceLoggerThreadState::init()
" EliminateRedundantChecks, AddKeepAliveInstructions, GenerateLIR, \n" " EliminateRedundantChecks, AddKeepAliveInstructions, GenerateLIR, \n"
" RegisterAllocation, GenerateCode, Scripts, IonBuilderRestartLoop\n" " RegisterAllocation, GenerateCode, Scripts, IonBuilderRestartLoop\n"
"\n" "\n"
" VMSpecific Output the specific name of the VM call"
"\n"
"Specific log items:\n" "Specific log items:\n"
); );
for (uint32_t i = 1; i < TraceLogger_Last; i++) { for (uint32_t i = 1; i < TraceLogger_Last; i++) {
@ -1024,3 +1026,10 @@ TraceLoggerEvent::operator=(const TraceLoggerEvent& other)
return *this; return *this;
} }
TraceLoggerEvent::TraceLoggerEvent(const TraceLoggerEvent& other)
{
payload_ = other.payload_;
if (hasPayload())
payload()->use();
}

View File

@ -93,6 +93,8 @@ class TraceLoggerEvent {
TraceLoggerEvent(TraceLoggerThread* logger, TraceLoggerTextId type, TraceLoggerEvent(TraceLoggerThread* logger, TraceLoggerTextId type,
const JS::ReadOnlyCompileOptions& compileOptions); const JS::ReadOnlyCompileOptions& compileOptions);
TraceLoggerEvent(TraceLoggerThread* logger, const char* text); TraceLoggerEvent(TraceLoggerThread* logger, const char* text);
TraceLoggerEvent(const TraceLoggerEvent& event);
TraceLoggerEvent& operator=(const TraceLoggerEvent& other);
~TraceLoggerEvent(); ~TraceLoggerEvent();
#else #else
TraceLoggerEvent (TraceLoggerThread* logger, TraceLoggerTextId textId) {} TraceLoggerEvent (TraceLoggerThread* logger, TraceLoggerTextId textId) {}
@ -100,6 +102,8 @@ class TraceLoggerEvent {
TraceLoggerEvent (TraceLoggerThread* logger, TraceLoggerTextId type, TraceLoggerEvent (TraceLoggerThread* logger, TraceLoggerTextId type,
const JS::ReadOnlyCompileOptions& compileOptions) {} const JS::ReadOnlyCompileOptions& compileOptions) {}
TraceLoggerEvent (TraceLoggerThread* logger, const char* text) {} TraceLoggerEvent (TraceLoggerThread* logger, const char* text) {}
TraceLoggerEvent(const TraceLoggerEvent& event) {}
TraceLoggerEvent& operator=(const TraceLoggerEvent& other) {};
~TraceLoggerEvent() {} ~TraceLoggerEvent() {}
#endif #endif
@ -110,9 +114,6 @@ class TraceLoggerEvent {
bool hasPayload() const { bool hasPayload() const {
return !!payload_; return !!payload_;
} }
TraceLoggerEvent& operator=(const TraceLoggerEvent& other);
TraceLoggerEvent(const TraceLoggerEvent& event) = delete;
}; };
/** /**

View File

@ -67,7 +67,8 @@
_(GenerateLIR) \ _(GenerateLIR) \
_(RegisterAllocation) \ _(RegisterAllocation) \
_(GenerateCode) \ _(GenerateCode) \
_(IonBuilderRestartLoop) _(IonBuilderRestartLoop) \
_(VMSpecific)
#define TRACELOGGER_LOG_ITEMS(_) \ #define TRACELOGGER_LOG_ITEMS(_) \
_(Bailout) \ _(Bailout) \