| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // Create a new context using the internal partial snapshot. | 43 // Create a new context using the internal partial snapshot. |
| 44 static Handle<Context> NewContextFromSnapshot(); | 44 static Handle<Context> NewContextFromSnapshot(); |
| 45 | 45 |
| 46 // Returns whether or not the snapshot is enabled. | 46 // Returns whether or not the snapshot is enabled. |
| 47 static bool IsEnabled() { return size_ != 0; } | 47 static bool IsEnabled() { return size_ != 0; } |
| 48 | 48 |
| 49 // Write snapshot to the given file. Returns true if snapshot was written | 49 // Write snapshot to the given file. Returns true if snapshot was written |
| 50 // successfully. | 50 // successfully. |
| 51 static bool WriteToFile(const char* snapshot_file); | 51 static bool WriteToFile(const char* snapshot_file); |
| 52 | 52 |
| 53 static const byte* data() { return data_; } |
| 54 static int size() { return size_; } |
| 55 static int raw_size() { return raw_size_; } |
| 56 static void set_raw_data(const byte* raw_data) { |
| 57 raw_data_ = raw_data; |
| 58 } |
| 59 static const byte* context_data() { return context_data_; } |
| 60 static int context_size() { return context_size_; } |
| 61 static int context_raw_size() { return context_raw_size_; } |
| 62 static void set_context_raw_data( |
| 63 const byte* context_raw_data) { |
| 64 context_raw_data_ = context_raw_data; |
| 65 } |
| 66 |
| 53 private: | 67 private: |
| 54 static const byte data_[]; | 68 static const byte data_[]; |
| 69 static const byte* raw_data_; |
| 55 static const byte context_data_[]; | 70 static const byte context_data_[]; |
| 71 static const byte* context_raw_data_; |
| 56 static const int new_space_used_; | 72 static const int new_space_used_; |
| 57 static const int pointer_space_used_; | 73 static const int pointer_space_used_; |
| 58 static const int data_space_used_; | 74 static const int data_space_used_; |
| 59 static const int code_space_used_; | 75 static const int code_space_used_; |
| 60 static const int map_space_used_; | 76 static const int map_space_used_; |
| 61 static const int cell_space_used_; | 77 static const int cell_space_used_; |
| 62 static const int large_space_used_; | 78 static const int large_space_used_; |
| 63 static const int size_; | 79 static const int size_; |
| 80 static const int raw_size_; |
| 64 static const int context_size_; | 81 static const int context_size_; |
| 82 static const int context_raw_size_; |
| 65 | 83 |
| 66 static bool Deserialize(const byte* content, int len); | 84 static bool Deserialize(const byte* content, int len); |
| 67 | 85 |
| 68 DISALLOW_IMPLICIT_CONSTRUCTORS(Snapshot); | 86 DISALLOW_IMPLICIT_CONSTRUCTORS(Snapshot); |
| 69 }; | 87 }; |
| 70 | 88 |
| 71 } } // namespace v8::internal | 89 } } // namespace v8::internal |
| 72 | 90 |
| 73 #endif // V8_SNAPSHOT_H_ | 91 #endif // V8_SNAPSHOT_H_ |
| OLD | NEW |