| 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 RUNTIME_VM_EXCEPTIONS_H_ | 5 #ifndef RUNTIME_VM_EXCEPTIONS_H_ |
| 6 #define RUNTIME_VM_EXCEPTIONS_H_ | 6 #define RUNTIME_VM_EXCEPTIONS_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/token_position.h" | 9 #include "vm/token_position.h" |
| 10 | 10 |
| 11 namespace dart { | 11 namespace dart { |
| 12 | 12 |
| 13 // Forward declarations. | 13 // Forward declarations. |
| 14 class AbstractType; | 14 class AbstractType; |
| 15 class Array; | 15 class Array; |
| 16 class DartFrameIterator; | 16 class DartFrameIterator; |
| 17 class Error; | 17 class Error; |
| 18 class LanguageError; | 18 class LanguageError; |
| 19 class Instance; | 19 class Instance; |
| 20 class Integer; | 20 class Integer; |
| 21 class RawInstance; | 21 class RawInstance; |
| 22 class RawObject; | 22 class RawObject; |
| 23 class RawScript; | 23 class RawScript; |
| 24 class RawStacktrace; | 24 class RawStackTrace; |
| 25 class String; | 25 class String; |
| 26 class Thread; | 26 class Thread; |
| 27 | 27 |
| 28 class Exceptions : AllStatic { | 28 class Exceptions : AllStatic { |
| 29 public: | 29 public: |
| 30 static void Throw(Thread* thread, const Instance& exception); | 30 static void Throw(Thread* thread, const Instance& exception); |
| 31 static void ReThrow(Thread* thread, | 31 static void ReThrow(Thread* thread, |
| 32 const Instance& exception, | 32 const Instance& exception, |
| 33 const Instance& stacktrace); | 33 const Instance& stacktrace); |
| 34 static void PropagateError(const Error& error); | 34 static void PropagateError(const Error& error); |
| 35 | 35 |
| 36 // Helpers to create and throw errors. | 36 // Helpers to create and throw errors. |
| 37 static RawStacktrace* CurrentStacktrace(); | 37 static RawStackTrace* CurrentStackTrace(); |
| 38 static RawScript* GetCallerScript(DartFrameIterator* iterator); | 38 static RawScript* GetCallerScript(DartFrameIterator* iterator); |
| 39 static RawInstance* NewInstance(const char* class_name); | 39 static RawInstance* NewInstance(const char* class_name); |
| 40 static void CreateAndThrowTypeError(TokenPosition location, | 40 static void CreateAndThrowTypeError(TokenPosition location, |
| 41 const AbstractType& src_type, | 41 const AbstractType& src_type, |
| 42 const AbstractType& dst_type, | 42 const AbstractType& dst_type, |
| 43 const String& dst_name, | 43 const String& dst_name, |
| 44 const String& bound_error_msg); | 44 const String& bound_error_msg); |
| 45 | 45 |
| 46 enum ExceptionType { | 46 enum ExceptionType { |
| 47 kNone, | 47 kNone, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 uword frame_pointer, | 86 uword frame_pointer, |
| 87 bool clear_deopt_at_target); | 87 bool clear_deopt_at_target); |
| 88 | 88 |
| 89 private: | 89 private: |
| 90 DISALLOW_COPY_AND_ASSIGN(Exceptions); | 90 DISALLOW_COPY_AND_ASSIGN(Exceptions); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 } // namespace dart | 93 } // namespace dart |
| 94 | 94 |
| 95 #endif // RUNTIME_VM_EXCEPTIONS_H_ | 95 #endif // RUNTIME_VM_EXCEPTIONS_H_ |
| OLD | NEW |