Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: src/snapshot.h

Issue 949623006: Attach snapshot data blob to the isolate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/mksnapshot.cc ('k') | src/snapshot-common.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/serialize.h" 6 #include "src/serialize.h"
7 7
8 #ifndef V8_SNAPSHOT_H_ 8 #ifndef V8_SNAPSHOT_H_
9 #define V8_SNAPSHOT_H_ 9 #define V8_SNAPSHOT_H_
10 10
(...skipping 18 matching lines...) Expand all
29 }; 29 };
30 30
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(); 39 static bool HaveASnapshotToStartFrom(Isolate* isolate) {
40 // Do not use snapshots if the isolate is used to create snapshots.
41 return isolate->snapshot_blob() != NULL;
42 }
40 43
41 static bool EmbedsScript(); 44 static bool EmbedsScript(Isolate* isolate);
42 45
43 static uint32_t SizeOfFirstPage(AllocationSpace space); 46 static uint32_t SizeOfFirstPage(Isolate* isolate, AllocationSpace space);
47
44 48
45 // To be implemented by the snapshot source. 49 // To be implemented by the snapshot source.
46 static const v8::StartupData SnapshotBlob(); 50 static const v8::StartupData* DefaultSnapshotBlob();
47 51
48 static v8::StartupData CreateSnapshotBlob( 52 static v8::StartupData CreateSnapshotBlob(
49 const StartupSerializer& startup_ser, 53 const StartupSerializer& startup_ser,
50 const PartialSerializer& context_ser, Snapshot::Metadata metadata); 54 const PartialSerializer& context_ser, Snapshot::Metadata metadata);
51 55
52 #ifdef DEBUG 56 #ifdef DEBUG
53 static bool SnapshotIsValid(v8::StartupData* snapshot_blob); 57 static bool SnapshotIsValid(v8::StartupData* snapshot_blob);
54 #endif // DEBUG 58 #endif // DEBUG
55 59
56 private: 60 private:
(...skipping 23 matching lines...) Expand all
80 DISALLOW_IMPLICIT_CONSTRUCTORS(Snapshot); 84 DISALLOW_IMPLICIT_CONSTRUCTORS(Snapshot);
81 }; 85 };
82 86
83 #ifdef V8_USE_EXTERNAL_STARTUP_DATA 87 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
84 void SetSnapshotFromFile(StartupData* snapshot_blob); 88 void SetSnapshotFromFile(StartupData* snapshot_blob);
85 #endif 89 #endif
86 90
87 } } // namespace v8::internal 91 } } // namespace v8::internal
88 92
89 #endif // V8_SNAPSHOT_H_ 93 #endif // V8_SNAPSHOT_H_
OLDNEW
« no previous file with comments | « src/mksnapshot.cc ('k') | src/snapshot-common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698