OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 4598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4609 | 4609 |
4610 /** | 4610 /** |
4611 * Set allocator to use for ArrayBuffer memory. | 4611 * Set allocator to use for ArrayBuffer memory. |
4612 * The allocator should be set only once. The allocator should be set | 4612 * The allocator should be set only once. The allocator should be set |
4613 * before any code tha uses ArrayBuffers is executed. | 4613 * before any code tha uses ArrayBuffers is executed. |
4614 * This allocator is used in all isolates. | 4614 * This allocator is used in all isolates. |
4615 */ | 4615 */ |
4616 static void SetArrayBufferAllocator(ArrayBuffer::Allocator* allocator); | 4616 static void SetArrayBufferAllocator(ArrayBuffer::Allocator* allocator); |
4617 | 4617 |
4618 /** | 4618 /** |
| 4619 * Ignore out-of-memory exceptions. |
| 4620 * |
| 4621 * V8 running out of memory is treated as a fatal error by default. |
| 4622 * This means that the fatal error handler is called and that V8 is |
| 4623 * terminated. |
| 4624 * |
| 4625 * IgnoreOutOfMemoryException can be used to not treat an |
| 4626 * out-of-memory situation as a fatal error. This way, the contexts |
| 4627 * that did not cause the out of memory problem might be able to |
| 4628 * continue execution. |
| 4629 */ |
| 4630 static void IgnoreOutOfMemoryException(); |
| 4631 |
| 4632 /** |
4619 * Check if V8 is dead and therefore unusable. This is the case after | 4633 * Check if V8 is dead and therefore unusable. This is the case after |
4620 * fatal errors such as out-of-memory situations. | 4634 * fatal errors such as out-of-memory situations. |
4621 */ | 4635 */ |
4622 static bool IsDead(); | 4636 static bool IsDead(); |
4623 | 4637 |
4624 /** | 4638 /** |
4625 * The following 4 functions are to be used when V8 is built with | 4639 * The following 4 functions are to be used when V8 is built with |
4626 * the 'compress_startup_data' flag enabled. In this case, the | 4640 * the 'compress_startup_data' flag enabled. In this case, the |
4627 * embedder must decompress startup data prior to initializing V8. | 4641 * embedder must decompress startup data prior to initializing V8. |
4628 * | 4642 * |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5212 * restored when the new context is exited. | 5226 * restored when the new context is exited. |
5213 */ | 5227 */ |
5214 void Enter(); | 5228 void Enter(); |
5215 | 5229 |
5216 /** | 5230 /** |
5217 * Exit this context. Exiting the current context restores the | 5231 * Exit this context. Exiting the current context restores the |
5218 * context that was in place when entering the current context. | 5232 * context that was in place when entering the current context. |
5219 */ | 5233 */ |
5220 void Exit(); | 5234 void Exit(); |
5221 | 5235 |
| 5236 /** Returns true if the context has experienced an out of memory situation. */ |
| 5237 bool HasOutOfMemoryException(); |
| 5238 |
5222 /** Returns an isolate associated with a current context. */ | 5239 /** Returns an isolate associated with a current context. */ |
5223 v8::Isolate* GetIsolate(); | 5240 v8::Isolate* GetIsolate(); |
5224 | 5241 |
5225 /** | 5242 /** |
5226 * Gets the embedder data with the given index, which must have been set by a | 5243 * Gets the embedder data with the given index, which must have been set by a |
5227 * previous call to SetEmbedderData with the same index. Note that index 0 | 5244 * previous call to SetEmbedderData with the same index. Note that index 0 |
5228 * currently has a special meaning for Chrome's debugger. | 5245 * currently has a special meaning for Chrome's debugger. |
5229 */ | 5246 */ |
5230 V8_INLINE Local<Value> GetEmbedderData(int index); | 5247 V8_INLINE Local<Value> GetEmbedderData(int index); |
5231 | 5248 |
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6600 */ | 6617 */ |
6601 | 6618 |
6602 | 6619 |
6603 } // namespace v8 | 6620 } // namespace v8 |
6604 | 6621 |
6605 | 6622 |
6606 #undef TYPE_CHECK | 6623 #undef TYPE_CHECK |
6607 | 6624 |
6608 | 6625 |
6609 #endif // V8_H_ | 6626 #endif // V8_H_ |
OLD | NEW |