OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 #include "src/isolate.h" | 5 #include "src/isolate.h" |
6 | 6 |
7 #ifndef V8_SNAPSHOT_H_ | 7 #ifndef V8_SNAPSHOT_H_ |
8 #define V8_SNAPSHOT_H_ | 8 #define V8_SNAPSHOT_H_ |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 | 12 |
13 class Snapshot { | 13 class Snapshot { |
14 public: | 14 public: |
15 // Initialize the Isolate from the internal snapshot. Returns false if no | 15 // Initialize the Isolate from the internal snapshot. Returns false if no |
16 // snapshot could be found. | 16 // snapshot could be found. |
17 static bool Initialize(Isolate* isolate); | 17 static bool Initialize(Isolate* isolate); |
18 | 18 |
19 static bool HaveASnapshotToStartFrom(); | 19 static bool HaveASnapshotToStartFrom(); |
20 | 20 |
21 // Create a new context using the internal partial snapshot. | 21 // Create a new context using the internal partial snapshot. |
22 static Handle<Context> NewContextFromSnapshot(Isolate* isolate); | 22 static Handle<Context> NewContextFromSnapshot(Isolate* isolate); |
23 | 23 |
24 private: | 24 private: |
25 static const byte data_[]; | 25 static const byte data_[]; |
| 26 static const byte* raw_data_; |
| 27 static const byte context_data_[]; |
| 28 static const byte* context_raw_data_; |
| 29 static const int new_space_used_; |
| 30 static const int pointer_space_used_; |
| 31 static const int data_space_used_; |
| 32 static const int code_space_used_; |
| 33 static const int map_space_used_; |
| 34 static const int cell_space_used_; |
| 35 static const int property_cell_space_used_; |
| 36 static const int lo_space_used_; |
| 37 static const int context_new_space_used_; |
| 38 static const int context_pointer_space_used_; |
| 39 static const int context_data_space_used_; |
| 40 static const int context_code_space_used_; |
| 41 static const int context_map_space_used_; |
| 42 static const int context_cell_space_used_; |
| 43 static const int context_property_cell_space_used_; |
| 44 static const int context_lo_space_used_; |
26 static const int size_; | 45 static const int size_; |
27 static const byte context_data_[]; | 46 static const int raw_size_; |
28 static const int context_size_; | 47 static const int context_size_; |
| 48 static const int context_raw_size_; |
| 49 |
| 50 static void ReserveSpaceForLinkedInSnapshot(Deserializer* deserializer); |
29 | 51 |
30 DISALLOW_IMPLICIT_CONSTRUCTORS(Snapshot); | 52 DISALLOW_IMPLICIT_CONSTRUCTORS(Snapshot); |
31 }; | 53 }; |
32 | 54 |
33 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 55 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
34 void SetSnapshotFromFile(StartupData* snapshot_blob); | 56 void SetSnapshotFromFile(StartupData* snapshot_blob); |
35 #endif | 57 #endif |
36 | 58 |
37 } } // namespace v8::internal | 59 } } // namespace v8::internal |
38 | 60 |
39 #endif // V8_SNAPSHOT_H_ | 61 #endif // V8_SNAPSHOT_H_ |
OLD | NEW |