summaryrefslogtreecommitdiff
path: root/deps/v8/src/utils.h
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2010-04-14 10:34:17 -0700
committerRyan Dahl <ry@tinyclouds.org>2010-04-14 10:34:27 -0700
commit41ef1717e096a9e1761efa0df97c395f59c51f16 (patch)
tree7e854284ef8ce5189a63074857a408b6eea5a9cb /deps/v8/src/utils.h
parent760bba55186eba039ca00e532f7813d2aea450a2 (diff)
downloadnode-new-41ef1717e096a9e1761efa0df97c395f59c51f16.tar.gz
Upgrade V8 to 2.2.3.1
Diffstat (limited to 'deps/v8/src/utils.h')
-rw-r--r--deps/v8/src/utils.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/deps/v8/src/utils.h b/deps/v8/src/utils.h
index 8ff1f9b1c8..fa249475ae 100644
--- a/deps/v8/src/utils.h
+++ b/deps/v8/src/utils.h
@@ -597,6 +597,27 @@ static inline void MemsetPointer(T** dest, T* value, int counter) {
}
+// Copies data from |src| to |dst|. The data spans MUST not overlap.
+inline void CopyWords(Object** dst, Object** src, int num_words) {
+ ASSERT(Min(dst, src) + num_words <= Max(dst, src));
+ ASSERT(num_words > 0);
+
+ // Use block copying memcpy if the segment we're copying is
+ // enough to justify the extra call/setup overhead.
+ static const int kBlockCopyLimit = 16;
+
+ if (num_words >= kBlockCopyLimit) {
+ memcpy(dst, src, num_words * kPointerSize);
+ } else {
+ int remaining = num_words;
+ do {
+ remaining--;
+ *dst++ = *src++;
+ } while (remaining > 0);
+ }
+}
+
+
// Calculate 10^exponent.
int TenToThe(int exponent);
@@ -636,7 +657,7 @@ inline Dest BitCast(const Source& source) {
return dest;
}
-
} } // namespace v8::internal
+
#endif // V8_UTILS_H_