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