OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 public: | 76 public: |
77 // Global actions. | 77 // Global actions. |
78 | 78 |
79 // If Initialize is called with des == NULL, the initial state is | 79 // If Initialize is called with des == NULL, the initial state is |
80 // created from scratch. If a non-null Deserializer is given, the | 80 // created from scratch. If a non-null Deserializer is given, the |
81 // initial state is created by reading the deserialized data into an | 81 // initial state is created by reading the deserialized data into an |
82 // empty heap. | 82 // empty heap. |
83 static bool Initialize(Deserializer* des); | 83 static bool Initialize(Deserializer* des); |
84 static void TearDown(); | 84 static void TearDown(); |
85 static bool IsRunning() { return is_running_; } | 85 static bool IsRunning() { return is_running_; } |
86 // To be dead you have to have lived | |
87 // TODO(isolates): move IsDead to Isolate. | |
88 static bool IsDead() { return has_fatal_error_ || has_been_disposed_; } | |
89 static void SetFatalError(); | |
90 | 86 |
91 // Report process out of memory. Implementation found in api.cc. | 87 // Report process out of memory. Implementation found in api.cc. |
92 static void FatalProcessOutOfMemory(const char* location, | 88 static void FatalProcessOutOfMemory(const char* location, |
93 bool take_snapshot = false); | 89 bool take_snapshot = false); |
94 | 90 |
95 // Allows an entropy source to be provided for use in random number | 91 // Allows an entropy source to be provided for use in random number |
96 // generation. | 92 // generation. |
97 static void SetEntropySource(EntropySource source); | 93 static void SetEntropySource(EntropySource source); |
98 // Support for return-address rewriting profilers. | 94 // Support for return-address rewriting profilers. |
99 static void SetReturnAddressLocationResolver( | 95 static void SetReturnAddressLocationResolver( |
(...skipping 27 matching lines...) Expand all Loading... |
127 } | 123 } |
128 | 124 |
129 private: | 125 private: |
130 static void InitializeOncePerProcessImpl(); | 126 static void InitializeOncePerProcessImpl(); |
131 static void InitializeOncePerProcess(); | 127 static void InitializeOncePerProcess(); |
132 | 128 |
133 // True if engine is currently running | 129 // True if engine is currently running |
134 static bool is_running_; | 130 static bool is_running_; |
135 // True if V8 has ever been run | 131 // True if V8 has ever been run |
136 static bool has_been_set_up_; | 132 static bool has_been_set_up_; |
137 // True if error has been signaled for current engine | |
138 // (reset to false if engine is restarted) | |
139 static bool has_fatal_error_; | |
140 // True if engine has been shut down | 133 // True if engine has been shut down |
141 // (reset if engine is restarted) | 134 // (reset if engine is restarted) |
142 static bool has_been_disposed_; | 135 static bool has_been_disposed_; |
143 // List of callbacks when a Call completes. | 136 // List of callbacks when a Call completes. |
144 static List<CallCompletedCallback>* call_completed_callbacks_; | 137 static List<CallCompletedCallback>* call_completed_callbacks_; |
145 // Allocator for external array buffers. | 138 // Allocator for external array buffers. |
146 static v8::ArrayBuffer::Allocator* array_buffer_allocator_; | 139 static v8::ArrayBuffer::Allocator* array_buffer_allocator_; |
147 }; | 140 }; |
148 | 141 |
149 | 142 |
150 // JavaScript defines two kinds of 'nil'. | 143 // JavaScript defines two kinds of 'nil'. |
151 enum NilValue { kNullValue, kUndefinedValue }; | 144 enum NilValue { kNullValue, kUndefinedValue }; |
152 | 145 |
153 | 146 |
154 } } // namespace v8::internal | 147 } } // namespace v8::internal |
155 | 148 |
156 namespace i = v8::internal; | 149 namespace i = v8::internal; |
157 | 150 |
158 #endif // V8_V8_H_ | 151 #endif // V8_V8_H_ |
OLD | NEW |