OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_LONGJUMP_H_ | 5 #ifndef VM_LONGJUMP_H_ |
6 #define VM_LONGJUMP_H_ | 6 #define VM_LONGJUMP_H_ |
7 | 7 |
8 #include <setjmp.h> | 8 #include <setjmp.h> |
9 | 9 |
10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
11 | 11 |
12 namespace dart { | 12 namespace dart { |
13 | 13 |
| 14 class Error; |
| 15 |
14 class LongJump : public ValueObject { | 16 class LongJump : public ValueObject { |
15 public: | 17 public: |
16 LongJump() : top_(NULL) { } | 18 LongJump() : top_(NULL) { } |
17 | 19 |
18 jmp_buf* Set(); | 20 jmp_buf* Set(); |
19 void Jump(int value, const char* msg); | 21 void Jump(int value, const Error& error); |
20 | 22 |
21 private: | 23 private: |
22 jmp_buf environment_; | 24 jmp_buf environment_; |
23 StackResource* top_; | 25 StackResource* top_; |
24 | 26 |
25 DISALLOW_COPY_AND_ASSIGN(LongJump); | 27 DISALLOW_COPY_AND_ASSIGN(LongJump); |
26 }; | 28 }; |
27 | 29 |
28 } // namespace dart | 30 } // namespace dart |
29 | 31 |
30 #endif // VM_LONGJUMP_H_ | 32 #endif // VM_LONGJUMP_H_ |
OLD | NEW |