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

Side by Side Diff: src/serialize.h

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/scanner.h ('k') | src/string-stream.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 Advance(bytes); 304 Advance(bytes);
305 uint32_t mask = 0xffffffffu; 305 uint32_t mask = 0xffffffffu;
306 mask >>= 32 - (bytes << 3); 306 mask >>= 32 - (bytes << 3);
307 answer &= mask; 307 answer &= mask;
308 answer >>= 2; 308 answer >>= 2;
309 return answer; 309 return answer;
310 } 310 }
311 311
312 312
313 void SnapshotByteSource::CopyRaw(byte* to, int number_of_bytes) { 313 void SnapshotByteSource::CopyRaw(byte* to, int number_of_bytes) {
314 memcpy(to, data_ + position_, number_of_bytes); 314 OS::MemCopy(to, data_ + position_, number_of_bytes);
315 position_ += number_of_bytes; 315 position_ += number_of_bytes;
316 } 316 }
317 317
318 318
319 // A Deserializer reads a snapshot and reconstructs the Object graph it defines. 319 // A Deserializer reads a snapshot and reconstructs the Object graph it defines.
320 class Deserializer: public SerializerDeserializer { 320 class Deserializer: public SerializerDeserializer {
321 public: 321 public:
322 // Create a deserializer from a snapshot byte source. 322 // Create a deserializer from a snapshot byte source.
323 explicit Deserializer(SnapshotByteSource* source); 323 explicit Deserializer(SnapshotByteSource* source);
324 324
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 private: 654 private:
655 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { 655 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) {
656 return false; 656 return false;
657 } 657 }
658 }; 658 };
659 659
660 660
661 } } // namespace v8::internal 661 } } // namespace v8::internal
662 662
663 #endif // V8_SERIALIZE_H_ 663 #endif // V8_SERIALIZE_H_
OLDNEW
« no previous file with comments | « src/scanner.h ('k') | src/string-stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698