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 4574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4585 */ | 4585 */ |
4586 static void SetJitCodeEventHandler(JitCodeEventOptions options, | 4586 static void SetJitCodeEventHandler(JitCodeEventOptions options, |
4587 JitCodeEventHandler event_handler); | 4587 JitCodeEventHandler event_handler); |
4588 | 4588 |
4589 // TODO(svenpanne) Really deprecate me when Chrome is fixed. | 4589 // TODO(svenpanne) Really deprecate me when Chrome is fixed. |
4590 /** Deprecated. Use Isolate::AdjustAmountOfExternalAllocatedMemory instead. */ | 4590 /** Deprecated. Use Isolate::AdjustAmountOfExternalAllocatedMemory instead. */ |
4591 static intptr_t AdjustAmountOfExternalAllocatedMemory( | 4591 static intptr_t AdjustAmountOfExternalAllocatedMemory( |
4592 intptr_t change_in_bytes); | 4592 intptr_t change_in_bytes); |
4593 | 4593 |
4594 /** | 4594 /** |
4595 * Retrieve the V8 thread id of the calling thread. | |
4596 * | |
4597 * The thread id for a thread should only be retrieved after the V8 | |
4598 * lock has been acquired with a Locker object with that thread. | |
4599 */ | |
4600 static int GetCurrentThreadId(); | |
4601 | |
4602 /** | |
4603 * Forcefully terminate execution of a JavaScript thread. This can | |
4604 * be used to terminate long-running scripts. | |
4605 * | |
4606 * TerminateExecution should only be called when then V8 lock has | |
4607 * been acquired with a Locker object. Therefore, in order to be | |
4608 * able to terminate long-running threads, preemption must be | |
4609 * enabled to allow the user of TerminateExecution to acquire the | |
4610 * lock. | |
4611 * | |
4612 * The termination is achieved by throwing an exception that is | |
4613 * uncatchable by JavaScript exception handlers. Termination | |
4614 * exceptions act as if they were caught by a C++ TryCatch exception | |
4615 * handler. If forceful termination is used, any C++ TryCatch | |
4616 * exception handler that catches an exception should check if that | |
4617 * exception is a termination exception and immediately return if | |
4618 * that is the case. Returning immediately in that case will | |
4619 * continue the propagation of the termination exception if needed. | |
4620 * | |
4621 * The thread id passed to TerminateExecution must have been | |
4622 * obtained by calling GetCurrentThreadId on the thread in question. | |
4623 * | |
4624 * \param thread_id The thread id of the thread to terminate. | |
4625 */ | |
4626 static void TerminateExecution(int thread_id); | |
4627 | |
4628 /** | |
4629 * Forcefully terminate the current thread of JavaScript execution | 4595 * Forcefully terminate the current thread of JavaScript execution |
4630 * in the given isolate. If no isolate is provided, the default | 4596 * in the given isolate. If no isolate is provided, the default |
4631 * isolate is used. | 4597 * isolate is used. |
4632 * | 4598 * |
4633 * This method can be used by any thread even if that thread has not | 4599 * This method can be used by any thread even if that thread has not |
4634 * acquired the V8 lock with a Locker object. | 4600 * acquired the V8 lock with a Locker object. |
4635 * | 4601 * |
4636 * \param isolate The isolate in which to terminate the current JS execution. | 4602 * \param isolate The isolate in which to terminate the current JS execution. |
4637 */ | 4603 */ |
4638 static void TerminateExecution(Isolate* isolate = NULL); | 4604 static void TerminateExecution(Isolate* isolate = NULL); |
(...skipping 1895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6534 */ | 6500 */ |
6535 | 6501 |
6536 | 6502 |
6537 } // namespace v8 | 6503 } // namespace v8 |
6538 | 6504 |
6539 | 6505 |
6540 #undef TYPE_CHECK | 6506 #undef TYPE_CHECK |
6541 | 6507 |
6542 | 6508 |
6543 #endif // V8_H_ | 6509 #endif // V8_H_ |
OLD | NEW |