V8 Project
snapshot.h
Go to the documentation of this file.
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
3 // found in the LICENSE file.
4 
5 #include "src/isolate.h"
6 
7 #ifndef V8_SNAPSHOT_H_
8 #define V8_SNAPSHOT_H_
9 
10 namespace v8 {
11 namespace internal {
12 
13 class Snapshot {
14  public:
15  // Initialize the Isolate from the internal snapshot. Returns false if no
16  // snapshot could be found.
17  static bool Initialize(Isolate* isolate);
18 
19  static bool HaveASnapshotToStartFrom();
20 
21  // Create a new context using the internal partial snapshot.
23 
24  // These methods support COMPRESS_STARTUP_DATA_BZ2.
25  static const byte* data() { return data_; }
26  static int size() { return size_; }
27  static int raw_size() { return raw_size_; }
28  static void set_raw_data(const byte* raw_data) {
29  raw_data_ = raw_data;
30  }
31  static const byte* context_data() { return context_data_; }
32  static int context_size() { return context_size_; }
33  static int context_raw_size() { return context_raw_size_; }
34  static void set_context_raw_data(
35  const byte* context_raw_data) {
36  context_raw_data_ = context_raw_data;
37  }
38 
39  private:
40  static const byte data_[];
41  static const byte* raw_data_;
42  static const byte context_data_[];
43  static const byte* context_raw_data_;
44  static const int new_space_used_;
45  static const int pointer_space_used_;
46  static const int data_space_used_;
47  static const int code_space_used_;
48  static const int map_space_used_;
49  static const int cell_space_used_;
50  static const int property_cell_space_used_;
51  static const int lo_space_used_;
52  static const int context_new_space_used_;
53  static const int context_pointer_space_used_;
54  static const int context_data_space_used_;
55  static const int context_code_space_used_;
56  static const int context_map_space_used_;
57  static const int context_cell_space_used_;
59  static const int context_lo_space_used_;
60  static const int size_;
61  static const int raw_size_;
62  static const int context_size_;
63  static const int context_raw_size_;
64 
65  static void ReserveSpaceForLinkedInSnapshot(Deserializer* deserializer);
66 
68 };
69 
70 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
71 void SetSnapshotFromFile(StartupData* snapshot_blob);
72 #endif
73 
74 } } // namespace v8::internal
75 
76 #endif // V8_SNAPSHOT_H_
static const int context_map_space_used_
Definition: snapshot.h:56
static Handle< Context > NewContextFromSnapshot(Isolate *isolate)
static const int context_data_space_used_
Definition: snapshot.h:54
static const int context_size_
Definition: snapshot.h:62
static int size()
Definition: snapshot.h:26
static const int raw_size_
Definition: snapshot.h:61
static void ReserveSpaceForLinkedInSnapshot(Deserializer *deserializer)
static const int pointer_space_used_
Definition: snapshot.h:45
static const int context_property_cell_space_used_
Definition: snapshot.h:58
static const byte data_[]
Definition: snapshot.h:40
static const int cell_space_used_
Definition: snapshot.h:49
static bool Initialize(Isolate *isolate)
static const int data_space_used_
Definition: snapshot.h:46
static const byte context_data_[]
Definition: snapshot.h:42
static const byte * context_raw_data_
Definition: snapshot.h:43
static const byte * context_data()
Definition: snapshot.h:31
static int raw_size()
Definition: snapshot.h:27
DISALLOW_IMPLICIT_CONSTRUCTORS(Snapshot)
static const int context_new_space_used_
Definition: snapshot.h:52
static bool HaveASnapshotToStartFrom()
static const int lo_space_used_
Definition: snapshot.h:51
static const int context_lo_space_used_
Definition: snapshot.h:59
static void set_context_raw_data(const byte *context_raw_data)
Definition: snapshot.h:34
static const int context_raw_size_
Definition: snapshot.h:63
static const int map_space_used_
Definition: snapshot.h:48
static const int context_code_space_used_
Definition: snapshot.h:55
static void set_raw_data(const byte *raw_data)
Definition: snapshot.h:28
static const byte * raw_data_
Definition: snapshot.h:41
static const int code_space_used_
Definition: snapshot.h:47
static const int new_space_used_
Definition: snapshot.h:44
static const int context_cell_space_used_
Definition: snapshot.h:57
static const int property_cell_space_used_
Definition: snapshot.h:50
static const byte * data()
Definition: snapshot.h:25
static const int context_pointer_space_used_
Definition: snapshot.h:53
static int context_size()
Definition: snapshot.h:32
static int context_raw_size()
Definition: snapshot.h:33
static const int size_
Definition: snapshot.h:60
void SetSnapshotFromFile(StartupData *snapshot_blob)
Debugger support for the V8 JavaScript engine.
Definition: accessors.cc:20