Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: runtime/vm/raw_object.h

Issue 9166016: Introduce the Error object class in the vm. It represents all of the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object_store.cc ('k') | runtime/vm/raw_object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object.h
===================================================================
--- runtime/vm/raw_object.h (revision 3167)
+++ runtime/vm/raw_object.h (working copy)
@@ -37,8 +37,11 @@
V(ExceptionHandlers) \
V(Context) \
V(ContextScope) \
- V(UnhandledException) \
- V(ApiError) \
+ V(Error) \
+ V(ApiError) \
+ V(LanguageError) \
+ V(UnhandledException) \
+ V(UnwindError) \
V(Instance) \
V(Number) \
V(Integer) \
@@ -726,7 +729,38 @@
};
-class RawUnhandledException : public RawObject {
+class RawError : public RawObject {
+ RAW_HEAP_OBJECT_IMPLEMENTATION(Error);
+};
+
+
+class RawApiError : public RawError {
+ RAW_HEAP_OBJECT_IMPLEMENTATION(ApiError);
+
+ RawObject** from() {
+ return reinterpret_cast<RawObject**>(&ptr()->message_);
+ }
+ RawString* message_;
+ RawObject** to() {
+ return reinterpret_cast<RawObject**>(&ptr()->message_);
+ }
+};
+
+
+class RawLanguageError : public RawError {
+ RAW_HEAP_OBJECT_IMPLEMENTATION(LanguageError);
+
+ RawObject** from() {
+ return reinterpret_cast<RawObject**>(&ptr()->message_);
+ }
+ RawString* message_;
+ RawObject** to() {
+ return reinterpret_cast<RawObject**>(&ptr()->message_);
+ }
+};
+
+
+class RawUnhandledException : public RawError {
RAW_HEAP_OBJECT_IMPLEMENTATION(UnhandledException);
RawObject** from() {
@@ -740,15 +774,15 @@
};
-class RawApiError : public RawObject {
- RAW_HEAP_OBJECT_IMPLEMENTATION(ApiError);
+class RawUnwindError : public RawError {
+ RAW_HEAP_OBJECT_IMPLEMENTATION(UnwindError);
RawObject** from() {
- return reinterpret_cast<RawObject**>(&ptr()->data_);
+ return reinterpret_cast<RawObject**>(&ptr()->message_);
}
- RawObject* data_;
+ RawString* message_;
RawObject** to() {
- return reinterpret_cast<RawObject**>(&ptr()->data_);
+ return reinterpret_cast<RawObject**>(&ptr()->message_);
}
};
« no previous file with comments | « runtime/vm/object_store.cc ('k') | runtime/vm/raw_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698