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 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 25 matching lines...) Expand all Loading... |
36 class Snapshot { | 36 class Snapshot { |
37 public: | 37 public: |
38 // Initialize the VM from the given snapshot file. If snapshot_file is | 38 // Initialize the VM from the given snapshot file. If snapshot_file is |
39 // NULL, use the internal snapshot instead. Returns false if no snapshot | 39 // NULL, use the internal snapshot instead. Returns false if no snapshot |
40 // could be found. | 40 // could be found. |
41 static bool Initialize(const char* snapshot_file = NULL); | 41 static bool Initialize(const char* snapshot_file = NULL); |
42 | 42 |
43 static bool HaveASnapshotToStartFrom(); | 43 static bool HaveASnapshotToStartFrom(); |
44 | 44 |
45 // Create a new context using the internal partial snapshot. | 45 // Create a new context using the internal partial snapshot. |
46 static Handle<Context> NewContextFromSnapshot(); | 46 static Handle<Context> NewContextFromSnapshot(Isolate* isolate); |
47 | 47 |
48 // Returns whether or not the snapshot is enabled. | 48 // Returns whether or not the snapshot is enabled. |
49 static bool IsEnabled() { return size_ != 0; } | 49 static bool IsEnabled() { return size_ != 0; } |
50 | 50 |
51 // Write snapshot to the given file. Returns true if snapshot was written | 51 // Write snapshot to the given file. Returns true if snapshot was written |
52 // successfully. | 52 // successfully. |
53 static bool WriteToFile(const char* snapshot_file); | 53 static bool WriteToFile(const char* snapshot_file); |
54 | 54 |
55 static const byte* data() { return data_; } | 55 static const byte* data() { return data_; } |
56 static int size() { return size_; } | 56 static int size() { return size_; } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 static const int context_raw_size_; | 91 static const int context_raw_size_; |
92 | 92 |
93 static void ReserveSpaceForLinkedInSnapshot(Deserializer* deserializer); | 93 static void ReserveSpaceForLinkedInSnapshot(Deserializer* deserializer); |
94 | 94 |
95 DISALLOW_IMPLICIT_CONSTRUCTORS(Snapshot); | 95 DISALLOW_IMPLICIT_CONSTRUCTORS(Snapshot); |
96 }; | 96 }; |
97 | 97 |
98 } } // namespace v8::internal | 98 } } // namespace v8::internal |
99 | 99 |
100 #endif // V8_SNAPSHOT_H_ | 100 #endif // V8_SNAPSHOT_H_ |
OLD | NEW |