| 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 3197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3208 } | 3208 } |
| 3209 const char* GetKindAsCString() const; | 3209 const char* GetKindAsCString() const; |
| 3210 intptr_t line_offset() const { return raw_ptr()->line_offset_; } | 3210 intptr_t line_offset() const { return raw_ptr()->line_offset_; } |
| 3211 intptr_t col_offset() const { return raw_ptr()->col_offset_; } | 3211 intptr_t col_offset() const { return raw_ptr()->col_offset_; } |
| 3212 | 3212 |
| 3213 RawTokenStream* tokens() const { return raw_ptr()->tokens_; } | 3213 RawTokenStream* tokens() const { return raw_ptr()->tokens_; } |
| 3214 | 3214 |
| 3215 void Tokenize(const String& private_key) const; | 3215 void Tokenize(const String& private_key) const; |
| 3216 | 3216 |
| 3217 RawLibrary* FindLibrary() const; | 3217 RawLibrary* FindLibrary() const; |
| 3218 RawString* GetLine(intptr_t line_number) const; | 3218 RawString* GetLine(intptr_t line_number, |
| 3219 Heap::Space space = Heap::kNew) const; |
| 3219 RawString* GetSnippet(intptr_t from_line, | 3220 RawString* GetSnippet(intptr_t from_line, |
| 3220 intptr_t from_column, | 3221 intptr_t from_column, |
| 3221 intptr_t to_line, | 3222 intptr_t to_line, |
| 3222 intptr_t to_column) const; | 3223 intptr_t to_column) const; |
| 3223 | 3224 |
| 3224 void SetLocationOffset(intptr_t line_offset, intptr_t col_offset) const; | 3225 void SetLocationOffset(intptr_t line_offset, intptr_t col_offset) const; |
| 3225 | 3226 |
| 3226 void GetTokenLocation(intptr_t token_pos, | 3227 void GetTokenLocation(intptr_t token_pos, |
| 3227 intptr_t* line, | 3228 intptr_t* line, |
| 3228 intptr_t* column, | 3229 intptr_t* column, |
| (...skipping 2172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5401 intptr_t index() const { return raw_ptr()->index_; } | 5402 intptr_t index() const { return raw_ptr()->index_; } |
| 5402 void set_index(intptr_t value) const; | 5403 void set_index(intptr_t value) const; |
| 5403 RawAbstractType* bound() const { return raw_ptr()->bound_; } | 5404 RawAbstractType* bound() const { return raw_ptr()->bound_; } |
| 5404 void set_bound(const AbstractType& value) const; | 5405 void set_bound(const AbstractType& value) const; |
| 5405 // Returns true if bounded_type is below upper_bound, otherwise return false | 5406 // Returns true if bounded_type is below upper_bound, otherwise return false |
| 5406 // and set bound_error if both bounded_type and upper_bound are instantiated. | 5407 // and set bound_error if both bounded_type and upper_bound are instantiated. |
| 5407 // If one or both are not instantiated, returning false only means that the | 5408 // If one or both are not instantiated, returning false only means that the |
| 5408 // bound cannot be checked yet and this is not an error. | 5409 // bound cannot be checked yet and this is not an error. |
| 5409 bool CheckBound(const AbstractType& bounded_type, | 5410 bool CheckBound(const AbstractType& bounded_type, |
| 5410 const AbstractType& upper_bound, | 5411 const AbstractType& upper_bound, |
| 5411 Error* bound_error) const; | 5412 Error* bound_error, |
| 5413 Heap::Space space = Heap::kNew) const; |
| 5412 virtual intptr_t token_pos() const { return raw_ptr()->token_pos_; } | 5414 virtual intptr_t token_pos() const { return raw_ptr()->token_pos_; } |
| 5413 virtual bool IsInstantiated(TrailPtr trail = NULL) const { | 5415 virtual bool IsInstantiated(TrailPtr trail = NULL) const { |
| 5414 return false; | 5416 return false; |
| 5415 } | 5417 } |
| 5416 virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const; | 5418 virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const; |
| 5417 virtual bool IsRecursive() const { return false; } | 5419 virtual bool IsRecursive() const { return false; } |
| 5418 virtual RawAbstractType* InstantiateFrom( | 5420 virtual RawAbstractType* InstantiateFrom( |
| 5419 const TypeArguments& instantiator_type_arguments, | 5421 const TypeArguments& instantiator_type_arguments, |
| 5420 Error* bound_error, | 5422 Error* bound_error, |
| 5421 TrailPtr trail = NULL, | 5423 TrailPtr trail = NULL, |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6179 Heap::Space space = Heap::kNew); | 6181 Heap::Space space = Heap::kNew); |
| 6180 | 6182 |
| 6181 static RawString* IdentifierPrettyName(const String& name); | 6183 static RawString* IdentifierPrettyName(const String& name); |
| 6182 static RawString* IdentifierPrettyNameRetainPrivate(const String& name); | 6184 static RawString* IdentifierPrettyNameRetainPrivate(const String& name); |
| 6183 | 6185 |
| 6184 static bool EqualsIgnoringPrivateKey(const String& str1, | 6186 static bool EqualsIgnoringPrivateKey(const String& str1, |
| 6185 const String& str2); | 6187 const String& str2); |
| 6186 | 6188 |
| 6187 static RawString* NewFormatted(const char* format, ...) | 6189 static RawString* NewFormatted(const char* format, ...) |
| 6188 PRINTF_ATTRIBUTE(1, 2); | 6190 PRINTF_ATTRIBUTE(1, 2); |
| 6189 static RawString* NewFormattedV(const char* format, va_list args); | 6191 static RawString* NewFormatted(Heap::Space space, const char* format, ...) |
| 6192 PRINTF_ATTRIBUTE(2, 3); |
| 6193 static RawString* NewFormattedV(const char* format, va_list args, |
| 6194 Heap::Space space = Heap::kNew); |
| 6190 | 6195 |
| 6191 static bool ParseDouble(const String& str, | 6196 static bool ParseDouble(const String& str, |
| 6192 intptr_t start, | 6197 intptr_t start, |
| 6193 intptr_t end, | 6198 intptr_t end, |
| 6194 double* result); | 6199 double* result); |
| 6195 | 6200 |
| 6196 protected: | 6201 protected: |
| 6197 // These two operate on an array of Latin-1 encoded characters. | 6202 // These two operate on an array of Latin-1 encoded characters. |
| 6198 // They are protected to avoid mistaking Latin-1 for UTF-8, but used | 6203 // They are protected to avoid mistaking Latin-1 for UTF-8, but used |
| 6199 // by friendly templated code (e.g., Symbols). | 6204 // by friendly templated code (e.g., Symbols). |
| (...skipping 1917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8117 | 8122 |
| 8118 | 8123 |
| 8119 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 8124 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 8120 intptr_t index) { | 8125 intptr_t index) { |
| 8121 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 8126 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 8122 } | 8127 } |
| 8123 | 8128 |
| 8124 } // namespace dart | 8129 } // namespace dart |
| 8125 | 8130 |
| 8126 #endif // VM_OBJECT_H_ | 8131 #endif // VM_OBJECT_H_ |
| OLD | NEW |