| 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 VM from the internal snapshot. Returns false if no snapshot | 15 // Initialize the Isolate from the internal snapshot. Returns false if no |
| 16 // could be found. | 16 // snapshot could be found. |
| 17 static bool Initialize(); | 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 // These methods support COMPRESS_STARTUP_DATA_BZ2. | 24 // These methods support COMPRESS_STARTUP_DATA_BZ2. |
| 25 static const byte* data() { return data_; } | 25 static const byte* data() { return data_; } |
| 26 static int size() { return size_; } | 26 static int size() { return size_; } |
| 27 static int raw_size() { return raw_size_; } | 27 static int raw_size() { return raw_size_; } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 DISALLOW_IMPLICIT_CONSTRUCTORS(Snapshot); | 65 DISALLOW_IMPLICIT_CONSTRUCTORS(Snapshot); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 68 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 69 void SetSnapshotFromFile(StartupData* snapshot_blob); | 69 void SetSnapshotFromFile(StartupData* snapshot_blob); |
| 70 #endif | 70 #endif |
| 71 | 71 |
| 72 } } // namespace v8::internal | 72 } } // namespace v8::internal |
| 73 | 73 |
| 74 #endif // V8_SNAPSHOT_H_ | 74 #endif // V8_SNAPSHOT_H_ |
| OLD | NEW |