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

Unified Diff: runtime/vm/object.h

Issue 208323015: Support deferred library prefix syntax (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 34480)
+++ runtime/vm/object.h (working copy)
@@ -447,7 +447,6 @@
static RawClass* token_stream_class() { return token_stream_class_; }
static RawClass* script_class() { return script_class_; }
static RawClass* library_class() { return library_class_; }
- static RawClass* library_prefix_class() { return library_prefix_class_; }
static RawClass* namespace_class() { return namespace_class_; }
static RawClass* code_class() { return code_class_; }
static RawClass* instructions_class() { return instructions_class_; }
@@ -598,7 +597,6 @@
static RawClass* token_stream_class_; // Class of the TokenStream vm object.
static RawClass* script_class_; // Class of the Script vm object.
static RawClass* library_class_; // Class of the Library vm object.
- static RawClass* library_prefix_class_; // Class of Library prefix vm object.
static RawClass* namespace_class_; // Class of Namespace vm object.
static RawClass* code_class_; // Class of the Code vm object.
static RawClass* instructions_class_; // Class of the Instructions vm object.
@@ -2722,41 +2720,6 @@
};
-class LibraryPrefix : public Object {
- public:
- RawString* name() const { return raw_ptr()->name_; }
- virtual RawString* DictionaryName() const { return name(); }
-
- RawArray* imports() const { return raw_ptr()->imports_; }
- intptr_t num_imports() const { return raw_ptr()->num_imports_; }
-
- bool ContainsLibrary(const Library& library) const;
- RawLibrary* GetLibrary(int index) const;
- void AddImport(const Namespace& import) const;
- RawObject* LookupObject(const String& name) const;
- RawClass* LookupClass(const String& class_name) const;
-
- static intptr_t InstanceSize() {
- return RoundedAllocationSize(sizeof(RawLibraryPrefix));
- }
-
- static RawLibraryPrefix* New(const String& name, const Namespace& import);
-
- private:
- static const int kInitialSize = 2;
- static const int kIncrementSize = 2;
-
- void set_name(const String& value) const;
- void set_imports(const Array& value) const;
- void set_num_imports(intptr_t value) const;
-
- static RawLibraryPrefix* New();
-
- FINAL_HEAP_OBJECT_IMPLEMENTATION(LibraryPrefix, Object);
- friend class Class;
-};
-
-
// A Namespace contains the names in a library dictionary, filtered by
// the show/hide combinators.
class Namespace : public Object {
@@ -4124,6 +4087,58 @@
};
+class LibraryPrefix : public Instance {
+ public:
+ RawString* name() const { return raw_ptr()->name_; }
+ virtual RawString* DictionaryName() const { return name(); }
+
+ RawArray* imports() const { return raw_ptr()->imports_; }
+ intptr_t num_imports() const { return raw_ptr()->num_imports_; }
+
+ bool ContainsLibrary(const Library& library) const;
+ RawLibrary* GetLibrary(int index) const;
+ void AddImport(const Namespace& import) const;
+ RawObject* LookupObject(const String& name) const;
+ RawClass* LookupClass(const String& class_name) const;
+
+ bool is_deferred_load() const { return raw_ptr()->is_deferred_load_; }
+ bool is_loaded() const { return raw_ptr()->is_loaded_; }
+ void LoadLibrary() const;
+
+ // Return the list of code objects that were compiled when this
+ // prefix was not yet loaded. These code objects will be invalidated
+ // when the prefix is loaded.
+ RawArray* dependent_code() const;
+ void set_dependent_code(const Array& array) const;
+
+ // Add the given code object to the list of dependent ones.
+ void RegisterDependentCode(const Code& code) const;
+ void InvalidateDependentCode() const;
+
+ static intptr_t InstanceSize() {
+ return RoundedAllocationSize(sizeof(RawLibraryPrefix));
+ }
+
+ static RawLibraryPrefix* New(const String& name,
+ const Namespace& import,
+ bool deferred_load);
+
+ private:
+ static const int kInitialSize = 2;
+ static const int kIncrementSize = 2;
+
+ void set_name(const String& value) const;
+ void set_imports(const Array& value) const;
+ void set_num_imports(intptr_t value) const;
+ void set_is_loaded() const;
+
+ static RawLibraryPrefix* New();
+
+ FINAL_HEAP_OBJECT_IMPLEMENTATION(LibraryPrefix, Instance);
+ friend class Class;
+};
+
+
// AbstractType is an abstract superclass.
// Subclasses of AbstractType are Type and TypeParameter.
class AbstractType : public Instance {
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698