| 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 : public AllStatic { | 13 class Snapshot : public AllStatic { |
| 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 // Create a new context using the internal partial snapshot. | 18 // Create a new context using the internal partial snapshot. |
| 19 static Handle<Context> NewContextFromSnapshot(Isolate* isolate); | 19 static MaybeHandle<Context> NewContextFromSnapshot( |
| 20 Isolate* isolate, Handle<FixedArray>* outdated_contexts_out); |
| 20 | 21 |
| 21 static bool HaveASnapshotToStartFrom(); | 22 static bool HaveASnapshotToStartFrom(); |
| 22 | 23 |
| 23 // To be implemented by the snapshot source. | 24 // To be implemented by the snapshot source. |
| 24 static const v8::StartupData SnapshotBlob(); | 25 static const v8::StartupData SnapshotBlob(); |
| 25 | 26 |
| 26 static v8::StartupData CreateSnapshotBlob( | 27 static v8::StartupData CreateSnapshotBlob( |
| 27 const Vector<const byte> startup_data, | 28 const Vector<const byte> startup_data, |
| 28 const Vector<const byte> context_data); | 29 const Vector<const byte> context_data); |
| 29 | 30 |
| 30 static Vector<const byte> ExtractStartupData(const v8::StartupData* data); | 31 static Vector<const byte> ExtractStartupData(const v8::StartupData* data); |
| 31 static Vector<const byte> ExtractContextData(const v8::StartupData* data); | 32 static Vector<const byte> ExtractContextData(const v8::StartupData* data); |
| 32 | 33 |
| 33 private: | 34 private: |
| 34 DISALLOW_IMPLICIT_CONSTRUCTORS(Snapshot); | 35 DISALLOW_IMPLICIT_CONSTRUCTORS(Snapshot); |
| 35 }; | 36 }; |
| 36 | 37 |
| 37 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 38 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 38 void SetSnapshotFromFile(StartupData* snapshot_blob); | 39 void SetSnapshotFromFile(StartupData* snapshot_blob); |
| 39 #endif | 40 #endif |
| 40 | 41 |
| 41 } } // namespace v8::internal | 42 } } // namespace v8::internal |
| 42 | 43 |
| 43 #endif // V8_SNAPSHOT_H_ | 44 #endif // V8_SNAPSHOT_H_ |
| OLD | NEW |