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

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

Issue 340203003: Cleanup of error and warning reporting. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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/flow_graph_compiler.cc ('k') | 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"
11 #include "vm/json_stream.h" 11 #include "vm/json_stream.h"
12 #include "vm/bitmap.h" 12 #include "vm/bitmap.h"
13 #include "vm/dart.h" 13 #include "vm/dart.h"
14 #include "vm/globals.h" 14 #include "vm/globals.h"
15 #include "vm/handles.h" 15 #include "vm/handles.h"
16 #include "vm/heap.h" 16 #include "vm/heap.h"
17 #include "vm/isolate.h" 17 #include "vm/isolate.h"
18 #include "vm/os.h" 18 #include "vm/os.h"
19 #include "vm/raw_object.h" 19 #include "vm/raw_object.h"
20 #include "vm/report.h"
20 #include "vm/scanner.h" 21 #include "vm/scanner.h"
21 #include "vm/tags.h" 22 #include "vm/tags.h"
22 23
23 namespace dart { 24 namespace dart {
24 25
25 // Forward declarations. 26 // Forward declarations.
26 #define DEFINE_FORWARD_DECLARATION(clazz) \ 27 #define DEFINE_FORWARD_DECLARATION(clazz) \
27 class clazz; 28 class clazz;
28 CLASS_LIST(DEFINE_FORWARD_DECLARATION) 29 CLASS_LIST(DEFINE_FORWARD_DECLARATION)
29 #undef DEFINE_FORWARD_DECLARATION 30 #undef DEFINE_FORWARD_DECLARATION
(...skipping 4023 matching lines...) Expand 10 before | Expand all | Expand 10 after
4053 4054
4054 static RawApiError* New(); 4055 static RawApiError* New();
4055 4056
4056 FINAL_HEAP_OBJECT_IMPLEMENTATION(ApiError, Error); 4057 FINAL_HEAP_OBJECT_IMPLEMENTATION(ApiError, Error);
4057 friend class Class; 4058 friend class Class;
4058 }; 4059 };
4059 4060
4060 4061
4061 class LanguageError : public Error { 4062 class LanguageError : public Error {
4062 public: 4063 public:
4063 enum Kind { 4064 Report::Kind kind() const {
4064 kWarning, 4065 return static_cast<Report::Kind>(raw_ptr()->kind_);
4065 kError, 4066 }
4066 kMalformedType,
4067 kMalboundedType,
4068 kBailout,
4069 };
4070
4071 Kind kind() const { return static_cast<Kind>(raw_ptr()->kind_); }
4072 4067
4073 // Build, cache, and return formatted message. 4068 // Build, cache, and return formatted message.
4074 RawString* FormatMessage() const; 4069 RawString* FormatMessage() const;
4075 4070
4076 static intptr_t InstanceSize() { 4071 static intptr_t InstanceSize() {
4077 return RoundedAllocationSize(sizeof(RawLanguageError)); 4072 return RoundedAllocationSize(sizeof(RawLanguageError));
4078 } 4073 }
4079 4074
4080 // A null script means no source and a negative token_pos means no position. 4075 // A null script means no source and a negative token_pos means no position.
4081 static RawLanguageError* NewFormatted(const Error& prev_error, 4076 static RawLanguageError* NewFormatted(const Error& prev_error,
4082 const Script& script, 4077 const Script& script,
4083 intptr_t token_pos, 4078 intptr_t token_pos,
4084 Kind kind, 4079 Report::Kind kind,
4085 Heap::Space space, 4080 Heap::Space space,
4086 const char* format, ...) 4081 const char* format, ...)
4087 PRINTF_ATTRIBUTE(6, 7); 4082 PRINTF_ATTRIBUTE(6, 7);
4088 4083
4089 static RawLanguageError* NewFormattedV(const Error& prev_error, 4084 static RawLanguageError* NewFormattedV(const Error& prev_error,
4090 const Script& script, 4085 const Script& script,
4091 intptr_t token_pos, 4086 intptr_t token_pos,
4092 Kind kind, 4087 Report::Kind kind,
4093 Heap::Space space, 4088 Heap::Space space,
4094 const char* format, va_list args); 4089 const char* format, va_list args);
4095 4090
4096 static RawLanguageError* New(const String& formatted_message, 4091 static RawLanguageError* New(const String& formatted_message,
4097 Kind kind = kError, 4092 Report::Kind kind = Report::kError,
4098 Heap::Space space = Heap::kNew); 4093 Heap::Space space = Heap::kNew);
4099 4094
4100 virtual const char* ToErrorCString() const; 4095 virtual const char* ToErrorCString() const;
4101 4096
4102 private: 4097 private:
4103 RawError* previous_error() const { 4098 RawError* previous_error() const {
4104 return raw_ptr()->previous_error_; 4099 return raw_ptr()->previous_error_;
4105 } 4100 }
4106 void set_previous_error(const Error& value) const; 4101 void set_previous_error(const Error& value) const;
4107 4102
(...skipping 3025 matching lines...) Expand 10 before | Expand all | Expand 10 after
7133 7128
7134 7129
7135 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 7130 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
7136 intptr_t index) { 7131 intptr_t index) {
7137 return array.At((index * kEntryLength) + kTargetFunctionIndex); 7132 return array.At((index * kEntryLength) + kTargetFunctionIndex);
7138 } 7133 }
7139 7134
7140 } // namespace dart 7135 } // namespace dart
7141 7136
7142 #endif // VM_OBJECT_H_ 7137 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698