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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
283 } | 283 } |
284 static RawClass* unwind_error_class() { return unwind_error_class_; } | 284 static RawClass* unwind_error_class() { return unwind_error_class_; } |
285 static RawClass* icdata_class() { return icdata_class_; } | 285 static RawClass* icdata_class() { return icdata_class_; } |
286 static RawClass* subtypetestcache_class() { return subtypetestcache_class_; } | 286 static RawClass* subtypetestcache_class() { return subtypetestcache_class_; } |
287 | 287 |
288 static RawClass* CreateAndRegisterInterface(const char* cname, | 288 static RawClass* CreateAndRegisterInterface(const char* cname, |
289 const Script& script, | 289 const Script& script, |
290 const Library& lib); | 290 const Library& lib); |
291 static void RegisterClass(const Class& cls, | 291 static void RegisterClass(const Class& cls, |
292 const char* cname, | 292 const char* cname, |
293 const Script& script, | |
294 const Library& lib); | 293 const Library& lib); |
295 | 294 |
296 static void RegisterPrivateClass(const Class& cls, | 295 static void RegisterPrivateClass(const Class& cls, |
297 const char* cname, | 296 const char* cname, |
298 const Script& script, | 297 const Script& script, |
299 const Library& lib); | 298 const Library& lib); |
siva
2012/08/13 18:46:12
We should probably move the two methods RegisterCl
Ivan Posva
2012/08/13 23:01:17
Done. Same for CreateAndRegisterInterface.
| |
300 | 299 |
301 static RawError* Init(Isolate* isolate); | 300 static RawError* Init(Isolate* isolate); |
302 static void InitFromSnapshot(Isolate* isolate); | 301 static void InitFromSnapshot(Isolate* isolate); |
303 static void InitOnce(); | 302 static void InitOnce(); |
304 static void RegisterSingletonClassNames(); | 303 static void RegisterSingletonClassNames(); |
305 | 304 |
306 static intptr_t InstanceSize() { | 305 static intptr_t InstanceSize() { |
307 return RoundedAllocationSize(sizeof(RawObject)); | 306 return RoundedAllocationSize(sizeof(RawObject)); |
308 } | 307 } |
309 | 308 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
457 intptr_t id() const { return raw_ptr()->id_; } | 456 intptr_t id() const { return raw_ptr()->id_; } |
458 void set_id(intptr_t value) const { | 457 void set_id(intptr_t value) const { |
459 raw_ptr()->id_ = value; | 458 raw_ptr()->id_ = value; |
460 } | 459 } |
461 | 460 |
462 RawString* Name() const; | 461 RawString* Name() const; |
463 | 462 |
464 RawString* UserVisibleName() const; | 463 RawString* UserVisibleName() const; |
465 | 464 |
466 RawScript* script() const { return raw_ptr()->script_; } | 465 RawScript* script() const { return raw_ptr()->script_; } |
466 void set_script(const Script& value) const; | |
467 | 467 |
468 intptr_t token_pos() const { return raw_ptr()->token_pos_; } | 468 intptr_t token_pos() const { return raw_ptr()->token_pos_; } |
469 | 469 |
470 // This class represents the signature class of a closure function if | 470 // This class represents the signature class of a closure function if |
471 // signature_function() is not null. | 471 // signature_function() is not null. |
472 // The associated function may be a closure function (with code) or a | 472 // The associated function may be a closure function (with code) or a |
473 // signature function (without code) solely describing the result type and | 473 // signature function (without code) solely describing the result type and |
474 // parameter types of the signature. | 474 // parameter types of the signature. |
475 RawFunction* signature_function() const { | 475 RawFunction* signature_function() const { |
476 return raw_ptr()->signature_function_; | 476 return raw_ptr()->signature_function_; |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
705 const Function& signature_function, | 705 const Function& signature_function, |
706 const Script& script); | 706 const Script& script); |
707 | 707 |
708 // Return a class object corresponding to the specified kind. If | 708 // Return a class object corresponding to the specified kind. If |
709 // a canonicalized version of it exists then that object is returned | 709 // a canonicalized version of it exists then that object is returned |
710 // otherwise a new object is allocated and returned. | 710 // otherwise a new object is allocated and returned. |
711 static RawClass* GetClass(intptr_t class_id, bool is_signature_class); | 711 static RawClass* GetClass(intptr_t class_id, bool is_signature_class); |
712 | 712 |
713 private: | 713 private: |
714 void set_name(const String& value) const; | 714 void set_name(const String& value) const; |
715 void set_script(const Script& value) const; | |
716 void set_token_pos(intptr_t value) const; | 715 void set_token_pos(intptr_t value) const; |
717 void set_signature_function(const Function& value) const; | 716 void set_signature_function(const Function& value) const; |
718 void set_signature_type(const AbstractType& value) const; | 717 void set_signature_type(const AbstractType& value) const; |
719 void set_class_state(int8_t state) const; | 718 void set_class_state(int8_t state) const; |
720 | 719 |
721 void set_constants(const Array& value) const; | 720 void set_constants(const Array& value) const; |
722 | 721 |
723 void set_canonical_types(const Array& value) const; | 722 void set_canonical_types(const Array& value) const; |
724 RawArray* canonical_types() const; | 723 RawArray* canonical_types() const; |
725 | 724 |
(...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1988 intptr_t token_pos) const; | 1987 intptr_t token_pos) const; |
1989 | 1988 |
1990 // Resolving native methods for script loaded in the library. | 1989 // Resolving native methods for script loaded in the library. |
1991 Dart_NativeEntryResolver native_entry_resolver() const { | 1990 Dart_NativeEntryResolver native_entry_resolver() const { |
1992 return raw_ptr()->native_entry_resolver_; | 1991 return raw_ptr()->native_entry_resolver_; |
1993 } | 1992 } |
1994 void set_native_entry_resolver(Dart_NativeEntryResolver value) const { | 1993 void set_native_entry_resolver(Dart_NativeEntryResolver value) const { |
1995 raw_ptr()->native_entry_resolver_ = value; | 1994 raw_ptr()->native_entry_resolver_ = value; |
1996 } | 1995 } |
1997 | 1996 |
1998 RawError* Patch(const String& url, const String& source) const; | 1997 RawError* Patch(const Script& script) const; |
1999 | 1998 |
2000 RawString* PrivateName(const String& name) const; | 1999 RawString* PrivateName(const String& name) const; |
2001 | 2000 |
2002 intptr_t index() const { return raw_ptr()->index_; } | 2001 intptr_t index() const { return raw_ptr()->index_; } |
2003 void set_index(intptr_t value) const { | 2002 void set_index(intptr_t value) const { |
2004 raw_ptr()->index_ = value; | 2003 raw_ptr()->index_ = value; |
2005 } | 2004 } |
2006 | 2005 |
2007 void Register() const; | 2006 void Register() const; |
2008 | 2007 |
(...skipping 3443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5452 if (this->CharAt(i) != str.CharAt(begin_index + i)) { | 5451 if (this->CharAt(i) != str.CharAt(begin_index + i)) { |
5453 return false; | 5452 return false; |
5454 } | 5453 } |
5455 } | 5454 } |
5456 return true; | 5455 return true; |
5457 } | 5456 } |
5458 | 5457 |
5459 } // namespace dart | 5458 } // namespace dart |
5460 | 5459 |
5461 #endif // VM_OBJECT_H_ | 5460 #endif // VM_OBJECT_H_ |
OLD | NEW |