| 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 5398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5409 friend class Class; | 5409 friend class Class; |
| 5410 }; | 5410 }; |
| 5411 | 5411 |
| 5412 | 5412 |
| 5413 class WeakProperty : public Instance { | 5413 class WeakProperty : public Instance { |
| 5414 public: | 5414 public: |
| 5415 RawObject* key() const { | 5415 RawObject* key() const { |
| 5416 return raw_ptr()->key_; | 5416 return raw_ptr()->key_; |
| 5417 } | 5417 } |
| 5418 | 5418 |
| 5419 void set_key(const Object& key) { | 5419 void set_key(const Object& key) const { |
| 5420 StorePointer(&raw_ptr()->key_, key.raw()); | 5420 StorePointer(&raw_ptr()->key_, key.raw()); |
| 5421 } | 5421 } |
| 5422 | 5422 |
| 5423 RawObject* value() const { | 5423 RawObject* value() const { |
| 5424 return raw_ptr()->value_; | 5424 return raw_ptr()->value_; |
| 5425 } | 5425 } |
| 5426 | 5426 |
| 5427 void set_value(const Object& value) { | 5427 void set_value(const Object& value) const { |
| 5428 StorePointer(&raw_ptr()->value_, value.raw()); | 5428 StorePointer(&raw_ptr()->value_, value.raw()); |
| 5429 } | 5429 } |
| 5430 | 5430 |
| 5431 static RawWeakProperty* New(Heap::Space space = Heap::kNew); | 5431 static RawWeakProperty* New(Heap::Space space = Heap::kNew); |
| 5432 | 5432 |
| 5433 static intptr_t InstanceSize() { | 5433 static intptr_t InstanceSize() { |
| 5434 return RoundedAllocationSize(sizeof(RawWeakProperty)); | 5434 return RoundedAllocationSize(sizeof(RawWeakProperty)); |
| 5435 } | 5435 } |
| 5436 | 5436 |
| 5437 static void Clear(RawWeakProperty* raw_weak) { | 5437 static void Clear(RawWeakProperty* raw_weak) { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5549 if (this->CharAt(i) != str.CharAt(begin_index + i)) { | 5549 if (this->CharAt(i) != str.CharAt(begin_index + i)) { |
| 5550 return false; | 5550 return false; |
| 5551 } | 5551 } |
| 5552 } | 5552 } |
| 5553 return true; | 5553 return true; |
| 5554 } | 5554 } |
| 5555 | 5555 |
| 5556 } // namespace dart | 5556 } // namespace dart |
| 5557 | 5557 |
| 5558 #endif // VM_OBJECT_H_ | 5558 #endif // VM_OBJECT_H_ |
| OLD | NEW |