remove operator-> from String
[hiphop-php.git] / hphp / runtime / vm / unwind.h
blobafa0cf8c18dd8d09707821b8bb48a9a72f0f1fdd
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-2014 Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
16 #ifndef incl_HPHP_UNWIND_H_
17 #define incl_HPHP_UNWIND_H_
19 #include <stdexcept>
21 namespace HPHP {
23 //////////////////////////////////////////////////////////////////////
26 * Enumerates actions that should be taken by the enterVM loop after
27 * unwinding an exception.
29 enum class UnwindAction {
31 * The exception was not handled in this nesting of the VM---it
32 * needs to be rethrown.
34 Propagate,
37 * A catch or fault handler was identified and the VM state has been
38 * prepared for entry to it.
40 ResumeVM,
44 * The main entry point to the unwinder.
46 * When an exception propagates up to the top-level try/catch in
47 * enterVM, it calls to this module to perform stack unwinding as
48 * appropriate. This function must be called from within the catch
49 * handler (it rethrows the exception to determine what to do).
51 * The returned UnwindAction instructs enterVM on how to proceed.
53 UnwindAction exception_handler() noexcept;
55 //////////////////////////////////////////////////////////////////////
58 * This exception is thrown when executing an Unwind bytecode, which
59 * will reraise the current fault and resume propagating it.
61 struct VMPrepareUnwind : std::exception {
62 const char* what() const throw() { return "VMPrepareUnwind"; }
66 * Thrown when we need to "switch modes" by re-starting the current VM
67 * invocation. For example, if we need to break for the debugger, or
68 * enable code coverage mode.
70 struct VMSwitchMode : std::exception {
71 const char* what() const throw() { return "VMSwitchMode"; }
75 * Thrown for stack overflow thrown from a prolog while
76 * re-entering
78 struct VMReenterStackOverflow : std::exception {
79 const char* what() const throw() { return "VMReenterStackOverflow"; }
83 * Same as VMSwitchMode, except for use from a builtin---the frame for
84 * the builtin function should be unwound before resuming the VM.
86 struct VMSwitchModeBuiltin : std::exception {
87 const char* what() const throw() { return "VMSwitchModeBuiltin"; }
90 //////////////////////////////////////////////////////////////////////
94 #endif