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

Side by Side Diff: src/regexp-macro-assembler-irregexp.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/prettyprinter.cc ('k') | src/regexp-stack.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2008-2009 the V8 project authors. All rights reserved. 1 // Copyright 2008-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 return array; 472 return array;
473 } 473 }
474 474
475 475
476 int RegExpMacroAssemblerIrregexp::length() { 476 int RegExpMacroAssemblerIrregexp::length() {
477 return pc_; 477 return pc_;
478 } 478 }
479 479
480 480
481 void RegExpMacroAssemblerIrregexp::Copy(Address a) { 481 void RegExpMacroAssemblerIrregexp::Copy(Address a) {
482 memcpy(a, buffer_.start(), length()); 482 OS::MemCopy(a, buffer_.start(), length());
483 } 483 }
484 484
485 485
486 void RegExpMacroAssemblerIrregexp::Expand() { 486 void RegExpMacroAssemblerIrregexp::Expand() {
487 bool old_buffer_was_our_own = own_buffer_; 487 bool old_buffer_was_our_own = own_buffer_;
488 Vector<byte> old_buffer = buffer_; 488 Vector<byte> old_buffer = buffer_;
489 buffer_ = Vector<byte>::New(old_buffer.length() * 2); 489 buffer_ = Vector<byte>::New(old_buffer.length() * 2);
490 own_buffer_ = true; 490 own_buffer_ = true;
491 memcpy(buffer_.start(), old_buffer.start(), old_buffer.length()); 491 OS::MemCopy(buffer_.start(), old_buffer.start(), old_buffer.length());
492 if (old_buffer_was_our_own) { 492 if (old_buffer_was_our_own) {
493 old_buffer.Dispose(); 493 old_buffer.Dispose();
494 } 494 }
495 } 495 }
496 496
497 #endif // V8_INTERPRETED_REGEXP 497 #endif // V8_INTERPRETED_REGEXP
498 498
499 } } // namespace v8::internal 499 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/prettyprinter.cc ('k') | src/regexp-stack.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698