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

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

Issue 10967052: Support for show/hide combinators (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 } 265 }
266 static RawClass* patch_class_class() { return patch_class_class_; } 266 static RawClass* patch_class_class() { return patch_class_class_; }
267 static RawClass* function_class() { return function_class_; } 267 static RawClass* function_class() { return function_class_; }
268 static RawClass* closure_data_class() { return closure_data_class_; } 268 static RawClass* closure_data_class() { return closure_data_class_; }
269 static RawClass* field_class() { return field_class_; } 269 static RawClass* field_class() { return field_class_; }
270 static RawClass* literal_token_class() { return literal_token_class_; } 270 static RawClass* literal_token_class() { return literal_token_class_; }
271 static RawClass* token_stream_class() { return token_stream_class_; } 271 static RawClass* token_stream_class() { return token_stream_class_; }
272 static RawClass* script_class() { return script_class_; } 272 static RawClass* script_class() { return script_class_; }
273 static RawClass* library_class() { return library_class_; } 273 static RawClass* library_class() { return library_class_; }
274 static RawClass* library_prefix_class() { return library_prefix_class_; } 274 static RawClass* library_prefix_class() { return library_prefix_class_; }
275 static RawClass* namespace_class() { return namespace_class_; }
275 static RawClass* code_class() { return code_class_; } 276 static RawClass* code_class() { return code_class_; }
276 static RawClass* instructions_class() { return instructions_class_; } 277 static RawClass* instructions_class() { return instructions_class_; }
277 static RawClass* pc_descriptors_class() { return pc_descriptors_class_; } 278 static RawClass* pc_descriptors_class() { return pc_descriptors_class_; }
278 static RawClass* stackmap_class() { return stackmap_class_; } 279 static RawClass* stackmap_class() { return stackmap_class_; }
279 static RawClass* var_descriptors_class() { return var_descriptors_class_; } 280 static RawClass* var_descriptors_class() { return var_descriptors_class_; }
280 static RawClass* exception_handlers_class() { 281 static RawClass* exception_handlers_class() {
281 return exception_handlers_class_; 282 return exception_handlers_class_;
282 } 283 }
283 static RawClass* deopt_info_class() { return deopt_info_class_; } 284 static RawClass* deopt_info_class() { return deopt_info_class_; }
284 static RawClass* context_class() { return context_class_; } 285 static RawClass* context_class() { return context_class_; }
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 static RawClass* instantiated_type_arguments_class_; // Class of Inst..ments. 397 static RawClass* instantiated_type_arguments_class_; // Class of Inst..ments.
397 static RawClass* patch_class_class_; // Class of the PatchClass vm object. 398 static RawClass* patch_class_class_; // Class of the PatchClass vm object.
398 static RawClass* function_class_; // Class of the Function vm object. 399 static RawClass* function_class_; // Class of the Function vm object.
399 static RawClass* closure_data_class_; // Class of ClosureData vm obj. 400 static RawClass* closure_data_class_; // Class of ClosureData vm obj.
400 static RawClass* field_class_; // Class of the Field vm object. 401 static RawClass* field_class_; // Class of the Field vm object.
401 static RawClass* literal_token_class_; // Class of LiteralToken vm object. 402 static RawClass* literal_token_class_; // Class of LiteralToken vm object.
402 static RawClass* token_stream_class_; // Class of the TokenStream vm object. 403 static RawClass* token_stream_class_; // Class of the TokenStream vm object.
403 static RawClass* script_class_; // Class of the Script vm object. 404 static RawClass* script_class_; // Class of the Script vm object.
404 static RawClass* library_class_; // Class of the Library vm object. 405 static RawClass* library_class_; // Class of the Library vm object.
405 static RawClass* library_prefix_class_; // Class of Library prefix vm object. 406 static RawClass* library_prefix_class_; // Class of Library prefix vm object.
407 static RawClass* namespace_class_; // Class of Namespace vm object.
406 static RawClass* code_class_; // Class of the Code vm object. 408 static RawClass* code_class_; // Class of the Code vm object.
407 static RawClass* instructions_class_; // Class of the Instructions vm object. 409 static RawClass* instructions_class_; // Class of the Instructions vm object.
408 static RawClass* pc_descriptors_class_; // Class of PcDescriptors vm object. 410 static RawClass* pc_descriptors_class_; // Class of PcDescriptors vm object.
409 static RawClass* stackmap_class_; // Class of Stackmap vm object. 411 static RawClass* stackmap_class_; // Class of Stackmap vm object.
410 static RawClass* var_descriptors_class_; // Class of LocalVarDescriptors. 412 static RawClass* var_descriptors_class_; // Class of LocalVarDescriptors.
411 static RawClass* exception_handlers_class_; // Class of ExceptionHandlers. 413 static RawClass* exception_handlers_class_; // Class of ExceptionHandlers.
412 static RawClass* deopt_info_class_; // Class of DeoptInfo. 414 static RawClass* deopt_info_class_; // Class of DeoptInfo.
413 static RawClass* context_class_; // Class of the Context vm object. 415 static RawClass* context_class_; // Class of the Context vm object.
414 static RawClass* context_scope_class_; // Class of ContextScope vm object. 416 static RawClass* context_scope_class_; // Class of ContextScope vm object.
415 static RawClass* icdata_class_; // Class of ICData. 417 static RawClass* icdata_class_; // Class of ICData.
(...skipping 1678 matching lines...) Expand 10 before | Expand all | Expand 10 after
2094 RawField* LookupLocalField(const String& name) const; 2096 RawField* LookupLocalField(const String& name) const;
2095 RawFunction* LookupFunctionAllowPrivate(const String& name) const; 2097 RawFunction* LookupFunctionAllowPrivate(const String& name) const;
2096 RawFunction* LookupLocalFunction(const String& name) const; 2098 RawFunction* LookupLocalFunction(const String& name) const;
2097 RawLibraryPrefix* LookupLocalLibraryPrefix(const String& name) const; 2099 RawLibraryPrefix* LookupLocalLibraryPrefix(const String& name) const;
2098 RawScript* LookupScript(const String& url) const; 2100 RawScript* LookupScript(const String& url) const;
2099 RawArray* LoadedScripts() const; 2101 RawArray* LoadedScripts() const;
2100 2102
2101 void AddAnonymousClass(const Class& cls) const; 2103 void AddAnonymousClass(const Class& cls) const;
2102 2104
2103 // Library imports. 2105 // Library imports.
2104 void AddImport(const Library& library) const; 2106 void AddImport(const Namespace& ns) const;
2107 void AddImportAll(const Library& library) const;
2105 RawLibrary* LookupImport(const String& url) const; 2108 RawLibrary* LookupImport(const String& url) const;
2106 intptr_t num_imports() const { return raw_ptr()->num_imports_; } 2109 intptr_t num_imports() const { return raw_ptr()->num_imports_; }
2107 RawLibrary* ImportAt(intptr_t index) const; 2110 RawNamespace* ImportAt(intptr_t index) const;
2108 RawLibraryPrefix* ImportPrefixAt(intptr_t index) const; 2111 RawLibrary* ImportLibraryAt(intptr_t index) const;
2109 bool ImportsCorelib() const; 2112 bool ImportsCorelib() const;
2110 2113
2111 RawFunction* LookupFunctionInSource(const String& script_url, 2114 RawFunction* LookupFunctionInSource(const String& script_url,
2112 intptr_t line_number) const; 2115 intptr_t line_number) const;
2113 RawFunction* LookupFunctionInScript(const Script& script, 2116 RawFunction* LookupFunctionInScript(const Script& script,
2114 intptr_t token_pos) const; 2117 intptr_t token_pos) const;
2115 2118
2116 // Resolving native methods for script loaded in the library. 2119 // Resolving native methods for script loaded in the library.
2117 Dart_NativeEntryResolver native_entry_resolver() const { 2120 Dart_NativeEntryResolver native_entry_resolver() const {
2118 return raw_ptr()->native_entry_resolver_; 2121 return raw_ptr()->native_entry_resolver_;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
2181 void GrowDictionary(const Array& dict, intptr_t dict_size) const; 2184 void GrowDictionary(const Array& dict, intptr_t dict_size) const;
2182 static RawLibrary* NewLibraryHelper(const String& url, 2185 static RawLibrary* NewLibraryHelper(const String& url,
2183 bool import_core_lib); 2186 bool import_core_lib);
2184 RawObject* LookupEntry(const String& name, intptr_t *index) const; 2187 RawObject* LookupEntry(const String& name, intptr_t *index) const;
2185 2188
2186 HEAP_OBJECT_IMPLEMENTATION(Library, Object); 2189 HEAP_OBJECT_IMPLEMENTATION(Library, Object);
2187 friend class Class; 2190 friend class Class;
2188 friend class Debugger; 2191 friend class Debugger;
2189 friend class DictionaryIterator; 2192 friend class DictionaryIterator;
2190 friend class Isolate; 2193 friend class Isolate;
2194 friend class Namespace;
2191 }; 2195 };
2192 2196
2193 2197
2194 class LibraryPrefix : public Object { 2198 class LibraryPrefix : public Object {
2195 public: 2199 public:
2196 RawString* name() const { return raw_ptr()->name_; } 2200 RawString* name() const { return raw_ptr()->name_; }
2197 virtual RawString* DictionaryName() const { return name(); } 2201 virtual RawString* DictionaryName() const { return name(); }
2198 2202
2199 RawArray* libraries() const { return raw_ptr()->libraries_; } 2203 RawArray* imports() const { return raw_ptr()->imports_; }
2200 intptr_t num_libs() const { return raw_ptr()->num_libs_; } 2204 intptr_t num_imports() const { return raw_ptr()->num_imports_; }
2201 2205
2202 bool ContainsLibrary(const Library& library) const; 2206 bool ContainsLibrary(const Library& library) const;
2203 RawLibrary* GetLibrary(int index) const; 2207 RawLibrary* GetLibrary(int index) const;
2204 void AddLibrary(const Library& library) const; 2208 void AddImport(const Namespace& import) const;
2205 RawClass* LookupLocalClass(const String& class_name) const; 2209 RawClass* LookupLocalClass(const String& class_name) const;
2206 2210
2207 static intptr_t InstanceSize() { 2211 static intptr_t InstanceSize() {
2208 return RoundedAllocationSize(sizeof(RawLibraryPrefix)); 2212 return RoundedAllocationSize(sizeof(RawLibraryPrefix));
2209 } 2213 }
2210 2214
2211 static RawLibraryPrefix* New(const String& name, const Library& lib); 2215 static RawLibraryPrefix* New(const String& name, const Namespace& import);
2212 2216
2213 private: 2217 private:
2214 static const int kInitialSize = 2; 2218 static const int kInitialSize = 2;
2215 static const int kIncrementSize = 2; 2219 static const int kIncrementSize = 2;
2216 2220
2217 void set_name(const String& value) const; 2221 void set_name(const String& value) const;
2218 void set_libraries(const Array& value) const; 2222 void set_imports(const Array& value) const;
2219 void set_num_libs(intptr_t value) const; 2223 void set_num_imports(intptr_t value) const;
2220 static RawLibraryPrefix* New(); 2224 static RawLibraryPrefix* New();
2221 2225
2222 HEAP_OBJECT_IMPLEMENTATION(LibraryPrefix, Object); 2226 HEAP_OBJECT_IMPLEMENTATION(LibraryPrefix, Object);
2223 friend class Class; 2227 friend class Class;
2224 friend class Isolate; 2228 friend class Isolate;
2225 }; 2229 };
2226 2230
2227 2231
2232 class Namespace : public Object {
2233 public:
2234 RawLibrary* library() const { return raw_ptr()->library_; }
2235 RawArray* show_names() const { return raw_ptr()->show_names_; }
2236 RawArray* hide_names() const { return raw_ptr()->hide_names_; }
2237
2238 static intptr_t InstanceSize() {
2239 return RoundedAllocationSize(sizeof(RawNamespace));
2240 }
2241
2242 bool HidesName(const String& name) const;
2243 RawObject* Lookup(const String& name) const;
2244
2245 static RawNamespace* New(const Library& library,
2246 const Array& show_names,
2247 const Array& hide_names);
2248 private:
2249 static RawNamespace* New();
2250
2251 HEAP_OBJECT_IMPLEMENTATION(Namespace, Object);
2252 friend class Class;
2253 };
2254
2255
2228 class Instructions : public Object { 2256 class Instructions : public Object {
2229 public: 2257 public:
2230 intptr_t size() const { return raw_ptr()->size_; } 2258 intptr_t size() const { return raw_ptr()->size_; }
2231 RawCode* code() const { return raw_ptr()->code_; } 2259 RawCode* code() const { return raw_ptr()->code_; }
2232 2260
2233 uword EntryPoint() const { 2261 uword EntryPoint() const {
2234 return reinterpret_cast<uword>(raw_ptr()) + HeaderSize(); 2262 return reinterpret_cast<uword>(raw_ptr()) + HeaderSize();
2235 } 2263 }
2236 2264
2237 static const intptr_t kMaxElements = (kIntptrMax - 2265 static const intptr_t kMaxElements = (kIntptrMax -
(...skipping 3412 matching lines...) Expand 10 before | Expand all | Expand 10 after
5650 if (this->CharAt(i) != str.CharAt(begin_index + i)) { 5678 if (this->CharAt(i) != str.CharAt(begin_index + i)) {
5651 return false; 5679 return false;
5652 } 5680 }
5653 } 5681 }
5654 return true; 5682 return true;
5655 } 5683 }
5656 5684
5657 } // namespace dart 5685 } // namespace dart
5658 5686
5659 #endif // VM_OBJECT_H_ 5687 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698