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

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

Issue 10834397: Expose the WeakProperty type. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: add missing files Created 8 years, 4 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
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5398 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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_
OLDNEW
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698