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

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

Issue 11275290: Count per check hits in ICData. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
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 2835 matching lines...) Expand 10 before | Expand all | Expand 10 after
2846 const Function& target) const; 2846 const Function& target) const;
2847 // Adds sorted so that Smi is the first class-id. Use only for 2847 // Adds sorted so that Smi is the first class-id. Use only for
2848 // num_args_tested == 1. 2848 // num_args_tested == 1.
2849 void AddReceiverCheck(intptr_t receiver_class_id, 2849 void AddReceiverCheck(intptr_t receiver_class_id,
2850 const Function& target) const; 2850 const Function& target) const;
2851 2851
2852 // Retrieving checks. 2852 // Retrieving checks.
2853 2853
2854 void GetCheckAt(intptr_t index, 2854 void GetCheckAt(intptr_t index,
2855 GrowableArray<intptr_t>* class_ids, 2855 GrowableArray<intptr_t>* class_ids,
2856 Function* target) const; 2856 Function* target,
2857 intptr_t* count = NULL) const;
srdjan 2012/11/13 20:58:14 Maybe it is OK if this method remains unchanged an
Kevin Millikin (Google) 2012/11/13 20:59:33 I'm not thrilled with the default parameter. It l
Vyacheslav Egorov (Google) 2012/12/17 12:54:16 Done.
2857 void GetOneClassCheckAt(intptr_t index, 2858 void GetOneClassCheckAt(intptr_t index,
2858 intptr_t* class_id, 2859 intptr_t* class_id,
2859 Function* target) const; 2860 Function* target) const;
2860 intptr_t GetReceiverClassIdAt(intptr_t index) const; 2861 intptr_t GetReceiverClassIdAt(intptr_t index) const;
2861 intptr_t GetClassIdAt(intptr_t index, intptr_t arg_nr) const; 2862 intptr_t GetClassIdAt(intptr_t index, intptr_t arg_nr) const;
2862 2863
2863 RawFunction* GetTargetAt(intptr_t index) const; 2864 RawFunction* GetTargetAt(intptr_t index) const;
2864 RawFunction* GetTargetForReceiverClassId(intptr_t class_id) const; 2865 RawFunction* GetTargetForReceiverClassId(intptr_t class_id) const;
2865 2866
2867 intptr_t GetCountAt(intptr_t index) const;
2868
2866 // Returns this->raw() if num_args_tested == 1 and arg_nr == 1, otherwise 2869 // Returns this->raw() if num_args_tested == 1 and arg_nr == 1, otherwise
2867 // returns a new ICData object containing only unique arg_nr checks. 2870 // returns a new ICData object containing only unique arg_nr checks.
2868 RawICData* AsUnaryClassChecksForArgNr(intptr_t arg_nr) const; 2871 RawICData* AsUnaryClassChecksForArgNr(intptr_t arg_nr) const;
2869 RawICData* AsUnaryClassChecks() const { 2872 RawICData* AsUnaryClassChecks() const {
2870 return AsUnaryClassChecksForArgNr(0); 2873 return AsUnaryClassChecksForArgNr(0);
2871 } 2874 }
2872 2875
2873 bool AllTargetsHaveSameOwner(intptr_t owner_cid) const; 2876 bool AllTargetsHaveSameOwner(intptr_t owner_cid) const;
2874 bool AllReceiversAreNumbers() const; 2877 bool AllReceiversAreNumbers() const;
2875 bool HasOneTarget() const; 2878 bool HasOneTarget() const;
2876 2879
2877 static RawICData* New(const Function& caller_function, 2880 static RawICData* New(const Function& caller_function,
2878 const String& target_name, 2881 const String& target_name,
2879 intptr_t deopt_id, 2882 intptr_t deopt_id,
2880 intptr_t num_args_tested); 2883 intptr_t num_args_tested);
2881 2884
2885 static intptr_t TestEntryLengthFor(intptr_t num_args);
2886
2887 static intptr_t TargetIndexFor(intptr_t num_args) {
Kevin Millikin (Google) 2012/11/13 20:59:33 Not an Index, but an Offset (from the beginning of
Vyacheslav Egorov (Google) 2012/12/17 12:54:16 Done.
2888 return num_args;
2889 }
2890
2891 static intptr_t CountIndexFor(intptr_t num_args) {
2892 return num_args + 1;
2893 }
2894
2882 private: 2895 private:
2883 RawArray* ic_data() const { 2896 RawArray* ic_data() const {
2884 return raw_ptr()->ic_data_; 2897 return raw_ptr()->ic_data_;
2885 } 2898 }
2886 2899
2887 void set_function(const Function& value) const; 2900 void set_function(const Function& value) const;
2888 void set_target_name(const String& value) const; 2901 void set_target_name(const String& value) const;
2889 void set_deopt_id(intptr_t value) const; 2902 void set_deopt_id(intptr_t value) const;
2890 void set_num_args_tested(intptr_t value) const; 2903 void set_num_args_tested(intptr_t value) const;
2891 void set_ic_data(const Array& value) const; 2904 void set_ic_data(const Array& value) const;
(...skipping 3003 matching lines...) Expand 10 before | Expand all | Expand 10 after
5895 if (this->CharAt(i) != str.CharAt(begin_index + i)) { 5908 if (this->CharAt(i) != str.CharAt(begin_index + i)) {
5896 return false; 5909 return false;
5897 } 5910 }
5898 } 5911 }
5899 return true; 5912 return true;
5900 } 5913 }
5901 5914
5902 } // namespace dart 5915 } // namespace dart
5903 5916
5904 #endif // VM_OBJECT_H_ 5917 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/object.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698