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

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

Issue 1700463002: Clone both descriptor and data array when compiling in background (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Reviewer's comments Created 4 years, 10 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/flow_graph_inliner.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 1923 matching lines...) Expand 10 before | Expand all | Expand 10 after
1934 bool HasOneTarget() const; 1934 bool HasOneTarget() const;
1935 bool HasReceiverClassId(intptr_t class_id) const; 1935 bool HasReceiverClassId(intptr_t class_id) const;
1936 1936
1937 static RawICData* New(const Function& owner, 1937 static RawICData* New(const Function& owner,
1938 const String& target_name, 1938 const String& target_name,
1939 const Array& arguments_descriptor, 1939 const Array& arguments_descriptor,
1940 intptr_t deopt_id, 1940 intptr_t deopt_id,
1941 intptr_t num_args_tested); 1941 intptr_t num_args_tested);
1942 static RawICData* NewFrom(const ICData& from, intptr_t num_args_tested); 1942 static RawICData* NewFrom(const ICData& from, intptr_t num_args_tested);
1943 1943
1944 // Generates a new ICData with descriptor data copied (shallow clone). 1944 // Generates a new ICData with descriptor and data array copied (deep clone).
1945 // Entry array of the result is the same as in 'from'. Once entry array is 1945 static RawICData* Clone(const ICData& from);
1946 // created, it can only change the 'count', all other properties are invariant
1947 // (target, cids, number of checks).
1948 static RawICData* CloneDescriptor(const ICData& from);
1949 1946
1950 static intptr_t TestEntryLengthFor(intptr_t num_args); 1947 static intptr_t TestEntryLengthFor(intptr_t num_args);
1951 1948
1952 static intptr_t TargetIndexFor(intptr_t num_args) { 1949 static intptr_t TargetIndexFor(intptr_t num_args) {
1953 return num_args; 1950 return num_args;
1954 } 1951 }
1955 1952
1956 static intptr_t CountIndexFor(intptr_t num_args) { 1953 static intptr_t CountIndexFor(intptr_t num_args) {
1957 return (num_args + 1); 1954 return (num_args + 1);
1958 } 1955 }
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
2674 int32_t SourceFingerprint() const; 2671 int32_t SourceFingerprint() const;
2675 2672
2676 // Return false and report an error if the fingerprint does not match. 2673 // Return false and report an error if the fingerprint does not match.
2677 bool CheckSourceFingerprint(const char* prefix, int32_t fp) const; 2674 bool CheckSourceFingerprint(const char* prefix, int32_t fp) const;
2678 2675
2679 // Works with map [deopt-id] -> ICData. 2676 // Works with map [deopt-id] -> ICData.
2680 void SaveICDataMap( 2677 void SaveICDataMap(
2681 const ZoneGrowableArray<const ICData*>& deopt_id_to_ic_data, 2678 const ZoneGrowableArray<const ICData*>& deopt_id_to_ic_data,
2682 const Array& edge_counters_array) const; 2679 const Array& edge_counters_array) const;
2683 // Uses 'ic_data_array' to populate the table 'deopt_id_to_ic_data'. Clone 2680 // Uses 'ic_data_array' to populate the table 'deopt_id_to_ic_data'. Clone
2684 // descriptors if 'clone_descriptors' true. 2681 // ic_data (array and descriptor) if 'clone_ic_data' is true.
2685 void RestoreICDataMap(ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data, 2682 void RestoreICDataMap(ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data,
2686 bool clone_descriptors) const; 2683 bool clone_ic_data) const;
2687 2684
2688 RawArray* ic_data_array() const; 2685 RawArray* ic_data_array() const;
2689 void ClearICDataArray() const; 2686 void ClearICDataArray() const;
2690 2687
2691 // Sets deopt reason in all ICData-s with given deopt_id. 2688 // Sets deopt reason in all ICData-s with given deopt_id.
2692 void SetDeoptReasonForAll(intptr_t deopt_id, ICData::DeoptReasonId reason); 2689 void SetDeoptReasonForAll(intptr_t deopt_id, ICData::DeoptReasonId reason);
2693 2690
2694 void set_modifier(RawFunction::AsyncModifier value) const; 2691 void set_modifier(RawFunction::AsyncModifier value) const;
2695 2692
2696 // static: Considered during class-side or top-level resolution rather than 2693 // static: Considered during class-side or top-level resolution rather than
(...skipping 5733 matching lines...) Expand 10 before | Expand all | Expand 10 after
8430 8427
8431 8428
8432 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 8429 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
8433 intptr_t index) { 8430 intptr_t index) {
8434 return array.At((index * kEntryLength) + kTargetFunctionIndex); 8431 return array.At((index * kEntryLength) + kTargetFunctionIndex);
8435 } 8432 }
8436 8433
8437 } // namespace dart 8434 } // namespace dart
8438 8435
8439 #endif // VM_OBJECT_H_ 8436 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698