author | ohair |
Sun, 17 Aug 2008 17:02:04 -0700 | |
changeset 1082 | 53833ff90c45 |
parent 2 | 90ce3da70b43 |
child 2624 | 1ae5a9028dd4 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
1082
53833ff90c45
6496269: Many warnings generated from com/sun/java/util/jar/pack/*.cpp when compiled on Linux
ohair
parents:
2
diff
changeset
|
2 |
* Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Sun designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Sun in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
22 |
* CA 95054 USA or visit www.sun.com if you need additional information or |
|
23 |
* have any questions. |
|
24 |
*/ |
|
25 |
||
26 |
||
27 |
||
28 |
// Global Structures |
|
29 |
struct jar; |
|
30 |
struct gunzip; |
|
31 |
struct band; |
|
32 |
struct cpool; |
|
33 |
struct entry; |
|
34 |
struct cpindex; |
|
35 |
struct inner_class; |
|
36 |
struct value_stream; |
|
37 |
||
38 |
struct cpindex { |
|
39 |
uint len; |
|
40 |
entry* base1; // base of primary index |
|
41 |
entry** base2; // base of secondary index |
|
42 |
byte ixTag; // type of entries (!= CONSTANT_None), plus 64 if sub-index |
|
43 |
enum { SUB_TAG = 64 }; |
|
44 |
||
45 |
entry* get(uint i); |
|
46 |
||
47 |
void init(int len_, entry* base1_, int ixTag_) { |
|
48 |
len = len_; |
|
49 |
base1 = base1_; |
|
50 |
base2 = null; |
|
51 |
ixTag = ixTag_; |
|
52 |
} |
|
53 |
void init(int len_, entry** base2_, int ixTag_) { |
|
54 |
len = len_; |
|
55 |
base1 = null; |
|
56 |
base2 = base2_; |
|
57 |
ixTag = ixTag_; |
|
58 |
} |
|
59 |
}; |
|
60 |
||
61 |
struct cpool { |
|
62 |
uint nentries; |
|
63 |
entry* entries; |
|
64 |
entry* first_extra_entry; |
|
65 |
uint maxentries; // total allocated size of entries |
|
66 |
||
67 |
// Position and size of each homogeneous subrange: |
|
68 |
int tag_count[CONSTANT_Limit]; |
|
69 |
int tag_base[CONSTANT_Limit]; |
|
70 |
cpindex tag_index[CONSTANT_Limit]; |
|
71 |
ptrlist tag_extras[CONSTANT_Limit]; |
|
72 |
||
73 |
cpindex* member_indexes; // indexed by 2*CONSTANT_Class.inord |
|
74 |
cpindex* getFieldIndex(entry* classRef); |
|
75 |
cpindex* getMethodIndex(entry* classRef); |
|
76 |
||
77 |
inner_class** ic_index; |
|
78 |
inner_class** ic_child_index; |
|
79 |
inner_class* getIC(entry* inner); |
|
80 |
inner_class* getFirstChildIC(entry* outer); |
|
81 |
inner_class* getNextChildIC(inner_class* child); |
|
82 |
||
83 |
int outputIndexLimit; // index limit after renumbering |
|
84 |
ptrlist outputEntries; // list of entry* needing output idx assigned |
|
85 |
||
86 |
entry** hashTab; |
|
87 |
uint hashTabLength; |
|
88 |
entry*& hashTabRef(byte tag, bytes& b); |
|
89 |
entry* ensureUtf8(bytes& b); |
|
90 |
entry* ensureClass(bytes& b); |
|
91 |
||
92 |
// Well-known Utf8 symbols. |
|
93 |
enum { |
|
94 |
#define SNAME(n,s) s_##s, |
|
95 |
ALL_ATTR_DO(SNAME) |
|
96 |
#undef SNAME |
|
97 |
s_lt_init_gt, // <init> |
|
98 |
s_LIMIT |
|
99 |
}; |
|
100 |
entry* sym[s_LIMIT]; |
|
101 |
||
102 |
// read counts from hdr, allocate main arrays |
|
103 |
enum { NUM_COUNTS = 12 }; |
|
104 |
void init(unpacker* u, int counts[NUM_COUNTS]); |
|
105 |
||
106 |
// pointer to outer unpacker, for error checks etc. |
|
107 |
unpacker* u; |
|
108 |
||
109 |
int getCount(byte tag) { |
|
110 |
assert((uint)tag < CONSTANT_Limit); |
|
111 |
return tag_count[tag]; |
|
112 |
} |
|
113 |
cpindex* getIndex(byte tag) { |
|
114 |
assert((uint)tag < CONSTANT_Limit); |
|
115 |
return &tag_index[tag]; |
|
116 |
} |
|
117 |
cpindex* getKQIndex(); // uses cur_descr |
|
118 |
||
119 |
void expandSignatures(); |
|
120 |
void initMemberIndexes(); |
|
121 |
||
122 |
void computeOutputOrder(); |
|
123 |
void computeOutputIndexes(); |
|
124 |
void resetOutputIndexes(); |
|
125 |
||
126 |
// error handling |
|
127 |
inline void abort(const char* msg); |
|
128 |
inline bool aborting(); |
|
129 |
}; |
|
130 |
||
131 |
/* |
|
132 |
* The unpacker provides the entry points to the unpack engine, |
|
133 |
* as well as maintains the state of the engine. |
|
134 |
*/ |
|
135 |
struct unpacker { |
|
136 |
// One element of the resulting JAR. |
|
137 |
struct file { |
|
138 |
const char* name; |
|
139 |
julong size; |
|
140 |
int modtime; |
|
141 |
int options; |
|
142 |
bytes data[2]; |
|
143 |
// Note: If Sum(data[*].len) < size, |
|
144 |
// remaining bytes must be read directly from the input stream. |
|
145 |
bool deflate_hint() { return ((options & FO_DEFLATE_HINT) != 0); } |
|
146 |
}; |
|
147 |
||
148 |
// back pointer to NativeUnpacker obj and Java environment |
|
149 |
void* jniobj; |
|
150 |
void* jnienv; |
|
151 |
||
152 |
// global pointer to self, if not running under JNI (not multi-thread safe) |
|
153 |
static unpacker* non_mt_current; |
|
154 |
||
155 |
// if running Unix-style, here are the inputs and outputs |
|
156 |
FILE* infileptr; // buffered |
|
157 |
int infileno; // unbuffered |
|
158 |
bytes inbytes; // direct |
|
159 |
gunzip* gzin; // gunzip filter, if any |
|
160 |
jar* jarout; // output JAR file |
|
161 |
||
162 |
#ifndef PRODUCT |
|
163 |
int nowrite; |
|
164 |
int skipfiles; |
|
165 |
int verbose_bands; |
|
166 |
#endif |
|
167 |
||
168 |
// pointer to self, for U_NEW macro |
|
169 |
unpacker* u; |
|
170 |
||
171 |
// private abort message string, allocated to PATH_MAX*2 |
|
172 |
const char* abort_message; |
|
173 |
ptrlist mallocs; // list of guys to free when we are all done |
|
174 |
ptrlist tmallocs; // list of guys to free on next client request |
|
175 |
fillbytes smallbuf; // supplies small alloc requests |
|
176 |
fillbytes tsmallbuf; // supplies temporary small alloc requests |
|
177 |
||
178 |
// option management members |
|
179 |
int verbose; // verbose level, 0 means no output |
|
180 |
bool strip_compile; |
|
181 |
bool strip_debug; |
|
182 |
bool strip_jcov; |
|
183 |
bool remove_packfile; |
|
184 |
int deflate_hint_or_zero; // ==0 means not set, otherwise -1 or 1 |
|
185 |
int modification_time_or_zero; |
|
186 |
||
187 |
FILE* errstrm; |
|
188 |
const char* errstrm_name; |
|
189 |
||
190 |
const char* log_file; |
|
191 |
||
192 |
// input stream |
|
193 |
fillbytes input; // the whole block (size is predicted, has slop too) |
|
194 |
bool live_input; // is the data in this block live? |
|
195 |
bool free_input; // must the input buffer be freed? |
|
196 |
byte* rp; // read pointer (< rplimit <= input.limit()) |
|
197 |
byte* rplimit; // how much of the input block has been read? |
|
198 |
julong bytes_read; |
|
199 |
int unsized_bytes_read; |
|
200 |
||
201 |
// callback to read at least one byte, up to available input |
|
202 |
typedef jlong (*read_input_fn_t)(unpacker* self, void* buf, jlong minlen, jlong maxlen); |
|
203 |
read_input_fn_t read_input_fn; |
|
204 |
||
205 |
// archive header fields |
|
206 |
int magic, minver, majver; |
|
207 |
julong archive_size; |
|
208 |
int archive_next_count, archive_options, archive_modtime; |
|
209 |
int band_headers_size; |
|
210 |
int file_count, attr_definition_count, ic_count, class_count; |
|
211 |
int default_class_minver, default_class_majver; |
|
212 |
int default_file_options, suppress_file_options; // not header fields |
|
213 |
int default_archive_modtime, default_file_modtime; // not header fields |
|
214 |
int code_count; // not a header field |
|
215 |
int files_remaining; // not a header field |
|
216 |
||
217 |
// engine state |
|
218 |
band* all_bands; // indexed by band_number |
|
219 |
byte* meta_rp; // read-pointer into (copy of) band_headers |
|
220 |
cpool cp; // all constant pool information |
|
221 |
inner_class* ics; // InnerClasses |
|
222 |
||
223 |
// output stream |
|
224 |
bytes output; // output block (either classfile head or tail) |
|
225 |
byte* wp; // write pointer (< wplimit == output.limit()) |
|
226 |
byte* wpbase; // write pointer starting address (<= wp) |
|
227 |
byte* wplimit; // how much of the output block has been written? |
|
228 |
||
229 |
// output state |
|
230 |
file cur_file; |
|
231 |
entry* cur_class; // CONSTANT_Class entry |
|
232 |
entry* cur_super; // CONSTANT_Class entry or null |
|
233 |
entry* cur_descr; // CONSTANT_NameandType entry |
|
234 |
int cur_descr_flags; // flags corresponding to cur_descr |
|
235 |
int cur_class_minver, cur_class_majver; |
|
236 |
bool cur_class_has_local_ics; |
|
237 |
fillbytes cur_classfile_head; |
|
238 |
fillbytes cur_classfile_tail; |
|
239 |
int files_written; // also tells which file we're working on |
|
240 |
int classes_written; // also tells which class we're working on |
|
241 |
julong bytes_written; |
|
242 |
intlist bcimap; |
|
243 |
fillbytes class_fixup_type; |
|
244 |
intlist class_fixup_offset; |
|
245 |
ptrlist class_fixup_ref; |
|
246 |
fillbytes code_fixup_type; // which format of branch operand? |
|
247 |
intlist code_fixup_offset; // location of operand needing fixup |
|
248 |
intlist code_fixup_source; // encoded ID of branch insn |
|
249 |
ptrlist requested_ics; // which ics need output? |
|
250 |
||
251 |
// stats pertaining to multiple segments (updated on reset) |
|
252 |
julong bytes_read_before_reset; |
|
253 |
julong bytes_written_before_reset; |
|
254 |
int files_written_before_reset; |
|
255 |
int classes_written_before_reset; |
|
256 |
int segments_read_before_reset; |
|
257 |
||
258 |
// attribute state |
|
259 |
struct layout_definition { |
|
260 |
uint idx; // index (0..31...) which identifies this layout |
|
261 |
const char* name; // name of layout |
|
262 |
entry* nameEntry; |
|
263 |
const char* layout; // string of layout (not yet parsed) |
|
264 |
band** elems; // array of top-level layout elems (or callables) |
|
265 |
||
266 |
bool hasCallables() { return layout[0] == '['; } |
|
267 |
band** bands() { assert(elems != null); return elems; } |
|
268 |
}; |
|
269 |
struct attr_definitions { |
|
270 |
unpacker* u; // pointer to self, for U_NEW macro |
|
271 |
int xxx_flags_hi_bn;// locator for flags, count, indexes, calls bands |
|
272 |
int attrc; // ATTR_CONTEXT_CLASS, etc. |
|
273 |
uint flag_limit; // 32 or 63, depending on archive_options bit |
|
274 |
julong predef; // mask of built-in definitions |
|
275 |
julong redef; // mask of local flag definitions or redefinitions |
|
276 |
ptrlist layouts; // local (compressor-defined) defs, in index order |
|
277 |
int flag_count[X_ATTR_LIMIT_FLAGS_HI]; |
|
278 |
intlist overflow_count; |
|
279 |
ptrlist strip_names; // what attribute names are being stripped? |
|
280 |
ptrlist band_stack; // Temp., used during layout parsing. |
|
281 |
ptrlist calls_to_link; // (ditto) |
|
282 |
int bands_made; // (ditto) |
|
283 |
||
284 |
void free() { |
|
285 |
layouts.free(); |
|
286 |
overflow_count.free(); |
|
287 |
strip_names.free(); |
|
288 |
band_stack.free(); |
|
289 |
calls_to_link.free(); |
|
290 |
} |
|
291 |
||
292 |
// Locate the five fixed bands. |
|
293 |
band& xxx_flags_hi(); |
|
294 |
band& xxx_flags_lo(); |
|
295 |
band& xxx_attr_count(); |
|
296 |
band& xxx_attr_indexes(); |
|
297 |
band& xxx_attr_calls(); |
|
298 |
band& fixed_band(int e_class_xxx); |
|
299 |
||
300 |
// Register a new layout, and make bands for it. |
|
301 |
layout_definition* defineLayout(int idx, const char* name, const char* layout); |
|
302 |
layout_definition* defineLayout(int idx, entry* nameEntry, const char* layout); |
|
303 |
band** buildBands(layout_definition* lo); |
|
304 |
||
305 |
// Parse a layout string or part of one, recursively if necessary. |
|
306 |
const char* parseLayout(const char* lp, band** &res, int curCble); |
|
307 |
const char* parseNumeral(const char* lp, int &res); |
|
308 |
const char* parseIntLayout(const char* lp, band* &res, byte le_kind, |
|
309 |
bool can_be_signed = false); |
|
310 |
band** popBody(int band_stack_base); // pops a body off band_stack |
|
311 |
||
312 |
// Read data into the bands of the idx-th layout. |
|
313 |
void readBandData(int idx); // parse layout, make bands, read data |
|
314 |
void readBandData(band** body, uint count); // recursive helper |
|
315 |
||
316 |
layout_definition* getLayout(uint idx) { |
|
1082
53833ff90c45
6496269: Many warnings generated from com/sun/java/util/jar/pack/*.cpp when compiled on Linux
ohair
parents:
2
diff
changeset
|
317 |
if (idx >= (uint)layouts.length()) return null; |
2 | 318 |
return (layout_definition*) layouts.get(idx); |
319 |
} |
|
320 |
||
321 |
void setHaveLongFlags(bool z) { |
|
322 |
assert(flag_limit == 0); // not set up yet |
|
323 |
flag_limit = (z? X_ATTR_LIMIT_FLAGS_HI: X_ATTR_LIMIT_NO_FLAGS_HI); |
|
324 |
} |
|
325 |
bool haveLongFlags() { |
|
326 |
assert(flag_limit == X_ATTR_LIMIT_NO_FLAGS_HI || |
|
327 |
flag_limit == X_ATTR_LIMIT_FLAGS_HI); |
|
328 |
return flag_limit == X_ATTR_LIMIT_FLAGS_HI; |
|
329 |
} |
|
330 |
||
331 |
// Return flag_count if idx is predef and not redef, else zero. |
|
332 |
int predefCount(uint idx); |
|
333 |
||
334 |
bool isRedefined(uint idx) { |
|
1082
53833ff90c45
6496269: Many warnings generated from com/sun/java/util/jar/pack/*.cpp when compiled on Linux
ohair
parents:
2
diff
changeset
|
335 |
if (idx >= flag_limit) return false; |
53833ff90c45
6496269: Many warnings generated from com/sun/java/util/jar/pack/*.cpp when compiled on Linux
ohair
parents:
2
diff
changeset
|
336 |
return (bool)((redef >> idx) & 1); |
2 | 337 |
} |
338 |
bool isPredefined(uint idx) { |
|
1082
53833ff90c45
6496269: Many warnings generated from com/sun/java/util/jar/pack/*.cpp when compiled on Linux
ohair
parents:
2
diff
changeset
|
339 |
if (idx >= flag_limit) return false; |
53833ff90c45
6496269: Many warnings generated from com/sun/java/util/jar/pack/*.cpp when compiled on Linux
ohair
parents:
2
diff
changeset
|
340 |
return (bool)(((predef & ~redef) >> idx) & 1); |
2 | 341 |
} |
342 |
julong flagIndexMask() { |
|
343 |
return (predef | redef); |
|
344 |
} |
|
345 |
bool isIndex(uint idx) { |
|
346 |
assert(flag_limit != 0); // must be set up already |
|
347 |
if (idx < flag_limit) |
|
1082
53833ff90c45
6496269: Many warnings generated from com/sun/java/util/jar/pack/*.cpp when compiled on Linux
ohair
parents:
2
diff
changeset
|
348 |
return (bool)(((predef | redef) >> idx) & 1); |
2 | 349 |
else |
1082
53833ff90c45
6496269: Many warnings generated from com/sun/java/util/jar/pack/*.cpp when compiled on Linux
ohair
parents:
2
diff
changeset
|
350 |
return (idx - flag_limit < (uint)overflow_count.length()); |
2 | 351 |
} |
352 |
int& getCount(uint idx) { |
|
353 |
assert(isIndex(idx)); |
|
354 |
if (idx < flag_limit) |
|
355 |
return flag_count[idx]; |
|
356 |
else |
|
357 |
return overflow_count.get(idx - flag_limit); |
|
358 |
} |
|
359 |
bool aborting() { return u->aborting(); } |
|
360 |
void abort(const char* msg) { u->abort(msg); } |
|
361 |
}; |
|
362 |
||
363 |
attr_definitions attr_defs[ATTR_CONTEXT_LIMIT]; |
|
364 |
||
365 |
// Initialization |
|
366 |
void init(read_input_fn_t input_fn = null); |
|
367 |
// Resets to a known sane state |
|
368 |
void reset(); |
|
369 |
// Deallocates all storage. |
|
370 |
void free(); |
|
371 |
// Deallocates temporary storage (volatile after next client call). |
|
372 |
void free_temps() { tsmallbuf.init(); tmallocs.freeAll(); } |
|
373 |
||
374 |
// Option management methods |
|
375 |
bool set_option(const char* option, const char* value); |
|
376 |
const char* get_option(const char* option); |
|
377 |
||
378 |
void dump_options(); |
|
379 |
||
380 |
// Fetching input. |
|
381 |
bool ensure_input(jlong more); |
|
382 |
byte* input_scan() { return rp; } |
|
383 |
size_t input_remaining() { return rplimit - rp; } |
|
384 |
size_t input_consumed() { return rp - input.base(); } |
|
385 |
||
386 |
// Entry points to the unpack engine |
|
387 |
static int run(int argc, char **argv); // Unix-style entry point. |
|
388 |
void check_options(); |
|
389 |
void start(void* packptr = null, size_t len = 0); |
|
390 |
void redirect_stdio(); |
|
391 |
void write_file_to_jar(file* f); |
|
392 |
void finish(); |
|
393 |
||
394 |
// Public post unpack methods |
|
395 |
int get_files_remaining() { return files_remaining; } |
|
396 |
int get_segments_remaining() { return archive_next_count; } |
|
397 |
file* get_next_file(); // returns null on last file |
|
398 |
||
399 |
// General purpose methods |
|
400 |
void* alloc(size_t size) { return alloc_heap(size, true); } |
|
401 |
void* temp_alloc(size_t size) { return alloc_heap(size, true, true); } |
|
402 |
void* alloc_heap(size_t size, bool smallOK = false, bool temp = false); |
|
403 |
void saveTo(bytes& b, const char* str) { saveTo(b, (byte*)str, strlen(str)); } |
|
404 |
void saveTo(bytes& b, bytes& data) { saveTo(b, data.ptr, data.len); } |
|
405 |
void saveTo(bytes& b, byte* ptr, size_t len); //{ b.ptr = U_NEW...} |
|
406 |
const char* saveStr(const char* str) { bytes buf; saveTo(buf, str); return buf.strval(); } |
|
407 |
const char* saveIntStr(int num) { char buf[30]; sprintf(buf, "%d", num); return saveStr(buf); } |
|
408 |
#ifndef PRODUCT |
|
409 |
int printcr_if_verbose(int level, const char* fmt,...); |
|
410 |
#endif |
|
411 |
const char* get_abort_message(); |
|
412 |
void abort(const char* s = null); |
|
413 |
bool aborting() { return abort_message != null; } |
|
414 |
static unpacker* current(); // find current instance |
|
415 |
||
416 |
// Output management |
|
417 |
void set_output(fillbytes* which) { |
|
418 |
assert(wp == null); |
|
419 |
which->ensureSize(1 << 12); // covers the average classfile |
|
420 |
wpbase = which->base(); |
|
421 |
wp = which->limit(); |
|
422 |
wplimit = which->end(); |
|
423 |
} |
|
424 |
fillbytes* close_output(fillbytes* which = null); // inverse of set_output |
|
425 |
||
426 |
// These take an implicit parameter of wp/wplimit, and resize as necessary: |
|
427 |
byte* put_space(size_t len); // allocates space at wp, returns pointer |
|
428 |
size_t put_empty(size_t s) { byte* p = put_space(s); return p - wpbase; } |
|
429 |
void ensure_put_space(size_t len); |
|
430 |
void put_bytes(bytes& b) { b.writeTo(put_space(b.len)); } |
|
431 |
void putu1(int n) { putu1_at(put_space(1), n); } |
|
432 |
void putu1_fast(int n) { putu1_at(wp++, n); } |
|
433 |
void putu2(int n); // { putu2_at(put_space(2), n); } |
|
434 |
void putu4(int n); // { putu4_at(put_space(4), n); } |
|
435 |
void putu8(jlong n); // { putu8_at(put_space(8), n); } |
|
436 |
void putref(entry* e); // { putu2_at(put_space(2), putref_index(e, 2)); } |
|
437 |
void putu1ref(entry* e); // { putu1_at(put_space(1), putref_index(e, 1)); } |
|
438 |
int putref_index(entry* e, int size); // size in [1..2] |
|
439 |
void put_label(int curIP, int size); // size in {2,4} |
|
440 |
void putlayout(band** body); |
|
441 |
void put_stackmap_type(); |
|
442 |
||
443 |
size_t wpoffset() { return (size_t)(wp - wpbase); } // (unvariant across overflow) |
|
444 |
byte* wp_at(size_t offset) { return wpbase + offset; } |
|
445 |
uint to_bci(uint bii); |
|
446 |
void get_code_header(int& max_stack, |
|
447 |
int& max_na_locals, |
|
448 |
int& handler_count, |
|
449 |
int& cflags); |
|
450 |
band* ref_band_for_self_op(int bc, bool& isAloadVar, int& origBCVar); |
|
451 |
band* ref_band_for_op(int bc); |
|
452 |
||
453 |
// Definitions of standard classfile int formats: |
|
454 |
static void putu1_at(byte* wp, int n) { assert(n == (n & 0xFF)); wp[0] = n; } |
|
455 |
static void putu2_at(byte* wp, int n); |
|
456 |
static void putu4_at(byte* wp, int n); |
|
457 |
static void putu8_at(byte* wp, jlong n); |
|
458 |
||
459 |
// Private stuff |
|
460 |
void reset_cur_classfile(); |
|
461 |
void write_classfile_tail(); |
|
462 |
void write_classfile_head(); |
|
463 |
void write_code(); |
|
464 |
void write_bc_ops(); |
|
465 |
void write_members(int num, int attrc); // attrc=ATTR_CONTEXT_FIELD/METHOD |
|
466 |
int write_attrs(int attrc, julong indexBits); |
|
467 |
||
468 |
// The readers |
|
469 |
void read_bands(); |
|
470 |
void read_file_header(); |
|
471 |
void read_cp(); |
|
472 |
void read_cp_counts(value_stream& hdr); |
|
473 |
void read_attr_defs(); |
|
474 |
void read_ics(); |
|
475 |
void read_attrs(int attrc, int obj_count); |
|
476 |
void read_classes(); |
|
477 |
void read_code_headers(); |
|
478 |
void read_bcs(); |
|
479 |
void read_bc_ops(); |
|
480 |
void read_files(); |
|
481 |
void read_Utf8_values(entry* cpMap, int len); |
|
482 |
void read_single_words(band& cp_band, entry* cpMap, int len); |
|
483 |
void read_double_words(band& cp_bands, entry* cpMap, int len); |
|
484 |
void read_single_refs(band& cp_band, byte refTag, entry* cpMap, int len); |
|
485 |
void read_double_refs(band& cp_band, byte ref1Tag, byte ref2Tag, entry* cpMap, int len); |
|
486 |
void read_signature_values(entry* cpMap, int len); |
|
487 |
}; |
|
488 |
||
489 |
inline void cpool::abort(const char* msg) { u->abort(msg); } |
|
490 |
inline bool cpool::aborting() { return u->aborting(); } |