| 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 2636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2647 bool LoadRequested() const { | 2647 bool LoadRequested() const { |
| 2648 return raw_ptr()->load_state_ == RawLibrary::kLoadRequested; | 2648 return raw_ptr()->load_state_ == RawLibrary::kLoadRequested; |
| 2649 } | 2649 } |
| 2650 bool LoadInProgress() const { | 2650 bool LoadInProgress() const { |
| 2651 return raw_ptr()->load_state_ == RawLibrary::kLoadInProgress; | 2651 return raw_ptr()->load_state_ == RawLibrary::kLoadInProgress; |
| 2652 } | 2652 } |
| 2653 void SetLoadRequested() const; | 2653 void SetLoadRequested() const; |
| 2654 void SetLoadInProgress() const; | 2654 void SetLoadInProgress() const; |
| 2655 bool Loaded() const { return raw_ptr()->load_state_ == RawLibrary::kLoaded; } | 2655 bool Loaded() const { return raw_ptr()->load_state_ == RawLibrary::kLoaded; } |
| 2656 void SetLoaded() const; | 2656 void SetLoaded() const; |
| 2657 bool LoadError() const { | 2657 bool LoadFailed() const { |
| 2658 return raw_ptr()->load_state_ == RawLibrary::kLoadError; | 2658 return raw_ptr()->load_state_ == RawLibrary::kLoadError; |
| 2659 } | 2659 } |
| 2660 void SetLoadError() const; | 2660 RawInstance* LoadError() const { return raw_ptr()->load_error_; } |
| 2661 void SetLoadError(const Instance& error) const; |
| 2662 RawInstance* TransitiveLoadError() const; |
| 2661 | 2663 |
| 2662 static intptr_t InstanceSize() { | 2664 static intptr_t InstanceSize() { |
| 2663 return RoundedAllocationSize(sizeof(RawLibrary)); | 2665 return RoundedAllocationSize(sizeof(RawLibrary)); |
| 2664 } | 2666 } |
| 2665 | 2667 |
| 2666 static RawLibrary* New(const String& url); | 2668 static RawLibrary* New(const String& url); |
| 2667 | 2669 |
| 2668 // Evaluate the given expression as if it appeared in an top-level | 2670 // Evaluate the given expression as if it appeared in an top-level |
| 2669 // method of this library and return the resulting value, or an | 2671 // method of this library and return the resulting value, or an |
| 2670 // error object if evaluating the expression fails. The method has | 2672 // error object if evaluating the expression fails. The method has |
| (...skipping 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4375 friend class TypedDataView; | 4377 friend class TypedDataView; |
| 4376 }; | 4378 }; |
| 4377 | 4379 |
| 4378 | 4380 |
| 4379 class LibraryPrefix : public Instance { | 4381 class LibraryPrefix : public Instance { |
| 4380 public: | 4382 public: |
| 4381 RawString* name() const { return raw_ptr()->name_; } | 4383 RawString* name() const { return raw_ptr()->name_; } |
| 4382 virtual RawString* DictionaryName() const { return name(); } | 4384 virtual RawString* DictionaryName() const { return name(); } |
| 4383 | 4385 |
| 4384 RawArray* imports() const { return raw_ptr()->imports_; } | 4386 RawArray* imports() const { return raw_ptr()->imports_; } |
| 4385 intptr_t num_imports() const { return raw_ptr()->num_imports_; } | 4387 int32_t num_imports() const { return raw_ptr()->num_imports_; } |
| 4386 RawLibrary* importer() const { return raw_ptr()->importer_; } | 4388 RawLibrary* importer() const { return raw_ptr()->importer_; } |
| 4387 | 4389 |
| 4390 RawInstance* LoadError() const; |
| 4391 |
| 4388 bool ContainsLibrary(const Library& library) const; | 4392 bool ContainsLibrary(const Library& library) const; |
| 4389 RawLibrary* GetLibrary(int index) const; | 4393 RawLibrary* GetLibrary(int index) const; |
| 4390 void AddImport(const Namespace& import) const; | 4394 void AddImport(const Namespace& import) const; |
| 4391 RawObject* LookupObject(const String& name) const; | 4395 RawObject* LookupObject(const String& name) const; |
| 4392 RawClass* LookupClass(const String& class_name) const; | 4396 RawClass* LookupClass(const String& class_name) const; |
| 4393 | 4397 |
| 4394 bool is_deferred_load() const { return raw_ptr()->is_deferred_load_; } | 4398 bool is_deferred_load() const { return raw_ptr()->is_deferred_load_; } |
| 4395 bool is_loaded() const { return raw_ptr()->is_loaded_; } | 4399 bool is_loaded() const { return raw_ptr()->is_loaded_; } |
| 4396 bool LoadLibrary() const; | 4400 bool LoadLibrary() const; |
| 4397 | 4401 |
| (...skipping 2903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7301 | 7305 |
| 7302 | 7306 |
| 7303 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 7307 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 7304 intptr_t index) { | 7308 intptr_t index) { |
| 7305 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 7309 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 7306 } | 7310 } |
| 7307 | 7311 |
| 7308 } // namespace dart | 7312 } // namespace dart |
| 7309 | 7313 |
| 7310 #endif // VM_OBJECT_H_ | 7314 #endif // VM_OBJECT_H_ |
| OLD | NEW |