OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |