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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 361 static const AbstractTypeArguments& null_abstract_type_arguments() { | 361 static const AbstractTypeArguments& null_abstract_type_arguments() { |
| 362 ASSERT(null_abstract_type_arguments_ != NULL); | 362 ASSERT(null_abstract_type_arguments_ != NULL); |
| 363 return *null_abstract_type_arguments_; | 363 return *null_abstract_type_arguments_; |
| 364 } | 364 } |
| 365 | 365 |
| 366 static const Array& empty_array() { | 366 static const Array& empty_array() { |
| 367 ASSERT(empty_array_ != NULL); | 367 ASSERT(empty_array_ != NULL); |
| 368 return *empty_array_; | 368 return *empty_array_; |
| 369 } | 369 } |
| 370 | 370 |
| 371 static const PcDescriptors& empty_descriptors() { | |
| 372 ASSERT(empty_descriptors_ != NULL); | |
| 373 return *empty_descriptors_; | |
| 374 } | |
| 375 | |
| 371 // The sentinel is a value that cannot be produced by Dart code. | 376 // The sentinel is a value that cannot be produced by Dart code. |
| 372 // It can be used to mark special values, for example to distinguish | 377 // It can be used to mark special values, for example to distinguish |
| 373 // "uninitialized" fields. | 378 // "uninitialized" fields. |
| 374 static const Instance& sentinel() { | 379 static const Instance& sentinel() { |
| 375 ASSERT(sentinel_ != NULL); | 380 ASSERT(sentinel_ != NULL); |
| 376 return *sentinel_; | 381 return *sentinel_; |
| 377 } | 382 } |
| 378 // Value marking that we are transitioning from sentinel, e.g., computing | 383 // Value marking that we are transitioning from sentinel, e.g., computing |
| 379 // a field value. Used to detect circular initialization. | 384 // a field value. Used to detect circular initialization. |
| 380 static const Instance& transition_sentinel() { | 385 static const Instance& transition_sentinel() { |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 607 static RawClass* unwind_error_class_; // Class of UnwindError. | 612 static RawClass* unwind_error_class_; // Class of UnwindError. |
| 608 | 613 |
| 609 // The static values below are read-only handle pointers for singleton | 614 // The static values below are read-only handle pointers for singleton |
| 610 // objects that are shared between the different isolates. | 615 // objects that are shared between the different isolates. |
| 611 static Object* null_object_; | 616 static Object* null_object_; |
| 612 static Array* null_array_; | 617 static Array* null_array_; |
| 613 static String* null_string_; | 618 static String* null_string_; |
| 614 static Instance* null_instance_; | 619 static Instance* null_instance_; |
| 615 static AbstractTypeArguments* null_abstract_type_arguments_; | 620 static AbstractTypeArguments* null_abstract_type_arguments_; |
| 616 static Array* empty_array_; | 621 static Array* empty_array_; |
| 622 static PcDescriptors* empty_descriptors_; | |
| 617 static Instance* sentinel_; | 623 static Instance* sentinel_; |
| 618 static Instance* transition_sentinel_; | 624 static Instance* transition_sentinel_; |
| 619 static Instance* unknown_constant_; | 625 static Instance* unknown_constant_; |
| 620 static Instance* non_constant_; | 626 static Instance* non_constant_; |
| 621 static Bool* bool_true_; | 627 static Bool* bool_true_; |
| 622 static Bool* bool_false_; | 628 static Bool* bool_false_; |
| 623 static Smi* smi_illegal_cid_; | 629 static Smi* smi_illegal_cid_; |
| 624 static LanguageError* snapshot_writer_error_; | 630 static LanguageError* snapshot_writer_error_; |
| 625 static LanguageError* branch_offset_error_; | 631 static LanguageError* branch_offset_error_; |
| 626 | 632 |
| (...skipping 2358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2985 ASSERT((index >=0) && (index < Length())); | 2991 ASSERT((index >=0) && (index < Length())); |
| 2986 intptr_t data_index = (index * kNumberOfEntries) + entry_offset; | 2992 intptr_t data_index = (index * kNumberOfEntries) + entry_offset; |
| 2987 return &raw_ptr()->data_[data_index]; | 2993 return &raw_ptr()->data_[data_index]; |
| 2988 } | 2994 } |
| 2989 RawSmi** SmiAddr(intptr_t index, intptr_t entry_offset) const { | 2995 RawSmi** SmiAddr(intptr_t index, intptr_t entry_offset) const { |
| 2990 return reinterpret_cast<RawSmi**>(EntryAddr(index, entry_offset)); | 2996 return reinterpret_cast<RawSmi**>(EntryAddr(index, entry_offset)); |
| 2991 } | 2997 } |
| 2992 | 2998 |
| 2993 FINAL_HEAP_OBJECT_IMPLEMENTATION(PcDescriptors, Object); | 2999 FINAL_HEAP_OBJECT_IMPLEMENTATION(PcDescriptors, Object); |
| 2994 friend class Class; | 3000 friend class Class; |
| 3001 friend class Object; | |
|
Ivan Posva
2014/01/21 06:36:05
Why was this needed?
Cutch
2014/01/21 15:49:58
The call to initializeHandle from Object::InitOnce
| |
| 2995 }; | 3002 }; |
| 2996 | 3003 |
| 2997 | 3004 |
| 2998 class Stackmap : public Object { | 3005 class Stackmap : public Object { |
| 2999 public: | 3006 public: |
| 3000 static const intptr_t kNoMaximum = -1; | 3007 static const intptr_t kNoMaximum = -1; |
| 3001 static const intptr_t kNoMinimum = -1; | 3008 static const intptr_t kNoMinimum = -1; |
| 3002 | 3009 |
| 3003 bool IsObject(intptr_t index) const { | 3010 bool IsObject(intptr_t index) const { |
| 3004 ASSERT(InRange(index)); | 3011 ASSERT(InRange(index)); |
| (...skipping 3618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6623 | 6630 |
| 6624 | 6631 |
| 6625 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6632 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6626 intptr_t index) { | 6633 intptr_t index) { |
| 6627 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6634 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6628 } | 6635 } |
| 6629 | 6636 |
| 6630 } // namespace dart | 6637 } // namespace dart |
| 6631 | 6638 |
| 6632 #endif // VM_OBJECT_H_ | 6639 #endif // VM_OBJECT_H_ |
| OLD | NEW |