| 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 3075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3086 return 0; | 3086 return 0; |
| 3087 } | 3087 } |
| 3088 static intptr_t InstanceSize(intptr_t len) { | 3088 static intptr_t InstanceSize(intptr_t len) { |
| 3089 ASSERT(0 <= len && len <= kMaxElements); | 3089 ASSERT(0 <= len && len <= kMaxElements); |
| 3090 return RoundedAllocationSize( | 3090 return RoundedAllocationSize( |
| 3091 sizeof(RawLocalVarDescriptors) + (len * kBytesPerElement)); | 3091 sizeof(RawLocalVarDescriptors) + (len * kBytesPerElement)); |
| 3092 } | 3092 } |
| 3093 | 3093 |
| 3094 static RawLocalVarDescriptors* New(intptr_t num_variables); | 3094 static RawLocalVarDescriptors* New(intptr_t num_variables); |
| 3095 | 3095 |
| 3096 static const char* KindToStr(intptr_t kind); |
| 3097 |
| 3096 private: | 3098 private: |
| 3097 FINAL_HEAP_OBJECT_IMPLEMENTATION(LocalVarDescriptors, Object); | 3099 FINAL_HEAP_OBJECT_IMPLEMENTATION(LocalVarDescriptors, Object); |
| 3098 friend class Class; | 3100 friend class Class; |
| 3099 }; | 3101 }; |
| 3100 | 3102 |
| 3101 | 3103 |
| 3102 class PcDescriptors : public Object { | 3104 class PcDescriptors : public Object { |
| 3103 public: | 3105 public: |
| 3104 void AddDescriptor(intptr_t index, | 3106 void AddDescriptor(intptr_t index, |
| 3105 uword pc, | 3107 uword pc, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3139 static RawPcDescriptors* New(intptr_t num_descriptors, bool has_try_index); | 3141 static RawPcDescriptors* New(intptr_t num_descriptors, bool has_try_index); |
| 3140 | 3142 |
| 3141 // Returns 0 if not found. | 3143 // Returns 0 if not found. |
| 3142 uword GetPcForKind(RawPcDescriptors::Kind kind) const; | 3144 uword GetPcForKind(RawPcDescriptors::Kind kind) const; |
| 3143 | 3145 |
| 3144 // Verify (assert) assumptions about pc descriptors in debug mode. | 3146 // Verify (assert) assumptions about pc descriptors in debug mode. |
| 3145 void Verify(const Function& function) const; | 3147 void Verify(const Function& function) const; |
| 3146 | 3148 |
| 3147 static void PrintHeaderString(); | 3149 static void PrintHeaderString(); |
| 3148 | 3150 |
| 3149 void PrintToJSONObject(JSONObject* jsobj) const; | 3151 void PrintToJSONObject(JSONObject* jsobj, bool ref) const; |
| 3150 | 3152 |
| 3151 // We would have a VisitPointers function here to traverse the | 3153 // We would have a VisitPointers function here to traverse the |
| 3152 // pc descriptors table to visit objects if any in the table. | 3154 // pc descriptors table to visit objects if any in the table. |
| 3153 // Note: never return a reference to a RawPcDescriptors::PcDescriptorRec | 3155 // Note: never return a reference to a RawPcDescriptors::PcDescriptorRec |
| 3154 // as the object can move. | 3156 // as the object can move. |
| 3155 class Iterator : ValueObject { | 3157 class Iterator : ValueObject { |
| 3156 public: | 3158 public: |
| 3157 Iterator(const PcDescriptors& descriptors, intptr_t kind_mask) | 3159 Iterator(const PcDescriptors& descriptors, intptr_t kind_mask) |
| 3158 : descriptors_(descriptors), | 3160 : descriptors_(descriptors), |
| 3159 kind_mask_(kind_mask), | 3161 kind_mask_(kind_mask), |
| (...skipping 4255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7415 | 7417 |
| 7416 | 7418 |
| 7417 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 7419 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 7418 intptr_t index) { | 7420 intptr_t index) { |
| 7419 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 7421 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 7420 } | 7422 } |
| 7421 | 7423 |
| 7422 } // namespace dart | 7424 } // namespace dart |
| 7423 | 7425 |
| 7424 #endif // VM_OBJECT_H_ | 7426 #endif // VM_OBJECT_H_ |
| OLD | NEW |