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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/object_store.cc ('k') | runtime/vm/raw_object.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_RAW_OBJECT_H_ 5 #ifndef VM_RAW_OBJECT_H_
6 #define VM_RAW_OBJECT_H_ 6 #define VM_RAW_OBJECT_H_
7 7
8 #include "vm/assert.h" 8 #include "vm/assert.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/snapshot.h" 10 #include "vm/snapshot.h"
(...skipping 19 matching lines...) Expand all
30 V(Script) \ 30 V(Script) \
31 V(Library) \ 31 V(Library) \
32 V(LibraryPrefix) \ 32 V(LibraryPrefix) \
33 V(Code) \ 33 V(Code) \
34 V(Instructions) \ 34 V(Instructions) \
35 V(PcDescriptors) \ 35 V(PcDescriptors) \
36 V(LocalVarDescriptors) \ 36 V(LocalVarDescriptors) \
37 V(ExceptionHandlers) \ 37 V(ExceptionHandlers) \
38 V(Context) \ 38 V(Context) \
39 V(ContextScope) \ 39 V(ContextScope) \
40 V(UnhandledException) \ 40 V(Error) \
41 V(ApiError) \ 41 V(ApiError) \
42 V(LanguageError) \
43 V(UnhandledException) \
44 V(UnwindError) \
42 V(Instance) \ 45 V(Instance) \
43 V(Number) \ 46 V(Number) \
44 V(Integer) \ 47 V(Integer) \
45 V(Smi) \ 48 V(Smi) \
46 V(Mint) \ 49 V(Mint) \
47 V(Bigint) \ 50 V(Bigint) \
48 V(Double) \ 51 V(Double) \
49 V(String) \ 52 V(String) \
50 V(OneByteString) \ 53 V(OneByteString) \
51 V(TwoByteString) \ 54 V(TwoByteString) \
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 // Variable length data follows here. 722 // Variable length data follows here.
720 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->data_[0]); } 723 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->data_[0]); }
721 RawObject* data_[0]; 724 RawObject* data_[0];
722 RawObject** to(intptr_t num_vars) { 725 RawObject** to(intptr_t num_vars) {
723 intptr_t data_length = num_vars * (sizeof(VariableDesc)/kWordSize); 726 intptr_t data_length = num_vars * (sizeof(VariableDesc)/kWordSize);
724 return reinterpret_cast<RawObject**>(&ptr()->data_[data_length - 1]); 727 return reinterpret_cast<RawObject**>(&ptr()->data_[data_length - 1]);
725 } 728 }
726 }; 729 };
727 730
728 731
729 class RawUnhandledException : public RawObject { 732 class RawError : public RawObject {
733 RAW_HEAP_OBJECT_IMPLEMENTATION(Error);
734 };
735
736
737 class RawApiError : public RawError {
738 RAW_HEAP_OBJECT_IMPLEMENTATION(ApiError);
739
740 RawObject** from() {
741 return reinterpret_cast<RawObject**>(&ptr()->message_);
742 }
743 RawString* message_;
744 RawObject** to() {
745 return reinterpret_cast<RawObject**>(&ptr()->message_);
746 }
747 };
748
749
750 class RawLanguageError : public RawError {
751 RAW_HEAP_OBJECT_IMPLEMENTATION(LanguageError);
752
753 RawObject** from() {
754 return reinterpret_cast<RawObject**>(&ptr()->message_);
755 }
756 RawString* message_;
757 RawObject** to() {
758 return reinterpret_cast<RawObject**>(&ptr()->message_);
759 }
760 };
761
762
763 class RawUnhandledException : public RawError {
730 RAW_HEAP_OBJECT_IMPLEMENTATION(UnhandledException); 764 RAW_HEAP_OBJECT_IMPLEMENTATION(UnhandledException);
731 765
732 RawObject** from() { 766 RawObject** from() {
733 return reinterpret_cast<RawObject**>(&ptr()->exception_); 767 return reinterpret_cast<RawObject**>(&ptr()->exception_);
734 } 768 }
735 RawInstance* exception_; 769 RawInstance* exception_;
736 RawInstance* stacktrace_; 770 RawInstance* stacktrace_;
737 RawObject** to() { 771 RawObject** to() {
738 return reinterpret_cast<RawObject**>(&ptr()->stacktrace_); 772 return reinterpret_cast<RawObject**>(&ptr()->stacktrace_);
739 } 773 }
740 }; 774 };
741 775
742 776
743 class RawApiError : public RawObject { 777 class RawUnwindError : public RawError {
744 RAW_HEAP_OBJECT_IMPLEMENTATION(ApiError); 778 RAW_HEAP_OBJECT_IMPLEMENTATION(UnwindError);
745 779
746 RawObject** from() { 780 RawObject** from() {
747 return reinterpret_cast<RawObject**>(&ptr()->data_); 781 return reinterpret_cast<RawObject**>(&ptr()->message_);
748 } 782 }
749 RawObject* data_; 783 RawString* message_;
750 RawObject** to() { 784 RawObject** to() {
751 return reinterpret_cast<RawObject**>(&ptr()->data_); 785 return reinterpret_cast<RawObject**>(&ptr()->message_);
752 } 786 }
753 }; 787 };
754 788
755 789
756 class RawInstance : public RawObject { 790 class RawInstance : public RawObject {
757 RAW_HEAP_OBJECT_IMPLEMENTATION(Instance); 791 RAW_HEAP_OBJECT_IMPLEMENTATION(Instance);
758 }; 792 };
759 793
760 794
761 class RawNumber : public RawInstance { 795 class RawNumber : public RawInstance {
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 intptr_t type_; // Uninitialized, simple or complex. 996 intptr_t type_; // Uninitialized, simple or complex.
963 intptr_t flags_; // Represents global/local, case insensitive, multiline. 997 intptr_t flags_; // Represents global/local, case insensitive, multiline.
964 998
965 // Variable length data follows here. 999 // Variable length data follows here.
966 uint8_t data_[0]; 1000 uint8_t data_[0];
967 }; 1001 };
968 1002
969 } // namespace dart 1003 } // namespace dart
970 1004
971 #endif // VM_RAW_OBJECT_H_ 1005 #endif // VM_RAW_OBJECT_H_
OLDNEW
« 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