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

Side by Side Diff: dart/runtime/vm/object.h

Issue 75123002: Version 1.0.0.6 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 1 month 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 | « dart/runtime/vm/intermediate_language.h ('k') | dart/runtime/vm/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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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_OBJECT_H_ 5 #ifndef VM_OBJECT_H_
6 #define VM_OBJECT_H_ 6 #define VM_OBJECT_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/utils.h" 10 #include "platform/utils.h"
(...skipping 3739 matching lines...) Expand 10 before | Expand all | Expand 10 after
3750 virtual const char* ToErrorCString() const; 3750 virtual const char* ToErrorCString() const;
3751 3751
3752 private: 3752 private:
3753 HEAP_OBJECT_IMPLEMENTATION(Error, Object); 3753 HEAP_OBJECT_IMPLEMENTATION(Error, Object);
3754 }; 3754 };
3755 3755
3756 3756
3757 class ApiError : public Error { 3757 class ApiError : public Error {
3758 public: 3758 public:
3759 RawString* message() const { return raw_ptr()->message_; } 3759 RawString* message() const { return raw_ptr()->message_; }
3760 static intptr_t message_offset() {
3761 return OFFSET_OF(RawApiError, message_);
3762 }
3763 3760
3764 static intptr_t InstanceSize() { 3761 static intptr_t InstanceSize() {
3765 return RoundedAllocationSize(sizeof(RawApiError)); 3762 return RoundedAllocationSize(sizeof(RawApiError));
3766 } 3763 }
3767 3764
3768 static RawApiError* New(const String& message, 3765 static RawApiError* New(const String& message,
3769 Heap::Space space = Heap::kNew); 3766 Heap::Space space = Heap::kNew);
3770 3767
3771 virtual const char* ToErrorCString() const; 3768 virtual const char* ToErrorCString() const;
3772 3769
3773 private: 3770 private:
3774 void set_message(const String& message) const; 3771 void set_message(const String& message) const;
3775 3772
3776 static RawApiError* New(); 3773 static RawApiError* New();
3777 3774
3778 FINAL_HEAP_OBJECT_IMPLEMENTATION(ApiError, Error); 3775 FINAL_HEAP_OBJECT_IMPLEMENTATION(ApiError, Error);
3779 friend class Class; 3776 friend class Class;
3780 }; 3777 };
3781 3778
3782 3779
3783 class LanguageError : public Error { 3780 class LanguageError : public Error {
3784 public: 3781 public:
3785 RawString* message() const { return raw_ptr()->message_; } 3782 enum Kind {
3786 static intptr_t message_offset() { 3783 kWarning,
3787 return OFFSET_OF(RawLanguageError, message_); 3784 kError,
3788 } 3785 kMalformedType,
3786 kMalboundedType,
3787 };
3788
3789 // Build, cache, and return formatted message.
3790 RawString* FormatMessage() const;
3789 3791
3790 static intptr_t InstanceSize() { 3792 static intptr_t InstanceSize() {
3791 return RoundedAllocationSize(sizeof(RawLanguageError)); 3793 return RoundedAllocationSize(sizeof(RawLanguageError));
3792 } 3794 }
3793 3795
3794 static RawLanguageError* New(const String& message, 3796 // A null script means no source and a negative token_pos means no position.
3797 static RawLanguageError* NewFormatted(const Error& prev_error,
3798 const Script& script,
3799 intptr_t token_pos,
3800 Kind kind,
3801 Heap::Space space,
3802 const char* format, ...)
3803 PRINTF_ATTRIBUTE(6, 7);
3804
3805 static RawLanguageError* NewFormattedV(const Error& prev_error,
3806 const Script& script,
3807 intptr_t token_pos,
3808 Kind kind,
3809 Heap::Space space,
3810 const char* format, va_list args);
3811
3812 static RawLanguageError* New(const String& formatted_message,
3795 Heap::Space space = Heap::kNew); 3813 Heap::Space space = Heap::kNew);
3796 3814
3797 virtual const char* ToErrorCString() const; 3815 virtual const char* ToErrorCString() const;
3798 3816
3799 private: 3817 private:
3800 void set_message(const String& message) const; 3818 RawError* previous_error() const {
3819 return raw_ptr()->previous_error_;
3820 }
3821 void set_previous_error(const Error& value) const;
3822
3823 RawScript* script() const { return raw_ptr()->script_; }
3824 void set_script(const Script& value) const;
3825
3826 intptr_t token_pos() const { return raw_ptr()->token_pos_; }
3827 void set_token_pos(intptr_t value) const;
3828
3829 Kind kind() const { return static_cast<Kind>(raw_ptr()->kind_); }
3830 void set_kind(uint8_t value) const;
3831
3832 RawString* message() const { return raw_ptr()->message_; }
3833 void set_message(const String& value) const;
3834
3835 RawString* formatted_message() const { return raw_ptr()->formatted_message_; }
3836 void set_formatted_message(const String& value) const;
3801 3837
3802 static RawLanguageError* New(); 3838 static RawLanguageError* New();
3803 3839
3804 FINAL_HEAP_OBJECT_IMPLEMENTATION(LanguageError, Error); 3840 FINAL_HEAP_OBJECT_IMPLEMENTATION(LanguageError, Error);
3805 friend class Class; 3841 friend class Class;
3806 }; 3842 };
3807 3843
3808 3844
3809 class UnhandledException : public Error { 3845 class UnhandledException : public Error {
3810 public: 3846 public:
(...skipping 22 matching lines...) Expand all
3833 void set_stacktrace(const Instance& stacktrace) const; 3869 void set_stacktrace(const Instance& stacktrace) const;
3834 3870
3835 FINAL_HEAP_OBJECT_IMPLEMENTATION(UnhandledException, Error); 3871 FINAL_HEAP_OBJECT_IMPLEMENTATION(UnhandledException, Error);
3836 friend class Class; 3872 friend class Class;
3837 }; 3873 };
3838 3874
3839 3875
3840 class UnwindError : public Error { 3876 class UnwindError : public Error {
3841 public: 3877 public:
3842 RawString* message() const { return raw_ptr()->message_; } 3878 RawString* message() const { return raw_ptr()->message_; }
3843 static intptr_t message_offset() {
3844 return OFFSET_OF(RawUnwindError, message_);
3845 }
3846 3879
3847 static intptr_t InstanceSize() { 3880 static intptr_t InstanceSize() {
3848 return RoundedAllocationSize(sizeof(RawUnwindError)); 3881 return RoundedAllocationSize(sizeof(RawUnwindError));
3849 } 3882 }
3850 3883
3851 static RawUnwindError* New(const String& message, 3884 static RawUnwindError* New(const String& message,
3852 Heap::Space space = Heap::kNew); 3885 Heap::Space space = Heap::kNew);
3853 3886
3854 virtual const char* ToErrorCString() const; 3887 virtual const char* ToErrorCString() const;
3855 3888
(...skipping 2525 matching lines...) Expand 10 before | Expand all | Expand 10 after
6381 6414
6382 6415
6383 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 6416 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
6384 intptr_t index) { 6417 intptr_t index) {
6385 return array.At((index * kEntryLength) + kTargetFunctionIndex); 6418 return array.At((index * kEntryLength) + kTargetFunctionIndex);
6386 } 6419 }
6387 6420
6388 } // namespace dart 6421 } // namespace dart
6389 6422
6390 #endif // VM_OBJECT_H_ 6423 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « dart/runtime/vm/intermediate_language.h ('k') | dart/runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698