Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Side by Side Diff: runtime/vm/object.h

Issue 2217733002: Reset most ICs by returning to the canonical empty data arrays. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/isolate_reload.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1835 matching lines...) Expand 10 before | Expand all | Expand 10 after
1846 } 1846 }
1847 1847
1848 intptr_t NumArgsTested() const; 1848 intptr_t NumArgsTested() const;
1849 1849
1850 intptr_t deopt_id() const { 1850 intptr_t deopt_id() const {
1851 return raw_ptr()->deopt_id_; 1851 return raw_ptr()->deopt_id_;
1852 } 1852 }
1853 1853
1854 bool IsImmutable() const; 1854 bool IsImmutable() const;
1855 1855
1856 void Reset() const; 1856 void Reset(Zone* zone) const;
1857 void ResetData() const;
1858 1857
1859 // Note: only deopts with reasons before Unknown in this list are recorded in 1858 // Note: only deopts with reasons before Unknown in this list are recorded in
1860 // the ICData. All other reasons are used purely for informational messages 1859 // the ICData. All other reasons are used purely for informational messages
1861 // printed during deoptimization itself. 1860 // printed during deoptimization itself.
1862 #define DEOPT_REASONS(V) \ 1861 #define DEOPT_REASONS(V) \
1863 V(BinarySmiOp) \ 1862 V(BinarySmiOp) \
1864 V(BinaryMintOp) \ 1863 V(BinaryMintOp) \
1865 V(DoubleToSmi) \ 1864 V(DoubleToSmi) \
1866 V(CheckSmi) \ 1865 V(CheckSmi) \
1867 V(Unknown) \ 1866 V(Unknown) \
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
1953 1952
1954 // Clear all entries with the sentinel value and reset the first entry 1953 // Clear all entries with the sentinel value and reset the first entry
1955 // with the dummy target entry. 1954 // with the dummy target entry.
1956 void ClearAndSetStaticTarget(const Function& func) const; 1955 void ClearAndSetStaticTarget(const Function& func) const;
1957 1956
1958 // Returns the first index that should be used to for a new entry. Will 1957 // Returns the first index that should be used to for a new entry. Will
1959 // grow the array if necessary. 1958 // grow the array if necessary.
1960 RawArray* FindFreeIndex(intptr_t* index) const; 1959 RawArray* FindFreeIndex(intptr_t* index) const;
1961 1960
1962 void DebugDump() const; 1961 void DebugDump() const;
1963 void ValidateSentinelLocations() const;
1964 1962
1965 // Returns true if this is a two arg smi operation. 1963 // Returns true if this is a two arg smi operation.
1966 bool AddSmiSmiCheckForFastSmiStubs() const; 1964 bool AddSmiSmiCheckForFastSmiStubs() const;
1967 1965
1968 // Used for unoptimized static calls when no class-ids are checked. 1966 // Used for unoptimized static calls when no class-ids are checked.
1969 void AddTarget(const Function& target) const; 1967 void AddTarget(const Function& target) const;
1970 1968
1971 // Adding checks. 1969 // Adding checks.
1972 1970
1973 // Adds one more class test to ICData. Length of 'classes' must be equal to 1971 // Adds one more class test to ICData. Length of 'classes' must be equal to
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
2126 bool, 2124 bool,
2127 ICData::kStaticCallPos, 2125 ICData::kStaticCallPos,
2128 ICData::kStaticCallSize> {}; 2126 ICData::kStaticCallSize> {};
2129 #if defined(DEBUG) 2127 #if defined(DEBUG)
2130 // Used in asserts to verify that a check is not added twice. 2128 // Used in asserts to verify that a check is not added twice.
2131 bool HasCheck(const GrowableArray<intptr_t>& cids) const; 2129 bool HasCheck(const GrowableArray<intptr_t>& cids) const;
2132 #endif // DEBUG 2130 #endif // DEBUG
2133 2131
2134 intptr_t TestEntryLength() const; 2132 intptr_t TestEntryLength() const;
2135 static RawArray* NewNonCachedEmptyICDataArray(intptr_t num_args_tested); 2133 static RawArray* NewNonCachedEmptyICDataArray(intptr_t num_args_tested);
2136 static RawArray* NewEmptyICDataArray(intptr_t num_args_tested); 2134 static RawArray* CachedEmptyICDataArray(intptr_t num_args_tested);
2137 static RawICData* NewDescriptor(Zone* zone, 2135 static RawICData* NewDescriptor(Zone* zone,
2138 const Function& owner, 2136 const Function& owner,
2139 const String& target_name, 2137 const String& target_name,
2140 const Array& arguments_descriptor, 2138 const Array& arguments_descriptor,
2141 intptr_t deopt_id, 2139 intptr_t deopt_id,
2142 intptr_t num_args_tested, 2140 intptr_t num_args_tested,
2143 bool is_static_call); 2141 bool is_static_call);
2144 2142
2145 static void WriteSentinel(const Array& data, intptr_t test_entry_length); 2143 static void WriteSentinel(const Array& data, intptr_t test_entry_length);
2146 2144
(...skipping 2350 matching lines...) Expand 10 before | Expand all | Expand 10 after
4497 return raw_ptr()->code_source_map_; 4495 return raw_ptr()->code_source_map_;
4498 } 4496 }
4499 4497
4500 void set_code_source_map(const CodeSourceMap& code_source_map) const { 4498 void set_code_source_map(const CodeSourceMap& code_source_map) const {
4501 ASSERT(code_source_map.IsOld()); 4499 ASSERT(code_source_map.IsOld());
4502 StorePointer(&raw_ptr()->code_source_map_, code_source_map.raw()); 4500 StorePointer(&raw_ptr()->code_source_map_, code_source_map.raw());
4503 } 4501 }
4504 4502
4505 // Used during reloading (see object_reload.cc). Calls Reset on all ICDatas 4503 // Used during reloading (see object_reload.cc). Calls Reset on all ICDatas
4506 // that are embedded inside the Code object. 4504 // that are embedded inside the Code object.
4507 void ResetICDatas() const; 4505 void ResetICDatas(Zone* zone) const;
4508 4506
4509 TokenPosition GetTokenPositionAt(intptr_t offset) const; 4507 TokenPosition GetTokenPositionAt(intptr_t offset) const;
4510 4508
4511 // Array of DeoptInfo objects. 4509 // Array of DeoptInfo objects.
4512 RawArray* deopt_info_array() const { 4510 RawArray* deopt_info_array() const {
4513 return raw_ptr()->deopt_info_array_; 4511 return raw_ptr()->deopt_info_array_;
4514 } 4512 }
4515 void set_deopt_info_array(const Array& array) const; 4513 void set_deopt_info_array(const Array& array) const;
4516 4514
4517 RawArray* stackmaps() const { 4515 RawArray* stackmaps() const {
(...skipping 4218 matching lines...) Expand 10 before | Expand all | Expand 10 after
8736 8734
8737 inline void TypeArguments::SetHash(intptr_t value) const { 8735 inline void TypeArguments::SetHash(intptr_t value) const {
8738 // This is only safe because we create a new Smi, which does not cause 8736 // This is only safe because we create a new Smi, which does not cause
8739 // heap allocation. 8737 // heap allocation.
8740 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); 8738 StoreSmi(&raw_ptr()->hash_, Smi::New(value));
8741 } 8739 }
8742 8740
8743 } // namespace dart 8741 } // namespace dart
8744 8742
8745 #endif // VM_OBJECT_H_ 8743 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/isolate_reload.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698