OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_SNAPSHOT_SERIALIZER_H_ | 5 #ifndef V8_SNAPSHOT_SERIALIZER_H_ |
6 #define V8_SNAPSHOT_SERIALIZER_H_ | 6 #define V8_SNAPSHOT_SERIALIZER_H_ |
7 | 7 |
8 #include "src/isolate.h" | 8 #include "src/isolate.h" |
9 #include "src/log.h" | 9 #include "src/log.h" |
10 #include "src/objects.h" | 10 #include "src/objects.h" |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 WhereToPoint where_to_point) | 274 WhereToPoint where_to_point) |
275 : serializer_(serializer), | 275 : serializer_(serializer), |
276 object_(obj), | 276 object_(obj), |
277 sink_(sink), | 277 sink_(sink), |
278 reference_representation_(how_to_code + where_to_point), | 278 reference_representation_(how_to_code + where_to_point), |
279 bytes_processed_so_far_(0), | 279 bytes_processed_so_far_(0), |
280 code_has_been_output_(false) {} | 280 code_has_been_output_(false) {} |
281 ~ObjectSerializer() override {} | 281 ~ObjectSerializer() override {} |
282 void Serialize(); | 282 void Serialize(); |
283 void SerializeDeferred(); | 283 void SerializeDeferred(); |
284 void VisitPointers(Object** start, Object** end) override; | 284 void VisitPointers(HeapObject* host, Object** start, Object** end) override; |
285 void VisitEmbeddedPointer(RelocInfo* target) override; | 285 void VisitEmbeddedPointer(Code* host, RelocInfo* target) override; |
286 void VisitExternalReference(Address* p) override; | 286 void VisitExternalReference(Foreign* host, Address* p) override; |
287 void VisitExternalReference(RelocInfo* rinfo) override; | 287 void VisitExternalReference(Code* host, RelocInfo* rinfo) override; |
288 void VisitInternalReference(RelocInfo* rinfo) override; | 288 void VisitInternalReference(Code* host, RelocInfo* rinfo) override; |
289 void VisitCodeTarget(RelocInfo* target) override; | 289 void VisitCodeTarget(Code* host, RelocInfo* target) override; |
290 void VisitCodeEntry(Address entry_address) override; | 290 void VisitCodeEntry(JSFunction* host, Address entry_address) override; |
291 void VisitCell(RelocInfo* rinfo) override; | 291 void VisitCell(Code* host, RelocInfo* rinfo) override; |
292 void VisitRuntimeEntry(RelocInfo* reloc) override; | 292 void VisitRuntimeEntry(Code* host, RelocInfo* reloc) override; |
293 | 293 |
294 private: | 294 private: |
295 bool TryEncodeDeoptimizationEntry(HowToCode how_to_code, Address target, | 295 bool TryEncodeDeoptimizationEntry(HowToCode how_to_code, Address target, |
296 int skip); | 296 int skip); |
297 void SerializePrologue(AllocationSpace space, int size, Map* map); | 297 void SerializePrologue(AllocationSpace space, int size, Map* map); |
298 | 298 |
299 | 299 |
300 enum ReturnSkip { kCanReturnSkipInsteadOfSkipping, kIgnoringReturn }; | 300 enum ReturnSkip { kCanReturnSkipInsteadOfSkipping, kIgnoringReturn }; |
301 // This function outputs or skips the raw data between the last pointer and | 301 // This function outputs or skips the raw data between the last pointer and |
302 // up to the current position. It optionally can just return the number of | 302 // up to the current position. It optionally can just return the number of |
(...skipping 14 matching lines...) Expand all Loading... |
317 SnapshotByteSink* sink_; | 317 SnapshotByteSink* sink_; |
318 int reference_representation_; | 318 int reference_representation_; |
319 int bytes_processed_so_far_; | 319 int bytes_processed_so_far_; |
320 bool code_has_been_output_; | 320 bool code_has_been_output_; |
321 }; | 321 }; |
322 | 322 |
323 } // namespace internal | 323 } // namespace internal |
324 } // namespace v8 | 324 } // namespace v8 |
325 | 325 |
326 #endif // V8_SNAPSHOT_SERIALIZER_H_ | 326 #endif // V8_SNAPSHOT_SERIALIZER_H_ |
OLD | NEW |