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 5083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5094 } | 5094 } |
| 5095 | 5095 |
| 5096 static const Bool& True() { | 5096 static const Bool& True() { |
| 5097 return Object::bool_true(); | 5097 return Object::bool_true(); |
| 5098 } | 5098 } |
| 5099 | 5099 |
| 5100 static const Bool& False() { | 5100 static const Bool& False() { |
| 5101 return Object::bool_false(); | 5101 return Object::bool_false(); |
| 5102 } | 5102 } |
| 5103 | 5103 |
| 5104 static RawBool* Get(bool value) { | 5104 static const Bool& Get(bool value) { |
| 5105 return value ? Bool::True().raw() : Bool::False().raw(); | 5105 return value ? Bool::True() : Bool::False(); |
| 5106 } | 5106 } |
|
srdjan
2013/08/27 15:32:44
Best from both worlds?
add:
static RawBool* GetRaw
Ivan Posva
2013/08/27 15:51:25
I would think that is overkill.
| |
| 5107 | 5107 |
| 5108 private: | 5108 private: |
| 5109 void set_value(bool value) const { raw_ptr()->value_ = value; } | 5109 void set_value(bool value) const { raw_ptr()->value_ = value; } |
| 5110 | 5110 |
| 5111 // New should only be called to initialize the two legal bool values. | 5111 // New should only be called to initialize the two legal bool values. |
| 5112 static RawBool* New(bool value); | 5112 static RawBool* New(bool value); |
| 5113 | 5113 |
| 5114 FINAL_HEAP_OBJECT_IMPLEMENTATION(Bool, Instance); | 5114 FINAL_HEAP_OBJECT_IMPLEMENTATION(Bool, Instance); |
| 5115 friend class Class; | 5115 friend class Class; |
| 5116 friend class Object; // To initialize the true and false values. | 5116 friend class Object; // To initialize the true and false values. |
| (...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6131 | 6131 |
| 6132 | 6132 |
| 6133 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6133 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6134 intptr_t index) { | 6134 intptr_t index) { |
| 6135 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6135 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6136 } | 6136 } |
| 6137 | 6137 |
| 6138 } // namespace dart | 6138 } // namespace dart |
| 6139 | 6139 |
| 6140 #endif // VM_OBJECT_H_ | 6140 #endif // VM_OBJECT_H_ |
| OLD | NEW |