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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 330 | 330 |
| 331 static Object& ZoneHandle() { | 331 static Object& ZoneHandle() { |
| 332 return ZoneHandle(Isolate::Current(), null_); | 332 return ZoneHandle(Isolate::Current(), null_); |
| 333 } | 333 } |
| 334 | 334 |
| 335 static Object& ZoneHandle(RawObject* raw_ptr) { | 335 static Object& ZoneHandle(RawObject* raw_ptr) { |
| 336 return ZoneHandle(Isolate::Current(), raw_ptr); | 336 return ZoneHandle(Isolate::Current(), raw_ptr); |
| 337 } | 337 } |
| 338 | 338 |
| 339 static RawObject* null() { return null_; } | 339 static RawObject* null() { return null_; } |
| 340 | |
| 340 static const Object& null_object() { | 341 static const Object& null_object() { |
| 341 ASSERT(null_object_ != NULL); | 342 ASSERT(null_object_ != NULL); |
| 342 return *null_object_; | 343 return *null_object_; |
| 343 } | 344 } |
| 344 static const Array& null_array() { | 345 static const Array& null_array() { |
| 345 ASSERT(null_array_ != NULL); | 346 ASSERT(null_array_ != NULL); |
| 346 return *null_array_; | 347 return *null_array_; |
| 347 } | 348 } |
| 348 static const String& null_string() { | 349 static const String& null_string() { |
| 349 ASSERT(null_string_ != NULL); | 350 ASSERT(null_string_ != NULL); |
| 350 return *null_string_; | 351 return *null_string_; |
| 351 } | 352 } |
| 352 static const Instance& null_instance() { | 353 static const Instance& null_instance() { |
| 353 ASSERT(null_instance_ != NULL); | 354 ASSERT(null_instance_ != NULL); |
| 354 return *null_instance_; | 355 return *null_instance_; |
| 355 } | 356 } |
| 356 static const AbstractTypeArguments& null_abstract_type_arguments() { | 357 static const AbstractTypeArguments& null_abstract_type_arguments() { |
| 357 ASSERT(null_abstract_type_arguments_ != NULL); | 358 ASSERT(null_abstract_type_arguments_ != NULL); |
| 358 return *null_abstract_type_arguments_; | 359 return *null_abstract_type_arguments_; |
| 359 } | 360 } |
| 360 static const Array& empty_array() { | 361 static const Array& empty_array() { |
|
Ivan Posva
2013/09/13 17:25:10
If you want to separate the null_xyz from the rest
zra
2013/09/13 17:46:18
Done.
| |
| 361 ASSERT(empty_array_ != NULL); | 362 ASSERT(empty_array_ != NULL); |
| 362 return *empty_array_; | 363 return *empty_array_; |
| 363 } | 364 } |
| 364 | 365 |
| 365 // The sentinel is a value that cannot be produced by Dart code. | 366 // The sentinel is a value that cannot be produced by Dart code. |
| 366 // It can be used to mark special values, for example to distinguish | 367 // It can be used to mark special values, for example to distinguish |
| 367 // "uninitialized" fields. | 368 // "uninitialized" fields. |
| 368 static const Instance& sentinel() { | 369 static const Instance& sentinel() { |
| 369 ASSERT(sentinel_ != NULL); | 370 ASSERT(sentinel_ != NULL); |
| 370 return *sentinel_; | 371 return *sentinel_; |
| (...skipping 5787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6158 | 6159 |
| 6159 | 6160 |
| 6160 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6161 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6161 intptr_t index) { | 6162 intptr_t index) { |
| 6162 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6163 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6163 } | 6164 } |
| 6164 | 6165 |
| 6165 } // namespace dart | 6166 } // namespace dart |
| 6166 | 6167 |
| 6167 #endif // VM_OBJECT_H_ | 6168 #endif // VM_OBJECT_H_ |
| OLD | NEW |