Mercurial > hg > truffle
comparison src/share/vm/ci/ciCallProfile.hpp @ 3441:f56542cb325a
7050554: JSR 292 - need optimization for selectAlternative
Reviewed-by: kvn, jrose
author | never |
---|---|
date | Thu, 02 Jun 2011 13:36:11 -0700 |
parents | c760f78e0a53 |
children | be4ca325525a c26de9aef2ed |
comparison
equal
deleted
inserted
replaced
3420:e5ae807761b8 | 3441:f56542cb325a |
---|---|
34 // at some call site | 34 // at some call site |
35 class ciCallProfile : StackObj { | 35 class ciCallProfile : StackObj { |
36 private: | 36 private: |
37 // Fields are initialized directly by ciMethod::call_profile_at_bci. | 37 // Fields are initialized directly by ciMethod::call_profile_at_bci. |
38 friend class ciMethod; | 38 friend class ciMethod; |
39 friend class ciMethodHandle; | |
39 | 40 |
40 enum { MorphismLimit = 2 }; // Max call site's morphism we care about | 41 enum { MorphismLimit = 2 }; // Max call site's morphism we care about |
41 int _limit; // number of receivers have been determined | 42 int _limit; // number of receivers have been determined |
42 int _morphism; // determined call site's morphism | 43 int _morphism; // determined call site's morphism |
43 int _count; // # times has this call been executed | 44 int _count; // # times has this call been executed |
56 | 57 |
57 void add_receiver(ciKlass* receiver, int receiver_count); | 58 void add_receiver(ciKlass* receiver, int receiver_count); |
58 | 59 |
59 public: | 60 public: |
60 // Note: The following predicates return false for invalid profiles: | 61 // Note: The following predicates return false for invalid profiles: |
61 bool has_receiver(int i) { return _limit > i; } | 62 bool has_receiver(int i) const { return _limit > i; } |
62 int morphism() { return _morphism; } | 63 int morphism() const { return _morphism; } |
63 | 64 |
64 int count() { return _count; } | 65 int count() const { return _count; } |
65 int receiver_count(int i) { | 66 int receiver_count(int i) { |
66 assert(i < _limit, "out of Call Profile MorphismLimit"); | 67 assert(i < _limit, "out of Call Profile MorphismLimit"); |
67 return _receiver_count[i]; | 68 return _receiver_count[i]; |
68 } | 69 } |
69 float receiver_prob(int i) { | 70 float receiver_prob(int i) { |