OLD | NEW |
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 3995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4006 }; | 4006 }; |
4007 | 4007 |
4008 | 4008 |
4009 class LanguageError : public Error { | 4009 class LanguageError : public Error { |
4010 public: | 4010 public: |
4011 enum Kind { | 4011 enum Kind { |
4012 kWarning, | 4012 kWarning, |
4013 kError, | 4013 kError, |
4014 kMalformedType, | 4014 kMalformedType, |
4015 kMalboundedType, | 4015 kMalboundedType, |
| 4016 kBailout, |
4016 }; | 4017 }; |
4017 | 4018 |
4018 Kind kind() const { return static_cast<Kind>(raw_ptr()->kind_); } | 4019 Kind kind() const { return static_cast<Kind>(raw_ptr()->kind_); } |
4019 | 4020 |
4020 // Build, cache, and return formatted message. | 4021 // Build, cache, and return formatted message. |
4021 RawString* FormatMessage() const; | 4022 RawString* FormatMessage() const; |
4022 | 4023 |
4023 static intptr_t InstanceSize() { | 4024 static intptr_t InstanceSize() { |
4024 return RoundedAllocationSize(sizeof(RawLanguageError)); | 4025 return RoundedAllocationSize(sizeof(RawLanguageError)); |
4025 } | 4026 } |
4026 | 4027 |
4027 // A null script means no source and a negative token_pos means no position. | 4028 // A null script means no source and a negative token_pos means no position. |
4028 static RawLanguageError* NewFormatted(const Error& prev_error, | 4029 static RawLanguageError* NewFormatted(const Error& prev_error, |
4029 const Script& script, | 4030 const Script& script, |
4030 intptr_t token_pos, | 4031 intptr_t token_pos, |
4031 Kind kind, | 4032 Kind kind, |
4032 Heap::Space space, | 4033 Heap::Space space, |
4033 const char* format, ...) | 4034 const char* format, ...) |
4034 PRINTF_ATTRIBUTE(6, 7); | 4035 PRINTF_ATTRIBUTE(6, 7); |
4035 | 4036 |
4036 static RawLanguageError* NewFormattedV(const Error& prev_error, | 4037 static RawLanguageError* NewFormattedV(const Error& prev_error, |
4037 const Script& script, | 4038 const Script& script, |
4038 intptr_t token_pos, | 4039 intptr_t token_pos, |
4039 Kind kind, | 4040 Kind kind, |
4040 Heap::Space space, | 4041 Heap::Space space, |
4041 const char* format, va_list args); | 4042 const char* format, va_list args); |
4042 | 4043 |
4043 static RawLanguageError* New(const String& formatted_message, | 4044 static RawLanguageError* New(const String& formatted_message, |
| 4045 Kind kind = kError, |
4044 Heap::Space space = Heap::kNew); | 4046 Heap::Space space = Heap::kNew); |
4045 | 4047 |
4046 virtual const char* ToErrorCString() const; | 4048 virtual const char* ToErrorCString() const; |
4047 | 4049 |
4048 private: | 4050 private: |
4049 RawError* previous_error() const { | 4051 RawError* previous_error() const { |
4050 return raw_ptr()->previous_error_; | 4052 return raw_ptr()->previous_error_; |
4051 } | 4053 } |
4052 void set_previous_error(const Error& value) const; | 4054 void set_previous_error(const Error& value) const; |
4053 | 4055 |
(...skipping 2980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7034 | 7036 |
7035 | 7037 |
7036 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 7038 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
7037 intptr_t index) { | 7039 intptr_t index) { |
7038 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 7040 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
7039 } | 7041 } |
7040 | 7042 |
7041 } // namespace dart | 7043 } // namespace dart |
7042 | 7044 |
7043 #endif // VM_OBJECT_H_ | 7045 #endif // VM_OBJECT_H_ |
OLD | NEW |