TTSnapValues.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #pragma once
  6. #if ENABLE_TTD
  7. namespace TTD
  8. {
  9. class TTDTimer
  10. {
  11. private:
  12. PlatformAgnostic::DateTime::HiResTimer m_timer;
  13. public:
  14. TTDTimer()
  15. : m_timer()
  16. {
  17. ;
  18. }
  19. ~TTDTimer()
  20. {
  21. ;
  22. }
  23. double Now()
  24. {
  25. return this->m_timer.Now();
  26. }
  27. };
  28. namespace JsSupport
  29. {
  30. //return true if the Var is a tagged number (inline)
  31. bool IsVarTaggedInline(Js::Var v);
  32. //return true if the Var is a ptr var value
  33. bool IsVarPtrValued(Js::Var v);
  34. //return true if the Var is a primitive value (string, number, symbol, etc.)
  35. bool IsVarPrimitiveKind(Js::Var v);
  36. //return true if the Var is a richer value (enumerator, dynamicObject, array, etc.)
  37. bool IsVarComplexKind(Js::Var v);
  38. #if ENABLE_TTD_INTERNAL_DIAGNOSTICS
  39. //Check if 2 inline values are equivalent -- JIT can use number vs. Int in interp mode but as long as values mean the same thing we are cool
  40. bool AreInlineVarsEquiv(Js::Var v1, Js::Var v2);
  41. #endif
  42. //Ensure a function is fully parsed/deserialized
  43. Js::FunctionBody* ForceAndGetFunctionBody(Js::ParseableFunctionInfo* pfi);
  44. void WriteCodeToFile(ThreadContext* threadContext, bool fromEvent, uint32 bodyId, bool isUtf8Source, byte* sourceBuffer, uint32 length);
  45. void ReadCodeFromFile(ThreadContext* threadContext, bool fromEvent, uint32 bodyId, bool isUtf8Source, byte* sourceBuffer, uint32 length);
  46. }
  47. namespace NSSnapValues
  48. {
  49. //////////////////
  50. //Helpers for TTDVars
  51. enum class TTDVarEmitTag
  52. {
  53. TTDVarInvalid = 0x0,
  54. TTDVarNull,
  55. TTDVarInt,
  56. TTDVarDouble,
  57. TTDVarAddr
  58. };
  59. //serialize the TTDVar
  60. void EmitTTDVar(TTDVar var, FileWriter* writer, NSTokens::Separator separator);
  61. //de-serialize the TTDVar
  62. TTDVar ParseTTDVar(bool readSeparator, FileReader* reader);
  63. #if ENABLE_SNAPSHOT_COMPARE
  64. bool CheckSnapEquivTTDDouble(double d1, double d2);
  65. void AssertSnapEquivTTDVar_Helper(const TTDVar v1, const TTDVar v2, TTDCompareMap& compareMap, TTDComparePath::StepKind stepKind, const TTDComparePath::PathEntry& next);
  66. void AssertSnapEquivTTDVar_Property(const TTDVar v1, const TTDVar v2, TTDCompareMap& compareMap, Js::PropertyId pid);
  67. void AssertSnapEquivTTDVar_PropertyGetter(const TTDVar v1, const TTDVar v2, TTDCompareMap& compareMap, Js::PropertyId pid);
  68. void AssertSnapEquivTTDVar_PropertySetter(const TTDVar v1, const TTDVar v2, TTDCompareMap& compareMap, Js::PropertyId pid);
  69. void AssertSnapEquivTTDVar_Array(const TTDVar v1, const TTDVar v2, TTDCompareMap& compareMap, uint32 index);
  70. void AssertSnapEquivTTDVar_SlotArray(const TTDVar v1, const TTDVar v2, TTDCompareMap& compareMap, uint32 index);
  71. void AssertSnapEquivTTDVar_Special(const TTDVar v1, const TTDVar v2, TTDCompareMap& compareMap, const char16* specialField);
  72. void AssertSnapEquivTTDVar_SpecialArray(const TTDVar v1, const TTDVar v2, TTDCompareMap& compareMap, const char16* specialField, uint32 index);
  73. #endif
  74. //////////////////
  75. //A structure for the primitive javascript types
  76. struct SnapPrimitiveValue
  77. {
  78. //The id (address of the object)
  79. TTD_PTR_ID PrimitiveValueId;
  80. //The type of the primitive value
  81. NSSnapType::SnapType* SnapType;
  82. //The optional well known token for this object (or INVALID)
  83. TTD_WELLKNOWN_TOKEN OptWellKnownToken;
  84. union
  85. {
  86. BOOL u_boolValue;
  87. int64 u_int64Value;
  88. uint64 u_uint64Value;
  89. double u_doubleValue;
  90. TTString* u_stringValue;
  91. Js::PropertyId u_propertyIdValue;
  92. };
  93. };
  94. void ExtractSnapPrimitiveValue(SnapPrimitiveValue* snapValue, Js::RecyclableObject* jsValue, bool isWellKnown, const TTDIdentifierDictionary<TTD_PTR_ID, NSSnapType::SnapType*>& idToTypeMap, SlabAllocator& alloc);
  95. void InflateSnapPrimitiveValue(const SnapPrimitiveValue* snapValue, InflateMap* inflator);
  96. void EmitSnapPrimitiveValue(const SnapPrimitiveValue* snapValue, FileWriter* writer, NSTokens::Separator separator);
  97. void ParseSnapPrimitiveValue(SnapPrimitiveValue* snapValue, bool readSeparator, FileReader* reader, SlabAllocator& alloc, const TTDIdentifierDictionary<TTD_PTR_ID, NSSnapType::SnapType*>& ptrIdToTypeMap);
  98. #if ENABLE_SNAPSHOT_COMPARE
  99. void AssertSnapEquiv(const SnapPrimitiveValue* v1, const SnapPrimitiveValue* v2, TTDCompareMap& compareMap);
  100. #endif
  101. //////////////////
  102. //If a scope is a slot array this class encodes the slot information and original address of the slot array
  103. struct SlotArrayInfo
  104. {
  105. //The unique id for the slot array scope entry
  106. TTD_PTR_ID SlotId;
  107. //The tag of the script context that this slot array is associated with
  108. TTD_LOG_PTR_ID ScriptContextLogId;
  109. //The number of slots in the scope array
  110. uint32 SlotCount;
  111. //The data values for the slots in the scope entry
  112. TTDVar* Slots;
  113. //The property ids associated with each index
  114. Js::PropertyId* PIDArray;
  115. //The meta-data for the slot array
  116. bool isFunctionBodyMetaData;
  117. TTD_PTR_ID OptFunctionBodyId;
  118. TTD_PTR_ID OptDebugScopeId;
  119. TTD_WELLKNOWN_TOKEN OptWellKnownDbgScope;
  120. };
  121. Field(Js::Var)* InflateSlotArrayInfo(const SlotArrayInfo* slotInfo, InflateMap* inflator);
  122. void EmitSlotArrayInfo(const SlotArrayInfo* slotInfo, FileWriter* writer, NSTokens::Separator separator);
  123. void ParseSlotArrayInfo(SlotArrayInfo* slotInfo, bool readSeparator, FileReader* reader, SlabAllocator& alloc);
  124. #if ENABLE_SNAPSHOT_COMPARE
  125. void AssertSnapEquiv(const SlotArrayInfo* sai1, const SlotArrayInfo* sai2, TTDCompareMap& compareMap);
  126. #endif
  127. //A struct to represent a single scope entry for a function
  128. struct ScopeInfoEntry
  129. {
  130. //The tag indicating what type of scope entry this is
  131. Js::ScopeType Tag;
  132. //The id for looking up the entry data
  133. //Either ptr object for Activation and With Scopes or the slotid for SlotArray Scopes
  134. TTD_PTR_ID IDValue;
  135. };
  136. //A class to represent a scope list for a script function
  137. struct ScriptFunctionScopeInfo
  138. {
  139. //The unique id for the scope array associated with this function
  140. TTD_PTR_ID ScopeId;
  141. //The id of the script context that this slot array is associated with
  142. TTD_LOG_PTR_ID ScriptContextLogId;
  143. //The number of scope entries
  144. uint16 ScopeCount;
  145. //The array of scope entries this function has
  146. ScopeInfoEntry* ScopeArray;
  147. };
  148. Js::FrameDisplay* InflateScriptFunctionScopeInfo(const ScriptFunctionScopeInfo* funcScopeInfo, InflateMap* inflator);
  149. void EmitScriptFunctionScopeInfo(const ScriptFunctionScopeInfo* funcScopeInfo, FileWriter* writer, NSTokens::Separator separator);
  150. void ParseScriptFunctionScopeInfo(ScriptFunctionScopeInfo* funcScopeInfo, bool readSeparator, FileReader* reader, SlabAllocator& alloc);
  151. #if ENABLE_SNAPSHOT_COMPARE
  152. void AssertSnapEquiv(const ScriptFunctionScopeInfo* funcScopeInfo1, const ScriptFunctionScopeInfo* funcScopeInfo2, TTDCompareMap& compareMap);
  153. #endif
  154. //////////////////
  155. //Capability info for a promise
  156. struct SnapPromiseCapabilityInfo
  157. {
  158. //The unique id for the capability entry
  159. TTD_PTR_ID CapabilityId;
  160. TTDVar PromiseVar;
  161. TTDVar ResolveVar;
  162. TTDVar RejectVar;
  163. };
  164. Js::JavascriptPromiseCapability* InflatePromiseCapabilityInfo(const SnapPromiseCapabilityInfo* capabilityInfo, Js::ScriptContext* ctx, InflateMap* inflator);
  165. void EmitPromiseCapabilityInfo(const SnapPromiseCapabilityInfo* capabilityInfo, FileWriter* writer, NSTokens::Separator separator);
  166. void ParsePromiseCapabilityInfo(SnapPromiseCapabilityInfo* capabilityInfo, bool readSeparator, FileReader* reader, SlabAllocator& alloc);
  167. #if ENABLE_SNAPSHOT_COMPARE
  168. void AssertSnapEquiv(const SnapPromiseCapabilityInfo* capabilityInfo1, const SnapPromiseCapabilityInfo* capabilityInfo2, TTDCompareMap& compareMap);
  169. #endif
  170. //A struct to represent a PromiseReaction
  171. struct SnapPromiseReactionInfo
  172. {
  173. //The unique id for PromiseReaction
  174. TTD_PTR_ID PromiseReactionId;
  175. TTD_PTR_ID HandlerObjId;
  176. SnapPromiseCapabilityInfo Capabilities;
  177. };
  178. Js::JavascriptPromiseReaction* InflatePromiseReactionInfo(const SnapPromiseReactionInfo* reactionInfo, Js::ScriptContext* ctx, InflateMap* inflator);
  179. void EmitPromiseReactionInfo(const SnapPromiseReactionInfo* reactionInfo, FileWriter* writer, NSTokens::Separator separator);
  180. void ParsePromiseReactionInfo(SnapPromiseReactionInfo* reactionInfo, bool readSeparator, FileReader* reader, SlabAllocator& alloc);
  181. #if ENABLE_SNAPSHOT_COMPARE
  182. void AssertSnapEquiv(const SnapPromiseReactionInfo* reactionInfo1, const SnapPromiseReactionInfo* reactionInfo2, TTDCompareMap& compareMap);
  183. #endif
  184. //////////////////
  185. //Information on the scopechain for a function body
  186. struct SnapFunctionBodyScopeChain
  187. {
  188. //The number of scopes associated with this function body
  189. uint32 ScopeCount;
  190. //The Ids of the scopes
  191. TTD_PTR_ID* ScopeArray;
  192. };
  193. void ExtractSnapFunctionBodyScopeChain(bool isWellKnownFunction, SnapFunctionBodyScopeChain& scopeChain, Js::FunctionBody* fb, SlabAllocator& alloc);
  194. void EmitSnapFunctionBodyScopeChain(const SnapFunctionBodyScopeChain& scopeChain, FileWriter* writer);
  195. void ParseSnapFunctionBodyScopeChain(SnapFunctionBodyScopeChain& scopeChain, FileReader* reader, SlabAllocator& alloc);
  196. #if ENABLE_SNAPSHOT_COMPARE
  197. void AssertSnapEquiv(const SnapFunctionBodyScopeChain& chain1, const SnapFunctionBodyScopeChain& chain2, TTDCompareMap& compareMap);
  198. #endif
  199. //////////////////
  200. //Information that is common to all top-level bodies
  201. struct TopLevelCommonBodyResolveInfo
  202. {
  203. //The context this body is associated with
  204. TTD_LOG_PTR_ID ScriptContextLogId;
  205. //A unique counter we produce for every top-level body as it is loaded
  206. uint32 TopLevelBodyCtr;
  207. //The string name of the function
  208. TTString FunctionName;
  209. //The module id and source context
  210. Js::ModuleID ModuleId;
  211. uint64 SourceContextId;
  212. //Src URI may be null
  213. TTString SourceUri;
  214. //The source length/buffer and if it is utf8 or char16 encoded
  215. bool IsUtf8;
  216. uint32 ByteLength;
  217. byte* SourceBuffer;
  218. //The (possibly empty) scope chain info
  219. SnapFunctionBodyScopeChain ScopeChainInfo;
  220. //The number of bytes (or -1 if not set) and the buffer for the serialized bytecode
  221. mutable DWORD DbgSerializedBytecodeSize;
  222. mutable byte* DbgSerializedBytecodeBuffer;
  223. };
  224. //Extract WITHOUT COPYING the info needed for this top level function -- use in script context when function is parsed to keep all the info together and then we do the copying later when doing snapshots
  225. void ExtractTopLevelCommonBodyResolveInfo(TopLevelCommonBodyResolveInfo* fbInfo, Js::FunctionBody* fb, uint32 topLevelCtr, Js::ModuleID moduleId, uint64 sourceContextId, bool isUtf8source, const byte* source, uint32 sourceLen, SlabAllocator& alloc);
  226. void EmitTopLevelCommonBodyResolveInfo(const TopLevelCommonBodyResolveInfo* fbInfo, bool emitInline, ThreadContext* threadContext, FileWriter* writer, NSTokens::Separator separator);
  227. void ParseTopLevelCommonBodyResolveInfo(TopLevelCommonBodyResolveInfo* fbInfo, bool readSeparator, bool parseInline, ThreadContext* threadContext, FileReader* reader, SlabAllocator& alloc);
  228. #if ENABLE_SNAPSHOT_COMPARE
  229. void AssertSnapEquiv(const TopLevelCommonBodyResolveInfo* fbInfo1, const TopLevelCommonBodyResolveInfo* fbInfo2, TTDCompareMap& compareMap);
  230. #endif
  231. //A struct that we can use to resolve a top-level script load function bodies and info
  232. struct TopLevelScriptLoadFunctionBodyResolveInfo
  233. {
  234. //The base information for the top-level resolve info
  235. TopLevelCommonBodyResolveInfo TopLevelBase;
  236. //The script flag this was loaded with
  237. LoadScriptFlag LoadFlag;
  238. };
  239. void ExtractTopLevelLoadedFunctionBodyInfo(TopLevelScriptLoadFunctionBodyResolveInfo* fbInfo, Js::FunctionBody* fb, uint32 topLevelCtr, Js::ModuleID moduleId, uint64 sourceContextId, bool isUtf8, const byte* source, uint32 sourceLen, LoadScriptFlag loadFlag, SlabAllocator& alloc);
  240. Js::FunctionBody* InflateTopLevelLoadedFunctionBodyInfo(const TopLevelScriptLoadFunctionBodyResolveInfo* fbInfo, Js::ScriptContext* ctx);
  241. void EmitTopLevelLoadedFunctionBodyInfo(const TopLevelScriptLoadFunctionBodyResolveInfo* fbInfo, ThreadContext* threadContext, FileWriter* writer, NSTokens::Separator separator);
  242. void ParseTopLevelLoadedFunctionBodyInfo(TopLevelScriptLoadFunctionBodyResolveInfo* fbInfo, bool readSeparator, ThreadContext* threadContext, FileReader* reader, SlabAllocator& alloc);
  243. #if ENABLE_SNAPSHOT_COMPARE
  244. void AssertSnapEquiv(const TopLevelScriptLoadFunctionBodyResolveInfo* fbInfo1, const TopLevelScriptLoadFunctionBodyResolveInfo* fbInfo2, TTDCompareMap& compareMap);
  245. #endif
  246. //A struct that we can use to resolve a top-level 'new Function' function bodies and info
  247. struct TopLevelNewFunctionBodyResolveInfo
  248. {
  249. //The base information for the top-level resolve info
  250. TopLevelCommonBodyResolveInfo TopLevelBase;
  251. };
  252. void ExtractTopLevelNewFunctionBodyInfo(TopLevelNewFunctionBodyResolveInfo* fbInfo, Js::FunctionBody* fb, uint32 topLevelCtr, Js::ModuleID moduleId, const char16* source, uint32 sourceLen, SlabAllocator& alloc);
  253. Js::FunctionBody* InflateTopLevelNewFunctionBodyInfo(const TopLevelNewFunctionBodyResolveInfo* fbInfo, Js::ScriptContext* ctx);
  254. void EmitTopLevelNewFunctionBodyInfo(const TopLevelNewFunctionBodyResolveInfo* fbInfo, ThreadContext* threadContext, FileWriter* writer, NSTokens::Separator separator);
  255. void ParseTopLevelNewFunctionBodyInfo(TopLevelNewFunctionBodyResolveInfo* fbInfo, bool readSeparator, ThreadContext* threadContext, FileReader* reader, SlabAllocator& alloc);
  256. #if ENABLE_SNAPSHOT_COMPARE
  257. void AssertSnapEquiv(const TopLevelNewFunctionBodyResolveInfo* fbInfo1, const TopLevelNewFunctionBodyResolveInfo* fbInfo2, TTDCompareMap& compareMap);
  258. #endif
  259. //A struct that we can use to resolve a top-level 'eval' function bodies and info
  260. struct TopLevelEvalFunctionBodyResolveInfo
  261. {
  262. //The base information for the top-level resolve info
  263. TopLevelCommonBodyResolveInfo TopLevelBase;
  264. //Additional data for handling the eval
  265. uint64 EvalFlags;
  266. bool RegisterDocument;
  267. bool IsIndirect;
  268. bool IsStrictMode;
  269. };
  270. void ExtractTopLevelEvalFunctionBodyInfo(TopLevelEvalFunctionBodyResolveInfo* fbInfo, Js::FunctionBody* fb, uint32 topLevelCtr, Js::ModuleID moduleId, const char16* source, uint32 sourceLen, uint32 grfscr, bool registerDocument, BOOL isIndirect, BOOL strictMode, SlabAllocator& alloc);
  271. Js::FunctionBody* InflateTopLevelEvalFunctionBodyInfo(const TopLevelEvalFunctionBodyResolveInfo* fbInfo, Js::ScriptContext* ctx);
  272. void EmitTopLevelEvalFunctionBodyInfo(const TopLevelEvalFunctionBodyResolveInfo* fbInfo, ThreadContext* threadContext, FileWriter* writer, NSTokens::Separator separator);
  273. void ParseTopLevelEvalFunctionBodyInfo(TopLevelEvalFunctionBodyResolveInfo* fbInfo, bool readSeparator, ThreadContext* threadContext, FileReader* reader, SlabAllocator& alloc);
  274. #if ENABLE_SNAPSHOT_COMPARE
  275. void AssertSnapEquiv(const TopLevelEvalFunctionBodyResolveInfo* fbInfo1, const TopLevelEvalFunctionBodyResolveInfo* fbInfo2, TTDCompareMap& compareMap);
  276. #endif
  277. //A struct that we can use to resolve a function body during inflation
  278. struct FunctionBodyResolveInfo
  279. {
  280. //The id this body is associated with
  281. TTD_PTR_ID FunctionBodyId;
  282. //The context this body is associated with
  283. TTD_LOG_PTR_ID ScriptContextLogId;
  284. //The string name of the function
  285. TTString FunctionName;
  286. //The known path to a function with the desired body
  287. TTD_WELLKNOWN_TOKEN OptKnownPath;
  288. //The ptr id of the parent function body
  289. TTD_PTR_ID OptParentBodyId;
  290. //The line number the function is def starts on
  291. int64 OptLine;
  292. //The column number the function is def starts on
  293. int64 OptColumn;
  294. //The (possibly empty) scope chain info
  295. SnapFunctionBodyScopeChain ScopeChainInfo;
  296. };
  297. void ExtractFunctionBodyInfo(FunctionBodyResolveInfo* fbInfo, Js::FunctionBody* fb, bool isWellKnown, SlabAllocator& alloc);
  298. void InflateFunctionBody(const FunctionBodyResolveInfo* fbInfo, InflateMap* inflator, const TTDIdentifierDictionary<TTD_PTR_ID, FunctionBodyResolveInfo*>& idToFbResolveMap);
  299. void EmitFunctionBodyInfo(const FunctionBodyResolveInfo* fbInfo, FileWriter* writer, NSTokens::Separator separator);
  300. void ParseFunctionBodyInfo(FunctionBodyResolveInfo* fbInfo, bool readSeparator, FileReader* reader, SlabAllocator& alloc);
  301. #if ENABLE_SNAPSHOT_COMPARE
  302. void AssertSnapEquiv(const FunctionBodyResolveInfo* fbInfo1, const FunctionBodyResolveInfo* fbInfo2, TTDCompareMap& compareMap);
  303. #endif
  304. //////////////////
  305. struct SnapRootInfoEntry
  306. {
  307. //The log id value
  308. TTD_LOG_PTR_ID LogId;
  309. //The object that this log id is mapped to
  310. TTD_PTR_ID LogObject;
  311. //True if the root maybe long lived/false otherwise
  312. bool MaybeLongLivedRoot;
  313. };
  314. struct SnapPendingAsyncBufferModification
  315. {
  316. //The log id value
  317. TTD_LOG_PTR_ID LogId;
  318. //The index value associated with this modification
  319. uint32 Index;
  320. };
  321. //A structure for serializing/tracking script contexts
  322. struct SnapContext
  323. {
  324. //The tag id of the script context (actually the global object associated with this context)
  325. TTD_LOG_PTR_ID ScriptContextLogId;
  326. //The random seed for the context
  327. bool IsPNRGSeeded;
  328. uint64 RandomSeed0;
  329. uint64 RandomSeed1;
  330. //The main URI of the context
  331. TTString ContextSRC;
  332. //A list of all *root* scripts that have been loaded into this context
  333. uint32 LoadedTopLevelScriptCount;
  334. TopLevelFunctionInContextRelation* LoadedTopLevelScriptArray;
  335. uint32 NewFunctionTopLevelScriptCount;
  336. TopLevelFunctionInContextRelation* NewFunctionTopLevelScriptArray;
  337. uint32 EvalTopLevelScriptCount;
  338. TopLevelFunctionInContextRelation* EvalTopLevelScriptArray;
  339. //A list of all the pending async buffer modifications
  340. uint32 PendingAsyncModCount;
  341. SnapPendingAsyncBufferModification* PendingAsyncModArray;
  342. };
  343. void ExtractScriptContext(SnapContext* snapCtx, Js::ScriptContext* ctx, const JsUtil::BaseDictionary<Js::RecyclableObject*, TTD_LOG_PTR_ID, HeapAllocator>& objToLogIdMap, const JsUtil::BaseHashSet<Js::FunctionBody*, HeapAllocator>& liveTopLevelBodies, SlabAllocator& alloc);
  344. void InflateScriptContext(const SnapContext* snpCtx, Js::ScriptContext* intoCtx, InflateMap* inflator,
  345. const TTDIdentifierDictionary<uint64, TopLevelScriptLoadFunctionBodyResolveInfo*>& topLevelLoadScriptMap,
  346. const TTDIdentifierDictionary<uint64, TopLevelNewFunctionBodyResolveInfo*>& topLevelNewScriptMap,
  347. const TTDIdentifierDictionary<uint64, TopLevelEvalFunctionBodyResolveInfo*>& topLevelEvalScriptMap);
  348. void ResetPendingAsyncBufferModInfo(const SnapContext* snpCtx, Js::ScriptContext* intoCtx, InflateMap* inflator);
  349. void EmitSnapContext(const SnapContext* snapCtx, FileWriter* writer, NSTokens::Separator separator);
  350. void ParseSnapContext(SnapContext* intoCtx, bool readSeparator, FileReader* reader, SlabAllocator& alloc);
  351. #if ENABLE_SNAPSHOT_COMPARE
  352. void AssertSnapEquiv(const SnapContext* snapCtx1, const SnapContext* snapCtx2, const JsUtil::BaseDictionary<TTD_LOG_PTR_ID, NSSnapValues::SnapRootInfoEntry*, HeapAllocator>& allRootMap1, const JsUtil::BaseDictionary<TTD_LOG_PTR_ID, NSSnapValues::SnapRootInfoEntry*, HeapAllocator>& allRootMap2, TTDCompareMap& compareMap);
  353. #endif
  354. }
  355. }
  356. #endif