| 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 #ifndef V8_SNAPSHOT_SNAPSHOT_H_ | 5 #ifndef V8_SNAPSHOT_SNAPSHOT_H_ |
| 6 #define V8_SNAPSHOT_SNAPSHOT_H_ | 6 #define V8_SNAPSHOT_SNAPSHOT_H_ |
| 7 | 7 |
| 8 #include "src/isolate.h" | |
| 9 #include "src/snapshot/serialize.h" | 8 #include "src/snapshot/serialize.h" |
| 10 | 9 |
| 11 namespace v8 { | 10 namespace v8 { |
| 12 namespace internal { | 11 namespace internal { |
| 13 | 12 |
| 14 // Forward declarations. | 13 // Forward declarations. |
| 15 class Isolate; | 14 class Isolate; |
| 16 class PartialSerializer; | 15 class PartialSerializer; |
| 17 class StartupSerializer; | 16 class StartupSerializer; |
| 18 | 17 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 34 }; | 33 }; |
| 35 | 34 |
| 36 // Initialize the Isolate from the internal snapshot. Returns false if no | 35 // Initialize the Isolate from the internal snapshot. Returns false if no |
| 37 // snapshot could be found. | 36 // snapshot could be found. |
| 38 static bool Initialize(Isolate* isolate); | 37 static bool Initialize(Isolate* isolate); |
| 39 // Create a new context using the internal partial snapshot. | 38 // Create a new context using the internal partial snapshot. |
| 40 static MaybeHandle<Context> NewContextFromSnapshot( | 39 static MaybeHandle<Context> NewContextFromSnapshot( |
| 41 Isolate* isolate, Handle<JSGlobalProxy> global_proxy, | 40 Isolate* isolate, Handle<JSGlobalProxy> global_proxy, |
| 42 Handle<FixedArray>* outdated_contexts_out); | 41 Handle<FixedArray>* outdated_contexts_out); |
| 43 | 42 |
| 44 static bool HaveASnapshotToStartFrom(Isolate* isolate) { | 43 static bool HaveASnapshotToStartFrom(Isolate* isolate); |
| 45 // Do not use snapshots if the isolate is used to create snapshots. | |
| 46 return isolate->snapshot_blob() != NULL && | |
| 47 isolate->snapshot_blob()->data != NULL; | |
| 48 } | |
| 49 | 44 |
| 50 static bool EmbedsScript(Isolate* isolate); | 45 static bool EmbedsScript(Isolate* isolate); |
| 51 | 46 |
| 52 static uint32_t SizeOfFirstPage(Isolate* isolate, AllocationSpace space); | 47 static uint32_t SizeOfFirstPage(Isolate* isolate, AllocationSpace space); |
| 53 | 48 |
| 54 | 49 |
| 55 // To be implemented by the snapshot source. | 50 // To be implemented by the snapshot source. |
| 56 static const v8::StartupData* DefaultSnapshotBlob(); | 51 static const v8::StartupData* DefaultSnapshotBlob(); |
| 57 | 52 |
| 58 static v8::StartupData CreateSnapshotBlob( | 53 static v8::StartupData CreateSnapshotBlob( |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 DISALLOW_IMPLICIT_CONSTRUCTORS(Snapshot); | 85 DISALLOW_IMPLICIT_CONSTRUCTORS(Snapshot); |
| 91 }; | 86 }; |
| 92 | 87 |
| 93 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 88 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 94 void SetSnapshotFromFile(StartupData* snapshot_blob); | 89 void SetSnapshotFromFile(StartupData* snapshot_blob); |
| 95 #endif | 90 #endif |
| 96 | 91 |
| 97 } } // namespace v8::internal | 92 } } // namespace v8::internal |
| 98 | 93 |
| 99 #endif // V8_SNAPSHOT_SNAPSHOT_H_ | 94 #endif // V8_SNAPSHOT_SNAPSHOT_H_ |
| OLD | NEW |