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

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: typo fix 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
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 1927 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 data copied (shallow clone).
1945 // Entry array of the result is the same as in 'from'. Once entry array is 1945 // Entry array of the result is the same as in 'from'. Once entry array is
1946 // created, it can only change the 'count', all other properties are invariant 1946 // created, it can only change the 'count', all other properties are invariant
1947 // (target, cids, number of checks). 1947 // (target, cids, number of checks).
1948 static RawICData* CloneDescriptor(const ICData& from); 1948 static RawICData* CloneDescriptorAndData(const ICData& from);
siva 2016/02/12 22:10:25 Why not call it Clone?
srdjan 2016/02/12 22:20:38 Renamed to Clone
1949 1949
1950 static intptr_t TestEntryLengthFor(intptr_t num_args); 1950 static intptr_t TestEntryLengthFor(intptr_t num_args);
1951 1951
1952 static intptr_t TargetIndexFor(intptr_t num_args) { 1952 static intptr_t TargetIndexFor(intptr_t num_args) {
1953 return num_args; 1953 return num_args;
1954 } 1954 }
1955 1955
1956 static intptr_t CountIndexFor(intptr_t num_args) { 1956 static intptr_t CountIndexFor(intptr_t num_args) {
1957 return (num_args + 1); 1957 return (num_args + 1);
1958 } 1958 }
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
2674 int32_t SourceFingerprint() const; 2674 int32_t SourceFingerprint() const;
2675 2675
2676 // Return false and report an error if the fingerprint does not match. 2676 // Return false and report an error if the fingerprint does not match.
2677 bool CheckSourceFingerprint(const char* prefix, int32_t fp) const; 2677 bool CheckSourceFingerprint(const char* prefix, int32_t fp) const;
2678 2678
2679 // Works with map [deopt-id] -> ICData. 2679 // Works with map [deopt-id] -> ICData.
2680 void SaveICDataMap( 2680 void SaveICDataMap(
2681 const ZoneGrowableArray<const ICData*>& deopt_id_to_ic_data, 2681 const ZoneGrowableArray<const ICData*>& deopt_id_to_ic_data,
2682 const Array& edge_counters_array) const; 2682 const Array& edge_counters_array) const;
2683 // Uses 'ic_data_array' to populate the table 'deopt_id_to_ic_data'. Clone 2683 // Uses 'ic_data_array' to populate the table 'deopt_id_to_ic_data'. Clone
2684 // descriptors if 'clone_descriptors' true. 2684 // ic_data (array and descriptor) if 'clone_ic_data' is true.
2685 void RestoreICDataMap(ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data, 2685 void RestoreICDataMap(ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data,
2686 bool clone_descriptors) const; 2686 bool clone_ic_data) const;
2687 2687
2688 RawArray* ic_data_array() const; 2688 RawArray* ic_data_array() const;
2689 void ClearICDataArray() const; 2689 void ClearICDataArray() const;
2690 2690
2691 // Sets deopt reason in all ICData-s with given deopt_id. 2691 // Sets deopt reason in all ICData-s with given deopt_id.
2692 void SetDeoptReasonForAll(intptr_t deopt_id, ICData::DeoptReasonId reason); 2692 void SetDeoptReasonForAll(intptr_t deopt_id, ICData::DeoptReasonId reason);
2693 2693
2694 void set_modifier(RawFunction::AsyncModifier value) const; 2694 void set_modifier(RawFunction::AsyncModifier value) const;
2695 2695
2696 // static: Considered during class-side or top-level resolution rather than 2696 // static: Considered during class-side or top-level resolution rather than
(...skipping 5733 matching lines...) Expand 10 before | Expand all | Expand 10 after
8430 8430
8431 8431
8432 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 8432 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
8433 intptr_t index) { 8433 intptr_t index) {
8434 return array.At((index * kEntryLength) + kTargetFunctionIndex); 8434 return array.At((index * kEntryLength) + kTargetFunctionIndex);
8435 } 8435 }
8436 8436
8437 } // namespace dart 8437 } // namespace dart
8438 8438
8439 #endif // VM_OBJECT_H_ 8439 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/object.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698