| 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 3068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3079 | 3079 |
| 3080 // Adding checks. | 3080 // Adding checks. |
| 3081 | 3081 |
| 3082 // Adds one more class test to ICData. Length of 'classes' must be equal to | 3082 // Adds one more class test to ICData. Length of 'classes' must be equal to |
| 3083 // the number of arguments tested. Use only for num_args_tested > 1. | 3083 // the number of arguments tested. Use only for num_args_tested > 1. |
| 3084 void AddCheck(const GrowableArray<intptr_t>& class_ids, | 3084 void AddCheck(const GrowableArray<intptr_t>& class_ids, |
| 3085 const Function& target) const; | 3085 const Function& target) const; |
| 3086 // Adds sorted so that Smi is the first class-id. Use only for | 3086 // Adds sorted so that Smi is the first class-id. Use only for |
| 3087 // num_args_tested == 1. | 3087 // num_args_tested == 1. |
| 3088 void AddReceiverCheck(intptr_t receiver_class_id, | 3088 void AddReceiverCheck(intptr_t receiver_class_id, |
| 3089 const Function& target) const; | 3089 const Function& target, |
| 3090 intptr_t count = 1) const; |
| 3090 | 3091 |
| 3091 // Retrieving checks. | 3092 // Retrieving checks. |
| 3092 | 3093 |
| 3093 void GetCheckAt(intptr_t index, | 3094 void GetCheckAt(intptr_t index, |
| 3094 GrowableArray<intptr_t>* class_ids, | 3095 GrowableArray<intptr_t>* class_ids, |
| 3095 Function* target) const; | 3096 Function* target) const; |
| 3096 void GetOneClassCheckAt(intptr_t index, | 3097 void GetOneClassCheckAt(intptr_t index, |
| 3097 intptr_t* class_id, | 3098 intptr_t* class_id, |
| 3098 Function* target) const; | 3099 Function* target) const; |
| 3099 intptr_t GetReceiverClassIdAt(intptr_t index) const; | 3100 intptr_t GetReceiverClassIdAt(intptr_t index) const; |
| 3100 intptr_t GetClassIdAt(intptr_t index, intptr_t arg_nr) const; | 3101 intptr_t GetClassIdAt(intptr_t index, intptr_t arg_nr) const; |
| 3101 | 3102 |
| 3102 RawFunction* GetTargetAt(intptr_t index) const; | 3103 RawFunction* GetTargetAt(intptr_t index) const; |
| 3103 RawFunction* GetTargetForReceiverClassId(intptr_t class_id) const; | 3104 RawFunction* GetTargetForReceiverClassId(intptr_t class_id) const; |
| 3104 | 3105 |
| 3106 void IncrementCountAt(intptr_t index, intptr_t value) const; |
| 3107 void SetCountAt(intptr_t index, intptr_t value) const; |
| 3105 intptr_t GetCountAt(intptr_t index) const; | 3108 intptr_t GetCountAt(intptr_t index) const; |
| 3106 intptr_t AggregateCount() const; | 3109 intptr_t AggregateCount() const; |
| 3107 | 3110 |
| 3108 // Returns this->raw() if num_args_tested == 1 and arg_nr == 1, otherwise | 3111 // Returns this->raw() if num_args_tested == 1 and arg_nr == 1, otherwise |
| 3109 // returns a new ICData object containing only unique arg_nr checks. | 3112 // returns a new ICData object containing only unique arg_nr checks. |
| 3110 RawICData* AsUnaryClassChecksForArgNr(intptr_t arg_nr) const; | 3113 RawICData* AsUnaryClassChecksForArgNr(intptr_t arg_nr) const; |
| 3111 RawICData* AsUnaryClassChecks() const { | 3114 RawICData* AsUnaryClassChecks() const { |
| 3112 return AsUnaryClassChecksForArgNr(0); | 3115 return AsUnaryClassChecksForArgNr(0); |
| 3113 } | 3116 } |
| 3114 | 3117 |
| (...skipping 2582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5697 | 5700 |
| 5698 | 5701 |
| 5699 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 5702 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 5700 intptr_t index) { | 5703 intptr_t index) { |
| 5701 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 5704 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 5702 } | 5705 } |
| 5703 | 5706 |
| 5704 } // namespace dart | 5707 } // namespace dart |
| 5705 | 5708 |
| 5706 #endif // VM_OBJECT_H_ | 5709 #endif // VM_OBJECT_H_ |
| OLD | NEW |