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

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

Issue 2062983002: Revert "Remember inside an ICData if it is for a static call or an instance call" (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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 1824 matching lines...) Expand 10 before | Expand all | Expand 10 after
1835 } 1835 }
1836 1836
1837 intptr_t NumArgsTested() const; 1837 intptr_t NumArgsTested() const;
1838 1838
1839 intptr_t deopt_id() const { 1839 intptr_t deopt_id() const {
1840 return raw_ptr()->deopt_id_; 1840 return raw_ptr()->deopt_id_;
1841 } 1841 }
1842 1842
1843 bool IsImmutable() const; 1843 bool IsImmutable() const;
1844 1844
1845 void Reset() const; 1845 void Reset(bool is_static_call) const;
1846 void ResetData() const; 1846 void ResetData() const;
1847 1847
1848 // Note: only deopts with reasons before Unknown in this list are recorded in 1848 // Note: only deopts with reasons before Unknown in this list are recorded in
1849 // the ICData. All other reasons are used purely for informational messages 1849 // the ICData. All other reasons are used purely for informational messages
1850 // printed during deoptimization itself. 1850 // printed during deoptimization itself.
1851 #define DEOPT_REASONS(V) \ 1851 #define DEOPT_REASONS(V) \
1852 V(BinarySmiOp) \ 1852 V(BinarySmiOp) \
1853 V(BinaryMintOp) \ 1853 V(BinaryMintOp) \
1854 V(DoubleToSmi) \ 1854 V(DoubleToSmi) \
1855 V(CheckSmi) \ 1855 V(CheckSmi) \
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
2139 2139
2140 enum { 2140 enum {
2141 kCachedICDataArrayCount = 4 2141 kCachedICDataArrayCount = 4
2142 }; 2142 };
2143 2143
2144 #if defined(TAG_IC_DATA) 2144 #if defined(TAG_IC_DATA)
2145 void set_tag(intptr_t value) const; 2145 void set_tag(intptr_t value) const;
2146 intptr_t tag() const { return raw_ptr()->tag_; } 2146 intptr_t tag() const { return raw_ptr()->tag_; }
2147 #endif 2147 #endif
2148 2148
2149 void SetIsStaticCall(bool static_call) const;
2150 bool is_static_call() const;
2151
2152 private: 2149 private:
2153 static RawICData* New(); 2150 static RawICData* New();
2154 2151
2155 RawArray* ic_data() const { 2152 RawArray* ic_data() const {
2156 return raw_ptr()->ic_data_; 2153 return raw_ptr()->ic_data_;
2157 } 2154 }
2158 2155
2159 void set_owner(const Function& value) const; 2156 void set_owner(const Function& value) const;
2160 void set_target_name(const String& value) const; 2157 void set_target_name(const String& value) const;
2161 void set_arguments_descriptor(const Array& value) const; 2158 void set_arguments_descriptor(const Array& value) const;
2162 void set_deopt_id(intptr_t value) const; 2159 void set_deopt_id(intptr_t value) const;
2163 void SetNumArgsTested(intptr_t value) const; 2160 void SetNumArgsTested(intptr_t value) const;
2164 void set_ic_data_array(const Array& value) const; 2161 void set_ic_data_array(const Array& value) const;
2165 void set_state_bits(uint32_t bits) const; 2162 void set_state_bits(uint32_t bits) const;
2166 2163
2167 enum { 2164 enum {
2168 kNumArgsTestedPos = 0, 2165 kNumArgsTestedPos = 0,
2169 kNumArgsTestedSize = 2, 2166 kNumArgsTestedSize = 2,
2170 kDeoptReasonPos = kNumArgsTestedPos + kNumArgsTestedSize, 2167 kDeoptReasonPos = kNumArgsTestedPos + kNumArgsTestedSize,
2171 kDeoptReasonSize = kLastRecordedDeoptReason + 1, 2168 kDeoptReasonSize = kLastRecordedDeoptReason + 1,
2172 kRangeFeedbackPos = kDeoptReasonPos + kDeoptReasonSize, 2169 kRangeFeedbackPos = kDeoptReasonPos + kDeoptReasonSize,
2173 kRangeFeedbackSize = kBitsPerRangeFeedback * kRangeFeedbackSlots, 2170 kRangeFeedbackSize = kBitsPerRangeFeedback * kRangeFeedbackSlots
2174 kStaticCallPos = kRangeFeedbackPos + kRangeFeedbackSize,
2175 kStaticCallSize = 1,
2176 }; 2171 };
2177 2172
2178 class NumArgsTestedBits : public BitField<uint32_t, 2173 class NumArgsTestedBits : public BitField<uint32_t,
2179 uint32_t, 2174 uint32_t,
2180 kNumArgsTestedPos, 2175 kNumArgsTestedPos,
2181 kNumArgsTestedSize> {}; 2176 kNumArgsTestedSize> {};
2182 class DeoptReasonBits : public BitField<uint32_t, 2177 class DeoptReasonBits : public BitField<uint32_t,
2183 uint32_t, 2178 uint32_t,
2184 ICData::kDeoptReasonPos, 2179 ICData::kDeoptReasonPos,
2185 ICData::kDeoptReasonSize> {}; 2180 ICData::kDeoptReasonSize> {};
2186 class RangeFeedbackBits : public BitField<uint32_t, 2181 class RangeFeedbackBits : public BitField<uint32_t,
2187 uint32_t, 2182 uint32_t,
2188 ICData::kRangeFeedbackPos, 2183 ICData::kRangeFeedbackPos,
2189 ICData::kRangeFeedbackSize> {}; 2184 ICData::kRangeFeedbackSize> {};
2190 2185
2191 class StaticCallBit : public BitField<uint32_t,
2192 bool,
2193 ICData::kStaticCallPos,
2194 ICData::kStaticCallSize> {};
2195 #if defined(DEBUG) 2186 #if defined(DEBUG)
2196 // Used in asserts to verify that a check is not added twice. 2187 // Used in asserts to verify that a check is not added twice.
2197 bool HasCheck(const GrowableArray<intptr_t>& cids) const; 2188 bool HasCheck(const GrowableArray<intptr_t>& cids) const;
2198 #endif // DEBUG 2189 #endif // DEBUG
2199 2190
2200 intptr_t TestEntryLength() const; 2191 intptr_t TestEntryLength() const;
2201 static RawArray* NewNonCachedEmptyICDataArray(intptr_t num_args_tested); 2192 static RawArray* NewNonCachedEmptyICDataArray(intptr_t num_args_tested);
2202 static RawArray* NewEmptyICDataArray(intptr_t num_args_tested); 2193 static RawArray* NewEmptyICDataArray(intptr_t num_args_tested);
2203 static RawICData* NewDescriptor(Zone* zone, 2194 static RawICData* NewDescriptor(Zone* zone,
2204 const Function& owner, 2195 const Function& owner,
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
2277 // does not involve generic parameter types or generic result type. 2268 // does not involve generic parameter types or generic result type.
2278 bool HasInstantiatedSignature() const; 2269 bool HasInstantiatedSignature() const;
2279 2270
2280 // Build a string of the form 'T, {B b, C c}' representing the user 2271 // Build a string of the form 'T, {B b, C c}' representing the user
2281 // visible formal parameters of the function. 2272 // visible formal parameters of the function.
2282 RawString* UserVisibleFormalParameters() const; 2273 RawString* UserVisibleFormalParameters() const;
2283 2274
2284 // Reloading support: 2275 // Reloading support:
2285 void Reparent(const Class& new_cls) const; 2276 void Reparent(const Class& new_cls) const;
2286 void ZeroEdgeCounters() const; 2277 void ZeroEdgeCounters() const;
2278 void FillICDataWithSentinels(const Code& code) const;
2287 2279
2288 RawClass* Owner() const; 2280 RawClass* Owner() const;
2289 RawClass* origin() const; 2281 RawClass* origin() const;
2290 RawScript* script() const; 2282 RawScript* script() const;
2291 RawObject* RawOwner() const { return raw_ptr()->owner_; } 2283 RawObject* RawOwner() const { return raw_ptr()->owner_; }
2292 2284
2293 RawRegExp* regexp() const; 2285 RawRegExp* regexp() const;
2294 intptr_t string_specialization_cid() const; 2286 intptr_t string_specialization_cid() const;
2295 void SetRegExpData(const RegExp& regexp, 2287 void SetRegExpData(const RegExp& regexp,
2296 intptr_t string_specialization_cid) const; 2288 intptr_t string_specialization_cid) const;
(...skipping 2243 matching lines...) Expand 10 before | Expand all | Expand 10 after
4540 4532
4541 RawCodeSourceMap* code_source_map() const { 4533 RawCodeSourceMap* code_source_map() const {
4542 return raw_ptr()->code_source_map_; 4534 return raw_ptr()->code_source_map_;
4543 } 4535 }
4544 4536
4545 void set_code_source_map(const CodeSourceMap& code_source_map) const { 4537 void set_code_source_map(const CodeSourceMap& code_source_map) const {
4546 ASSERT(code_source_map.IsOld()); 4538 ASSERT(code_source_map.IsOld());
4547 StorePointer(&raw_ptr()->code_source_map_, code_source_map.raw()); 4539 StorePointer(&raw_ptr()->code_source_map_, code_source_map.raw());
4548 } 4540 }
4549 4541
4550 // Used during reloading (see object_reload.cc).
4551 void ResetICDatas(const Function& function) const;
4552
4553 TokenPosition GetTokenPositionAt(intptr_t offset) const; 4542 TokenPosition GetTokenPositionAt(intptr_t offset) const;
4554 4543
4555 // Array of DeoptInfo objects. 4544 // Array of DeoptInfo objects.
4556 RawArray* deopt_info_array() const { 4545 RawArray* deopt_info_array() const {
4557 return raw_ptr()->deopt_info_array_; 4546 return raw_ptr()->deopt_info_array_;
4558 } 4547 }
4559 void set_deopt_info_array(const Array& array) const; 4548 void set_deopt_info_array(const Array& array) const;
4560 4549
4561 RawArray* stackmaps() const { 4550 RawArray* stackmaps() const {
4562 return raw_ptr()->stackmaps_; 4551 return raw_ptr()->stackmaps_;
(...skipping 4160 matching lines...) Expand 10 before | Expand all | Expand 10 after
8723 8712
8724 inline void TypeArguments::SetHash(intptr_t value) const { 8713 inline void TypeArguments::SetHash(intptr_t value) const {
8725 // This is only safe because we create a new Smi, which does not cause 8714 // This is only safe because we create a new Smi, which does not cause
8726 // heap allocation. 8715 // heap allocation.
8727 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); 8716 StoreSmi(&raw_ptr()->hash_, Smi::New(value));
8728 } 8717 }
8729 8718
8730 } // namespace dart 8719 } // namespace dart
8731 8720
8732 #endif // VM_OBJECT_H_ 8721 #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