| 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 1908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1919 Function* target) const; | 1919 Function* target) const; |
| 1920 // Only for 'num_args_checked == 1'. | 1920 // Only for 'num_args_checked == 1'. |
| 1921 intptr_t GetCidAt(intptr_t index) const; | 1921 intptr_t GetCidAt(intptr_t index) const; |
| 1922 | 1922 |
| 1923 intptr_t GetReceiverClassIdAt(intptr_t index) const; | 1923 intptr_t GetReceiverClassIdAt(intptr_t index) const; |
| 1924 intptr_t GetClassIdAt(intptr_t index, intptr_t arg_nr) const; | 1924 intptr_t GetClassIdAt(intptr_t index, intptr_t arg_nr) const; |
| 1925 | 1925 |
| 1926 RawFunction* GetTargetAt(intptr_t index) const; | 1926 RawFunction* GetTargetAt(intptr_t index) const; |
| 1927 RawFunction* GetTargetForReceiverClassId(intptr_t class_id) const; | 1927 RawFunction* GetTargetForReceiverClassId(intptr_t class_id) const; |
| 1928 | 1928 |
| 1929 RawObject* GetTargetOrCodeAt(intptr_t index) const; |
| 1930 void SetCodeAt(intptr_t index, const Code& value) const; |
| 1931 void SetEntryPointAt(intptr_t index, const Smi& value) const; |
| 1932 |
| 1929 void IncrementCountAt(intptr_t index, intptr_t value) const; | 1933 void IncrementCountAt(intptr_t index, intptr_t value) const; |
| 1930 void SetCountAt(intptr_t index, intptr_t value) const; | 1934 void SetCountAt(intptr_t index, intptr_t value) const; |
| 1931 intptr_t GetCountAt(intptr_t index) const; | 1935 intptr_t GetCountAt(intptr_t index) const; |
| 1932 intptr_t AggregateCount() const; | 1936 intptr_t AggregateCount() const; |
| 1933 | 1937 |
| 1934 // Returns this->raw() if num_args_tested == 1 and arg_nr == 1, otherwise | 1938 // Returns this->raw() if num_args_tested == 1 and arg_nr == 1, otherwise |
| 1935 // returns a new ICData object containing only unique arg_nr checks. | 1939 // returns a new ICData object containing only unique arg_nr checks. |
| 1936 // Returns only used entries. | 1940 // Returns only used entries. |
| 1937 RawICData* AsUnaryClassChecksForArgNr(intptr_t arg_nr) const; | 1941 RawICData* AsUnaryClassChecksForArgNr(intptr_t arg_nr) const; |
| 1938 RawICData* AsUnaryClassChecks() const { | 1942 RawICData* AsUnaryClassChecks() const { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1955 static RawICData* NewFrom(const ICData& from, intptr_t num_args_tested); | 1959 static RawICData* NewFrom(const ICData& from, intptr_t num_args_tested); |
| 1956 | 1960 |
| 1957 // Generates a new ICData with descriptor and data array copied (deep clone). | 1961 // Generates a new ICData with descriptor and data array copied (deep clone). |
| 1958 static RawICData* Clone(const ICData& from); | 1962 static RawICData* Clone(const ICData& from); |
| 1959 | 1963 |
| 1960 static intptr_t TestEntryLengthFor(intptr_t num_args); | 1964 static intptr_t TestEntryLengthFor(intptr_t num_args); |
| 1961 | 1965 |
| 1962 static intptr_t TargetIndexFor(intptr_t num_args) { | 1966 static intptr_t TargetIndexFor(intptr_t num_args) { |
| 1963 return num_args; | 1967 return num_args; |
| 1964 } | 1968 } |
| 1969 static intptr_t CodeIndexFor(intptr_t num_args) { |
| 1970 return num_args; |
| 1971 } |
| 1965 | 1972 |
| 1966 static intptr_t CountIndexFor(intptr_t num_args) { | 1973 static intptr_t CountIndexFor(intptr_t num_args) { |
| 1967 return (num_args + 1); | 1974 return (num_args + 1); |
| 1968 } | 1975 } |
| 1976 static intptr_t EntryPointIndexFor(intptr_t num_args) { |
| 1977 return (num_args + 1); |
| 1978 } |
| 1969 | 1979 |
| 1970 bool IsUsedAt(intptr_t i) const; | 1980 bool IsUsedAt(intptr_t i) const; |
| 1971 | 1981 |
| 1972 void GetUsedCidsForTwoArgs(GrowableArray<intptr_t>* first, | 1982 void GetUsedCidsForTwoArgs(GrowableArray<intptr_t>* first, |
| 1973 GrowableArray<intptr_t>* second) const; | 1983 GrowableArray<intptr_t>* second) const; |
| 1974 | 1984 |
| 1975 // Range feedback tracking functionality. | 1985 // Range feedback tracking functionality. |
| 1976 | 1986 |
| 1977 // For arithmetic operations we store range information for inputs and the | 1987 // For arithmetic operations we store range information for inputs and the |
| 1978 // result. The goal is to discover: | 1988 // result. The goal is to discover: |
| (...skipping 6511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8490 | 8500 |
| 8491 | 8501 |
| 8492 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 8502 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 8493 intptr_t index) { | 8503 intptr_t index) { |
| 8494 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 8504 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 8495 } | 8505 } |
| 8496 | 8506 |
| 8497 } // namespace dart | 8507 } // namespace dart |
| 8498 | 8508 |
| 8499 #endif // VM_OBJECT_H_ | 8509 #endif // VM_OBJECT_H_ |
| OLD | NEW |