Mercurial > hg > truffle
comparison src/share/vm/interpreter/rewriter.hpp @ 1339:09ac706c2623
Merge
author | asaha |
---|---|
date | Wed, 24 Mar 2010 17:16:33 -0700 |
parents | dd57230ba8fe |
children | c18cbe5936b8 ab102d5d923e |
comparison
equal
deleted
inserted
replaced
1338:f5dd08ad65df | 1339:09ac706c2623 |
---|---|
41 } | 41 } |
42 int cp_entry_to_cp_cache(int i) { assert(has_cp_cache(i), "oob"); return _cp_map[i]; } | 42 int cp_entry_to_cp_cache(int i) { assert(has_cp_cache(i), "oob"); return _cp_map[i]; } |
43 bool has_cp_cache(int i) { return (uint)i < (uint)_cp_map.length() && _cp_map[i] >= 0; } | 43 bool has_cp_cache(int i) { return (uint)i < (uint)_cp_map.length() && _cp_map[i] >= 0; } |
44 int maybe_add_cp_cache_entry(int i) { return has_cp_cache(i) ? _cp_map[i] : add_cp_cache_entry(i); } | 44 int maybe_add_cp_cache_entry(int i) { return has_cp_cache(i) ? _cp_map[i] : add_cp_cache_entry(i); } |
45 int add_cp_cache_entry(int cp_index) { | 45 int add_cp_cache_entry(int cp_index) { |
46 assert((cp_index & _secondary_entry_tag) == 0, "bad tag"); | |
46 assert(_cp_map[cp_index] == -1, "not twice on same cp_index"); | 47 assert(_cp_map[cp_index] == -1, "not twice on same cp_index"); |
47 int cache_index = _cp_cache_map.append(cp_index); | 48 int cache_index = _cp_cache_map.append(cp_index); |
48 _cp_map.at_put(cp_index, cache_index); | 49 _cp_map.at_put(cp_index, cache_index); |
49 assert(cp_entry_to_cp_cache(cp_index) == cache_index, ""); | 50 assert(cp_entry_to_cp_cache(cp_index) == cache_index, ""); |
50 return cache_index; | 51 return cache_index; |
51 } | 52 } |
52 int add_extra_cp_cache_entry(int main_entry); | 53 int add_secondary_cp_cache_entry(int main_cpc_entry) { |
54 assert(main_cpc_entry < _cp_cache_map.length(), "must be earlier CP cache entry"); | |
55 int cache_index = _cp_cache_map.append(main_cpc_entry | _secondary_entry_tag); | |
56 return cache_index; | |
57 } | |
53 | 58 |
54 // All the work goes in here: | 59 // All the work goes in here: |
55 Rewriter(instanceKlassHandle klass, TRAPS); | 60 Rewriter(instanceKlassHandle klass, constantPoolHandle cpool, objArrayHandle methods, TRAPS); |
56 | 61 |
57 void compute_index_maps(); | 62 void compute_index_maps(); |
58 void make_constant_pool_cache(TRAPS); | 63 void make_constant_pool_cache(TRAPS); |
59 void scan_method(methodOop m); | 64 void scan_method(methodOop m); |
60 methodHandle rewrite_jsrs(methodHandle m, TRAPS); | 65 methodHandle rewrite_jsrs(methodHandle m, TRAPS); |
63 void rewrite_invokedynamic(address bcp, int offset, int cp_index); | 68 void rewrite_invokedynamic(address bcp, int offset, int cp_index); |
64 | 69 |
65 public: | 70 public: |
66 // Driver routine: | 71 // Driver routine: |
67 static void rewrite(instanceKlassHandle klass, TRAPS); | 72 static void rewrite(instanceKlassHandle klass, TRAPS); |
73 static void rewrite(instanceKlassHandle klass, constantPoolHandle cpool, objArrayHandle methods, TRAPS); | |
74 | |
75 enum { | |
76 _secondary_entry_tag = nth_bit(30) | |
77 }; | |
68 }; | 78 }; |