Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bin/ch/ChakraRtInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ struct JsAPIHooks
typedef JsErrorCode(WINAPI *JsrtTTDNotifyYieldPtr)();
typedef JsErrorCode(WINAPI *JsrtTTDHostExitPtr)(int statusCode);

typedef JsErrorCode(WINAPI *JsrtTTDGetSnapTimeTopLevelEventMovePtr)(JsRuntimeHandle runtimeHandle, JsTTDMoveMode moveMode, int64_t* targetEventTime, int64_t* targetStartSnapTime, int64_t* targetEndSnapTime);
typedef JsErrorCode(WINAPI *JsrtTTDGetSnapTimeTopLevelEventMovePtr)(JsRuntimeHandle runtimeHandle, JsTTDMoveMode moveMode, uint32_t kthEvent, int64_t* targetEventTime, int64_t* targetStartSnapTime, int64_t* targetEndSnapTime);
typedef JsErrorCode(WINAPI *JsrtTTDMoveToTopLevelEventPtr)(JsRuntimeHandle runtimeHandle, JsTTDMoveMode moveMode, int64_t snapshotStartTime, int64_t eventTime);
typedef JsErrorCode(WINAPI *JsrtTTDReplayExecutionPtr)(JsTTDMoveMode* moveMode, int64_t* rootEventTime);

Expand Down Expand Up @@ -360,7 +360,7 @@ class ChakraRTInterface
static JsErrorCode WINAPI JsTTDNotifyYield() { return HOOK_JS_API(TTDNotifyYield()); }
static JsErrorCode WINAPI JsTTDHostExit(int statusCode) { return HOOK_JS_API(TTDHostExit(statusCode)); }

static JsErrorCode WINAPI JsTTDGetSnapTimeTopLevelEventMove(JsRuntimeHandle runtimeHandle, JsTTDMoveMode moveMode, int64_t* targetEventTime, int64_t* targetStartSnapTime, int64_t* targetEndSnapTime) { return HOOK_JS_API(TTDGetSnapTimeTopLevelEventMove(runtimeHandle, moveMode, targetEventTime, targetStartSnapTime, targetEndSnapTime)); }
static JsErrorCode WINAPI JsTTDGetSnapTimeTopLevelEventMove(JsRuntimeHandle runtimeHandle, JsTTDMoveMode moveMode, uint32_t kthEvent, int64_t* targetEventTime, int64_t* targetStartSnapTime, int64_t* targetEndSnapTime) { return HOOK_JS_API(TTDGetSnapTimeTopLevelEventMove(runtimeHandle, moveMode, kthEvent, targetEventTime, targetStartSnapTime, targetEndSnapTime)); }
static JsErrorCode WINAPI JsTTDMoveToTopLevelEvent(JsRuntimeHandle runtimeHandle, JsTTDMoveMode moveMode, int64_t snapshotStartTime, int64_t eventTime) { return HOOK_JS_API(TTDMoveToTopLevelEvent(runtimeHandle, moveMode, snapshotStartTime, eventTime)); }
static JsErrorCode WINAPI JsTTDReplayExecution(JsTTDMoveMode* moveMode, int64_t* rootEventTime) { return HOOK_JS_API(TTDReplayExecution(moveMode, rootEventTime)); }

Expand Down
4 changes: 2 additions & 2 deletions bin/ch/ch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,13 @@ HRESULT RunScript(const char* fileName, LPCSTR fileContents, BYTE *bcBuffer, cha

try
{
JsTTDMoveMode moveMode = (JsTTDMoveMode)(JsTTDMoveMode::JsTTDMoveKthEvent | ((int64) startEventCount) << 32);
JsTTDMoveMode moveMode = JsTTDMoveMode::JsTTDMoveKthEvent;
int64_t snapEventTime = -1;
int64_t nextEventTime = -2;

while(true)
{
JsErrorCode error = ChakraRTInterface::JsTTDGetSnapTimeTopLevelEventMove(chRuntime, moveMode, &nextEventTime, &snapEventTime, nullptr);
JsErrorCode error = ChakraRTInterface::JsTTDGetSnapTimeTopLevelEventMove(chRuntime, moveMode, startEventCount, &nextEventTime, &snapEventTime, nullptr);

if(error != JsNoError)
{
Expand Down
5 changes: 3 additions & 2 deletions lib/Jsrt/ChakraCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ typedef BYTE* ChakraBytePtr;
#define CHAKRA_API extern "C" SET_API_VISIBILITY JsErrorCode
#else
#define CHAKRA_API extern SET_API_VISIBILITY JsErrorCode
#include <stdbool.h>
#endif

#include <stddef.h> // for size_t
Expand Down Expand Up @@ -321,7 +322,7 @@ typedef UINT32 DWORD;
/// <summary>
/// An invalid runtime handle.
/// </summary>
const JsRuntimeHandle JS_INVALID_RUNTIME_HANDLE = nullptr;
const JsRuntimeHandle JS_INVALID_RUNTIME_HANDLE = 0;

/// <summary>
/// A reference to an object owned by the Chakra garbage collector.
Expand All @@ -338,7 +339,7 @@ typedef UINT32 DWORD;
/// <summary>
/// An invalid reference.
/// </summary>
const JsRef JS_INVALID_REFERENCE = nullptr;
const JsRef JS_INVALID_REFERENCE = 0;

/// <summary>
/// A reference to a script context.
Expand Down
4 changes: 3 additions & 1 deletion lib/Jsrt/ChakraDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ typedef __int64 int64_t;
/// <summary>
/// TimeTravel move options as bit flag enum.
/// </summary>
typedef enum _JsTTDMoveModes : int64_t
typedef enum _JsTTDMoveModes
{
/// <summary>
/// Indicates no special actions needed for move.
Expand Down Expand Up @@ -966,13 +966,15 @@ typedef __int64 int64_t;
/// </summary>
/// <param name="runtimeHandle">The runtime handle that the script is executing in.</param>
/// <param name="moveMode">Flags controlling the way the move it performed and how other parameters are interpreted.</param>
/// <param name="kthEvent">When <c>moveMode == JsTTDMoveKthEvent</c> indicates which event, otherwise this parameter is ignored.</param>
/// <param name="targetEventTime">The event time we want to move to or -1 if not relevant.</param>
/// <param name="targetStartSnapTime">Out parameter with the event time of the snapshot that we should inflate from.</param>
/// <param name="targetEndSnapTime">Optional Out parameter with the snapshot time following the event.</param>
/// <returns>The code <c>JsNoError</c> if the operation succeeded, a failure code otherwise.</returns>
CHAKRA_API JsTTDGetSnapTimeTopLevelEventMove(
_In_ JsRuntimeHandle runtimeHandle,
_In_ JsTTDMoveMode moveMode,
_In_opt_ uint32_t kthEvent,
_Inout_ int64_t* targetEventTime,
_Out_ int64_t* targetStartSnapTime,
_Out_opt_ int64_t* targetEndSnapTime);
Expand Down
6 changes: 3 additions & 3 deletions lib/Jsrt/Jsrt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3742,8 +3742,9 @@ CHAKRA_API JsTTDCheckAndAssertIfTTDRunning(_In_ const char* msg)
}

CHAKRA_API JsTTDGetSnapTimeTopLevelEventMove(_In_ JsRuntimeHandle runtimeHandle,
_In_ JsTTDMoveMode moveMode, _Inout_ int64_t* targetEventTime,
_Out_ int64_t* targetStartSnapTime, _Out_opt_ int64_t* targetEndSnapTime)
_In_ JsTTDMoveMode moveMode, _In_opt_ uint32_t kthEvent,
_Inout_ int64_t* targetEventTime, _Out_ int64_t* targetStartSnapTime,
_Out_opt_ int64_t* targetEndSnapTime)
{
#if !ENABLE_TTD
return JsErrorCategoryUsage;
Expand Down Expand Up @@ -3778,7 +3779,6 @@ CHAKRA_API JsTTDGetSnapTimeTopLevelEventMove(_In_ JsRuntimeHandle runtimeHandle,
}
else if((moveMode & JsTTDMoveMode::JsTTDMoveKthEvent) == JsTTDMoveMode::JsTTDMoveKthEvent)
{
uint32 kthEvent = (uint32)(((int64)moveMode) >> 32);
*targetEventTime = threadContext->TTDLog->GetKthEventTimeInLog(kthEvent);
if(*targetEventTime == -1)
{
Expand Down