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