Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
ttd: adding ttd tracking logic to aliased_buffer
Browse files Browse the repository at this point in the history
Whenever state modifications happen outside of JSRT API calls, we need
to to track them to for TTD to correctly track state.  This change
updates aliased_buffer's SetValue() method to do the correct TTD
tracking.

PR-URL: #397
Reviewed-By: Mark Marron <marron@microsoft.com>
  • Loading branch information
Mike Kaufman authored and MSLaguana committed Sep 26, 2017
1 parent 96ec109 commit a838d66
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 12 deletions.
3 changes: 2 additions & 1 deletion node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@
'src/base-object-inl.h',
'src/connection_wrap.h',
'src/connect_wrap.h',
'src/chakra_ttd.h',
'src/env.h',
'src/env-inl.h',
'src/handle_wrap.h',
Expand Down Expand Up @@ -856,4 +857,4 @@
], # end targets
}], # end aix section
], # end conditions block
}
}
9 changes: 9 additions & 0 deletions src/aliased_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#ifndef SRC_ALIASED_BUFFER_H_
#define SRC_ALIASED_BUFFER_H_

#include "chakra_ttd.h"
#include "v8.h"
#include "util.h"
#include "util-inl.h"
Expand Down Expand Up @@ -164,6 +165,14 @@ class AliasedBuffer {
CHECK_LT(index, count_);
#endif
buffer_[index] = value;

#if defined(ENABLE_TTD_NODE) && ENABLE_TTD_NODE
if (s_doTTRecord || s_doTTReplay) {
const int modlength = count_ * sizeof(NativeT);
GetArrayBuffer()->TTDRawBufferModifyNotifySync(byte_offset_, modlength);
}
#endif

}

/**
Expand Down
16 changes: 16 additions & 0 deletions src/chakra_ttd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef SRC_CHAKRA_TTD_H_
#define SRC_CHAKRA_TTD_H_

#if defined(NODE_ENGINE_CHAKRACORE)
#define ENABLE_TTD_NODE 1
#else
#define ENABLE_TTD_NODE 0
#endif

#if defined(ENABLE_TTD_NODE) && ENABLE_TTD_NODE
extern bool s_doTTRecord;
extern bool s_doTTReplay;
extern bool s_doTTDebug;
#endif

#endif // SRC_CHAKRA_TTD_H_
12 changes: 1 addition & 11 deletions src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,7 @@
// Forward-declare libuv loop
struct uv_loop_s;

#if defined(NODE_ENGINE_CHAKRACORE)
#define ENABLE_TTD_NODE 1
#else
#define ENABLE_TTD_NODE 0
#endif

#if ENABLE_TTD_NODE
extern bool s_doTTRecord;
extern bool s_doTTReplay;
extern bool s_doTTDebug;
#endif
#include "chakra_ttd.h"

// Forward-declare these functions now to stop MSVS from becoming
// terminally confused when it's done in node_internals.h
Expand Down

0 comments on commit a838d66

Please sign in to comment.