Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Unified Diff: src/regexp-stack.cc

Issue 13932006: Replace OS::MemCopy with OS::MemMove (just as fast but more flexible). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/regexp-macro-assembler-irregexp.cc ('k') | src/scanner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/regexp-stack.cc
diff --git a/src/regexp-stack.cc b/src/regexp-stack.cc
index 325a1496c98c9a26d05c9fffc1c97be132e401f0..fc4114af5de202d49507b9be3a1902c43b3d1881 100644
--- a/src/regexp-stack.cc
+++ b/src/regexp-stack.cc
@@ -57,9 +57,7 @@ RegExpStack::~RegExpStack() {
char* RegExpStack::ArchiveStack(char* to) {
size_t size = sizeof(thread_local_);
- memcpy(reinterpret_cast<void*>(to),
- &thread_local_,
- size);
+ OS::MemCopy(reinterpret_cast<void*>(to), &thread_local_, size);
thread_local_ = ThreadLocal();
return to + size;
}
@@ -67,7 +65,7 @@ char* RegExpStack::ArchiveStack(char* to) {
char* RegExpStack::RestoreStack(char* from) {
size_t size = sizeof(thread_local_);
- memcpy(&thread_local_, reinterpret_cast<void*>(from), size);
+ OS::MemCopy(&thread_local_, reinterpret_cast<void*>(from), size);
return from + size;
}
@@ -95,10 +93,11 @@ Address RegExpStack::EnsureCapacity(size_t size) {
Address new_memory = NewArray<byte>(static_cast<int>(size));
if (thread_local_.memory_size_ > 0) {
// Copy original memory into top of new memory.
- memcpy(reinterpret_cast<void*>(
- new_memory + size - thread_local_.memory_size_),
- reinterpret_cast<void*>(thread_local_.memory_),
- thread_local_.memory_size_);
+ OS::MemCopy(
+ reinterpret_cast<void*>(
+ new_memory + size - thread_local_.memory_size_),
+ reinterpret_cast<void*>(thread_local_.memory_),
+ thread_local_.memory_size_);
DeleteArray(thread_local_.memory_);
}
thread_local_.memory_ = new_memory;
« no previous file with comments | « src/regexp-macro-assembler-irregexp.cc ('k') | src/scanner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698