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

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

Issue 419103003: Handle load errors in deferred code (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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
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 2616 matching lines...) Expand 10 before | Expand all | Expand 10 after
2627 bool LoadRequested() const { 2627 bool LoadRequested() const {
2628 return raw_ptr()->load_state_ == RawLibrary::kLoadRequested; 2628 return raw_ptr()->load_state_ == RawLibrary::kLoadRequested;
2629 } 2629 }
2630 bool LoadInProgress() const { 2630 bool LoadInProgress() const {
2631 return raw_ptr()->load_state_ == RawLibrary::kLoadInProgress; 2631 return raw_ptr()->load_state_ == RawLibrary::kLoadInProgress;
2632 } 2632 }
2633 void SetLoadRequested() const; 2633 void SetLoadRequested() const;
2634 void SetLoadInProgress() const; 2634 void SetLoadInProgress() const;
2635 bool Loaded() const { return raw_ptr()->load_state_ == RawLibrary::kLoaded; } 2635 bool Loaded() const { return raw_ptr()->load_state_ == RawLibrary::kLoaded; }
2636 void SetLoaded() const; 2636 void SetLoaded() const;
2637 bool LoadError() const { 2637 bool LoadFailed() const {
2638 return raw_ptr()->load_state_ == RawLibrary::kLoadError; 2638 return raw_ptr()->load_state_ == RawLibrary::kLoadError;
2639 } 2639 }
2640 void SetLoadError() const; 2640 RawObject* LoadError() const { return raw_ptr()->load_error_; }
Ivan Posva 2014/07/31 18:29:05 RawInstance* here and other related places.
hausner 2014/07/31 21:12:45 Done.
2641 void SetLoadError(const Object& error) const;
2642 RawObject* TransitiveLoadError() const;
2641 2643
2642 static intptr_t InstanceSize() { 2644 static intptr_t InstanceSize() {
2643 return RoundedAllocationSize(sizeof(RawLibrary)); 2645 return RoundedAllocationSize(sizeof(RawLibrary));
2644 } 2646 }
2645 2647
2646 static RawLibrary* New(const String& url); 2648 static RawLibrary* New(const String& url);
2647 2649
2648 // Evaluate the given expression as if it appeared in an top-level 2650 // Evaluate the given expression as if it appeared in an top-level
2649 // method of this library and return the resulting value, or an 2651 // method of this library and return the resulting value, or an
2650 // error object if evaluating the expression fails. The method has 2652 // error object if evaluating the expression fails. The method has
(...skipping 1708 matching lines...) Expand 10 before | Expand all | Expand 10 after
4359 friend class TypedDataView; 4361 friend class TypedDataView;
4360 }; 4362 };
4361 4363
4362 4364
4363 class LibraryPrefix : public Instance { 4365 class LibraryPrefix : public Instance {
4364 public: 4366 public:
4365 RawString* name() const { return raw_ptr()->name_; } 4367 RawString* name() const { return raw_ptr()->name_; }
4366 virtual RawString* DictionaryName() const { return name(); } 4368 virtual RawString* DictionaryName() const { return name(); }
4367 4369
4368 RawArray* imports() const { return raw_ptr()->imports_; } 4370 RawArray* imports() const { return raw_ptr()->imports_; }
4369 intptr_t num_imports() const { return raw_ptr()->num_imports_; } 4371 int32_t num_imports() const { return raw_ptr()->num_imports_; }
4370 RawLibrary* importer() const { return raw_ptr()->importer_; } 4372 RawLibrary* importer() const { return raw_ptr()->importer_; }
4371 4373
4374 RawObject* LoadError() const;
Ivan Posva 2014/07/31 18:29:05 Thinking about this more as I go through the CL. C
hausner 2014/07/31 21:12:45 Leaving the name but changing to type Instance, as
4375
4372 bool ContainsLibrary(const Library& library) const; 4376 bool ContainsLibrary(const Library& library) const;
4373 RawLibrary* GetLibrary(int index) const; 4377 RawLibrary* GetLibrary(int index) const;
4374 void AddImport(const Namespace& import) const; 4378 void AddImport(const Namespace& import) const;
4375 RawObject* LookupObject(const String& name) const; 4379 RawObject* LookupObject(const String& name) const;
4376 RawClass* LookupClass(const String& class_name) const; 4380 RawClass* LookupClass(const String& class_name) const;
4377 4381
4378 bool is_deferred_load() const { return raw_ptr()->is_deferred_load_; } 4382 bool is_deferred_load() const { return raw_ptr()->is_deferred_load_; }
4379 bool is_loaded() const { return raw_ptr()->is_loaded_; } 4383 bool is_loaded() const { return raw_ptr()->is_loaded_; }
4380 bool LoadLibrary() const; 4384 bool LoadLibrary() const;
4381 4385
(...skipping 2901 matching lines...) Expand 10 before | Expand all | Expand 10 after
7283 7287
7284 7288
7285 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 7289 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
7286 intptr_t index) { 7290 intptr_t index) {
7287 return array.At((index * kEntryLength) + kTargetFunctionIndex); 7291 return array.At((index * kEntryLength) + kTargetFunctionIndex);
7288 } 7292 }
7289 7293
7290 } // namespace dart 7294 } // namespace dart
7291 7295
7292 #endif // VM_OBJECT_H_ 7296 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698