| 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 1902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1913 bool AllReceiversAreNumbers() const; | 1913 bool AllReceiversAreNumbers() const; |
| 1914 bool HasOneTarget() const; | 1914 bool HasOneTarget() const; |
| 1915 bool HasReceiverClassId(intptr_t class_id) const; | 1915 bool HasReceiverClassId(intptr_t class_id) const; |
| 1916 | 1916 |
| 1917 static RawICData* New(const Function& owner, | 1917 static RawICData* New(const Function& owner, |
| 1918 const String& target_name, | 1918 const String& target_name, |
| 1919 const Array& arguments_descriptor, | 1919 const Array& arguments_descriptor, |
| 1920 intptr_t deopt_id, | 1920 intptr_t deopt_id, |
| 1921 intptr_t num_args_tested); | 1921 intptr_t num_args_tested); |
| 1922 static RawICData* NewFrom(const ICData& from, intptr_t num_args_tested); | 1922 static RawICData* NewFrom(const ICData& from, intptr_t num_args_tested); |
| 1923 static RawICData* CloneDescriptor(const ICData& from); |
| 1923 | 1924 |
| 1924 static intptr_t TestEntryLengthFor(intptr_t num_args); | 1925 static intptr_t TestEntryLengthFor(intptr_t num_args); |
| 1925 | 1926 |
| 1926 static intptr_t TargetIndexFor(intptr_t num_args) { | 1927 static intptr_t TargetIndexFor(intptr_t num_args) { |
| 1927 return num_args; | 1928 return num_args; |
| 1928 } | 1929 } |
| 1929 | 1930 |
| 1930 static intptr_t CountIndexFor(intptr_t num_args) { | 1931 static intptr_t CountIndexFor(intptr_t num_args) { |
| 1931 return (num_args + 1); | 1932 return (num_args + 1); |
| 1932 } | 1933 } |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2609 // functions. | 2610 // functions. |
| 2610 int32_t SourceFingerprint() const; | 2611 int32_t SourceFingerprint() const; |
| 2611 | 2612 |
| 2612 // Return false and report an error if the fingerprint does not match. | 2613 // Return false and report an error if the fingerprint does not match. |
| 2613 bool CheckSourceFingerprint(const char* prefix, int32_t fp) const; | 2614 bool CheckSourceFingerprint(const char* prefix, int32_t fp) const; |
| 2614 | 2615 |
| 2615 // Works with map [deopt-id] -> ICData. | 2616 // Works with map [deopt-id] -> ICData. |
| 2616 void SaveICDataMap( | 2617 void SaveICDataMap( |
| 2617 const ZoneGrowableArray<const ICData*>& deopt_id_to_ic_data, | 2618 const ZoneGrowableArray<const ICData*>& deopt_id_to_ic_data, |
| 2618 const Array& edge_counters_array) const; | 2619 const Array& edge_counters_array) const; |
| 2620 // Uses saved ICData to populate the table 'deopt_id_to_ic_data' |
| 2619 void RestoreICDataMap( | 2621 void RestoreICDataMap( |
| 2620 ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data) const; | 2622 ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data) const; |
| 2623 // Copies saved ICData descriptors, so that they are invariant during |
| 2624 // background compilation. |
| 2625 void CopyICDataMap( |
| 2626 ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data) const; |
| 2621 | 2627 |
| 2622 RawArray* ic_data_array() const; | 2628 RawArray* ic_data_array() const; |
| 2623 void ClearICDataArray() const; | 2629 void ClearICDataArray() const; |
| 2624 | 2630 |
| 2625 // Sets deopt reason in all ICData-s with given deopt_id. | 2631 // Sets deopt reason in all ICData-s with given deopt_id. |
| 2626 void SetDeoptReasonForAll(intptr_t deopt_id, ICData::DeoptReasonId reason); | 2632 void SetDeoptReasonForAll(intptr_t deopt_id, ICData::DeoptReasonId reason); |
| 2627 | 2633 |
| 2628 static const int kCtorPhaseInit = 1 << 0; | 2634 static const int kCtorPhaseInit = 1 << 0; |
| 2629 static const int kCtorPhaseBody = 1 << 1; | 2635 static const int kCtorPhaseBody = 1 << 1; |
| 2630 static const int kCtorPhaseAll = (kCtorPhaseInit | kCtorPhaseBody); | 2636 static const int kCtorPhaseAll = (kCtorPhaseInit | kCtorPhaseBody); |
| (...skipping 5565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8196 | 8202 |
| 8197 | 8203 |
| 8198 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 8204 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 8199 intptr_t index) { | 8205 intptr_t index) { |
| 8200 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 8206 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 8201 } | 8207 } |
| 8202 | 8208 |
| 8203 } // namespace dart | 8209 } // namespace dart |
| 8204 | 8210 |
| 8205 #endif // VM_OBJECT_H_ | 8211 #endif // VM_OBJECT_H_ |
| OLD | NEW |