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 2614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2625 #else | 2625 #else |
2626 ASSERT(value >= 0); | 2626 ASSERT(value >= 0); |
2627 if (value > kMaxInstructionCount) { | 2627 if (value > kMaxInstructionCount) { |
2628 value = kMaxInstructionCount; | 2628 value = kMaxInstructionCount; |
2629 } | 2629 } |
2630 StoreNonPointer(&raw_ptr()->optimized_call_site_count_, | 2630 StoreNonPointer(&raw_ptr()->optimized_call_site_count_, |
2631 static_cast<uint16_t>(value)); | 2631 static_cast<uint16_t>(value)); |
2632 #endif | 2632 #endif |
2633 } | 2633 } |
2634 | 2634 |
| 2635 void* kernel_function() const { |
| 2636 #if defined(DART_PRECOMPILED_RUNTIME) |
| 2637 return NULL; |
| 2638 #else |
| 2639 return raw_ptr()->kernel_function_; |
| 2640 #endif |
| 2641 } |
| 2642 |
| 2643 void set_kernel_function(void* kernel_function) const { |
| 2644 #if !defined(DART_PRECOMPILED_RUNTIME) |
| 2645 StoreNonPointer(&raw_ptr()->kernel_function_, kernel_function); |
| 2646 #endif |
| 2647 } |
| 2648 |
2635 bool IsOptimizable() const; | 2649 bool IsOptimizable() const; |
2636 bool IsNativeAutoSetupScope() const; | 2650 bool IsNativeAutoSetupScope() const; |
2637 void SetIsOptimizable(bool value) const; | 2651 void SetIsOptimizable(bool value) const; |
2638 void SetIsNativeAutoSetupScope(bool value) const; | 2652 void SetIsNativeAutoSetupScope(bool value) const; |
2639 | 2653 |
2640 bool CanBeInlined() const; | 2654 bool CanBeInlined() const; |
2641 | 2655 |
2642 MethodRecognizer::Kind recognized_kind() const { | 2656 MethodRecognizer::Kind recognized_kind() const { |
2643 return RecognizedBits::decode(raw_ptr()->kind_tag_); | 2657 return RecognizedBits::decode(raw_ptr()->kind_tag_); |
2644 } | 2658 } |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3145 return DoubleInitializedBit::decode(raw_ptr()->kind_bits_); | 3159 return DoubleInitializedBit::decode(raw_ptr()->kind_bits_); |
3146 } | 3160 } |
3147 // Called in parser after allocating field, immutable property otherwise. | 3161 // Called in parser after allocating field, immutable property otherwise. |
3148 // Marks fields that are initialized with a simple double constant. | 3162 // Marks fields that are initialized with a simple double constant. |
3149 void set_is_double_initialized(bool value) const { | 3163 void set_is_double_initialized(bool value) const { |
3150 ASSERT(Thread::Current()->IsMutatorThread()); | 3164 ASSERT(Thread::Current()->IsMutatorThread()); |
3151 ASSERT(IsOriginal()); | 3165 ASSERT(IsOriginal()); |
3152 set_kind_bits(DoubleInitializedBit::update(value, raw_ptr()->kind_bits_)); | 3166 set_kind_bits(DoubleInitializedBit::update(value, raw_ptr()->kind_bits_)); |
3153 } | 3167 } |
3154 | 3168 |
| 3169 void* kernel_field() const { |
| 3170 #if defined(DART_PRECOMPILED_RUNTIME) |
| 3171 return NULL; |
| 3172 #else |
| 3173 return raw_ptr()->kernel_field_; |
| 3174 #endif |
| 3175 } |
| 3176 |
| 3177 void set_kernel_field(void* kernel_field) const { |
| 3178 #if !defined(DART_PRECOMPILED_RUNTIME) |
| 3179 StoreNonPointer(&raw_ptr()->kernel_field_, kernel_field); |
| 3180 #endif |
| 3181 } |
| 3182 |
| 3183 |
3155 inline intptr_t Offset() const; | 3184 inline intptr_t Offset() const; |
3156 // Called during class finalization. | 3185 // Called during class finalization. |
3157 inline void SetOffset(intptr_t offset_in_bytes) const; | 3186 inline void SetOffset(intptr_t offset_in_bytes) const; |
3158 | 3187 |
3159 inline RawInstance* StaticValue() const; | 3188 inline RawInstance* StaticValue() const; |
3160 inline void SetStaticValue(const Instance& value, | 3189 inline void SetStaticValue(const Instance& value, |
3161 bool save_initial_value = false) const; | 3190 bool save_initial_value = false) const; |
3162 | 3191 |
3163 RawClass* Owner() const; | 3192 RawClass* Owner() const; |
3164 RawClass* Origin() const; // Either mixin class, or same as owner(). | 3193 RawClass* Origin() const; // Either mixin class, or same as owner(). |
(...skipping 5813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8978 | 9007 |
8979 inline void TypeArguments::SetHash(intptr_t value) const { | 9008 inline void TypeArguments::SetHash(intptr_t value) const { |
8980 // This is only safe because we create a new Smi, which does not cause | 9009 // This is only safe because we create a new Smi, which does not cause |
8981 // heap allocation. | 9010 // heap allocation. |
8982 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); | 9011 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); |
8983 } | 9012 } |
8984 | 9013 |
8985 } // namespace dart | 9014 } // namespace dart |
8986 | 9015 |
8987 #endif // VM_OBJECT_H_ | 9016 #endif // VM_OBJECT_H_ |
OLD | NEW |