| 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 3165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3176 class ICData : public Object { | 3176 class ICData : public Object { |
| 3177 public: | 3177 public: |
| 3178 RawFunction* function() const { | 3178 RawFunction* function() const { |
| 3179 return raw_ptr()->function_; | 3179 return raw_ptr()->function_; |
| 3180 } | 3180 } |
| 3181 | 3181 |
| 3182 RawString* target_name() const { | 3182 RawString* target_name() const { |
| 3183 return raw_ptr()->target_name_; | 3183 return raw_ptr()->target_name_; |
| 3184 } | 3184 } |
| 3185 | 3185 |
| 3186 RawArray* arguments_descriptor() const { |
| 3187 return raw_ptr()->args_descriptor_; |
| 3188 } |
| 3189 |
| 3186 intptr_t num_args_tested() const { | 3190 intptr_t num_args_tested() const { |
| 3187 return raw_ptr()->num_args_tested_; | 3191 return raw_ptr()->num_args_tested_; |
| 3188 } | 3192 } |
| 3189 | 3193 |
| 3190 intptr_t deopt_id() const { | 3194 intptr_t deopt_id() const { |
| 3191 return raw_ptr()->deopt_id_; | 3195 return raw_ptr()->deopt_id_; |
| 3192 } | 3196 } |
| 3193 | 3197 |
| 3194 intptr_t deopt_reason() const { | 3198 intptr_t deopt_reason() const { |
| 3195 return raw_ptr()->deopt_reason_; | 3199 return raw_ptr()->deopt_reason_; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 3210 } | 3214 } |
| 3211 | 3215 |
| 3212 static intptr_t target_name_offset() { | 3216 static intptr_t target_name_offset() { |
| 3213 return OFFSET_OF(RawICData, target_name_); | 3217 return OFFSET_OF(RawICData, target_name_); |
| 3214 } | 3218 } |
| 3215 | 3219 |
| 3216 static intptr_t num_args_tested_offset() { | 3220 static intptr_t num_args_tested_offset() { |
| 3217 return OFFSET_OF(RawICData, num_args_tested_); | 3221 return OFFSET_OF(RawICData, num_args_tested_); |
| 3218 } | 3222 } |
| 3219 | 3223 |
| 3224 static intptr_t arguments_descriptor_offset() { |
| 3225 return OFFSET_OF(RawICData, args_descriptor_); |
| 3226 } |
| 3227 |
| 3220 static intptr_t ic_data_offset() { | 3228 static intptr_t ic_data_offset() { |
| 3221 return OFFSET_OF(RawICData, ic_data_); | 3229 return OFFSET_OF(RawICData, ic_data_); |
| 3222 } | 3230 } |
| 3223 | 3231 |
| 3224 static intptr_t function_offset() { | 3232 static intptr_t function_offset() { |
| 3225 return OFFSET_OF(RawICData, function_); | 3233 return OFFSET_OF(RawICData, function_); |
| 3226 } | 3234 } |
| 3227 | 3235 |
| 3228 static intptr_t is_closure_call_offset() { | 3236 static intptr_t is_closure_call_offset() { |
| 3229 return OFFSET_OF(RawICData, is_closure_call_); | 3237 return OFFSET_OF(RawICData, is_closure_call_); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3267 return AsUnaryClassChecksForArgNr(0); | 3275 return AsUnaryClassChecksForArgNr(0); |
| 3268 } | 3276 } |
| 3269 | 3277 |
| 3270 bool AllTargetsHaveSameOwner(intptr_t owner_cid) const; | 3278 bool AllTargetsHaveSameOwner(intptr_t owner_cid) const; |
| 3271 bool AllReceiversAreNumbers() const; | 3279 bool AllReceiversAreNumbers() const; |
| 3272 bool HasOneTarget() const; | 3280 bool HasOneTarget() const; |
| 3273 bool HasReceiverClassId(intptr_t class_id) const; | 3281 bool HasReceiverClassId(intptr_t class_id) const; |
| 3274 | 3282 |
| 3275 static RawICData* New(const Function& caller_function, | 3283 static RawICData* New(const Function& caller_function, |
| 3276 const String& target_name, | 3284 const String& target_name, |
| 3285 const Array& arguments_descriptor, |
| 3277 intptr_t deopt_id, | 3286 intptr_t deopt_id, |
| 3278 intptr_t num_args_tested); | 3287 intptr_t num_args_tested); |
| 3279 | 3288 |
| 3280 static intptr_t TestEntryLengthFor(intptr_t num_args); | 3289 static intptr_t TestEntryLengthFor(intptr_t num_args); |
| 3281 | 3290 |
| 3282 static intptr_t TargetIndexFor(intptr_t num_args) { | 3291 static intptr_t TargetIndexFor(intptr_t num_args) { |
| 3283 return num_args; | 3292 return num_args; |
| 3284 } | 3293 } |
| 3285 | 3294 |
| 3286 static intptr_t CountIndexFor(intptr_t num_args) { | 3295 static intptr_t CountIndexFor(intptr_t num_args) { |
| 3287 return (num_args + 1); | 3296 return (num_args + 1); |
| 3288 } | 3297 } |
| 3289 | 3298 |
| 3290 private: | 3299 private: |
| 3291 RawArray* ic_data() const { | 3300 RawArray* ic_data() const { |
| 3292 return raw_ptr()->ic_data_; | 3301 return raw_ptr()->ic_data_; |
| 3293 } | 3302 } |
| 3294 | 3303 |
| 3295 void set_function(const Function& value) const; | 3304 void set_function(const Function& value) const; |
| 3296 void set_target_name(const String& value) const; | 3305 void set_target_name(const String& value) const; |
| 3306 void set_arguments_descriptor(const Array& value) const; |
| 3297 void set_deopt_id(intptr_t value) const; | 3307 void set_deopt_id(intptr_t value) const; |
| 3298 void set_num_args_tested(intptr_t value) const; | 3308 void set_num_args_tested(intptr_t value) const; |
| 3299 void set_ic_data(const Array& value) const; | 3309 void set_ic_data(const Array& value) const; |
| 3300 | 3310 |
| 3301 #if defined(DEBUG) | 3311 #if defined(DEBUG) |
| 3302 // Used in asserts to verify that a check is not added twice. | 3312 // Used in asserts to verify that a check is not added twice. |
| 3303 bool HasCheck(const GrowableArray<intptr_t>& cids) const; | 3313 bool HasCheck(const GrowableArray<intptr_t>& cids) const; |
| 3304 #endif // DEBUG | 3314 #endif // DEBUG |
| 3305 | 3315 |
| 3306 intptr_t TestEntryLength() const; | 3316 intptr_t TestEntryLength() const; |
| (...skipping 2614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5921 | 5931 |
| 5922 | 5932 |
| 5923 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 5933 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 5924 intptr_t index) { | 5934 intptr_t index) { |
| 5925 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 5935 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 5926 } | 5936 } |
| 5927 | 5937 |
| 5928 } // namespace dart | 5938 } // namespace dart |
| 5929 | 5939 |
| 5930 #endif // VM_OBJECT_H_ | 5940 #endif // VM_OBJECT_H_ |
| OLD | NEW |