Chromium Code Reviews| 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 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1601 static intptr_t InstanceSize() { | 1601 static intptr_t InstanceSize() { |
| 1602 return RoundedAllocationSize(sizeof(RawFunction)); | 1602 return RoundedAllocationSize(sizeof(RawFunction)); |
| 1603 } | 1603 } |
| 1604 | 1604 |
| 1605 static RawFunction* New(const String& name, | 1605 static RawFunction* New(const String& name, |
| 1606 RawFunction::Kind kind, | 1606 RawFunction::Kind kind, |
| 1607 bool is_static, | 1607 bool is_static, |
| 1608 bool is_const, | 1608 bool is_const, |
| 1609 bool is_abstract, | 1609 bool is_abstract, |
| 1610 bool is_external, | 1610 bool is_external, |
| 1611 const Class& owner, | |
| 1611 intptr_t token_pos); | 1612 intptr_t token_pos); |
| 1612 | 1613 |
| 1613 // Allocates a new Function object representing a closure function, as well as | 1614 // Allocates a new Function object representing a closure function, as well as |
| 1614 // a new associated Class object representing the signature class of the | 1615 // a new associated Class object representing the signature class of the |
| 1615 // function. | 1616 // function. |
| 1616 // The function and the class share the same given name. | 1617 // The function and the class share the same given name. |
| 1617 static RawFunction* NewClosureFunction(const String& name, | 1618 static RawFunction* NewClosureFunction(const String& name, |
| 1618 const Function& parent, | 1619 const Function& parent, |
| 1619 intptr_t token_pos); | 1620 intptr_t token_pos); |
| 1620 | 1621 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1666 bool is_final() const { return raw_ptr()->is_final_; } | 1667 bool is_final() const { return raw_ptr()->is_final_; } |
| 1667 bool is_const() const { return raw_ptr()->is_const_; } | 1668 bool is_const() const { return raw_ptr()->is_const_; } |
| 1668 | 1669 |
| 1669 inline intptr_t Offset() const; | 1670 inline intptr_t Offset() const; |
| 1670 inline void SetOffset(intptr_t value) const; | 1671 inline void SetOffset(intptr_t value) const; |
| 1671 | 1672 |
| 1672 RawInstance* value() const; | 1673 RawInstance* value() const; |
| 1673 void set_value(const Instance& value) const; | 1674 void set_value(const Instance& value) const; |
| 1674 | 1675 |
| 1675 RawClass* owner() const { return raw_ptr()->owner_; } | 1676 RawClass* owner() const { return raw_ptr()->owner_; } |
| 1676 void set_owner(const Class& value) const { | 1677 void set_owner(const Class& value) const { |
|
hausner
2012/08/02 23:25:00
Make this setter private?
regis
2012/08/02 23:58:37
Done.
| |
| 1677 StorePointer(&raw_ptr()->owner_, value.raw()); | 1678 StorePointer(&raw_ptr()->owner_, value.raw()); |
| 1678 } | 1679 } |
| 1679 | 1680 |
| 1680 RawAbstractType* type() const { return raw_ptr()->type_; } | 1681 RawAbstractType* type() const { return raw_ptr()->type_; } |
| 1681 void set_type(const AbstractType& value) const; | 1682 void set_type(const AbstractType& value) const; |
| 1682 | 1683 |
| 1683 static intptr_t InstanceSize() { | 1684 static intptr_t InstanceSize() { |
| 1684 return RoundedAllocationSize(sizeof(RawField)); | 1685 return RoundedAllocationSize(sizeof(RawField)); |
| 1685 } | 1686 } |
| 1686 | 1687 |
| 1687 static RawField* New(const String& name, | 1688 static RawField* New(const String& name, |
| 1688 bool is_static, | 1689 bool is_static, |
| 1689 bool is_final, | 1690 bool is_final, |
| 1690 bool is_const, | 1691 bool is_const, |
| 1692 const Class& owner, | |
| 1691 intptr_t token_pos); | 1693 intptr_t token_pos); |
| 1692 | 1694 |
| 1693 static intptr_t value_offset() { return OFFSET_OF(RawField, value_); } | 1695 static intptr_t value_offset() { return OFFSET_OF(RawField, value_); } |
| 1694 | 1696 |
| 1695 intptr_t token_pos() const { return raw_ptr()->token_pos_; } | 1697 intptr_t token_pos() const { return raw_ptr()->token_pos_; } |
| 1696 | 1698 |
| 1697 bool has_initializer() const { return raw_ptr()->has_initializer_; } | 1699 bool has_initializer() const { return raw_ptr()->has_initializer_; } |
| 1698 void set_has_initializer(bool has_initializer) const { | 1700 void set_has_initializer(bool has_initializer) const { |
| 1699 raw_ptr()->has_initializer_ = has_initializer; | 1701 raw_ptr()->has_initializer_ = has_initializer; |
| 1700 } | 1702 } |
| (...skipping 3742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5443 if (this->CharAt(i) != str.CharAt(begin_index + i)) { | 5445 if (this->CharAt(i) != str.CharAt(begin_index + i)) { |
| 5444 return false; | 5446 return false; |
| 5445 } | 5447 } |
| 5446 } | 5448 } |
| 5447 return true; | 5449 return true; |
| 5448 } | 5450 } |
| 5449 | 5451 |
| 5450 } // namespace dart | 5452 } // namespace dart |
| 5451 | 5453 |
| 5452 #endif // VM_OBJECT_H_ | 5454 #endif // VM_OBJECT_H_ |
| OLD | NEW |