OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_SERIALIZE_H_ | 5 #ifndef V8_SERIALIZE_H_ |
6 #define V8_SERIALIZE_H_ | 6 #define V8_SERIALIZE_H_ |
7 | 7 |
8 #include "hashmap.h" | 8 #include "hashmap.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 Advance(bytes); | 276 Advance(bytes); |
277 uint32_t mask = 0xffffffffu; | 277 uint32_t mask = 0xffffffffu; |
278 mask >>= 32 - (bytes << 3); | 278 mask >>= 32 - (bytes << 3); |
279 answer &= mask; | 279 answer &= mask; |
280 answer >>= 2; | 280 answer >>= 2; |
281 return answer; | 281 return answer; |
282 } | 282 } |
283 | 283 |
284 | 284 |
285 void SnapshotByteSource::CopyRaw(byte* to, int number_of_bytes) { | 285 void SnapshotByteSource::CopyRaw(byte* to, int number_of_bytes) { |
286 OS::MemCopy(to, data_ + position_, number_of_bytes); | 286 MemCopy(to, data_ + position_, number_of_bytes); |
287 position_ += number_of_bytes; | 287 position_ += number_of_bytes; |
288 } | 288 } |
289 | 289 |
290 | 290 |
291 // A Deserializer reads a snapshot and reconstructs the Object graph it defines. | 291 // A Deserializer reads a snapshot and reconstructs the Object graph it defines. |
292 class Deserializer: public SerializerDeserializer { | 292 class Deserializer: public SerializerDeserializer { |
293 public: | 293 public: |
294 // Create a deserializer from a snapshot byte source. | 294 // Create a deserializer from a snapshot byte source. |
295 explicit Deserializer(SnapshotByteSource* source); | 295 explicit Deserializer(SnapshotByteSource* source); |
296 | 296 |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 private: | 629 private: |
630 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { | 630 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { |
631 return false; | 631 return false; |
632 } | 632 } |
633 }; | 633 }; |
634 | 634 |
635 | 635 |
636 } } // namespace v8::internal | 636 } } // namespace v8::internal |
637 | 637 |
638 #endif // V8_SERIALIZE_H_ | 638 #endif // V8_SERIALIZE_H_ |
OLD | NEW |