| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- //-------------------------------------------------------------------------------------------------------
- // Copyright (C) Microsoft. All rights reserved.
- // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
- //-------------------------------------------------------------------------------------------------------
- #pragma once
- // forward decls
- class AsmJsJITInfo;
- class JITTimeProfileInfo;
- class FunctionJITRuntimeInfo;
- class JITTimeFunctionBody
- {
- public:
- JITTimeFunctionBody(FunctionBodyDataIDL * bodyData);
- static void InitializeJITFunctionData(
- __in Recycler * recycler,
- __in Js::FunctionBody * functionBody,
- __out FunctionBodyDataIDL * jitBody);
- intptr_t GetAddr() const;
- uint GetFunctionNumber() const;
- uint GetSourceContextId() const;
- uint GetNestedCount() const;
- uint GetScopeSlotArraySize() const;
- uint GetParamScopeSlotArraySize() const;
- uint GetByteCodeCount() const;
- uint GetByteCodeInLoopCount() const;
- uint GetNonLoadByteCodeCount() const;
- uint GetLoopCount() const;
- uint GetByteCodeLength() const;
- uint GetInnerScopeCount() const;
- uint GetInlineCacheCount() const;
- uint GetRecursiveCallSiteCount() const;
- Js::RegSlot GetLocalFrameDisplayReg() const;
- Js::RegSlot GetLocalClosureReg() const;
- Js::RegSlot GetEnvReg() const;
- Js::RegSlot GetFirstTmpReg() const;
- Js::RegSlot GetFirstInnerScopeReg() const;
- Js::RegSlot GetVarCount() const;
- Js::RegSlot GetConstCount() const;
- Js::RegSlot GetLocalsCount() const;
- Js::RegSlot GetTempCount() const;
- Js::RegSlot GetFuncExprScopeReg() const;
- Js::RegSlot GetThisRegForEventHandler() const;
- Js::RegSlot GetFirstNonTempLocalIndex() const;
- Js::RegSlot GetEndNonTempLocalIndex() const;
- Js::RegSlot GetNonTempLocalVarCount() const;
- Js::RegSlot GetRestParamRegSlot() const;
- Js::RegSlot GetParamClosureReg() const;
- Js::PropertyId GetPropertyIdFromCacheId(uint cacheId) const;
- Js::PropertyId GetReferencedPropertyId(uint index) const;
- uint16 GetEnvDepth() const;
- uint16 GetProfiledIterations() const;
- uint16 GetArgUsedForBranch() const;
- Js::ProfileId GetProfiledCallSiteCount() const;
- Js::ArgSlot GetInParamsCount() const;
- bool DoStackNestedFunc() const;
- bool DoStackClosure() const;
- bool DoBackendArgumentsOptimization() const;
- bool IsLibraryCode() const;
- bool HasTry() const;
- bool HasFinally() const;
- bool HasOrParentHasArguments() const;
- bool IsGenerator() const;
- bool IsAsmJsMode() const;
- bool IsStrictMode() const;
- bool IsEval() const;
- bool HasImplicitArgIns() const;
- bool HasRestParameter() const;
- bool HasScopeObject() const;
- bool HasCachedScopePropIds() const;
- bool HasInlineCachesOnFunctionObject() const;
- bool DoInterruptProbe() const;
- bool IsGlobalFunc() const;
- void DisableInlineApply();
- bool IsInlineApplyDisabled() const;
- bool IsNonTempLocalVar(uint32 varIndex) const;
- bool DoJITLoopBody() const;
- bool IsInlineSpreadDisabled() const;
- void DisableInlineSpread();
- bool HasLoops() const;
- bool HasNonBuiltInCallee() const;
- bool HasNestedLoop() const;
- bool UsesArgumentsObject() const;
- bool IsParamAndBodyScopeMerged() const;
- bool CanInlineRecursively(uint depth, bool tryAggressive = true) const;
- bool NeedScopeObjectForArguments(bool hasNonSimpleParams) const;
- const byte * GetByteCodeBuffer() const;
- void * ReadFromAuxData(uint offset) const;
- void * ReadFromAuxContextData(uint offset) const;
- intptr_t GetNestedFuncRef(uint index) const;
- intptr_t GetConstantVar(Js::RegSlot location) const;
- template<class T>
- T* GetConstAsT(Js::RegSlot location) const
- {
- Assert(m_bodyData.constTableContent != nullptr);
- Assert(location < GetConstCount());
- Assert(location != 0);
- auto obj = m_bodyData.constTableContent[location - Js::FunctionBody::FirstRegSlot];
- Assert(obj);
- Assert(T::Is(obj));
- return (T*)obj;
- }
- intptr_t GetInlineCache(uint index) const;
- intptr_t GetIsInstInlineCache(uint index) const;
- Js::TypeId GetConstantType(Js::RegSlot location) const;
- void * GetConstTable() const;
- intptr_t GetRootObject() const;
- intptr_t GetLoopHeaderAddr(uint loopNum) const;
- const JITLoopHeaderIDL * GetLoopHeaderData(uint loopNum) const;
- intptr_t GetScriptIdAddr() const;
- intptr_t GetProbeCountAddr() const;
- intptr_t GetFlagsAddr() const;
- intptr_t GetRegAllocLoadCountAddr() const;
- intptr_t GetRegAllocStoreCountAddr() const;
- intptr_t GetCallCountStatsAddr() const;
- intptr_t GetFormalsPropIdArrayAddr() const;
- intptr_t GetObjectLiteralTypeRef(uint index) const;
- intptr_t GetLiteralRegexAddr(uint index) const;
- const AsmJsJITInfo * GetAsmJsInfo() const;
- const JITTimeProfileInfo * GetReadOnlyProfileInfo() const;
- JITTimeProfileInfo * GetProfileInfo() const;
- bool HasProfileInfo() const;
- static bool LoopContains(const JITLoopHeaderIDL * loop1, const JITLoopHeaderIDL * loop2);
- wchar_t* GetDisplayName() const;
- intptr_t GetAuxDataAddr(uint offset) const;
- const Js::PropertyIdArray * ReadPropertyIdArrayFromAuxData(uint offset) const;
- Js::PropertyIdArray * GetFormalsPropIdArray() const;
- void InitializeStatementMap(__out Js::SmallSpanSequence * statementMap) const;
- private:
- Js::FunctionInfo::Attributes GetAttributes() const;
- Js::FunctionBody::FunctionBodyFlags GetFlags() const;
- FunctionBodyDataIDL m_bodyData;
- };
|