| 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 "src/compiler.h" | 8 #include "src/compiler.h" |
| 9 #include "src/hashmap.h" | 9 #include "src/hashmap.h" |
| 10 #include "src/heap-profiler.h" | 10 #include "src/heap-profiler.h" |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 // Used for seralizing the external strings that hold the natives source. | 432 // Used for seralizing the external strings that hold the natives source. |
| 433 void VisitExternalOneByteString( | 433 void VisitExternalOneByteString( |
| 434 v8::String::ExternalOneByteStringResource** resource); | 434 v8::String::ExternalOneByteStringResource** resource); |
| 435 // We can't serialize a heap with external two byte strings. | 435 // We can't serialize a heap with external two byte strings. |
| 436 void VisitExternalTwoByteString( | 436 void VisitExternalTwoByteString( |
| 437 v8::String::ExternalStringResource** resource) { | 437 v8::String::ExternalStringResource** resource) { |
| 438 UNREACHABLE(); | 438 UNREACHABLE(); |
| 439 } | 439 } |
| 440 | 440 |
| 441 private: | 441 private: |
| 442 void SerializePrologue(int space, int size, Map* map); |
| 443 |
| 442 enum ReturnSkip { kCanReturnSkipInsteadOfSkipping, kIgnoringReturn }; | 444 enum ReturnSkip { kCanReturnSkipInsteadOfSkipping, kIgnoringReturn }; |
| 443 // This function outputs or skips the raw data between the last pointer and | 445 // This function outputs or skips the raw data between the last pointer and |
| 444 // up to the current position. It optionally can just return the number of | 446 // up to the current position. It optionally can just return the number of |
| 445 // bytes to skip instead of performing a skip instruction, in case the skip | 447 // bytes to skip instead of performing a skip instruction, in case the skip |
| 446 // can be merged into the next instruction. | 448 // can be merged into the next instruction. |
| 447 int OutputRawData(Address up_to, ReturnSkip return_skip = kIgnoringReturn); | 449 int OutputRawData(Address up_to, ReturnSkip return_skip = kIgnoringReturn); |
| 450 // External strings are serialized in a way to resemble sequential strings. |
| 451 void SerializeExternalString(); |
| 448 | 452 |
| 449 Serializer* serializer_; | 453 Serializer* serializer_; |
| 450 HeapObject* object_; | 454 HeapObject* object_; |
| 451 SnapshotByteSink* sink_; | 455 SnapshotByteSink* sink_; |
| 452 int reference_representation_; | 456 int reference_representation_; |
| 453 int bytes_processed_so_far_; | 457 int bytes_processed_so_far_; |
| 454 bool code_object_; | 458 bool code_object_; |
| 455 bool code_has_been_output_; | 459 bool code_has_been_output_; |
| 456 }; | 460 }; |
| 457 | 461 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 // Following the header, we store, in sequential order | 707 // Following the header, we store, in sequential order |
| 704 // - code stub keys | 708 // - code stub keys |
| 705 // - serialization payload | 709 // - serialization payload |
| 706 | 710 |
| 707 ScriptData* script_data_; | 711 ScriptData* script_data_; |
| 708 bool owns_script_data_; | 712 bool owns_script_data_; |
| 709 }; | 713 }; |
| 710 } } // namespace v8::internal | 714 } } // namespace v8::internal |
| 711 | 715 |
| 712 #endif // V8_SERIALIZE_H_ | 716 #endif // V8_SERIALIZE_H_ |
| OLD | NEW |