View | Details | Raw Unified | Return to bug 61075
Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java (-1767 / +795 lines)
Lines 78-100 Link Here
78
	if (DEBUG) System.out.println(position + "\t\taaload"); //$NON-NLS-1$
78
	if (DEBUG) System.out.println(position + "\t\taaload"); //$NON-NLS-1$
79
	countLabels = 0;
79
	countLabels = 0;
80
	stackDepth--;
80
	stackDepth--;
81
	try {
81
82
		position++;
82
	checkOffset(classFileOffset);
83
		bCodeStream[classFileOffset++] = OPC_aaload;
83
	position++;
84
	} catch (IndexOutOfBoundsException e) {
84
	bCodeStream[classFileOffset++] = OPC_aaload;
85
		resizeByteArray(OPC_aaload);
86
	}
87
}
85
}
88
final public void aastore() {
86
final public void aastore() {
89
	if (DEBUG) System.out.println(position + "\t\taastore"); //$NON-NLS-1$
87
	if (DEBUG) System.out.println(position + "\t\taastore"); //$NON-NLS-1$
90
	countLabels = 0;
88
	countLabels = 0;
91
	stackDepth -= 3;
89
	stackDepth -= 3;
92
	try {
90
	
93
		position++;
91
	checkOffset(classFileOffset);
94
		bCodeStream[classFileOffset++] = OPC_aastore;
92
	position++;
95
	} catch (IndexOutOfBoundsException e) {
93
	bCodeStream[classFileOffset++] = OPC_aastore;
96
		resizeByteArray(OPC_aastore);
97
	}
98
}
94
}
99
final public void aconst_null() {
95
final public void aconst_null() {
100
	if (DEBUG) System.out.println(position + "\t\taconst_null"); //$NON-NLS-1$
96
	if (DEBUG) System.out.println(position + "\t\taconst_null"); //$NON-NLS-1$
Lines 102-113 Link Here
102
	stackDepth++;
98
	stackDepth++;
103
	if (stackDepth > stackMax)
99
	if (stackDepth > stackMax)
104
		stackMax = stackDepth;
100
		stackMax = stackDepth;
105
	try {
101
	checkOffset(classFileOffset);
106
		position++;
102
	position++;
107
		bCodeStream[classFileOffset++] = OPC_aconst_null;
103
	bCodeStream[classFileOffset++] = OPC_aconst_null;
108
	} catch (IndexOutOfBoundsException e) {
109
		resizeByteArray(OPC_aconst_null);
110
	}
111
}
104
}
112
public final void addDefinitelyAssignedVariables(Scope scope, int initStateIndex) {
105
public final void addDefinitelyAssignedVariables(Scope scope, int initStateIndex) {
113
	// Required to fix 1PR0XVS: LFRE:WINNT - Compiler: variable table for method appears incorrect
106
	// Required to fix 1PR0XVS: LFRE:WINNT - Compiler: variable table for method appears incorrect
Lines 166-199 Link Here
166
	if (maxLocals <= iArg) {
159
	if (maxLocals <= iArg) {
167
		maxLocals = iArg + 1;
160
		maxLocals = iArg + 1;
168
	}
161
	}
162
163
	checkOffset(classFileOffset + 1);
164
	position+=2;
169
	if (iArg > 255) { // Widen
165
	if (iArg > 255) { // Widen
170
		try {
166
		bCodeStream[classFileOffset++] = OPC_wide;
171
			position++;
167
		bCodeStream[classFileOffset++] = OPC_aload;
172
			bCodeStream[classFileOffset++] = OPC_wide;
173
		} catch (IndexOutOfBoundsException e) {
174
			resizeByteArray(OPC_wide);
175
		}
176
		try {
177
			position++;
178
			bCodeStream[classFileOffset++] = OPC_aload;
179
		} catch (IndexOutOfBoundsException e) {
180
			resizeByteArray(OPC_aload);
181
		}
182
		writeUnsignedShort(iArg);
168
		writeUnsignedShort(iArg);
183
	} else {
169
	} else {
184
		// Don't need to use the wide bytecode
170
		// Don't need to use the wide bytecode
185
		try {
171
		bCodeStream[classFileOffset++] = (OPC_aload);
186
			position++;
172
		bCodeStream[classFileOffset++] = (byte)iArg;
187
			bCodeStream[classFileOffset++] = OPC_aload;
188
		} catch (IndexOutOfBoundsException e) {
189
			resizeByteArray(OPC_aload);
190
		}
191
		try {
192
			position++;
193
			bCodeStream[classFileOffset++] = (byte) (iArg);
194
		} catch (IndexOutOfBoundsException e) {
195
			resizeByteArray((byte) iArg);
196
		}
197
	}
173
	}
198
}
174
}
199
final public void aload_0() {
175
final public void aload_0() {
Lines 205-216 Link Here
205
	if (maxLocals == 0) {
181
	if (maxLocals == 0) {
206
		maxLocals = 1;
182
		maxLocals = 1;
207
	}
183
	}
208
	try {
184
	
209
		position++;
185
	checkOffset(classFileOffset);
210
		bCodeStream[classFileOffset++] = OPC_aload_0;
186
	position++;
211
	} catch (IndexOutOfBoundsException e) {
187
	bCodeStream[classFileOffset++] = OPC_aload_0;
212
		resizeByteArray(OPC_aload_0);
213
	}
214
}
188
}
215
final public void aload_1() {
189
final public void aload_1() {
216
	if (DEBUG) System.out.println(position + "\t\taload_1"); //$NON-NLS-1$
190
	if (DEBUG) System.out.println(position + "\t\taload_1"); //$NON-NLS-1$
Lines 221-232 Link Here
221
	if (maxLocals <= 1) {
195
	if (maxLocals <= 1) {
222
		maxLocals = 2;
196
		maxLocals = 2;
223
	}
197
	}
224
	try {
198
	checkOffset(classFileOffset);
225
		position++;
199
	position++;
226
		bCodeStream[classFileOffset++] = OPC_aload_1;
200
	bCodeStream[classFileOffset++] = OPC_aload_1;
227
	} catch (IndexOutOfBoundsException e) {
228
		resizeByteArray(OPC_aload_1);
229
	}
230
}
201
}
231
final public void aload_2() {
202
final public void aload_2() {
232
	if (DEBUG) System.out.println(position + "\t\taload_2"); //$NON-NLS-1$
203
	if (DEBUG) System.out.println(position + "\t\taload_2"); //$NON-NLS-1$
Lines 237-248 Link Here
237
	if (maxLocals <= 2) {
208
	if (maxLocals <= 2) {
238
		maxLocals = 3;
209
		maxLocals = 3;
239
	}
210
	}
240
	try {
211
	checkOffset(classFileOffset);
241
		position++;
212
	position++;
242
		bCodeStream[classFileOffset++] = OPC_aload_2;
213
	bCodeStream[classFileOffset++] = OPC_aload_2;
243
	} catch (IndexOutOfBoundsException e) {
244
		resizeByteArray(OPC_aload_2);
245
	}
246
}
214
}
247
final public void aload_3() {
215
final public void aload_3() {
248
	if (DEBUG) System.out.println(position + "\t\taload_3"); //$NON-NLS-1$
216
	if (DEBUG) System.out.println(position + "\t\taload_3"); //$NON-NLS-1$
Lines 253-287 Link Here
253
	if (maxLocals <= 3) {
221
	if (maxLocals <= 3) {
254
		maxLocals = 4;
222
		maxLocals = 4;
255
	}
223
	}
256
	try {
224
	checkOffset(classFileOffset);
257
		position++;
225
	position++;
258
		bCodeStream[classFileOffset++] = OPC_aload_3;
226
	bCodeStream[classFileOffset++] = OPC_aload_3;
259
	} catch (IndexOutOfBoundsException e) {
260
		resizeByteArray(OPC_aload_3);
261
	}
262
}
227
}
263
public final void anewarray(TypeBinding typeBinding) {
228
public final void anewarray(TypeBinding typeBinding) {
264
	if (DEBUG) System.out.println(position + "\t\tanewarray: " + typeBinding); //$NON-NLS-1$
229
	if (DEBUG) System.out.println(position + "\t\tanewarray: " + typeBinding); //$NON-NLS-1$
265
	countLabels = 0;
230
	countLabels = 0;
266
	try {
231
	checkOffset(classFileOffset);
267
		position++;
232
	position++;
268
		bCodeStream[classFileOffset++] = OPC_anewarray;
233
	bCodeStream[classFileOffset++] = OPC_anewarray;
269
	} catch (IndexOutOfBoundsException e) {
270
		resizeByteArray(OPC_anewarray);
271
	}
272
	writeUnsignedShort(constantPool.literalIndex(typeBinding));
234
	writeUnsignedShort(constantPool.literalIndex(typeBinding));
273
}
235
}
274
final public void areturn() {
236
final public void areturn() {
275
	if (DEBUG) System.out.println(position + "\t\tareturn"); //$NON-NLS-1$
237
	if (DEBUG) System.out.println(position + "\t\tareturn"); //$NON-NLS-1$
276
	countLabels = 0;
238
	countLabels = 0;
277
	stackDepth--;
239
	stackDepth--;
278
	// the stackDepth should be equal to 0 
240
	// the stackDepth should be equal to 0
279
	try {
241
	checkOffset(classFileOffset);
280
		position++;
242
	position++;
281
		bCodeStream[classFileOffset++] = OPC_areturn;
243
	bCodeStream[classFileOffset++] = OPC_areturn;
282
	} catch (IndexOutOfBoundsException e) {
283
		resizeByteArray(OPC_areturn);
284
	}
285
}
244
}
286
public void arrayAt(int typeBindingID) {
245
public void arrayAt(int typeBindingID) {
287
	switch (typeBindingID) {
246
	switch (typeBindingID) {
Lines 358-369 Link Here
358
final public void arraylength() {
317
final public void arraylength() {
359
	if (DEBUG) System.out.println(position + "\t\tarraylength"); //$NON-NLS-1$
318
	if (DEBUG) System.out.println(position + "\t\tarraylength"); //$NON-NLS-1$
360
	countLabels = 0;
319
	countLabels = 0;
361
	try {
320
	checkOffset(classFileOffset);
362
		position++;
321
	position++;
363
		bCodeStream[classFileOffset++] = OPC_arraylength;
322
	bCodeStream[classFileOffset++] = OPC_arraylength;
364
	} catch (IndexOutOfBoundsException e) {
365
		resizeByteArray(OPC_arraylength);
366
	}
367
}
323
}
368
final public void astore(int iArg) {
324
final public void astore(int iArg) {
369
	if (DEBUG) System.out.println(position + "\t\tastore:"+iArg); //$NON-NLS-1$
325
	if (DEBUG) System.out.println(position + "\t\tastore:"+iArg); //$NON-NLS-1$
Lines 372-404 Link Here
372
	if (maxLocals <= iArg) {
328
	if (maxLocals <= iArg) {
373
		maxLocals = iArg + 1;
329
		maxLocals = iArg + 1;
374
	}
330
	}
331
	checkOffset(classFileOffset + 1);
332
	position+=2;	
375
	if (iArg > 255) { // Widen
333
	if (iArg > 255) { // Widen
376
		try {
334
		bCodeStream[classFileOffset++] = OPC_wide;
377
			position++;
335
		bCodeStream[classFileOffset++] = OPC_astore;
378
			bCodeStream[classFileOffset++] = OPC_wide;
379
		} catch (IndexOutOfBoundsException e) {
380
			resizeByteArray(OPC_wide);
381
		}
382
		try {
383
			position++;
384
			bCodeStream[classFileOffset++] = OPC_astore;
385
		} catch (IndexOutOfBoundsException e) {
386
			resizeByteArray(OPC_astore);
387
		}
388
		writeUnsignedShort(iArg);
336
		writeUnsignedShort(iArg);
389
	} else {
337
	} else {
390
		try {
338
		bCodeStream[classFileOffset++] = OPC_astore;
391
			position++;
339
		bCodeStream[classFileOffset++] = (byte)iArg;
392
			bCodeStream[classFileOffset++] = OPC_astore;
393
		} catch (IndexOutOfBoundsException e) {
394
			resizeByteArray(OPC_astore);
395
		}
396
		try {
397
			position++;
398
			bCodeStream[classFileOffset++] = (byte) iArg;
399
		} catch (IndexOutOfBoundsException e) {
400
			resizeByteArray((byte) iArg);
401
		}
402
	}
340
	}
403
}
341
}
404
final public void astore_0() {
342
final public void astore_0() {
Lines 408-419 Link Here
408
	if (maxLocals == 0) {
346
	if (maxLocals == 0) {
409
		maxLocals = 1;
347
		maxLocals = 1;
410
	}
348
	}
411
	try {
349
	checkOffset(classFileOffset);
412
		position++;
350
	position++;
413
		bCodeStream[classFileOffset++] = OPC_astore_0;
351
	bCodeStream[classFileOffset++] = OPC_astore_0;
414
	} catch (IndexOutOfBoundsException e) {
415
		resizeByteArray(OPC_astore_0);
416
	}
417
}
352
}
418
final public void astore_1() {
353
final public void astore_1() {
419
	if (DEBUG) System.out.println(position + "\t\tastore_1"); //$NON-NLS-1$
354
	if (DEBUG) System.out.println(position + "\t\tastore_1"); //$NON-NLS-1$
Lines 422-433 Link Here
422
	if (maxLocals <= 1) {
357
	if (maxLocals <= 1) {
423
		maxLocals = 2;
358
		maxLocals = 2;
424
	}
359
	}
425
	try {
360
	checkOffset(classFileOffset);
426
		position++;
361
	position++;
427
		bCodeStream[classFileOffset++] = OPC_astore_1;
362
	bCodeStream[classFileOffset++] = OPC_astore_1;
428
	} catch (IndexOutOfBoundsException e) {
429
		resizeByteArray(OPC_astore_1);
430
	}
431
}
363
}
432
final public void astore_2() {
364
final public void astore_2() {
433
	if (DEBUG) System.out.println(position + "\t\tastore_2"); //$NON-NLS-1$
365
	if (DEBUG) System.out.println(position + "\t\tastore_2"); //$NON-NLS-1$
Lines 436-447 Link Here
436
	if (maxLocals <= 2) {
368
	if (maxLocals <= 2) {
437
		maxLocals = 3;
369
		maxLocals = 3;
438
	}
370
	}
439
	try {
371
	checkOffset(classFileOffset);
440
		position++;
372
	position++;
441
		bCodeStream[classFileOffset++] = OPC_astore_2;
373
	bCodeStream[classFileOffset++] = OPC_astore_2;
442
	} catch (IndexOutOfBoundsException e) {
443
		resizeByteArray(OPC_astore_2);
444
	}
445
}
374
}
446
final public void astore_3() {
375
final public void astore_3() {
447
	if (DEBUG) System.out.println(position + "\t\tastore_3"); //$NON-NLS-1$
376
	if (DEBUG) System.out.println(position + "\t\tastore_3"); //$NON-NLS-1$
Lines 450-494 Link Here
450
	if (maxLocals <= 3) {
379
	if (maxLocals <= 3) {
451
		maxLocals = 4;
380
		maxLocals = 4;
452
	}
381
	}
453
	try {
382
	checkOffset(classFileOffset);
454
		position++;
383
	position++;
455
		bCodeStream[classFileOffset++] = OPC_astore_3;
384
	bCodeStream[classFileOffset++] = OPC_astore_3;
456
	} catch (IndexOutOfBoundsException e) {
457
		resizeByteArray(OPC_astore_3);
458
	}
459
}
385
}
460
final public void athrow() {
386
final public void athrow() {
461
	if (DEBUG) System.out.println(position + "\t\tathrow"); //$NON-NLS-1$
387
	if (DEBUG) System.out.println(position + "\t\tathrow"); //$NON-NLS-1$
462
	countLabels = 0;
388
	countLabels = 0;
463
	stackDepth--;
389
	stackDepth--;
464
	try {
390
	checkOffset(classFileOffset);
465
		position++;
391
	position++;
466
		bCodeStream[classFileOffset++] = OPC_athrow;
392
	bCodeStream[classFileOffset++] = OPC_athrow;
467
	} catch (IndexOutOfBoundsException e) {
468
		resizeByteArray(OPC_athrow);
469
	}
470
}
393
}
471
final public void baload() {
394
final public void baload() {
472
	if (DEBUG) System.out.println(position + "\t\tbaload"); //$NON-NLS-1$
395
	if (DEBUG) System.out.println(position + "\t\tbaload"); //$NON-NLS-1$
473
	countLabels = 0;
396
	countLabels = 0;
474
	stackDepth--;
397
	stackDepth--;
475
	try {
398
	checkOffset(classFileOffset);
476
		position++;
399
	position++;
477
		bCodeStream[classFileOffset++] = OPC_baload;
400
	bCodeStream[classFileOffset++] = OPC_baload;
478
	} catch (IndexOutOfBoundsException e) {
479
		resizeByteArray(OPC_baload);
480
	}
481
}
401
}
482
final public void bastore() {
402
final public void bastore() {
483
	if (DEBUG) System.out.println(position + "\t\tbastore"); //$NON-NLS-1$
403
	if (DEBUG) System.out.println(position + "\t\tbastore"); //$NON-NLS-1$
484
	countLabels = 0;
404
	countLabels = 0;
485
	stackDepth -= 3;
405
	stackDepth -= 3;
486
	try {
406
	checkOffset(classFileOffset);
487
		position++;
407
	position++;
488
		bCodeStream[classFileOffset++] = OPC_bastore;
408
	bCodeStream[classFileOffset++] = OPC_bastore;
489
	} catch (IndexOutOfBoundsException e) {
490
		resizeByteArray(OPC_bastore);
491
	}
492
}
409
}
493
final public void bipush(byte b) {
410
final public void bipush(byte b) {
494
	if (DEBUG) System.out.println(position + "\t\tbipush "+b); //$NON-NLS-1$
411
	if (DEBUG) System.out.println(position + "\t\tbipush "+b); //$NON-NLS-1$
Lines 496-627 Link Here
496
	stackDepth++;
413
	stackDepth++;
497
	if (stackDepth > stackMax)
414
	if (stackDepth > stackMax)
498
		stackMax = stackDepth;
415
		stackMax = stackDepth;
499
	try {
416
	checkOffset(classFileOffset);
500
		position++;
417
	position++;
501
		bCodeStream[classFileOffset++] = OPC_bipush;
418
	bCodeStream[classFileOffset++] = OPC_bipush;
502
	} catch (IndexOutOfBoundsException e) {
503
		resizeByteArray(OPC_bipush);
504
	}
505
	writeSignedByte(b);
419
	writeSignedByte(b);
506
}
420
}
507
final public void caload() {
421
final public void caload() {
508
	if (DEBUG) System.out.println(position + "\t\tcaload"); //$NON-NLS-1$
422
	if (DEBUG) System.out.println(position + "\t\tcaload"); //$NON-NLS-1$
509
	countLabels = 0;
423
	countLabels = 0;
510
	stackDepth--;
424
	stackDepth--;
511
	try {
425
	checkOffset(classFileOffset);
512
		position++;
426
	position++;
513
		bCodeStream[classFileOffset++] = OPC_caload;
427
	bCodeStream[classFileOffset++] = OPC_caload;
514
	} catch (IndexOutOfBoundsException e) {
515
		resizeByteArray(OPC_caload);
516
	}
517
}
428
}
518
final public void castore() {
429
final public void castore() {
519
	if (DEBUG) System.out.println(position + "\t\tcastore"); //$NON-NLS-1$
430
	if (DEBUG) System.out.println(position + "\t\tcastore"); //$NON-NLS-1$
520
	countLabels = 0;
431
	countLabels = 0;
521
	stackDepth -= 3;
432
	stackDepth -= 3;
522
	try {
433
	checkOffset(classFileOffset);
523
		position++;
434
	position++;
524
		bCodeStream[classFileOffset++] = OPC_castore;
435
	bCodeStream[classFileOffset++] = OPC_castore;
525
	} catch (IndexOutOfBoundsException e) {
526
		resizeByteArray(OPC_castore);
527
	}
528
}
436
}
529
public final void checkcast(TypeBinding typeBinding) {
437
public final void checkcast(TypeBinding typeBinding) {
530
	if (DEBUG) System.out.println(position + "\t\tcheckcast:"+typeBinding); //$NON-NLS-1$
438
	if (DEBUG) System.out.println(position + "\t\tcheckcast:"+typeBinding); //$NON-NLS-1$
531
	countLabels = 0;
439
	countLabels = 0;
532
	try {
440
	checkOffset(classFileOffset);
533
		position++;
441
	position++;
534
		bCodeStream[classFileOffset++] = OPC_checkcast;
442
	bCodeStream[classFileOffset++] = OPC_checkcast;
535
	} catch (IndexOutOfBoundsException e) {
536
		resizeByteArray(OPC_checkcast);
537
	}
538
	writeUnsignedShort(constantPool.literalIndex(typeBinding));
443
	writeUnsignedShort(constantPool.literalIndex(typeBinding));
539
}
444
}
540
final public void d2f() {
445
final public void d2f() {
541
	if (DEBUG) System.out.println(position + "\t\td2f"); //$NON-NLS-1$
446
	if (DEBUG) System.out.println(position + "\t\td2f"); //$NON-NLS-1$
542
	countLabels = 0;
447
	countLabels = 0;
543
	stackDepth--;
448
	stackDepth--;
544
	try {
449
	checkOffset(classFileOffset);
545
		position++;
450
	position++;
546
		bCodeStream[classFileOffset++] = OPC_d2f;
451
	bCodeStream[classFileOffset++] = OPC_d2f;
547
	} catch (IndexOutOfBoundsException e) {
548
		resizeByteArray(OPC_d2f);
549
	}
550
}
452
}
551
final public void d2i() {
453
final public void d2i() {
552
	if (DEBUG) System.out.println(position + "\t\td2i"); //$NON-NLS-1$
454
	if (DEBUG) System.out.println(position + "\t\td2i"); //$NON-NLS-1$
553
	countLabels = 0;
455
	countLabels = 0;
554
	stackDepth--;
456
	stackDepth--;
555
	try {
457
	checkOffset(classFileOffset);
556
		position++;
458
	position++;
557
		bCodeStream[classFileOffset++] = OPC_d2i;
459
	bCodeStream[classFileOffset++] = OPC_d2i;
558
	} catch (IndexOutOfBoundsException e) {
559
		resizeByteArray(OPC_d2i);
560
	}
561
}
460
}
562
final public void d2l() {
461
final public void d2l() {
563
	if (DEBUG) System.out.println(position + "\t\td2l"); //$NON-NLS-1$
462
	if (DEBUG) System.out.println(position + "\t\td2l"); //$NON-NLS-1$
564
	countLabels = 0;
463
	countLabels = 0;
565
	try {
464
	checkOffset(classFileOffset);
566
		position++;
465
	position++;
567
		bCodeStream[classFileOffset++] = OPC_d2l;
466
	bCodeStream[classFileOffset++] = OPC_d2l;
568
	} catch (IndexOutOfBoundsException e) {
569
		resizeByteArray(OPC_d2l);
570
	}
571
}
467
}
572
final public void dadd() {
468
final public void dadd() {
573
	if (DEBUG) System.out.println(position + "\t\tdadd"); //$NON-NLS-1$
469
	if (DEBUG) System.out.println(position + "\t\tdadd"); //$NON-NLS-1$
574
	countLabels = 0;
470
	countLabels = 0;
575
	stackDepth -= 2;
471
	stackDepth -= 2;
576
	try {
472
	checkOffset(classFileOffset);
577
		position++;
473
	position++;
578
		bCodeStream[classFileOffset++] = OPC_dadd;
474
	bCodeStream[classFileOffset++] = OPC_dadd;
579
	} catch (IndexOutOfBoundsException e) {
580
		resizeByteArray(OPC_dadd);
581
	}
582
}
475
}
583
final public void daload() {
476
final public void daload() {
584
	if (DEBUG) System.out.println(position + "\t\tdaload"); //$NON-NLS-1$
477
	if (DEBUG) System.out.println(position + "\t\tdaload"); //$NON-NLS-1$
585
	countLabels = 0;
478
	countLabels = 0;
586
	try {
479
	checkOffset(classFileOffset);
587
		position++;
480
	position++;
588
		bCodeStream[classFileOffset++] = OPC_daload;
481
	bCodeStream[classFileOffset++] = OPC_daload;
589
	} catch (IndexOutOfBoundsException e) {
590
		resizeByteArray(OPC_daload);
591
	}
592
}
482
}
593
final public void dastore() {
483
final public void dastore() {
594
	if (DEBUG) System.out.println(position + "\t\tdastore"); //$NON-NLS-1$
484
	if (DEBUG) System.out.println(position + "\t\tdastore"); //$NON-NLS-1$
595
	countLabels = 0;
485
	countLabels = 0;
596
	stackDepth -= 4;
486
	stackDepth -= 4;
597
	try {
487
	checkOffset(classFileOffset);
598
		position++;
488
	position++;
599
		bCodeStream[classFileOffset++] = OPC_dastore;
489
	bCodeStream[classFileOffset++] = OPC_dastore;
600
	} catch (IndexOutOfBoundsException e) {
601
		resizeByteArray(OPC_dastore);
602
	}
603
}
490
}
604
final public void dcmpg() {
491
final public void dcmpg() {
605
	if (DEBUG) System.out.println(position + "\t\tdcmpg"); //$NON-NLS-1$
492
	if (DEBUG) System.out.println(position + "\t\tdcmpg"); //$NON-NLS-1$
606
	countLabels = 0;
493
	countLabels = 0;
607
	stackDepth -= 3;
494
	stackDepth -= 3;
608
	try {
495
	checkOffset(classFileOffset);
609
		position++;
496
	position++;
610
		bCodeStream[classFileOffset++] = OPC_dcmpg;
497
	bCodeStream[classFileOffset++] = OPC_dcmpg;
611
	} catch (IndexOutOfBoundsException e) {
612
		resizeByteArray(OPC_dcmpg);
613
	}
614
}
498
}
615
final public void dcmpl() {
499
final public void dcmpl() {
616
	if (DEBUG) System.out.println(position + "\t\tdcmpl"); //$NON-NLS-1$
500
	if (DEBUG) System.out.println(position + "\t\tdcmpl"); //$NON-NLS-1$
617
	countLabels = 0;
501
	countLabels = 0;
618
	stackDepth -= 3;
502
	stackDepth -= 3;
619
	try {
503
	checkOffset(classFileOffset);
620
		position++;
504
	position++;
621
		bCodeStream[classFileOffset++] = OPC_dcmpl;
505
	bCodeStream[classFileOffset++] = OPC_dcmpl;
622
	} catch (IndexOutOfBoundsException e) {
623
		resizeByteArray(OPC_dcmpl);
624
	}
625
}
506
}
626
final public void dconst_0() {
507
final public void dconst_0() {
627
	if (DEBUG) System.out.println(position + "\t\tdconst_0"); //$NON-NLS-1$
508
	if (DEBUG) System.out.println(position + "\t\tdconst_0"); //$NON-NLS-1$
Lines 629-640 Link Here
629
	stackDepth += 2;
510
	stackDepth += 2;
630
	if (stackDepth > stackMax)
511
	if (stackDepth > stackMax)
631
		stackMax = stackDepth;
512
		stackMax = stackDepth;
632
	try {
513
	checkOffset(classFileOffset);
633
		position++;
514
	position++;
634
		bCodeStream[classFileOffset++] = OPC_dconst_0;
515
	bCodeStream[classFileOffset++] = OPC_dconst_0;
635
	} catch (IndexOutOfBoundsException e) {
636
		resizeByteArray(OPC_dconst_0);
637
	}
638
}
516
}
639
final public void dconst_1() {
517
final public void dconst_1() {
640
	if (DEBUG) System.out.println(position + "\t\tdconst_1"); //$NON-NLS-1$
518
	if (DEBUG) System.out.println(position + "\t\tdconst_1"); //$NON-NLS-1$
Lines 642-664 Link Here
642
	stackDepth += 2;
520
	stackDepth += 2;
643
	if (stackDepth > stackMax)
521
	if (stackDepth > stackMax)
644
		stackMax = stackDepth;
522
		stackMax = stackDepth;
645
	try {
523
	checkOffset(classFileOffset);
646
		position++;
524
	position++;
647
		bCodeStream[classFileOffset++] = OPC_dconst_1;
525
	bCodeStream[classFileOffset++] = OPC_dconst_1;
648
	} catch (IndexOutOfBoundsException e) {
649
		resizeByteArray(OPC_dconst_1);
650
	}
651
}
526
}
652
final public void ddiv() {
527
final public void ddiv() {
653
	if (DEBUG) System.out.println(position + "\t\tddiv"); //$NON-NLS-1$
528
	if (DEBUG) System.out.println(position + "\t\tddiv"); //$NON-NLS-1$
654
	countLabels = 0;
529
	countLabels = 0;
655
	stackDepth -= 2;
530
	stackDepth -= 2;
656
	try {
531
	checkOffset(classFileOffset);
657
		position++;
532
	position++;
658
		bCodeStream[classFileOffset++] = OPC_ddiv;
533
	bCodeStream[classFileOffset++] = OPC_ddiv;
659
	} catch (IndexOutOfBoundsException e) {
660
		resizeByteArray(OPC_ddiv);
661
	}
662
}
534
}
663
public void decrStackSize(int offset) {
535
public void decrStackSize(int offset) {
664
	stackDepth -= offset;
536
	stackDepth -= offset;
Lines 672-705 Link Here
672
	if (maxLocals < iArg + 2) {
544
	if (maxLocals < iArg + 2) {
673
		maxLocals = iArg + 2; // + 2 because it is a double
545
		maxLocals = iArg + 2; // + 2 because it is a double
674
	}
546
	}
547
	checkOffset(classFileOffset + 1);
548
	position+=2;
675
	if (iArg > 255) { // Widen
549
	if (iArg > 255) { // Widen
676
		try {
550
		bCodeStream[classFileOffset++] = OPC_wide;
677
			position++;
551
		bCodeStream[classFileOffset++] = OPC_dload;
678
			bCodeStream[classFileOffset++] = OPC_wide;
679
		} catch (IndexOutOfBoundsException e) {
680
			resizeByteArray(OPC_wide);
681
		}
682
		try {
683
			position++;
684
			bCodeStream[classFileOffset++] = OPC_dload;
685
		} catch (IndexOutOfBoundsException e) {
686
			resizeByteArray(OPC_dload);
687
		}
688
		writeUnsignedShort(iArg);
552
		writeUnsignedShort(iArg);
689
	} else {
553
	} else {
690
		// Don't need to use the wide bytecode
554
		// Don't need to use the wide bytecode
691
		try {
555
		bCodeStream[classFileOffset++] = OPC_dload;
692
			position++;
556
		bCodeStream[classFileOffset++] = (byte)iArg;
693
			bCodeStream[classFileOffset++] = OPC_dload;
694
		} catch (IndexOutOfBoundsException e) {
695
			resizeByteArray(OPC_dload);
696
		}
697
		try {
698
			position++;
699
			bCodeStream[classFileOffset++] = (byte) iArg;
700
		} catch (IndexOutOfBoundsException e) {
701
			resizeByteArray((byte) iArg);
702
		}
703
	}
557
	}
704
}
558
}
705
final public void dload_0() {
559
final public void dload_0() {
Lines 711-722 Link Here
711
	if (maxLocals < 2) {
565
	if (maxLocals < 2) {
712
		maxLocals = 2;
566
		maxLocals = 2;
713
	}
567
	}
714
	try {
568
	checkOffset(classFileOffset);
715
		position++;
569
	position++;
716
		bCodeStream[classFileOffset++] = OPC_dload_0;
570
	bCodeStream[classFileOffset++] = OPC_dload_0;
717
	} catch (IndexOutOfBoundsException e) {
718
		resizeByteArray(OPC_dload_0);
719
	}
720
}
571
}
721
final public void dload_1() {
572
final public void dload_1() {
722
	if (DEBUG) System.out.println(position + "\t\tdload_1"); //$NON-NLS-1$
573
	if (DEBUG) System.out.println(position + "\t\tdload_1"); //$NON-NLS-1$
Lines 727-738 Link Here
727
	if (maxLocals < 3) {
578
	if (maxLocals < 3) {
728
		maxLocals = 3;
579
		maxLocals = 3;
729
	}
580
	}
730
	try {
581
	checkOffset(classFileOffset);
731
		position++;
582
	position++;
732
		bCodeStream[classFileOffset++] = OPC_dload_1;
583
	bCodeStream[classFileOffset++] = OPC_dload_1;
733
	} catch (IndexOutOfBoundsException e) {
734
		resizeByteArray(OPC_dload_1);
735
	}
736
}
584
}
737
final public void dload_2() {
585
final public void dload_2() {
738
	if (DEBUG) System.out.println(position + "\t\tdload_2"); //$NON-NLS-1$
586
	if (DEBUG) System.out.println(position + "\t\tdload_2"); //$NON-NLS-1$
Lines 743-754 Link Here
743
	if (maxLocals < 4) {
591
	if (maxLocals < 4) {
744
		maxLocals = 4;
592
		maxLocals = 4;
745
	}
593
	}
746
	try {
594
	checkOffset(classFileOffset);
747
		position++;
595
	position++;
748
		bCodeStream[classFileOffset++] = OPC_dload_2;
596
	bCodeStream[classFileOffset++] = OPC_dload_2;
749
	} catch (IndexOutOfBoundsException e) {
750
		resizeByteArray(OPC_dload_2);
751
	}
752
}
597
}
753
final public void dload_3() {
598
final public void dload_3() {
754
	if (DEBUG) System.out.println(position + "\t\tdload_3"); //$NON-NLS-1$
599
	if (DEBUG) System.out.println(position + "\t\tdload_3"); //$NON-NLS-1$
Lines 759-814 Link Here
759
	if (maxLocals < 5) {
604
	if (maxLocals < 5) {
760
		maxLocals = 5;
605
		maxLocals = 5;
761
	}
606
	}
762
	try {
607
	checkOffset(classFileOffset);
763
		position++;
608
	position++;
764
		bCodeStream[classFileOffset++] = OPC_dload_3;
609
	bCodeStream[classFileOffset++] = OPC_dload_3;
765
	} catch (IndexOutOfBoundsException e) {
766
		resizeByteArray(OPC_dload_3);
767
	}
768
}
610
}
769
final public void dmul() {
611
final public void dmul() {
770
	if (DEBUG) System.out.println(position + "\t\tdmul"); //$NON-NLS-1$
612
	if (DEBUG) System.out.println(position + "\t\tdmul"); //$NON-NLS-1$
771
	countLabels = 0;
613
	countLabels = 0;
772
	stackDepth -= 2;
614
	stackDepth -= 2;
773
	try {
615
	checkOffset(classFileOffset);
774
		position++;
616
	position++;
775
		bCodeStream[classFileOffset++] = OPC_dmul;
617
	bCodeStream[classFileOffset++] = OPC_dmul;
776
	} catch (IndexOutOfBoundsException e) {
777
		resizeByteArray(OPC_dmul);
778
	}
779
}
618
}
780
final public void dneg() {
619
final public void dneg() {
781
	if (DEBUG) System.out.println(position + "\t\tdneg"); //$NON-NLS-1$
620
	if (DEBUG) System.out.println(position + "\t\tdneg"); //$NON-NLS-1$
782
	countLabels = 0;
621
	countLabels = 0;
783
	try {
622
	checkOffset(classFileOffset);
784
		position++;
623
	position++;
785
		bCodeStream[classFileOffset++] = OPC_dneg;
624
	bCodeStream[classFileOffset++] = OPC_dneg;
786
	} catch (IndexOutOfBoundsException e) {
787
		resizeByteArray(OPC_dneg);
788
	}
789
}
625
}
790
final public void drem() {
626
final public void drem() {
791
	if (DEBUG) System.out.println(position + "\t\tdrem"); //$NON-NLS-1$
627
	if (DEBUG) System.out.println(position + "\t\tdrem"); //$NON-NLS-1$
792
	countLabels = 0;
628
	countLabels = 0;
793
	stackDepth -= 2;
629
	stackDepth -= 2;
794
	try {
630
	checkOffset(classFileOffset);
795
		position++;
631
	position++;
796
		bCodeStream[classFileOffset++] = OPC_drem;
632
	bCodeStream[classFileOffset++] = OPC_drem;
797
	} catch (IndexOutOfBoundsException e) {
798
		resizeByteArray(OPC_drem);
799
	}
800
}
633
}
801
final public void dreturn() {
634
final public void dreturn() {
802
	if (DEBUG) System.out.println(position + "\t\tdreturn"); //$NON-NLS-1$
635
	if (DEBUG) System.out.println(position + "\t\tdreturn"); //$NON-NLS-1$
803
	countLabels = 0;
636
	countLabels = 0;
804
	stackDepth -= 2;
637
	stackDepth -= 2;
805
	// the stackDepth should be equal to 0 
638
	// the stackDepth should be equal to 0
806
	try {
639
	checkOffset(classFileOffset);
807
		position++;
640
	position++;
808
		bCodeStream[classFileOffset++] = OPC_dreturn;
641
	bCodeStream[classFileOffset++] = OPC_dreturn;
809
	} catch (IndexOutOfBoundsException e) {
810
		resizeByteArray(OPC_dreturn);
811
	}
812
}
642
}
813
final public void dstore(int iArg) {
643
final public void dstore(int iArg) {
814
	if (DEBUG) System.out.println(position + "\t\tdstore:"+iArg); //$NON-NLS-1$
644
	if (DEBUG) System.out.println(position + "\t\tdstore:"+iArg); //$NON-NLS-1$
Lines 817-849 Link Here
817
	if (maxLocals <= iArg + 1) {
647
	if (maxLocals <= iArg + 1) {
818
		maxLocals = iArg + 2;
648
		maxLocals = iArg + 2;
819
	}
649
	}
650
	checkOffset(classFileOffset + 1);
651
	position+=2;
820
	if (iArg > 255) { // Widen
652
	if (iArg > 255) { // Widen
821
		try {
653
		bCodeStream[classFileOffset++] = OPC_wide;
822
			position++;
654
		bCodeStream[classFileOffset++] = OPC_dstore;
823
			bCodeStream[classFileOffset++] = OPC_wide;
824
		} catch (IndexOutOfBoundsException e) {
825
			resizeByteArray(OPC_wide);
826
		}
827
		try {
828
			position++;
829
			bCodeStream[classFileOffset++] = OPC_dstore;
830
		} catch (IndexOutOfBoundsException e) {
831
			resizeByteArray(OPC_dstore);
832
		}
833
		writeUnsignedShort(iArg);
655
		writeUnsignedShort(iArg);
834
	} else {
656
	} else {
835
		try {
657
		bCodeStream[classFileOffset++] = OPC_dstore;
836
			position++;
658
		bCodeStream[classFileOffset++] = (byte)iArg;
837
			bCodeStream[classFileOffset++] = OPC_dstore;
838
		} catch (IndexOutOfBoundsException e) {
839
			resizeByteArray(OPC_dstore);
840
		}
841
		try {
842
			position++;
843
			bCodeStream[classFileOffset++] = (byte) iArg;
844
		} catch (IndexOutOfBoundsException e) {
845
			resizeByteArray((byte) iArg);
846
		}
847
	}
659
	}
848
}
660
}
849
final public void dstore_0() {
661
final public void dstore_0() {
Lines 853-864 Link Here
853
	if (maxLocals < 2) {
665
	if (maxLocals < 2) {
854
		maxLocals = 2;
666
		maxLocals = 2;
855
	}
667
	}
856
	try {
668
	checkOffset(classFileOffset);
857
		position++;
669
	position++;
858
		bCodeStream[classFileOffset++] = OPC_dstore_0;
670
	bCodeStream[classFileOffset++] = OPC_dstore_0;
859
	} catch (IndexOutOfBoundsException e) {
860
		resizeByteArray(OPC_dstore_0);
861
	}
862
}
671
}
863
final public void dstore_1() {
672
final public void dstore_1() {
864
	if (DEBUG) System.out.println(position + "\t\tdstore_1"); //$NON-NLS-1$
673
	if (DEBUG) System.out.println(position + "\t\tdstore_1"); //$NON-NLS-1$
Lines 867-878 Link Here
867
	if (maxLocals < 3) {
676
	if (maxLocals < 3) {
868
		maxLocals = 3;
677
		maxLocals = 3;
869
	}
678
	}
870
	try {
679
	checkOffset(classFileOffset);
871
		position++;
680
	position++;
872
		bCodeStream[classFileOffset++] = OPC_dstore_1;
681
	bCodeStream[classFileOffset++] = OPC_dstore_1;
873
	} catch (IndexOutOfBoundsException e) {
874
		resizeByteArray(OPC_dstore_1);
875
	}
876
}
682
}
877
final public void dstore_2() {
683
final public void dstore_2() {
878
	if (DEBUG) System.out.println(position + "\t\tdstore_2"); //$NON-NLS-1$
684
	if (DEBUG) System.out.println(position + "\t\tdstore_2"); //$NON-NLS-1$
Lines 881-892 Link Here
881
	if (maxLocals < 4) {
687
	if (maxLocals < 4) {
882
		maxLocals = 4;
688
		maxLocals = 4;
883
	}
689
	}
884
	try {
690
	checkOffset(classFileOffset);
885
		position++;
691
	position++;
886
		bCodeStream[classFileOffset++] = OPC_dstore_2;
692
	bCodeStream[classFileOffset++] = OPC_dstore_2;
887
	} catch (IndexOutOfBoundsException e) {
888
		resizeByteArray(OPC_dstore_2);
889
	}
890
}
693
}
891
final public void dstore_3() {
694
final public void dstore_3() {
892
	if (DEBUG) System.out.println(position + "\t\tdstore_3"); //$NON-NLS-1$
695
	if (DEBUG) System.out.println(position + "\t\tdstore_3"); //$NON-NLS-1$
Lines 895-917 Link Here
895
	if (maxLocals < 5) {
698
	if (maxLocals < 5) {
896
		maxLocals = 5;
699
		maxLocals = 5;
897
	}
700
	}
898
	try {
701
	checkOffset(classFileOffset);
899
		position++;
702
	position++;
900
		bCodeStream[classFileOffset++] = OPC_dstore_3;
703
	bCodeStream[classFileOffset++] = OPC_dstore_3;
901
	} catch (IndexOutOfBoundsException e) {
902
		resizeByteArray(OPC_dstore_3);
903
	}
904
}
704
}
905
final public void dsub() {
705
final public void dsub() {
906
	if (DEBUG) System.out.println(position + "\t\tdsub"); //$NON-NLS-1$
706
	if (DEBUG) System.out.println(position + "\t\tdsub"); //$NON-NLS-1$
907
	countLabels = 0;
707
	countLabels = 0;
908
	stackDepth -= 2;
708
	stackDepth -= 2;
909
	try {
709
	checkOffset(classFileOffset);
910
		position++;
710
	position++;
911
		bCodeStream[classFileOffset++] = OPC_dsub;
711
	bCodeStream[classFileOffset++] = OPC_dsub;
912
	} catch (IndexOutOfBoundsException e) {
913
		resizeByteArray(OPC_dsub);
914
	}
915
}
712
}
916
final public void dup() {
713
final public void dup() {
917
	if (DEBUG) System.out.println(position + "\t\tdup"); //$NON-NLS-1$
714
	if (DEBUG) System.out.println(position + "\t\tdup"); //$NON-NLS-1$
Lines 919-930 Link Here
919
	stackDepth++;
716
	stackDepth++;
920
	if (stackDepth > stackMax)
717
	if (stackDepth > stackMax)
921
		stackMax = stackDepth;
718
		stackMax = stackDepth;
922
	try {
719
	checkOffset(classFileOffset);
923
		position++;
720
	position++;
924
		bCodeStream[classFileOffset++] = OPC_dup;
721
	bCodeStream[classFileOffset++] = OPC_dup;
925
	} catch (IndexOutOfBoundsException e) {
926
		resizeByteArray(OPC_dup);
927
	}
928
}
722
}
929
final public void dup_x1() {
723
final public void dup_x1() {
930
	if (DEBUG) System.out.println(position + "\t\tdup_x1"); //$NON-NLS-1$
724
	if (DEBUG) System.out.println(position + "\t\tdup_x1"); //$NON-NLS-1$
Lines 932-943 Link Here
932
	stackDepth++;
726
	stackDepth++;
933
	if (stackDepth > stackMax)
727
	if (stackDepth > stackMax)
934
		stackMax = stackDepth;
728
		stackMax = stackDepth;
935
	try {
729
	checkOffset(classFileOffset);
936
		position++;
730
	position++;
937
		bCodeStream[classFileOffset++] = OPC_dup_x1;
731
	bCodeStream[classFileOffset++] = OPC_dup_x1;
938
	} catch (IndexOutOfBoundsException e) {
939
		resizeByteArray(OPC_dup_x1);
940
	}
941
}
732
}
942
final public void dup_x2() {
733
final public void dup_x2() {
943
	if (DEBUG) System.out.println(position + "\t\tdup_x2"); //$NON-NLS-1$
734
	if (DEBUG) System.out.println(position + "\t\tdup_x2"); //$NON-NLS-1$
Lines 945-956 Link Here
945
	stackDepth++;
736
	stackDepth++;
946
	if (stackDepth > stackMax)
737
	if (stackDepth > stackMax)
947
		stackMax = stackDepth;
738
		stackMax = stackDepth;
948
	try {
739
	checkOffset(classFileOffset);
949
		position++;
740
	position++;
950
		bCodeStream[classFileOffset++] = OPC_dup_x2;
741
	bCodeStream[classFileOffset++] = OPC_dup_x2;
951
	} catch (IndexOutOfBoundsException e) {
952
		resizeByteArray(OPC_dup_x2);
953
	}
954
}
742
}
955
final public void dup2() {
743
final public void dup2() {
956
	if (DEBUG) System.out.println(position + "\t\tdup2"); //$NON-NLS-1$
744
	if (DEBUG) System.out.println(position + "\t\tdup2"); //$NON-NLS-1$
Lines 958-969 Link Here
958
	stackDepth += 2;
746
	stackDepth += 2;
959
	if (stackDepth > stackMax)
747
	if (stackDepth > stackMax)
960
		stackMax = stackDepth;
748
		stackMax = stackDepth;
961
	try {
749
	checkOffset(classFileOffset);
962
		position++;
750
	position++;
963
		bCodeStream[classFileOffset++] = OPC_dup2;
751
	bCodeStream[classFileOffset++] = OPC_dup2;
964
	} catch (IndexOutOfBoundsException e) {
965
		resizeByteArray(OPC_dup2);
966
	}
967
}
752
}
968
final public void dup2_x1() {
753
final public void dup2_x1() {
969
	if (DEBUG) System.out.println(position + "\t\tdup2_x1"); //$NON-NLS-1$
754
	if (DEBUG) System.out.println(position + "\t\tdup2_x1"); //$NON-NLS-1$
Lines 971-982 Link Here
971
	stackDepth += 2;
756
	stackDepth += 2;
972
	if (stackDepth > stackMax)
757
	if (stackDepth > stackMax)
973
		stackMax = stackDepth;
758
		stackMax = stackDepth;
974
	try {
759
	checkOffset(classFileOffset);
975
		position++;
760
	position++;
976
		bCodeStream[classFileOffset++] = OPC_dup2_x1;
761
	bCodeStream[classFileOffset++] = OPC_dup2_x1;
977
	} catch (IndexOutOfBoundsException e) {
978
		resizeByteArray(OPC_dup2_x1);
979
	}
980
}
762
}
981
final public void dup2_x2() {
763
final public void dup2_x2() {
982
	if (DEBUG) System.out.println(position + "\t\tdup2_x2"); //$NON-NLS-1$
764
	if (DEBUG) System.out.println(position + "\t\tdup2_x2"); //$NON-NLS-1$
Lines 984-995 Link Here
984
	stackDepth += 2;
766
	stackDepth += 2;
985
	if (stackDepth > stackMax)
767
	if (stackDepth > stackMax)
986
		stackMax = stackDepth;
768
		stackMax = stackDepth;
987
	try {
769
	checkOffset(classFileOffset);
988
		position++;
770
	position++;
989
		bCodeStream[classFileOffset++] = OPC_dup2_x2;
771
	bCodeStream[classFileOffset++] = OPC_dup2_x2;
990
	} catch (IndexOutOfBoundsException e) {
991
		resizeByteArray(OPC_dup2_x2);
992
	}
993
}
772
}
994
public void exitUserScope(BlockScope blockScope) {
773
public void exitUserScope(BlockScope blockScope) {
995
	// mark all the scope's locals as loosing their definite assignment
774
	// mark all the scope's locals as loosing their definite assignment
Lines 1013-1034 Link Here
1013
	stackDepth++;
792
	stackDepth++;
1014
	if (stackDepth > stackMax)
793
	if (stackDepth > stackMax)
1015
		stackMax = stackDepth;
794
		stackMax = stackDepth;
1016
	try {
795
	checkOffset(classFileOffset);
1017
		position++;
796
	position++;
1018
		bCodeStream[classFileOffset++] = OPC_f2d;
797
	bCodeStream[classFileOffset++] = OPC_f2d;
1019
	} catch (IndexOutOfBoundsException e) {
1020
		resizeByteArray(OPC_f2d);
1021
	}
1022
}
798
}
1023
final public void f2i() {
799
final public void f2i() {
1024
	if (DEBUG) System.out.println(position + "\t\tf2i"); //$NON-NLS-1$
800
	if (DEBUG) System.out.println(position + "\t\tf2i"); //$NON-NLS-1$
1025
	countLabels = 0;
801
	countLabels = 0;
1026
	try {
802
	checkOffset(classFileOffset);
1027
		position++;
803
	position++;
1028
		bCodeStream[classFileOffset++] = OPC_f2i;
804
	bCodeStream[classFileOffset++] = OPC_f2i;
1029
	} catch (IndexOutOfBoundsException e) {
1030
		resizeByteArray(OPC_f2i);
1031
	}
1032
}
805
}
1033
final public void f2l() {
806
final public void f2l() {
1034
	if (DEBUG) System.out.println(position + "\t\tf2l"); //$NON-NLS-1$
807
	if (DEBUG) System.out.println(position + "\t\tf2l"); //$NON-NLS-1$
Lines 1036-1102 Link Here
1036
	stackDepth++;
809
	stackDepth++;
1037
	if (stackDepth > stackMax)
810
	if (stackDepth > stackMax)
1038
		stackMax = stackDepth;
811
		stackMax = stackDepth;
1039
	try {
812
	checkOffset(classFileOffset);
1040
		position++;
813
	position++;
1041
		bCodeStream[classFileOffset++] = OPC_f2l;
814
	bCodeStream[classFileOffset++] = OPC_f2l;
1042
	} catch (IndexOutOfBoundsException e) {
1043
		resizeByteArray(OPC_f2l);
1044
	}
1045
}
815
}
1046
final public void fadd() {
816
final public void fadd() {
1047
	if (DEBUG) System.out.println(position + "\t\tfadd"); //$NON-NLS-1$
817
	if (DEBUG) System.out.println(position + "\t\tfadd"); //$NON-NLS-1$
1048
	countLabels = 0;
818
	countLabels = 0;
1049
	stackDepth--;
819
	stackDepth--;
1050
	try {
820
	checkOffset(classFileOffset);
1051
		position++;
821
	position++;
1052
		bCodeStream[classFileOffset++] = OPC_fadd;
822
	bCodeStream[classFileOffset++] = OPC_fadd;
1053
	} catch (IndexOutOfBoundsException e) {
1054
		resizeByteArray(OPC_fadd);
1055
	}
1056
}
823
}
1057
final public void faload() {
824
final public void faload() {
1058
	if (DEBUG) System.out.println(position + "\t\tfaload"); //$NON-NLS-1$
825
	if (DEBUG) System.out.println(position + "\t\tfaload"); //$NON-NLS-1$
1059
	countLabels = 0;
826
	countLabels = 0;
1060
	stackDepth--;
827
	stackDepth--;
1061
	try {
828
	checkOffset(classFileOffset);
1062
		position++;
829
	position++;
1063
		bCodeStream[classFileOffset++] = OPC_faload;
830
	bCodeStream[classFileOffset++] = OPC_faload;
1064
	} catch (IndexOutOfBoundsException e) {
1065
		resizeByteArray(OPC_faload);
1066
	}
1067
}
831
}
1068
final public void fastore() {
832
final public void fastore() {
1069
	if (DEBUG) System.out.println(position + "\t\tfaload"); //$NON-NLS-1$
833
	if (DEBUG) System.out.println(position + "\t\tfaload"); //$NON-NLS-1$
1070
	countLabels = 0;
834
	countLabels = 0;
1071
	stackDepth -= 3;
835
	stackDepth -= 3;
1072
	try {
836
	checkOffset(classFileOffset);
1073
		position++;
837
	position++;
1074
		bCodeStream[classFileOffset++] = OPC_fastore;
838
	bCodeStream[classFileOffset++] = OPC_fastore;
1075
	} catch (IndexOutOfBoundsException e) {
1076
		resizeByteArray(OPC_fastore);
1077
	}
1078
}
839
}
1079
final public void fcmpg() {
840
final public void fcmpg() {
1080
	if (DEBUG) System.out.println(position + "\t\tfcmpg"); //$NON-NLS-1$
841
	if (DEBUG) System.out.println(position + "\t\tfcmpg"); //$NON-NLS-1$
1081
	countLabels = 0;
842
	countLabels = 0;
1082
	stackDepth--;
843
	stackDepth--;
1083
	try {
844
	checkOffset(classFileOffset);
1084
		position++;
845
	position++;
1085
		bCodeStream[classFileOffset++] = OPC_fcmpg;
846
	bCodeStream[classFileOffset++] = OPC_fcmpg;
1086
	} catch (IndexOutOfBoundsException e) {
1087
		resizeByteArray(OPC_fcmpg);
1088
	}
1089
}
847
}
1090
final public void fcmpl() {
848
final public void fcmpl() {
1091
	if (DEBUG) System.out.println(position + "\t\tfcmpl"); //$NON-NLS-1$
849
	if (DEBUG) System.out.println(position + "\t\tfcmpl"); //$NON-NLS-1$
1092
	countLabels = 0;
850
	countLabels = 0;
1093
	stackDepth--;
851
	stackDepth--;
1094
	try {
852
	checkOffset(classFileOffset);
1095
		position++;
853
	position++;
1096
		bCodeStream[classFileOffset++] = OPC_fcmpl;
854
	bCodeStream[classFileOffset++] = OPC_fcmpl;
1097
	} catch (IndexOutOfBoundsException e) {
1098
		resizeByteArray(OPC_fcmpl);
1099
	}
1100
}
855
}
1101
final public void fconst_0() {
856
final public void fconst_0() {
1102
	if (DEBUG) System.out.println(position + "\t\tfconst_0"); //$NON-NLS-1$
857
	if (DEBUG) System.out.println(position + "\t\tfconst_0"); //$NON-NLS-1$
Lines 1104-1115 Link Here
1104
	stackDepth++;
859
	stackDepth++;
1105
	if (stackDepth > stackMax)
860
	if (stackDepth > stackMax)
1106
		stackMax = stackDepth;
861
		stackMax = stackDepth;
1107
	try {
862
	checkOffset(classFileOffset);
1108
		position++;
863
	position++;
1109
		bCodeStream[classFileOffset++] = OPC_fconst_0;
864
	bCodeStream[classFileOffset++] = OPC_fconst_0;
1110
	} catch (IndexOutOfBoundsException e) {
1111
		resizeByteArray(OPC_fconst_0);
1112
	}
1113
}
865
}
1114
final public void fconst_1() {
866
final public void fconst_1() {
1115
	if (DEBUG) System.out.println(position + "\t\tfconst_1"); //$NON-NLS-1$
867
	if (DEBUG) System.out.println(position + "\t\tfconst_1"); //$NON-NLS-1$
Lines 1117-1128 Link Here
1117
	stackDepth++;
869
	stackDepth++;
1118
	if (stackDepth > stackMax)
870
	if (stackDepth > stackMax)
1119
		stackMax = stackDepth;
871
		stackMax = stackDepth;
1120
	try {
872
	checkOffset(classFileOffset);
1121
		position++;
873
	position++;
1122
		bCodeStream[classFileOffset++] = OPC_fconst_1;
874
	bCodeStream[classFileOffset++] = OPC_fconst_1;
1123
	} catch (IndexOutOfBoundsException e) {
1124
		resizeByteArray(OPC_fconst_1);
1125
	}
1126
}
875
}
1127
final public void fconst_2() {
876
final public void fconst_2() {
1128
	if (DEBUG) System.out.println(position + "\t\tfconst_2"); //$NON-NLS-1$
877
	if (DEBUG) System.out.println(position + "\t\tfconst_2"); //$NON-NLS-1$
Lines 1130-1152 Link Here
1130
	stackDepth++;
879
	stackDepth++;
1131
	if (stackDepth > stackMax)
880
	if (stackDepth > stackMax)
1132
		stackMax = stackDepth;
881
		stackMax = stackDepth;
1133
	try {
882
	checkOffset(classFileOffset);
1134
		position++;
883
	position++;
1135
		bCodeStream[classFileOffset++] = OPC_fconst_2;
884
	bCodeStream[classFileOffset++] = OPC_fconst_2;
1136
	} catch (IndexOutOfBoundsException e) {
1137
		resizeByteArray(OPC_fconst_2);
1138
	}
1139
}
885
}
1140
final public void fdiv() {
886
final public void fdiv() {
1141
	if (DEBUG) System.out.println(position + "\t\tfdiv"); //$NON-NLS-1$
887
	if (DEBUG) System.out.println(position + "\t\tfdiv"); //$NON-NLS-1$
1142
	countLabels = 0;
888
	countLabels = 0;
1143
	stackDepth--;
889
	stackDepth--;
1144
	try {
890
	checkOffset(classFileOffset);
1145
		position++;
891
	position++;
1146
		bCodeStream[classFileOffset++] = OPC_fdiv;
892
	bCodeStream[classFileOffset++] = OPC_fdiv;
1147
	} catch (IndexOutOfBoundsException e) {
1148
		resizeByteArray(OPC_fdiv);
1149
	}
1150
}
893
}
1151
final public void fload(int iArg) {
894
final public void fload(int iArg) {
1152
	if (DEBUG) System.out.println(position + "\t\tfload:"+iArg); //$NON-NLS-1$
895
	if (DEBUG) System.out.println(position + "\t\tfload:"+iArg); //$NON-NLS-1$
Lines 1157-1189 Link Here
1157
	}
900
	}
1158
	if (stackDepth > stackMax)
901
	if (stackDepth > stackMax)
1159
		stackMax = stackDepth;
902
		stackMax = stackDepth;
903
	checkOffset(classFileOffset + 1);
904
	position+=2;
1160
	if (iArg > 255) { // Widen
905
	if (iArg > 255) { // Widen
1161
		try {
906
		bCodeStream[classFileOffset++] = OPC_wide;
1162
			position++;
907
		bCodeStream[classFileOffset++] = OPC_fload;
1163
			bCodeStream[classFileOffset++] = OPC_wide;
1164
		} catch (IndexOutOfBoundsException e) {
1165
			resizeByteArray(OPC_wide);
1166
		}
1167
		try {
1168
			position++;
1169
			bCodeStream[classFileOffset++] = OPC_fload;
1170
		} catch (IndexOutOfBoundsException e) {
1171
			resizeByteArray(OPC_fload);
1172
		}
1173
		writeUnsignedShort(iArg);
908
		writeUnsignedShort(iArg);
1174
	} else {
909
	} else {
1175
		try {
910
		bCodeStream[classFileOffset++] = OPC_fload;
1176
			position++;
911
		bCodeStream[classFileOffset++] = (byte)iArg;
1177
			bCodeStream[classFileOffset++] = OPC_fload;
1178
		} catch (IndexOutOfBoundsException e) {
1179
			resizeByteArray(OPC_fload);
1180
		}
1181
		try {
1182
			position++;
1183
			bCodeStream[classFileOffset++] = (byte) iArg;
1184
		} catch (IndexOutOfBoundsException e) {
1185
			resizeByteArray((byte) iArg);
1186
		}
1187
	}
912
	}
1188
}
913
}
1189
final public void fload_0() {
914
final public void fload_0() {
Lines 1195-1206 Link Here
1195
	}
920
	}
1196
	if (stackDepth > stackMax)
921
	if (stackDepth > stackMax)
1197
		stackMax = stackDepth;
922
		stackMax = stackDepth;
1198
	try {
923
	checkOffset(classFileOffset);
1199
		position++;
924
	position++;
1200
		bCodeStream[classFileOffset++] = OPC_fload_0;
925
	bCodeStream[classFileOffset++] = OPC_fload_0;
1201
	} catch (IndexOutOfBoundsException e) {
1202
		resizeByteArray(OPC_fload_0);
1203
	}
1204
}
926
}
1205
final public void fload_1() {
927
final public void fload_1() {
1206
	if (DEBUG) System.out.println(position + "\t\tfload_1"); //$NON-NLS-1$
928
	if (DEBUG) System.out.println(position + "\t\tfload_1"); //$NON-NLS-1$
Lines 1211-1222 Link Here
1211
	}
933
	}
1212
	if (stackDepth > stackMax)
934
	if (stackDepth > stackMax)
1213
		stackMax = stackDepth;
935
		stackMax = stackDepth;
1214
	try {
936
	checkOffset(classFileOffset);
1215
		position++;
937
	position++;
1216
		bCodeStream[classFileOffset++] = OPC_fload_1;
938
	bCodeStream[classFileOffset++] = OPC_fload_1;
1217
	} catch (IndexOutOfBoundsException e) {
1218
		resizeByteArray(OPC_fload_1);
1219
	}
1220
}
939
}
1221
final public void fload_2() {
940
final public void fload_2() {
1222
	if (DEBUG) System.out.println(position + "\t\tfload_2"); //$NON-NLS-1$
941
	if (DEBUG) System.out.println(position + "\t\tfload_2"); //$NON-NLS-1$
Lines 1227-1238 Link Here
1227
	}
946
	}
1228
	if (stackDepth > stackMax)
947
	if (stackDepth > stackMax)
1229
		stackMax = stackDepth;
948
		stackMax = stackDepth;
1230
	try {
949
	checkOffset(classFileOffset);
1231
		position++;
950
	position++;
1232
		bCodeStream[classFileOffset++] = OPC_fload_2;
951
	bCodeStream[classFileOffset++] = OPC_fload_2;
1233
	} catch (IndexOutOfBoundsException e) {
1234
		resizeByteArray(OPC_fload_2);
1235
	}
1236
}
952
}
1237
final public void fload_3() {
953
final public void fload_3() {
1238
	if (DEBUG) System.out.println(position + "\t\tfload_3"); //$NON-NLS-1$
954
	if (DEBUG) System.out.println(position + "\t\tfload_3"); //$NON-NLS-1$
Lines 1243-1298 Link Here
1243
	}
959
	}
1244
	if (stackDepth > stackMax)
960
	if (stackDepth > stackMax)
1245
		stackMax = stackDepth;
961
		stackMax = stackDepth;
1246
	try {
962
	checkOffset(classFileOffset);
1247
		position++;
963
	position++;
1248
		bCodeStream[classFileOffset++] = OPC_fload_3;
964
	bCodeStream[classFileOffset++] = OPC_fload_3;
1249
	} catch (IndexOutOfBoundsException e) {
1250
		resizeByteArray(OPC_fload_3);
1251
	}
1252
}
965
}
1253
final public void fmul() {
966
final public void fmul() {
1254
	if (DEBUG) System.out.println(position + "\t\tfmul"); //$NON-NLS-1$
967
	if (DEBUG) System.out.println(position + "\t\tfmul"); //$NON-NLS-1$
1255
	countLabels = 0;
968
	countLabels = 0;
1256
	stackDepth--;
969
	stackDepth--;
1257
	try {
970
	checkOffset(classFileOffset);
1258
		position++;
971
	position++;
1259
		bCodeStream[classFileOffset++] = OPC_fmul;
972
	bCodeStream[classFileOffset++] = OPC_fmul;
1260
	} catch (IndexOutOfBoundsException e) {
1261
		resizeByteArray(OPC_fmul);
1262
	}
1263
}
973
}
1264
final public void fneg() {
974
final public void fneg() {
1265
	if (DEBUG) System.out.println(position + "\t\tfneg"); //$NON-NLS-1$
975
	if (DEBUG) System.out.println(position + "\t\tfneg"); //$NON-NLS-1$
1266
	countLabels = 0;
976
	countLabels = 0;
1267
	try {
977
	checkOffset(classFileOffset);
1268
		position++;
978
	position++;
1269
		bCodeStream[classFileOffset++] = OPC_fneg;
979
	bCodeStream[classFileOffset++] = OPC_fneg;
1270
	} catch (IndexOutOfBoundsException e) {
1271
		resizeByteArray(OPC_fneg);
1272
	}
1273
}
980
}
1274
final public void frem() {
981
final public void frem() {
1275
	if (DEBUG) System.out.println(position + "\t\tfrem"); //$NON-NLS-1$
982
	if (DEBUG) System.out.println(position + "\t\tfrem"); //$NON-NLS-1$
1276
	countLabels = 0;
983
	countLabels = 0;
1277
	stackDepth--;
984
	stackDepth--;
1278
	try {
985
	checkOffset(classFileOffset);
1279
		position++;
986
	position++;
1280
		bCodeStream[classFileOffset++] = OPC_frem;
987
	bCodeStream[classFileOffset++] = OPC_frem;
1281
	} catch (IndexOutOfBoundsException e) {
1282
		resizeByteArray(OPC_frem);
1283
	}
1284
}
988
}
1285
final public void freturn() {
989
final public void freturn() {
1286
	if (DEBUG) System.out.println(position + "\t\tfreturn"); //$NON-NLS-1$
990
	if (DEBUG) System.out.println(position + "\t\tfreturn"); //$NON-NLS-1$
1287
	countLabels = 0;
991
	countLabels = 0;
1288
	stackDepth--;
992
	stackDepth--;
1289
	// the stackDepth should be equal to 0 
993
	// the stackDepth should be equal to 0
1290
	try {
994
	checkOffset(classFileOffset);
1291
		position++;
995
	position++;
1292
		bCodeStream[classFileOffset++] = OPC_freturn;
996
	bCodeStream[classFileOffset++] = OPC_freturn;
1293
	} catch (IndexOutOfBoundsException e) {
1294
		resizeByteArray(OPC_freturn);
1295
	}
1296
}
997
}
1297
final public void fstore(int iArg) {
998
final public void fstore(int iArg) {
1298
	if (DEBUG) System.out.println(position + "\t\tfstore:"+iArg); //$NON-NLS-1$
999
	if (DEBUG) System.out.println(position + "\t\tfstore:"+iArg); //$NON-NLS-1$
Lines 1301-1333 Link Here
1301
	if (maxLocals <= iArg) {
1002
	if (maxLocals <= iArg) {
1302
		maxLocals = iArg + 1;
1003
		maxLocals = iArg + 1;
1303
	}
1004
	}
1005
	checkOffset(classFileOffset + 1);
1006
	position+=2;
1304
	if (iArg > 255) { // Widen
1007
	if (iArg > 255) { // Widen
1305
		try {
1008
		bCodeStream[classFileOffset++] = OPC_wide;
1306
			position++;
1009
		bCodeStream[classFileOffset++] = OPC_fstore;
1307
			bCodeStream[classFileOffset++] = OPC_wide;
1308
		} catch (IndexOutOfBoundsException e) {
1309
			resizeByteArray(OPC_wide);
1310
		}
1311
		try {
1312
			position++;
1313
			bCodeStream[classFileOffset++] = OPC_fstore;
1314
		} catch (IndexOutOfBoundsException e) {
1315
			resizeByteArray(OPC_fstore);
1316
		}
1317
		writeUnsignedShort(iArg);
1010
		writeUnsignedShort(iArg);
1318
	} else {
1011
	} else {
1319
		try {
1012
		bCodeStream[classFileOffset++] = OPC_fstore;
1320
			position++;
1013
		bCodeStream[classFileOffset++] = (byte)iArg;
1321
			bCodeStream[classFileOffset++] = OPC_fstore;
1322
		} catch (IndexOutOfBoundsException e) {
1323
			resizeByteArray(OPC_fstore);
1324
		}
1325
		try {
1326
			position++;
1327
			bCodeStream[classFileOffset++] = (byte) iArg;
1328
		} catch (IndexOutOfBoundsException e) {
1329
			resizeByteArray((byte) iArg);
1330
		}
1331
	}
1014
	}
1332
}
1015
}
1333
final public void fstore_0() {
1016
final public void fstore_0() {
Lines 1337-1348 Link Here
1337
	if (maxLocals == 0) {
1020
	if (maxLocals == 0) {
1338
		maxLocals = 1;
1021
		maxLocals = 1;
1339
	}
1022
	}
1340
	try {
1023
	checkOffset(classFileOffset);
1341
		position++;
1024
	position++;
1342
		bCodeStream[classFileOffset++] = OPC_fstore_0;
1025
	bCodeStream[classFileOffset++] = OPC_fstore_0;
1343
	} catch (IndexOutOfBoundsException e) {
1344
		resizeByteArray(OPC_fstore_0);
1345
	}
1346
}
1026
}
1347
final public void fstore_1() {
1027
final public void fstore_1() {
1348
	if (DEBUG) System.out.println(position + "\t\tfstore_1"); //$NON-NLS-1$
1028
	if (DEBUG) System.out.println(position + "\t\tfstore_1"); //$NON-NLS-1$
Lines 1351-1362 Link Here
1351
	if (maxLocals <= 1) {
1031
	if (maxLocals <= 1) {
1352
		maxLocals = 2;
1032
		maxLocals = 2;
1353
	}
1033
	}
1354
	try {
1034
	checkOffset(classFileOffset);
1355
		position++;
1035
	position++;
1356
		bCodeStream[classFileOffset++] = OPC_fstore_1;
1036
	bCodeStream[classFileOffset++] = OPC_fstore_1;
1357
	} catch (IndexOutOfBoundsException e) {
1358
		resizeByteArray(OPC_fstore_1);
1359
	}
1360
}
1037
}
1361
final public void fstore_2() {
1038
final public void fstore_2() {
1362
	if (DEBUG) System.out.println(position + "\t\tfstore_2"); //$NON-NLS-1$
1039
	if (DEBUG) System.out.println(position + "\t\tfstore_2"); //$NON-NLS-1$
Lines 1365-1376 Link Here
1365
	if (maxLocals <= 2) {
1042
	if (maxLocals <= 2) {
1366
		maxLocals = 3;
1043
		maxLocals = 3;
1367
	}
1044
	}
1368
	try {
1045
	checkOffset(classFileOffset);
1369
		position++;
1046
	position++;
1370
		bCodeStream[classFileOffset++] = OPC_fstore_2;
1047
	bCodeStream[classFileOffset++] = OPC_fstore_2;
1371
	} catch (IndexOutOfBoundsException e) {
1372
		resizeByteArray(OPC_fstore_2);
1373
	}
1374
}
1048
}
1375
final public void fstore_3() {
1049
final public void fstore_3() {
1376
	if (DEBUG) System.out.println(position + "\t\tfstore_3"); //$NON-NLS-1$
1050
	if (DEBUG) System.out.println(position + "\t\tfstore_3"); //$NON-NLS-1$
Lines 1379-1401 Link Here
1379
	if (maxLocals <= 3) {
1053
	if (maxLocals <= 3) {
1380
		maxLocals = 4;
1054
		maxLocals = 4;
1381
	}
1055
	}
1382
	try {
1056
	checkOffset(classFileOffset);
1383
		position++;
1057
	position++;
1384
		bCodeStream[classFileOffset++] = OPC_fstore_3;
1058
	bCodeStream[classFileOffset++] = OPC_fstore_3;
1385
	} catch (IndexOutOfBoundsException e) {
1386
		resizeByteArray(OPC_fstore_3);
1387
	}
1388
}
1059
}
1389
final public void fsub() {
1060
final public void fsub() {
1390
	if (DEBUG) System.out.println(position + "\t\tfsub"); //$NON-NLS-1$
1061
	if (DEBUG) System.out.println(position + "\t\tfsub"); //$NON-NLS-1$
1391
	countLabels = 0;
1062
	countLabels = 0;
1392
	stackDepth--;
1063
	stackDepth--;
1393
	try {
1064
	checkOffset(classFileOffset);
1394
		position++;
1065
	position++;
1395
		bCodeStream[classFileOffset++] = OPC_fsub;
1066
	bCodeStream[classFileOffset++] = OPC_fsub;
1396
	} catch (IndexOutOfBoundsException e) {
1397
		resizeByteArray(OPC_fsub);
1398
	}
1399
}
1067
}
1400
/**
1068
/**
1401
 * Macro for building a class descriptor object
1069
 * Macro for building a class descriptor object
Lines 2097-2108 Link Here
2097
		if (++stackDepth > stackMax)
1765
		if (++stackDepth > stackMax)
2098
			stackMax = stackDepth;
1766
			stackMax = stackDepth;
2099
	}
1767
	}
2100
	try {
1768
	checkOffset(classFileOffset);
2101
		position++;
1769
	position++;
2102
		bCodeStream[classFileOffset++] = OPC_getfield;
1770
	bCodeStream[classFileOffset++] = OPC_getfield;
2103
	} catch (IndexOutOfBoundsException e) {
2104
		resizeByteArray(OPC_getfield);
2105
	}
2106
	writeUnsignedShort(constantPool.literalIndex(fieldBinding));
1771
	writeUnsignedShort(constantPool.literalIndex(fieldBinding));
2107
}
1772
}
2108
final public void getstatic(FieldBinding fieldBinding) {
1773
final public void getstatic(FieldBinding fieldBinding) {
Lines 2114-2137 Link Here
2114
		stackDepth += 1;
1779
		stackDepth += 1;
2115
	if (stackDepth > stackMax)
1780
	if (stackDepth > stackMax)
2116
		stackMax = stackDepth;
1781
		stackMax = stackDepth;
2117
	try {
1782
	checkOffset(classFileOffset);
2118
		position++;
1783
	position++;
2119
		bCodeStream[classFileOffset++] = OPC_getstatic;
1784
	bCodeStream[classFileOffset++] = OPC_getstatic;
2120
	} catch (IndexOutOfBoundsException e) {
2121
		resizeByteArray(OPC_getstatic);
2122
	}
2123
	writeUnsignedShort(constantPool.literalIndex(fieldBinding));
1785
	writeUnsignedShort(constantPool.literalIndex(fieldBinding));
2124
}
1786
}
2125
public void getTYPE(int baseTypeID) {
1787
public void getTYPE(int baseTypeID) {
2126
	countLabels = 0;
1788
	countLabels = 0;
2127
	if (++stackDepth > stackMax)
1789
	if (++stackDepth > stackMax)
2128
		stackMax = stackDepth;
1790
		stackMax = stackDepth;
2129
	try {
1791
	checkOffset(classFileOffset);
2130
		position++;
1792
	position++;
2131
		bCodeStream[classFileOffset++] = OPC_getstatic;
1793
	bCodeStream[classFileOffset++] = OPC_getstatic;
2132
	} catch (IndexOutOfBoundsException e) {
2133
		resizeByteArray(OPC_getstatic);
2134
	}
2135
	switch (baseTypeID) {
1794
	switch (baseTypeID) {
2136
		case T_byte :
1795
		case T_byte :
2137
			// getstatic: java.lang.Byte.TYPE			
1796
			// getstatic: java.lang.Byte.TYPE			
Lines 2189-2196 Link Here
2189
		return;
1848
		return;
2190
	}
1849
	}
2191
	if (DEBUG) System.out.println(position + "\t\tgoto:"+label); //$NON-NLS-1$
1850
	if (DEBUG) System.out.println(position + "\t\tgoto:"+label); //$NON-NLS-1$
2192
	try {
1851
2193
		label.inlineForwardReferencesFromLabelsTargeting(position);
1852
	label.inlineForwardReferencesFromLabelsTargeting(position);
2194
		/*
1853
		/*
2195
		 Possible optimization for code such as:
1854
		 Possible optimization for code such as:
2196
		 public Object foo() {
1855
		 public Object foo() {
Lines 2218-2260 Link Here
2218
					return;
1877
					return;
2219
			}
1878
			}
2220
		}*/
1879
		}*/
2221
		position++;
1880
	checkOffset(classFileOffset);
2222
		bCodeStream[classFileOffset++] = OPC_goto;
1881
	position++;
2223
	} catch (IndexOutOfBoundsException e) {
1882
	bCodeStream[classFileOffset++] = OPC_goto;
2224
		resizeByteArray(OPC_goto);
2225
	}
2226
	label.branch();
1883
	label.branch();
2227
}
1884
}
2228
1885
2229
final public void goto_w(Label lbl) {
1886
final public void goto_w(Label lbl) {
2230
	if (DEBUG) System.out.println(position + "\t\tgotow:"+lbl); //$NON-NLS-1$
1887
	if (DEBUG) System.out.println(position + "\t\tgotow:"+lbl); //$NON-NLS-1$
2231
	try {
1888
	checkOffset(classFileOffset);
2232
		position++;
1889
	position++;
2233
		bCodeStream[classFileOffset++] = OPC_goto_w;
1890
	bCodeStream[classFileOffset++] = OPC_goto_w;
2234
	} catch (IndexOutOfBoundsException e) {
2235
		resizeByteArray(OPC_goto_w);
2236
	}
2237
	lbl.branchWide();
1891
	lbl.branchWide();
2238
}
1892
}
2239
final public void i2b() {
1893
final public void i2b() {
2240
	if (DEBUG) System.out.println(position + "\t\ti2b"); //$NON-NLS-1$
1894
	if (DEBUG) System.out.println(position + "\t\ti2b"); //$NON-NLS-1$
2241
	countLabels = 0;
1895
	countLabels = 0;
2242
	try {
1896
	checkOffset(classFileOffset);
2243
		position++;
1897
	position++;
2244
		bCodeStream[classFileOffset++] = OPC_i2b;
1898
	bCodeStream[classFileOffset++] = OPC_i2b;
2245
	} catch (IndexOutOfBoundsException e) {
2246
		resizeByteArray(OPC_i2b);
2247
	}
2248
}
1899
}
2249
final public void i2c() {
1900
final public void i2c() {
2250
	if (DEBUG) System.out.println(position + "\t\ti2c"); //$NON-NLS-1$
1901
	if (DEBUG) System.out.println(position + "\t\ti2c"); //$NON-NLS-1$
2251
	countLabels = 0;
1902
	countLabels = 0;
2252
	try {
1903
	checkOffset(classFileOffset);
2253
		position++;
1904
	position++;
2254
		bCodeStream[classFileOffset++] = OPC_i2c;
1905
	bCodeStream[classFileOffset++] = OPC_i2c;
2255
	} catch (IndexOutOfBoundsException e) {
2256
		resizeByteArray(OPC_i2c);
2257
	}
2258
}
1906
}
2259
final public void i2d() {
1907
final public void i2d() {
2260
	if (DEBUG) System.out.println(position + "\t\ti2d"); //$NON-NLS-1$
1908
	if (DEBUG) System.out.println(position + "\t\ti2d"); //$NON-NLS-1$
Lines 2262-2283 Link Here
2262
	stackDepth++;
1910
	stackDepth++;
2263
	if (stackDepth > stackMax)
1911
	if (stackDepth > stackMax)
2264
		stackMax = stackDepth;
1912
		stackMax = stackDepth;
2265
	try {
1913
	checkOffset(classFileOffset);
2266
		position++;
1914
	position++;
2267
		bCodeStream[classFileOffset++] = OPC_i2d;
1915
	bCodeStream[classFileOffset++] = OPC_i2d;
2268
	} catch (IndexOutOfBoundsException e) {
2269
		resizeByteArray(OPC_i2d);
2270
	}
2271
}
1916
}
2272
final public void i2f() {
1917
final public void i2f() {
2273
	if (DEBUG) System.out.println(position + "\t\ti2f"); //$NON-NLS-1$
1918
	if (DEBUG) System.out.println(position + "\t\ti2f"); //$NON-NLS-1$
2274
	countLabels = 0;
1919
	countLabels = 0;
2275
	try {
1920
	checkOffset(classFileOffset);
2276
		position++;
1921
	position++;
2277
		bCodeStream[classFileOffset++] = OPC_i2f;
1922
	bCodeStream[classFileOffset++] = OPC_i2f;
2278
	} catch (IndexOutOfBoundsException e) {
2279
		resizeByteArray(OPC_i2f);
2280
	}
2281
}
1923
}
2282
final public void i2l() {
1924
final public void i2l() {
2283
	if (DEBUG) System.out.println(position + "\t\ti2l"); //$NON-NLS-1$
1925
	if (DEBUG) System.out.println(position + "\t\ti2l"); //$NON-NLS-1$
Lines 2285-2350 Link Here
2285
	stackDepth++;
1927
	stackDepth++;
2286
	if (stackDepth > stackMax)
1928
	if (stackDepth > stackMax)
2287
		stackMax = stackDepth;
1929
		stackMax = stackDepth;
2288
	try {
1930
	checkOffset(classFileOffset);
2289
		position++;
1931
	position++;
2290
		bCodeStream[classFileOffset++] = OPC_i2l;
1932
	bCodeStream[classFileOffset++] = OPC_i2l;
2291
	} catch (IndexOutOfBoundsException e) {
2292
		resizeByteArray(OPC_i2l);
2293
	}
2294
}
1933
}
2295
final public void i2s() {
1934
final public void i2s() {
2296
	if (DEBUG) System.out.println(position + "\t\ti2s"); //$NON-NLS-1$
1935
	if (DEBUG) System.out.println(position + "\t\ti2s"); //$NON-NLS-1$
2297
	countLabels = 0;
1936
	countLabels = 0;
2298
	try {
1937
	checkOffset(classFileOffset);
2299
		position++;
1938
	position++;
2300
		bCodeStream[classFileOffset++] = OPC_i2s;
1939
	bCodeStream[classFileOffset++] = OPC_i2s;
2301
	} catch (IndexOutOfBoundsException e) {
2302
		resizeByteArray(OPC_i2s);
2303
	}
2304
}
1940
}
2305
final public void iadd() {
1941
final public void iadd() {
2306
	if (DEBUG) System.out.println(position + "\t\tiadd"); //$NON-NLS-1$
1942
	if (DEBUG) System.out.println(position + "\t\tiadd"); //$NON-NLS-1$
2307
	countLabels = 0;
1943
	countLabels = 0;
2308
	stackDepth--;
1944
	stackDepth--;
2309
	try {
1945
	checkOffset(classFileOffset);
2310
		position++;
1946
	position++;
2311
		bCodeStream[classFileOffset++] = OPC_iadd;
1947
	bCodeStream[classFileOffset++] = OPC_iadd;
2312
	} catch (IndexOutOfBoundsException e) {
2313
		resizeByteArray(OPC_iadd);
2314
	}
2315
}
1948
}
2316
final public void iaload() {
1949
final public void iaload() {
2317
	if (DEBUG) System.out.println(position + "\t\tiaload"); //$NON-NLS-1$
1950
	if (DEBUG) System.out.println(position + "\t\tiaload"); //$NON-NLS-1$
2318
	countLabels = 0;
1951
	countLabels = 0;
2319
	stackDepth--;
1952
	stackDepth--;
2320
	try {
1953
	checkOffset(classFileOffset);
2321
		position++;
1954
	position++;
2322
		bCodeStream[classFileOffset++] = OPC_iaload;
1955
	bCodeStream[classFileOffset++] = OPC_iaload;
2323
	} catch (IndexOutOfBoundsException e) {
2324
		resizeByteArray(OPC_iaload);
2325
	}
2326
}
1956
}
2327
final public void iand() {
1957
final public void iand() {
2328
	if (DEBUG) System.out.println(position + "\t\tiand"); //$NON-NLS-1$
1958
	if (DEBUG) System.out.println(position + "\t\tiand"); //$NON-NLS-1$
2329
	countLabels = 0;
1959
	countLabels = 0;
2330
	stackDepth--;
1960
	stackDepth--;
2331
	try {
1961
	checkOffset(classFileOffset);
2332
		position++;
1962
	position++;
2333
		bCodeStream[classFileOffset++] = OPC_iand;
1963
	bCodeStream[classFileOffset++] = OPC_iand;
2334
	} catch (IndexOutOfBoundsException e) {
2335
		resizeByteArray(OPC_iand);
2336
	}
2337
}
1964
}
2338
final public void iastore() {
1965
final public void iastore() {
2339
	if (DEBUG) System.out.println(position + "\t\tiastore"); //$NON-NLS-1$
1966
	if (DEBUG) System.out.println(position + "\t\tiastore"); //$NON-NLS-1$
2340
	countLabels = 0;
1967
	countLabels = 0;
2341
	stackDepth -= 3;
1968
	stackDepth -= 3;
2342
	try {
1969
	checkOffset(classFileOffset);
2343
		position++;
1970
	position++;
2344
		bCodeStream[classFileOffset++] = OPC_iastore;
1971
	bCodeStream[classFileOffset++] = OPC_iastore;
2345
	} catch (IndexOutOfBoundsException e) {
2346
		resizeByteArray(OPC_iastore);
2347
	}
2348
}
1972
}
2349
final public void iconst_0() {
1973
final public void iconst_0() {
2350
	if (DEBUG) System.out.println(position + "\t\ticonst_0"); //$NON-NLS-1$
1974
	if (DEBUG) System.out.println(position + "\t\ticonst_0"); //$NON-NLS-1$
Lines 2352-2363 Link Here
2352
	stackDepth++;
1976
	stackDepth++;
2353
	if (stackDepth > stackMax)
1977
	if (stackDepth > stackMax)
2354
		stackMax = stackDepth;
1978
		stackMax = stackDepth;
2355
	try {
1979
	checkOffset(classFileOffset);
2356
		position++;
1980
	position++;
2357
		bCodeStream[classFileOffset++] = OPC_iconst_0;
1981
	bCodeStream[classFileOffset++] = OPC_iconst_0;
2358
	} catch (IndexOutOfBoundsException e) {
2359
		resizeByteArray(OPC_iconst_0);
2360
	}
2361
}
1982
}
2362
final public void iconst_1() {
1983
final public void iconst_1() {
2363
	if (DEBUG) System.out.println(position + "\t\ticonst_1"); //$NON-NLS-1$
1984
	if (DEBUG) System.out.println(position + "\t\ticonst_1"); //$NON-NLS-1$
Lines 2365-2376 Link Here
2365
	stackDepth++;
1986
	stackDepth++;
2366
	if (stackDepth > stackMax)
1987
	if (stackDepth > stackMax)
2367
		stackMax = stackDepth;
1988
		stackMax = stackDepth;
2368
	try {
1989
	checkOffset(classFileOffset);
2369
		position++;
1990
	position++;
2370
		bCodeStream[classFileOffset++] = OPC_iconst_1;
1991
	bCodeStream[classFileOffset++] = OPC_iconst_1;
2371
	} catch (IndexOutOfBoundsException e) {
2372
		resizeByteArray(OPC_iconst_1);
2373
	}
2374
}
1992
}
2375
final public void iconst_2() {
1993
final public void iconst_2() {
2376
	if (DEBUG) System.out.println(position + "\t\ticonst_2"); //$NON-NLS-1$
1994
	if (DEBUG) System.out.println(position + "\t\ticonst_2"); //$NON-NLS-1$
Lines 2378-2389 Link Here
2378
	stackDepth++;
1996
	stackDepth++;
2379
	if (stackDepth > stackMax)
1997
	if (stackDepth > stackMax)
2380
		stackMax = stackDepth;
1998
		stackMax = stackDepth;
2381
	try {
1999
	checkOffset(classFileOffset);
2382
		position++;
2000
	position++;
2383
		bCodeStream[classFileOffset++] = OPC_iconst_2;
2001
	bCodeStream[classFileOffset++] = OPC_iconst_2;
2384
	} catch (IndexOutOfBoundsException e) {
2385
		resizeByteArray(OPC_iconst_2);
2386
	}
2387
}
2002
}
2388
final public void iconst_3() {
2003
final public void iconst_3() {
2389
	if (DEBUG) System.out.println(position + "\t\ticonst_3"); //$NON-NLS-1$
2004
	if (DEBUG) System.out.println(position + "\t\ticonst_3"); //$NON-NLS-1$
Lines 2391-2402 Link Here
2391
	stackDepth++;
2006
	stackDepth++;
2392
	if (stackDepth > stackMax)
2007
	if (stackDepth > stackMax)
2393
		stackMax = stackDepth;
2008
		stackMax = stackDepth;
2394
	try {
2009
	checkOffset(classFileOffset);
2395
		position++;
2010
	position++;
2396
		bCodeStream[classFileOffset++] = OPC_iconst_3;
2011
	bCodeStream[classFileOffset++] = OPC_iconst_3;
2397
	} catch (IndexOutOfBoundsException e) {
2398
		resizeByteArray(OPC_iconst_3);
2399
	}
2400
}
2012
}
2401
final public void iconst_4() {
2013
final public void iconst_4() {
2402
	if (DEBUG) System.out.println(position + "\t\ticonst_4"); //$NON-NLS-1$
2014
	if (DEBUG) System.out.println(position + "\t\ticonst_4"); //$NON-NLS-1$
Lines 2404-2415 Link Here
2404
	stackDepth++;
2016
	stackDepth++;
2405
	if (stackDepth > stackMax)
2017
	if (stackDepth > stackMax)
2406
		stackMax = stackDepth;
2018
		stackMax = stackDepth;
2407
	try {
2019
	checkOffset(classFileOffset);
2408
		position++;
2020
	position++;
2409
		bCodeStream[classFileOffset++] = OPC_iconst_4;
2021
	bCodeStream[classFileOffset++] = OPC_iconst_4;
2410
	} catch (IndexOutOfBoundsException e) {
2411
		resizeByteArray(OPC_iconst_4);
2412
	}
2413
}
2022
}
2414
final public void iconst_5() {
2023
final public void iconst_5() {
2415
	if (DEBUG) System.out.println(position + "\t\ticonst_5"); //$NON-NLS-1$
2024
	if (DEBUG) System.out.println(position + "\t\ticonst_5"); //$NON-NLS-1$
Lines 2417-2428 Link Here
2417
	stackDepth++;
2026
	stackDepth++;
2418
	if (stackDepth > stackMax)
2027
	if (stackDepth > stackMax)
2419
		stackMax = stackDepth;
2028
		stackMax = stackDepth;
2420
	try {
2029
	checkOffset(classFileOffset);
2421
		position++;
2030
	position++;
2422
		bCodeStream[classFileOffset++] = OPC_iconst_5;
2031
	bCodeStream[classFileOffset++] = OPC_iconst_5;
2423
	} catch (IndexOutOfBoundsException e) {
2424
		resizeByteArray(OPC_iconst_5);
2425
	}
2426
}
2032
}
2427
final public void iconst_m1() {
2033
final public void iconst_m1() {
2428
	if (DEBUG) System.out.println(position + "\t\ticonst_m1"); //$NON-NLS-1$
2034
	if (DEBUG) System.out.println(position + "\t\ticonst_m1"); //$NON-NLS-1$
Lines 2430-2452 Link Here
2430
	stackDepth++;
2036
	stackDepth++;
2431
	if (stackDepth > stackMax)
2037
	if (stackDepth > stackMax)
2432
		stackMax = stackDepth;
2038
		stackMax = stackDepth;
2433
	try {
2039
	checkOffset(classFileOffset);
2434
		position++;
2040
	position++;
2435
		bCodeStream[classFileOffset++] = OPC_iconst_m1;
2041
	bCodeStream[classFileOffset++] = OPC_iconst_m1;
2436
	} catch (IndexOutOfBoundsException e) {
2437
		resizeByteArray(OPC_iconst_m1);
2438
	}
2439
}
2042
}
2440
final public void idiv() {
2043
final public void idiv() {
2441
	if (DEBUG) System.out.println(position + "\t\tidiv"); //$NON-NLS-1$
2044
	if (DEBUG) System.out.println(position + "\t\tidiv"); //$NON-NLS-1$
2442
	countLabels = 0;
2045
	countLabels = 0;
2443
	stackDepth--;
2046
	stackDepth--;
2444
	try {
2047
	checkOffset(classFileOffset);
2445
		position++;
2048
	position++;
2446
		bCodeStream[classFileOffset++] = OPC_idiv;
2049
	bCodeStream[classFileOffset++] = OPC_idiv;
2447
	} catch (IndexOutOfBoundsException e) {
2448
		resizeByteArray(OPC_idiv);
2449
	}
2450
}
2050
}
2451
final public void if_acmpeq(Label lbl) {
2051
final public void if_acmpeq(Label lbl) {
2452
	if (DEBUG) System.out.println(position + "\t\tif_acmpeq:"+lbl); //$NON-NLS-1$
2052
	if (DEBUG) System.out.println(position + "\t\tif_acmpeq:"+lbl); //$NON-NLS-1$
Lines 2454-2466 Link Here
2454
	stackDepth-=2;
2054
	stackDepth-=2;
2455
	if (this.wideMode) {
2055
	if (this.wideMode) {
2456
		generateWideRevertedConditionalBranch(OPC_if_acmpne, lbl);
2056
		generateWideRevertedConditionalBranch(OPC_if_acmpne, lbl);
2457
	} else {	
2057
	} else {
2458
		try {
2058
		checkOffset(classFileOffset);
2459
			position++;
2059
		position++;
2460
			bCodeStream[classFileOffset++] = OPC_if_acmpeq;
2060
		bCodeStream[classFileOffset++] = OPC_if_acmpeq;
2461
		} catch (IndexOutOfBoundsException e) {
2462
			resizeByteArray(OPC_if_acmpeq);
2463
		}
2464
		lbl.branch();
2061
		lbl.branch();
2465
	}
2062
	}
2466
}
2063
}
Lines 2470-2482 Link Here
2470
	stackDepth-=2;
2067
	stackDepth-=2;
2471
	if (this.wideMode) {
2068
	if (this.wideMode) {
2472
		generateWideRevertedConditionalBranch(OPC_if_acmpeq, lbl);
2069
		generateWideRevertedConditionalBranch(OPC_if_acmpeq, lbl);
2473
	} else {	
2070
	} else {
2474
		try {
2071
		checkOffset(classFileOffset);
2475
			position++;
2072
		position++;
2476
			bCodeStream[classFileOffset++] = OPC_if_acmpne;
2073
		bCodeStream[classFileOffset++] = OPC_if_acmpne;
2477
		} catch (IndexOutOfBoundsException e) {
2478
			resizeByteArray(OPC_if_acmpne);
2479
		}
2480
		lbl.branch();
2074
		lbl.branch();
2481
	}
2075
	}
2482
}
2076
}
Lines 2486-2498 Link Here
2486
	stackDepth -= 2;
2080
	stackDepth -= 2;
2487
	if (this.wideMode) {
2081
	if (this.wideMode) {
2488
		generateWideRevertedConditionalBranch(OPC_if_icmpne, lbl);
2082
		generateWideRevertedConditionalBranch(OPC_if_icmpne, lbl);
2489
	} else {	
2083
	} else {
2490
		try {
2084
		checkOffset(classFileOffset);
2491
			position++;
2085
		position++;
2492
			bCodeStream[classFileOffset++] = OPC_if_icmpeq;
2086
		bCodeStream[classFileOffset++] = OPC_if_icmpeq;
2493
		} catch (IndexOutOfBoundsException e) {
2494
			resizeByteArray(OPC_if_icmpeq);
2495
		}
2496
		lbl.branch();
2087
		lbl.branch();
2497
	}
2088
	}
2498
}
2089
}
Lines 2503-2514 Link Here
2503
	if (this.wideMode) {
2094
	if (this.wideMode) {
2504
		generateWideRevertedConditionalBranch(OPC_if_icmplt, lbl);
2095
		generateWideRevertedConditionalBranch(OPC_if_icmplt, lbl);
2505
	} else {	
2096
	} else {	
2506
		try {
2097
		checkOffset(classFileOffset);
2507
			position++;
2098
		position++;
2508
			bCodeStream[classFileOffset++] = OPC_if_icmpge;
2099
		bCodeStream[classFileOffset++] = OPC_if_icmpge;
2509
		} catch (IndexOutOfBoundsException e) {
2510
			resizeByteArray(OPC_if_icmpge);
2511
		}
2512
		lbl.branch();
2100
		lbl.branch();
2513
	}
2101
	}
2514
}
2102
}
Lines 2518-2530 Link Here
2518
	stackDepth -= 2;
2106
	stackDepth -= 2;
2519
	if (this.wideMode) {
2107
	if (this.wideMode) {
2520
		generateWideRevertedConditionalBranch(OPC_if_icmple, lbl);
2108
		generateWideRevertedConditionalBranch(OPC_if_icmple, lbl);
2521
	} else {	
2109
	} else {
2522
		try {
2110
		checkOffset(classFileOffset);
2523
			position++;
2111
		position++;
2524
			bCodeStream[classFileOffset++] = OPC_if_icmpgt;
2112
		bCodeStream[classFileOffset++] = OPC_if_icmpgt;
2525
		} catch (IndexOutOfBoundsException e) {
2526
			resizeByteArray(OPC_if_icmpgt);
2527
		}
2528
		lbl.branch();
2113
		lbl.branch();
2529
	}
2114
	}
2530
}
2115
}
Lines 2534-2546 Link Here
2534
	stackDepth -= 2;
2119
	stackDepth -= 2;
2535
	if (this.wideMode) {
2120
	if (this.wideMode) {
2536
		generateWideRevertedConditionalBranch(OPC_if_icmpgt, lbl);
2121
		generateWideRevertedConditionalBranch(OPC_if_icmpgt, lbl);
2537
	} else {	
2122
	} else {
2538
		try {
2123
		checkOffset(classFileOffset);
2539
			position++;
2124
		position++;
2540
			bCodeStream[classFileOffset++] = OPC_if_icmple;
2125
		bCodeStream[classFileOffset++] = OPC_if_icmple;
2541
		} catch (IndexOutOfBoundsException e) {
2542
			resizeByteArray(OPC_if_icmple);
2543
		}
2544
		lbl.branch();
2126
		lbl.branch();
2545
	}
2127
	}
2546
}
2128
}
Lines 2551-2562 Link Here
2551
	if (this.wideMode) {
2133
	if (this.wideMode) {
2552
		generateWideRevertedConditionalBranch(OPC_if_icmpge, lbl);
2134
		generateWideRevertedConditionalBranch(OPC_if_icmpge, lbl);
2553
	} else {
2135
	} else {
2554
		try {
2136
		checkOffset(classFileOffset);
2555
			position++;
2137
		position++;
2556
			bCodeStream[classFileOffset++] = OPC_if_icmplt;
2138
		bCodeStream[classFileOffset++] = OPC_if_icmplt;
2557
		} catch (IndexOutOfBoundsException e) {
2558
			resizeByteArray(OPC_if_icmplt);
2559
		}
2560
		lbl.branch();
2139
		lbl.branch();
2561
	}
2140
	}
2562
}
2141
}
Lines 2567-2578 Link Here
2567
	if (this.wideMode) {
2146
	if (this.wideMode) {
2568
		generateWideRevertedConditionalBranch(OPC_if_icmpeq, lbl);
2147
		generateWideRevertedConditionalBranch(OPC_if_icmpeq, lbl);
2569
	} else {
2148
	} else {
2570
		try {
2149
		checkOffset(classFileOffset);
2571
			position++;
2150
		position++;
2572
			bCodeStream[classFileOffset++] = OPC_if_icmpne;
2151
		bCodeStream[classFileOffset++] = OPC_if_icmpne;
2573
		} catch (IndexOutOfBoundsException e) {
2574
			resizeByteArray(OPC_if_icmpne);
2575
		}
2576
		lbl.branch();
2152
		lbl.branch();
2577
	}
2153
	}
2578
}
2154
}
Lines 2583-2594 Link Here
2583
	if (this.wideMode) {
2159
	if (this.wideMode) {
2584
		generateWideRevertedConditionalBranch(OPC_ifne, lbl);
2160
		generateWideRevertedConditionalBranch(OPC_ifne, lbl);
2585
	} else {
2161
	} else {
2586
		try {
2162
		checkOffset(classFileOffset);
2587
			position++;
2163
		position++;
2588
			bCodeStream[classFileOffset++] = OPC_ifeq;
2164
		bCodeStream[classFileOffset++] = OPC_ifeq;
2589
		} catch (IndexOutOfBoundsException e) {
2590
			resizeByteArray(OPC_ifeq);
2591
		}
2592
		lbl.branch();
2165
		lbl.branch();
2593
	}
2166
	}
2594
}
2167
}
Lines 2599-2610 Link Here
2599
	if (this.wideMode) {
2172
	if (this.wideMode) {
2600
		generateWideRevertedConditionalBranch(OPC_iflt, lbl);
2173
		generateWideRevertedConditionalBranch(OPC_iflt, lbl);
2601
	} else {
2174
	} else {
2602
		try {
2175
		checkOffset(classFileOffset);
2603
			position++;
2176
		position++;
2604
			bCodeStream[classFileOffset++] = OPC_ifge;
2177
		bCodeStream[classFileOffset++] = OPC_ifge;
2605
		} catch (IndexOutOfBoundsException e) {
2606
			resizeByteArray(OPC_ifge);
2607
		}
2608
		lbl.branch();
2178
		lbl.branch();
2609
	}
2179
	}
2610
}
2180
}
Lines 2615-2626 Link Here
2615
	if (this.wideMode) {
2185
	if (this.wideMode) {
2616
		generateWideRevertedConditionalBranch(OPC_ifle, lbl);
2186
		generateWideRevertedConditionalBranch(OPC_ifle, lbl);
2617
	} else {
2187
	} else {
2618
		try {
2188
		checkOffset(classFileOffset);
2619
			position++;
2189
		position++;
2620
			bCodeStream[classFileOffset++] = OPC_ifgt;
2190
		bCodeStream[classFileOffset++] = OPC_ifgt;
2621
		} catch (IndexOutOfBoundsException e) {
2622
			resizeByteArray(OPC_ifgt);
2623
		}
2624
		lbl.branch();
2191
		lbl.branch();
2625
	}
2192
	}
2626
}
2193
}
Lines 2631-2642 Link Here
2631
	if (this.wideMode) {
2198
	if (this.wideMode) {
2632
		generateWideRevertedConditionalBranch(OPC_ifgt, lbl);
2199
		generateWideRevertedConditionalBranch(OPC_ifgt, lbl);
2633
	} else {
2200
	} else {
2634
		try {
2201
		checkOffset(classFileOffset);
2635
			position++;
2202
		position++;
2636
			bCodeStream[classFileOffset++] = OPC_ifle;
2203
		bCodeStream[classFileOffset++] = OPC_ifle;
2637
		} catch (IndexOutOfBoundsException e) {
2638
			resizeByteArray(OPC_ifle);
2639
		}
2640
		lbl.branch();
2204
		lbl.branch();
2641
	}
2205
	}
2642
}
2206
}
Lines 2647-2658 Link Here
2647
	if (this.wideMode) {
2211
	if (this.wideMode) {
2648
		generateWideRevertedConditionalBranch(OPC_ifge, lbl);
2212
		generateWideRevertedConditionalBranch(OPC_ifge, lbl);
2649
	} else {
2213
	} else {
2650
		try {
2214
		checkOffset(classFileOffset);
2651
			position++;
2215
		position++;
2652
			bCodeStream[classFileOffset++] = OPC_iflt;
2216
		bCodeStream[classFileOffset++] = OPC_iflt;
2653
		} catch (IndexOutOfBoundsException e) {
2654
			resizeByteArray(OPC_iflt);
2655
		}
2656
		lbl.branch();
2217
		lbl.branch();
2657
	}
2218
	}
2658
}
2219
}
Lines 2663-2674 Link Here
2663
	if (this.wideMode) {
2224
	if (this.wideMode) {
2664
		generateWideRevertedConditionalBranch(OPC_ifeq, lbl);
2225
		generateWideRevertedConditionalBranch(OPC_ifeq, lbl);
2665
	} else {
2226
	} else {
2666
		try {
2227
		checkOffset(classFileOffset);
2667
			position++;
2228
		position++;
2668
			bCodeStream[classFileOffset++] = OPC_ifne;
2229
		bCodeStream[classFileOffset++] = OPC_ifne;
2669
		} catch (IndexOutOfBoundsException e) {
2670
			resizeByteArray(OPC_ifne);
2671
		}
2672
		lbl.branch();
2230
		lbl.branch();
2673
	}
2231
	}
2674
}
2232
}
Lines 2679-2690 Link Here
2679
	if (this.wideMode) {
2237
	if (this.wideMode) {
2680
		generateWideRevertedConditionalBranch(OPC_ifnull, lbl);
2238
		generateWideRevertedConditionalBranch(OPC_ifnull, lbl);
2681
	} else {
2239
	} else {
2682
		try {
2240
		checkOffset(classFileOffset);
2683
			position++;
2241
		position++;
2684
			bCodeStream[classFileOffset++] = OPC_ifnonnull;
2242
		bCodeStream[classFileOffset++] = OPC_ifnonnull;
2685
		} catch (IndexOutOfBoundsException e) {
2686
			resizeByteArray(OPC_ifnonnull);
2687
		}
2688
		lbl.branch();
2243
		lbl.branch();
2689
	}
2244
	}
2690
}
2245
}
Lines 2695-2706 Link Here
2695
	if (this.wideMode) {
2250
	if (this.wideMode) {
2696
		generateWideRevertedConditionalBranch(OPC_ifnonnull, lbl);
2251
		generateWideRevertedConditionalBranch(OPC_ifnonnull, lbl);
2697
	} else {
2252
	} else {
2698
		try {
2253
		checkOffset(classFileOffset);
2699
			position++;
2254
		position++;
2700
			bCodeStream[classFileOffset++] = OPC_ifnull;
2255
		bCodeStream[classFileOffset++] = OPC_ifnull;
2701
		} catch (IndexOutOfBoundsException e) {
2702
			resizeByteArray(OPC_ifnull);
2703
		}
2704
		lbl.branch();
2256
		lbl.branch();
2705
	}
2257
	}
2706
}
2258
}
Lines 2708-2734 Link Here
2708
	if (DEBUG) System.out.println(position + "\t\tiinc:"+index+","+value); //$NON-NLS-1$ //$NON-NLS-2$
2260
	if (DEBUG) System.out.println(position + "\t\tiinc:"+index+","+value); //$NON-NLS-1$ //$NON-NLS-2$
2709
	countLabels = 0;
2261
	countLabels = 0;
2710
	if ((index > 255) || (value < -128 || value > 127)) { // have to widen
2262
	if ((index > 255) || (value < -128 || value > 127)) { // have to widen
2711
		try {
2263
		checkOffset(classFileOffset + 1);
2712
			position++;
2264
		position+=2;
2713
			bCodeStream[classFileOffset++] = OPC_wide;
2265
		bCodeStream[classFileOffset++] = OPC_wide;
2714
		} catch (IndexOutOfBoundsException e) {
2266
		bCodeStream[classFileOffset++] = OPC_iinc;
2715
			resizeByteArray(OPC_wide);
2716
		}
2717
		try {
2718
			position++;
2719
			bCodeStream[classFileOffset++] = OPC_iinc;
2720
		} catch (IndexOutOfBoundsException e) {
2721
			resizeByteArray(OPC_iinc);
2722
		}
2723
		writeUnsignedShort(index);
2267
		writeUnsignedShort(index);
2724
		writeSignedShort(value);
2268
		writeSignedShort(value);
2725
	} else {
2269
	} else {
2726
		try {
2270
		checkOffset(classFileOffset);
2727
			position++;
2271
		position++;
2728
			bCodeStream[classFileOffset++] = OPC_iinc;
2272
		bCodeStream[classFileOffset++] = OPC_iinc;
2729
		} catch (IndexOutOfBoundsException e) {
2730
			resizeByteArray(OPC_iinc);
2731
		}
2732
		writeUnsignedByte(index);
2273
		writeUnsignedByte(index);
2733
		writeSignedByte(value);
2274
		writeSignedByte(value);
2734
	}
2275
	}
Lines 2742-2774 Link Here
2742
	}
2283
	}
2743
	if (stackDepth > stackMax)
2284
	if (stackDepth > stackMax)
2744
		stackMax = stackDepth;
2285
		stackMax = stackDepth;
2286
	checkOffset(classFileOffset + 1);
2287
	position+=2;
2745
	if (iArg > 255) { // Widen
2288
	if (iArg > 255) { // Widen
2746
		try {
2289
		bCodeStream[classFileOffset++] = OPC_wide;
2747
			position++;
2290
		bCodeStream[classFileOffset++] = OPC_iload;
2748
			bCodeStream[classFileOffset++] = OPC_wide;
2749
		} catch (IndexOutOfBoundsException e) {
2750
			resizeByteArray(OPC_wide);
2751
		}
2752
		try {
2753
			position++;
2754
			bCodeStream[classFileOffset++] = OPC_iload;
2755
		} catch (IndexOutOfBoundsException e) {
2756
			resizeByteArray(OPC_iload);
2757
		}
2758
		writeUnsignedShort(iArg);
2291
		writeUnsignedShort(iArg);
2759
	} else {
2292
	} else {
2760
		try {
2293
		bCodeStream[classFileOffset++] = OPC_iload;
2761
			position++;
2294
		bCodeStream[classFileOffset++] = (byte)iArg;
2762
			bCodeStream[classFileOffset++] = OPC_iload;
2763
		} catch (IndexOutOfBoundsException e) {
2764
			resizeByteArray(OPC_iload);
2765
		}
2766
		try {
2767
			position++;
2768
			bCodeStream[classFileOffset++] = (byte) iArg;
2769
		} catch (IndexOutOfBoundsException e) {
2770
			resizeByteArray((byte) iArg);
2771
		}
2772
	}
2295
	}
2773
}
2296
}
2774
final public void iload_0() {
2297
final public void iload_0() {
Lines 2780-2791 Link Here
2780
	}
2303
	}
2781
	if (stackDepth > stackMax)
2304
	if (stackDepth > stackMax)
2782
		stackMax = stackDepth;
2305
		stackMax = stackDepth;
2783
	try {
2306
	checkOffset(classFileOffset);
2784
		position++;
2307
	position++;
2785
		bCodeStream[classFileOffset++] = OPC_iload_0;
2308
	bCodeStream[classFileOffset++] = OPC_iload_0;
2786
	} catch (IndexOutOfBoundsException e) {
2787
		resizeByteArray(OPC_iload_0);
2788
	}
2789
}
2309
}
2790
final public void iload_1() {
2310
final public void iload_1() {
2791
	if (DEBUG) System.out.println(position + "\t\tiload_1"); //$NON-NLS-1$
2311
	if (DEBUG) System.out.println(position + "\t\tiload_1"); //$NON-NLS-1$
Lines 2796-2807 Link Here
2796
	}
2316
	}
2797
	if (stackDepth > stackMax)
2317
	if (stackDepth > stackMax)
2798
		stackMax = stackDepth;
2318
		stackMax = stackDepth;
2799
	try {
2319
	checkOffset(classFileOffset);
2800
		position++;
2320
	position++;
2801
		bCodeStream[classFileOffset++] = OPC_iload_1;
2321
	bCodeStream[classFileOffset++] = OPC_iload_1;
2802
	} catch (IndexOutOfBoundsException e) {
2803
		resizeByteArray(OPC_iload_1);
2804
	}
2805
}
2322
}
2806
final public void iload_2() {
2323
final public void iload_2() {
2807
	if (DEBUG) System.out.println(position + "\t\tiload_2"); //$NON-NLS-1$
2324
	if (DEBUG) System.out.println(position + "\t\tiload_2"); //$NON-NLS-1$
Lines 2812-2823 Link Here
2812
	}
2329
	}
2813
	if (stackDepth > stackMax)
2330
	if (stackDepth > stackMax)
2814
		stackMax = stackDepth;
2331
		stackMax = stackDepth;
2815
	try {
2332
	checkOffset(classFileOffset);
2816
		position++;
2333
	position++;
2817
		bCodeStream[classFileOffset++] = OPC_iload_2;
2334
	bCodeStream[classFileOffset++] = OPC_iload_2;
2818
	} catch (IndexOutOfBoundsException e) {
2819
		resizeByteArray(OPC_iload_2);
2820
	}
2821
}
2335
}
2822
final public void iload_3() {
2336
final public void iload_3() {
2823
	if (DEBUG) System.out.println(position + "\t\tiload_3"); //$NON-NLS-1$
2337
	if (DEBUG) System.out.println(position + "\t\tiload_3"); //$NON-NLS-1$
Lines 2828-2850 Link Here
2828
	}
2342
	}
2829
	if (stackDepth > stackMax)
2343
	if (stackDepth > stackMax)
2830
		stackMax = stackDepth;
2344
		stackMax = stackDepth;
2831
	try {
2345
	checkOffset(classFileOffset);
2832
		position++;
2346
	position++;
2833
		bCodeStream[classFileOffset++] = OPC_iload_3;
2347
	bCodeStream[classFileOffset++] = OPC_iload_3;
2834
	} catch (IndexOutOfBoundsException e) {
2835
		resizeByteArray(OPC_iload_3);
2836
	}
2837
}
2348
}
2838
final public void imul() {
2349
final public void imul() {
2839
	if (DEBUG) System.out.println(position + "\t\timul"); //$NON-NLS-1$
2350
	if (DEBUG) System.out.println(position + "\t\timul"); //$NON-NLS-1$
2840
	countLabels = 0;
2351
	countLabels = 0;
2841
	stackDepth--;
2352
	stackDepth--;
2842
	try {
2353
	checkOffset(classFileOffset);
2843
		position++;
2354
	position++;
2844
		bCodeStream[classFileOffset++] = OPC_imul;
2355
	bCodeStream[classFileOffset++] = OPC_imul;
2845
	} catch (IndexOutOfBoundsException e) {
2846
		resizeByteArray(OPC_imul);
2847
	}
2848
}
2356
}
2849
public void incrementTemp(LocalVariableBinding localBinding, int value) {
2357
public void incrementTemp(LocalVariableBinding localBinding, int value) {
2850
	if (value == (short) value) {
2358
	if (value == (short) value) {
Lines 2870-2881 Link Here
2870
final public void ineg() {
2378
final public void ineg() {
2871
	if (DEBUG) System.out.println(position + "\t\tineg"); //$NON-NLS-1$
2379
	if (DEBUG) System.out.println(position + "\t\tineg"); //$NON-NLS-1$
2872
	countLabels = 0;
2380
	countLabels = 0;
2873
	try {
2381
	checkOffset(classFileOffset);
2874
		position++;
2382
	position++;
2875
		bCodeStream[classFileOffset++] = OPC_ineg;
2383
	bCodeStream[classFileOffset++] = OPC_ineg;
2876
	} catch (IndexOutOfBoundsException e) {
2877
		resizeByteArray(OPC_ineg);
2878
	}
2879
}
2384
}
2880
public void init(ClassFile targetClassFile) {
2385
public void init(ClassFile targetClassFile) {
2881
	this.classFile = targetClassFile;
2386
	this.classFile = targetClassFile;
Lines 2999-3022 Link Here
2999
final public void instance_of(TypeBinding typeBinding) {
2504
final public void instance_of(TypeBinding typeBinding) {
3000
	if (DEBUG) System.out.println(position + "\t\tinstance_of:"+typeBinding); //$NON-NLS-1$
2505
	if (DEBUG) System.out.println(position + "\t\tinstance_of:"+typeBinding); //$NON-NLS-1$
3001
	countLabels = 0;
2506
	countLabels = 0;
3002
	try {
2507
	checkOffset(classFileOffset);
3003
		position++;
2508
	position++;
3004
		bCodeStream[classFileOffset++] = OPC_instanceof;
2509
	bCodeStream[classFileOffset++] = OPC_instanceof;
3005
	} catch (IndexOutOfBoundsException e) {
3006
		resizeByteArray(OPC_instanceof);
3007
	}
3008
	writeUnsignedShort(constantPool.literalIndex(typeBinding));
2510
	writeUnsignedShort(constantPool.literalIndex(typeBinding));
3009
}
2511
}
3010
public void invokeClassForName() {
2512
public void invokeClassForName() {
3011
	// invokestatic: java.lang.Class.forName(Ljava.lang.String;)Ljava.lang.Class;
2513
	// invokestatic: java.lang.Class.forName(Ljava.lang.String;)Ljava.lang.Class;
3012
	if (DEBUG) System.out.println(position + "\t\tinvokestatic: java.lang.Class.forName(Ljava.lang.String;)Ljava.lang.Class;"); //$NON-NLS-1$
2514
	if (DEBUG) System.out.println(position + "\t\tinvokestatic: java.lang.Class.forName(Ljava.lang.String;)Ljava.lang.Class;"); //$NON-NLS-1$
3013
	countLabels = 0;
2515
	countLabels = 0;
3014
	try {
2516
	checkOffset(classFileOffset);
3015
		position++;
2517
	position++;
3016
		bCodeStream[classFileOffset++] = OPC_invokestatic;
2518
	bCodeStream[classFileOffset++] = OPC_invokestatic;
3017
	} catch (IndexOutOfBoundsException e) {
3018
		resizeByteArray(OPC_invokestatic);
3019
	}
3020
	writeUnsignedShort(constantPool.literalIndexForJavaLangClassForName());
2519
	writeUnsignedShort(constantPool.literalIndexForJavaLangClassForName());
3021
}
2520
}
3022
2521
Lines 3025-3036 Link Here
3025
	if (DEBUG) System.out.println(position + "\t\tinvokevirtual: java.lang.Class.desiredAssertionStatus()Z;"); //$NON-NLS-1$
2524
	if (DEBUG) System.out.println(position + "\t\tinvokevirtual: java.lang.Class.desiredAssertionStatus()Z;"); //$NON-NLS-1$
3026
	countLabels = 0;
2525
	countLabels = 0;
3027
	stackDepth--;
2526
	stackDepth--;
3028
	try {
2527
	checkOffset(classFileOffset);
3029
		position++;
2528
	position++;
3030
		bCodeStream[classFileOffset++] = OPC_invokevirtual;
2529
	bCodeStream[classFileOffset++] = OPC_invokevirtual;
3031
	} catch (IndexOutOfBoundsException e) {
3032
		resizeByteArray(OPC_invokevirtual);
3033
	}
3034
	writeUnsignedShort(constantPool.literalIndexForJavaLangClassDesiredAssertionStatus());
2530
	writeUnsignedShort(constantPool.literalIndexForJavaLangClassDesiredAssertionStatus());
3035
}
2531
}
3036
2532
Lines 3038-3049 Link Here
3038
	// invokevirtual: java.lang.Class.getComponentType()java.lang.Class;
2534
	// invokevirtual: java.lang.Class.getComponentType()java.lang.Class;
3039
	if (DEBUG) System.out.println(position + "\t\tinvokevirtual: java.lang.Class.getComponentType()java.lang.Class;"); //$NON-NLS-1$
2535
	if (DEBUG) System.out.println(position + "\t\tinvokevirtual: java.lang.Class.getComponentType()java.lang.Class;"); //$NON-NLS-1$
3040
	countLabels = 0;
2536
	countLabels = 0;
3041
	try {
2537
	checkOffset(classFileOffset);
3042
		position++;
2538
	position++;
3043
		bCodeStream[classFileOffset++] = OPC_invokevirtual;
2539
	bCodeStream[classFileOffset++] = OPC_invokevirtual;
3044
	} catch (IndexOutOfBoundsException e) {
3045
		resizeByteArray(OPC_invokevirtual);
3046
	}
3047
	writeUnsignedShort(constantPool.literalIndexForJavaLangClassGetComponentType());
2540
	writeUnsignedShort(constantPool.literalIndexForJavaLangClassGetComponentType());
3048
}
2541
}
3049
2542
Lines 3053-3064 Link Here
3053
	countLabels = 0;
2546
	countLabels = 0;
3054
	int argCount = 1;
2547
	int argCount = 1;
3055
	int id;
2548
	int id;
3056
	try {
2549
	checkOffset(classFileOffset);
3057
		position++;
2550
	position++;
3058
		bCodeStream[classFileOffset++] = OPC_invokeinterface;
2551
	bCodeStream[classFileOffset++] = OPC_invokeinterface;
3059
	} catch (IndexOutOfBoundsException e) {
3060
		resizeByteArray(OPC_invokeinterface);
3061
	}
3062
	writeUnsignedShort(constantPool.literalIndex(methodBinding));
2552
	writeUnsignedShort(constantPool.literalIndex(methodBinding));
3063
	for (int i = methodBinding.parameters.length - 1; i >= 0; i--)
2553
	for (int i = methodBinding.parameters.length - 1; i >= 0; i--)
3064
		if (((id = methodBinding.parameters[i].id) == T_double) || (id == T_long))
2554
		if (((id = methodBinding.parameters[i].id) == T_double) || (id == T_long))
Lines 3068-3079 Link Here
3068
	writeUnsignedByte(argCount);
2558
	writeUnsignedByte(argCount);
3069
	// Generate a  0 into the byte array. Like the array is already fill with 0, we just need to increment
2559
	// Generate a  0 into the byte array. Like the array is already fill with 0, we just need to increment
3070
	// the number of bytes.
2560
	// the number of bytes.
3071
	try {
2561
	checkOffset(classFileOffset);
3072
		position++;
2562
	position++;
3073
		bCodeStream[classFileOffset++] = 0;
2563
	bCodeStream[classFileOffset++] = (byte)0;
3074
	} catch (IndexOutOfBoundsException e) {
3075
		resizeByteArray((byte)0);
3076
	}
3077
	if (((id = methodBinding.returnType.id) == T_double) || (id == T_long))
2564
	if (((id = methodBinding.returnType.id) == T_double) || (id == T_long))
3078
		stackDepth += (2 - argCount);
2565
		stackDepth += (2 - argCount);
3079
	else
2566
	else
Lines 3088-3099 Link Here
3088
	// invokespecial: java.lang.Error<init>(Ljava.lang.String;)V
2575
	// invokespecial: java.lang.Error<init>(Ljava.lang.String;)V
3089
	if (DEBUG) System.out.println(position + "\t\tinvokespecial: java.lang.Error<init>(Ljava.lang.String;)V"); //$NON-NLS-1$
2576
	if (DEBUG) System.out.println(position + "\t\tinvokespecial: java.lang.Error<init>(Ljava.lang.String;)V"); //$NON-NLS-1$
3090
	countLabels = 0;
2577
	countLabels = 0;
3091
	try {
2578
	checkOffset(classFileOffset);
3092
		position++;
2579
	position++;
3093
		bCodeStream[classFileOffset++] = OPC_invokespecial;
2580
	bCodeStream[classFileOffset++] = OPC_invokespecial;
3094
	} catch (IndexOutOfBoundsException e) {
3095
		resizeByteArray(OPC_invokespecial);
3096
	}
3097
	stackDepth -= 2;
2581
	stackDepth -= 2;
3098
	writeUnsignedShort(constantPool.literalIndexForJavaLangErrorConstructor());
2582
	writeUnsignedShort(constantPool.literalIndexForJavaLangErrorConstructor());
3099
}
2583
}
Lines 3101-3112 Link Here
3101
	// invokespecial: java.lang.NoClassDefFoundError.<init>(Ljava.lang.String;)V
2585
	// invokespecial: java.lang.NoClassDefFoundError.<init>(Ljava.lang.String;)V
3102
	if (DEBUG) System.out.println(position + "\t\tinvokespecial: java.lang.NoClassDefFoundError.<init>(Ljava.lang.String;)V"); //$NON-NLS-1$
2586
	if (DEBUG) System.out.println(position + "\t\tinvokespecial: java.lang.NoClassDefFoundError.<init>(Ljava.lang.String;)V"); //$NON-NLS-1$
3103
	countLabels = 0;
2587
	countLabels = 0;
3104
	try {
2588
	checkOffset(classFileOffset);
3105
		position++;
2589
	position++;
3106
		bCodeStream[classFileOffset++] = OPC_invokespecial;
2590
	bCodeStream[classFileOffset++] = OPC_invokespecial;
3107
	} catch (IndexOutOfBoundsException e) {
3108
		resizeByteArray(OPC_invokespecial);
3109
	}
3110
	writeUnsignedShort(constantPool.literalIndexForJavaLangNoClassDefFoundErrorStringConstructor());
2591
	writeUnsignedShort(constantPool.literalIndexForJavaLangNoClassDefFoundErrorStringConstructor());
3111
	stackDepth -= 2;
2592
	stackDepth -= 2;
3112
}
2593
}
Lines 3114-3125 Link Here
3114
	// invokevirtual: java.lang.Object.getClass()Ljava.lang.Class;
2595
	// invokevirtual: java.lang.Object.getClass()Ljava.lang.Class;
3115
	if (DEBUG) System.out.println(position + "\t\tinvokevirtual: java.lang.Object.getClass()Ljava.lang.Class;"); //$NON-NLS-1$
2596
	if (DEBUG) System.out.println(position + "\t\tinvokevirtual: java.lang.Object.getClass()Ljava.lang.Class;"); //$NON-NLS-1$
3116
	countLabels = 0;
2597
	countLabels = 0;
3117
	try {
2598
	checkOffset(classFileOffset);
3118
		position++;
2599
	position++;
3119
		bCodeStream[classFileOffset++] = OPC_invokevirtual;
2600
	bCodeStream[classFileOffset++] = OPC_invokevirtual;
3120
	} catch (IndexOutOfBoundsException e) {
3121
		resizeByteArray(OPC_invokevirtual);
3122
	}
3123
	writeUnsignedShort(constantPool.literalIndexForJavaLangObjectGetClass());
2601
	writeUnsignedShort(constantPool.literalIndexForJavaLangObjectGetClass());
3124
}
2602
}
3125
2603
Lines 3129-3140 Link Here
3129
	countLabels = 0;
2607
	countLabels = 0;
3130
	int argCount = 1;
2608
	int argCount = 1;
3131
	int id;
2609
	int id;
3132
	try {
2610
	checkOffset(classFileOffset);
3133
		position++;
2611
	position++;
3134
		bCodeStream[classFileOffset++] = OPC_invokespecial;
2612
	bCodeStream[classFileOffset++] = OPC_invokespecial;
3135
	} catch (IndexOutOfBoundsException e) {
3136
		resizeByteArray(OPC_invokespecial);
3137
	}
3138
	writeUnsignedShort(constantPool.literalIndex(methodBinding));
2613
	writeUnsignedShort(constantPool.literalIndex(methodBinding));
3139
	if (methodBinding.isConstructor() && methodBinding.declaringClass.isNestedType()) {
2614
	if (methodBinding.isConstructor() && methodBinding.declaringClass.isNestedType()) {
3140
		// enclosing instances
2615
		// enclosing instances
Lines 3182-3193 Link Here
3182
	countLabels = 0;
2657
	countLabels = 0;
3183
	int argCount = 0;
2658
	int argCount = 0;
3184
	int id;
2659
	int id;
3185
	try {
2660
	checkOffset(classFileOffset);
3186
		position++;
2661
	position++;
3187
		bCodeStream[classFileOffset++] = OPC_invokestatic;
2662
	bCodeStream[classFileOffset++] = OPC_invokestatic;
3188
	} catch (IndexOutOfBoundsException e) {
3189
		resizeByteArray(OPC_invokestatic);
3190
	}
3191
	writeUnsignedShort(constantPool.literalIndex(methodBinding));
2663
	writeUnsignedShort(constantPool.literalIndex(methodBinding));
3192
	for (int i = methodBinding.parameters.length - 1; i >= 0; i--)
2664
	for (int i = methodBinding.parameters.length - 1; i >= 0; i--)
3193
		if (((id = methodBinding.parameters[i].id) == T_double) || (id == T_long))
2665
		if (((id = methodBinding.parameters[i].id) == T_double) || (id == T_long))
Lines 3217-3228 Link Here
3217
	else
2689
	else
3218
		usedTypeID = typeID;
2690
		usedTypeID = typeID;
3219
	// invokevirtual
2691
	// invokevirtual
3220
	try {
2692
	checkOffset(classFileOffset);
3221
		position++;
2693
	position++;
3222
		bCodeStream[classFileOffset++] = OPC_invokevirtual;
2694
	bCodeStream[classFileOffset++] = OPC_invokevirtual;
3223
	} catch (IndexOutOfBoundsException e) {
3224
		resizeByteArray(OPC_invokevirtual);
3225
	}
3226
	writeUnsignedShort(constantPool.literalIndexForJavaLangStringBufferAppend(typeID));
2695
	writeUnsignedShort(constantPool.literalIndexForJavaLangStringBufferAppend(typeID));
3227
	if ((usedTypeID == T_long) || (usedTypeID == T_double))
2696
	if ((usedTypeID == T_long) || (usedTypeID == T_double))
3228
		stackDepth -= 2;
2697
		stackDepth -= 2;
Lines 3234-3245 Link Here
3234
	// invokespecial: java.lang.AssertionError.<init>(typeBindingID)V
2703
	// invokespecial: java.lang.AssertionError.<init>(typeBindingID)V
3235
	if (DEBUG) System.out.println(position + "\t\tinvokespecial: java.lang.AssertionError.<init>(typeBindingID)V"); //$NON-NLS-1$
2704
	if (DEBUG) System.out.println(position + "\t\tinvokespecial: java.lang.AssertionError.<init>(typeBindingID)V"); //$NON-NLS-1$
3236
	countLabels = 0;
2705
	countLabels = 0;
3237
	try {
2706
	checkOffset(classFileOffset);
3238
		position++;
2707
	position++;
3239
		bCodeStream[classFileOffset++] = OPC_invokespecial;
2708
	bCodeStream[classFileOffset++] = OPC_invokespecial;
3240
	} catch (IndexOutOfBoundsException e) {
3241
		resizeByteArray(OPC_invokespecial);
3242
	}
3243
	writeUnsignedShort(constantPool.literalIndexForJavaLangAssertionErrorConstructor(typeBindingID));
2709
	writeUnsignedShort(constantPool.literalIndexForJavaLangAssertionErrorConstructor(typeBindingID));
3244
	stackDepth -= 2;
2710
	stackDepth -= 2;
3245
}
2711
}
Lines 3248-3259 Link Here
3248
	// invokespecial: java.lang.AssertionError.<init>()V
2714
	// invokespecial: java.lang.AssertionError.<init>()V
3249
	if (DEBUG) System.out.println(position + "\t\tinvokespecial: java.lang.AssertionError.<init>()V"); //$NON-NLS-1$
2715
	if (DEBUG) System.out.println(position + "\t\tinvokespecial: java.lang.AssertionError.<init>()V"); //$NON-NLS-1$
3250
	countLabels = 0;
2716
	countLabels = 0;
3251
	try {
2717
	checkOffset(classFileOffset);
3252
		position++;
2718
	position++;
3253
		bCodeStream[classFileOffset++] = OPC_invokespecial;
2719
	bCodeStream[classFileOffset++] = OPC_invokespecial;
3254
	} catch (IndexOutOfBoundsException e) {
3255
		resizeByteArray(OPC_invokespecial);
3256
	}
3257
	writeUnsignedShort(constantPool.literalIndexForJavaLangAssertionErrorDefaultConstructor());
2720
	writeUnsignedShort(constantPool.literalIndexForJavaLangAssertionErrorDefaultConstructor());
3258
	stackDepth --;
2721
	stackDepth --;
3259
}
2722
}
Lines 3262-3273 Link Here
3262
	// invokespecial: java.lang.StringBuffer.<init>()V
2725
	// invokespecial: java.lang.StringBuffer.<init>()V
3263
	if (DEBUG) System.out.println(position + "\t\tinvokespecial: java.lang.StringBuffer.<init>()V"); //$NON-NLS-1$
2726
	if (DEBUG) System.out.println(position + "\t\tinvokespecial: java.lang.StringBuffer.<init>()V"); //$NON-NLS-1$
3264
	countLabels = 0;
2727
	countLabels = 0;
3265
	try {
2728
	checkOffset(classFileOffset);
3266
		position++;
2729
	position++;
3267
		bCodeStream[classFileOffset++] = OPC_invokespecial;
2730
	bCodeStream[classFileOffset++] = OPC_invokespecial;
3268
	} catch (IndexOutOfBoundsException e) {
3269
		resizeByteArray(OPC_invokespecial);
3270
	}
3271
	writeUnsignedShort(constantPool.literalIndexForJavaLangStringBufferDefaultConstructor());
2731
	writeUnsignedShort(constantPool.literalIndexForJavaLangStringBufferDefaultConstructor());
3272
	stackDepth--;
2732
	stackDepth--;
3273
}
2733
}
Lines 3275-3286 Link Here
3275
	// invokespecial: java.lang.StringBuffer.<init>(Ljava.lang.String;)V
2735
	// invokespecial: java.lang.StringBuffer.<init>(Ljava.lang.String;)V
3276
	if (DEBUG) System.out.println(position + "\t\tjava.lang.StringBuffer.<init>(Ljava.lang.String;)V"); //$NON-NLS-1$
2736
	if (DEBUG) System.out.println(position + "\t\tjava.lang.StringBuffer.<init>(Ljava.lang.String;)V"); //$NON-NLS-1$
3277
	countLabels = 0;
2737
	countLabels = 0;
3278
	try {
2738
	checkOffset(classFileOffset);
3279
		position++;
2739
	position++;
3280
		bCodeStream[classFileOffset++] = OPC_invokespecial;
2740
	bCodeStream[classFileOffset++] = OPC_invokespecial;
3281
	} catch (IndexOutOfBoundsException e) {
3282
		resizeByteArray(OPC_invokespecial);
3283
	}
3284
	writeUnsignedShort(constantPool.literalIndexForJavaLangStringBufferConstructor());
2741
	writeUnsignedShort(constantPool.literalIndexForJavaLangStringBufferConstructor());
3285
	stackDepth -= 2;
2742
	stackDepth -= 2;
3286
}
2743
}
Lines 3289-3336 Link Here
3289
	// invokevirtual: StringBuffer.toString()Ljava.lang.String;
2746
	// invokevirtual: StringBuffer.toString()Ljava.lang.String;
3290
	if (DEBUG) System.out.println(position + "\t\tinvokevirtual: StringBuffer.toString()Ljava.lang.String;"); //$NON-NLS-1$
2747
	if (DEBUG) System.out.println(position + "\t\tinvokevirtual: StringBuffer.toString()Ljava.lang.String;"); //$NON-NLS-1$
3291
	countLabels = 0;
2748
	countLabels = 0;
3292
	try {
2749
	checkOffset(classFileOffset);
3293
		position++;
2750
	position++;
3294
		bCodeStream[classFileOffset++] = OPC_invokevirtual;
2751
	bCodeStream[classFileOffset++] = OPC_invokevirtual;
3295
	} catch (IndexOutOfBoundsException e) {
3296
		resizeByteArray(OPC_invokevirtual);
3297
	}
3298
	writeUnsignedShort(constantPool.literalIndexForJavaLangStringBufferToString());
2752
	writeUnsignedShort(constantPool.literalIndexForJavaLangStringBufferToString());
3299
}
2753
}
3300
public void invokeStringIntern() {
2754
public void invokeStringIntern() {
3301
	// invokevirtual: java.lang.String.intern()
2755
	// invokevirtual: java.lang.String.intern()
3302
	if (DEBUG) System.out.println(position + "\t\tinvokevirtual: java.lang.String.intern()"); //$NON-NLS-1$
2756
	if (DEBUG) System.out.println(position + "\t\tinvokevirtual: java.lang.String.intern()"); //$NON-NLS-1$
3303
	countLabels = 0;
2757
	countLabels = 0;
3304
	try {
2758
	checkOffset(classFileOffset);
3305
		position++;
2759
	position++;
3306
		bCodeStream[classFileOffset++] = OPC_invokevirtual;
2760
	bCodeStream[classFileOffset++] = OPC_invokevirtual;
3307
	} catch (IndexOutOfBoundsException e) {
3308
		resizeByteArray(OPC_invokevirtual);
3309
	}
3310
	writeUnsignedShort(constantPool.literalIndexForJavaLangStringIntern());
2761
	writeUnsignedShort(constantPool.literalIndexForJavaLangStringIntern());
3311
}
2762
}
3312
public void invokeStringValueOf(int typeID) {
2763
public void invokeStringValueOf(int typeID) {
3313
	// invokestatic: java.lang.String.valueOf(argumentType)
2764
	// invokestatic: java.lang.String.valueOf(argumentType)
3314
	if (DEBUG) System.out.println(position + "\t\tinvokestatic: java.lang.String.valueOf(...)"); //$NON-NLS-1$
2765
	if (DEBUG) System.out.println(position + "\t\tinvokestatic: java.lang.String.valueOf(...)"); //$NON-NLS-1$
3315
	countLabels = 0;
2766
	countLabels = 0;
3316
	try {
2767
	checkOffset(classFileOffset);
3317
		position++;
2768
	position++;
3318
		bCodeStream[classFileOffset++] = OPC_invokestatic;
2769
	bCodeStream[classFileOffset++] = OPC_invokestatic;
3319
	} catch (IndexOutOfBoundsException e) {
3320
		resizeByteArray(OPC_invokestatic);
3321
	}
3322
	writeUnsignedShort(constantPool.literalIndexForJavaLangStringValueOf(typeID));
2770
	writeUnsignedShort(constantPool.literalIndexForJavaLangStringValueOf(typeID));
3323
}
2771
}
3324
public void invokeThrowableGetMessage() {
2772
public void invokeThrowableGetMessage() {
3325
	// invokevirtual: java.lang.Throwable.getMessage()Ljava.lang.String;
2773
	// invokevirtual: java.lang.Throwable.getMessage()Ljava.lang.String;
3326
	if (DEBUG) System.out.println(position + "\t\tinvokevirtual: java.lang.Throwable.getMessage()Ljava.lang.String;"); //$NON-NLS-1$
2774
	if (DEBUG) System.out.println(position + "\t\tinvokevirtual: java.lang.Throwable.getMessage()Ljava.lang.String;"); //$NON-NLS-1$
3327
	countLabels = 0;
2775
	countLabels = 0;
3328
	try {
2776
	checkOffset(classFileOffset);
3329
		position++;
2777
	position++;
3330
		bCodeStream[classFileOffset++] = OPC_invokevirtual;
2778
	bCodeStream[classFileOffset++] = OPC_invokevirtual;
3331
	} catch (IndexOutOfBoundsException e) {
3332
		resizeByteArray(OPC_invokevirtual);
3333
	}
3334
	writeUnsignedShort(constantPool.literalIndexForJavaLangThrowableGetMessage());
2779
	writeUnsignedShort(constantPool.literalIndexForJavaLangThrowableGetMessage());
3335
}
2780
}
3336
final public void invokevirtual(MethodBinding methodBinding) {
2781
final public void invokevirtual(MethodBinding methodBinding) {
Lines 3339-3350 Link Here
3339
	countLabels = 0;
2784
	countLabels = 0;
3340
	int argCount = 1;
2785
	int argCount = 1;
3341
	int id;
2786
	int id;
3342
	try {
2787
	checkOffset(classFileOffset);
3343
		position++;
2788
	position++;
3344
		bCodeStream[classFileOffset++] = OPC_invokevirtual;
2789
	bCodeStream[classFileOffset++] = OPC_invokevirtual;
3345
	} catch (IndexOutOfBoundsException e) {
3346
		resizeByteArray(OPC_invokevirtual);
3347
	}
3348
	writeUnsignedShort(constantPool.literalIndex(methodBinding));
2790
	writeUnsignedShort(constantPool.literalIndex(methodBinding));
3349
	for (int i = methodBinding.parameters.length - 1; i >= 0; i--)
2791
	for (int i = methodBinding.parameters.length - 1; i >= 0; i--)
3350
		if (((id = methodBinding.parameters[i].id) == T_double) || (id == T_long))
2792
		if (((id = methodBinding.parameters[i].id) == T_double) || (id == T_long))
Lines 3365-3399 Link Here
3365
	if (DEBUG) System.out.println(position + "\t\tior"); //$NON-NLS-1$
2807
	if (DEBUG) System.out.println(position + "\t\tior"); //$NON-NLS-1$
3366
	countLabels = 0;
2808
	countLabels = 0;
3367
	stackDepth--;
2809
	stackDepth--;
3368
	try {
2810
	checkOffset(classFileOffset);
3369
		position++;
2811
	position++;
3370
		bCodeStream[classFileOffset++] = OPC_ior;
2812
	bCodeStream[classFileOffset++] = OPC_ior;
3371
	} catch (IndexOutOfBoundsException e) {
3372
		resizeByteArray(OPC_ior);
3373
	}
3374
}
2813
}
3375
final public void irem() {
2814
final public void irem() {
3376
	if (DEBUG) System.out.println(position + "\t\tirem"); //$NON-NLS-1$
2815
	if (DEBUG) System.out.println(position + "\t\tirem"); //$NON-NLS-1$
3377
	countLabels = 0;
2816
	countLabels = 0;
3378
	stackDepth--;
2817
	stackDepth--;
3379
	try {
2818
	checkOffset(classFileOffset);
3380
		position++;
2819
	position++;
3381
		bCodeStream[classFileOffset++] = OPC_irem;
2820
	bCodeStream[classFileOffset++] = OPC_irem;
3382
	} catch (IndexOutOfBoundsException e) {
3383
		resizeByteArray(OPC_irem);
3384
	}
3385
}
2821
}
3386
final public void ireturn() {
2822
final public void ireturn() {
3387
	if (DEBUG) System.out.println(position + "\t\tireturn"); //$NON-NLS-1$
2823
	if (DEBUG) System.out.println(position + "\t\tireturn"); //$NON-NLS-1$
3388
	countLabels = 0;
2824
	countLabels = 0;
3389
	stackDepth--;
2825
	stackDepth--;
3390
	// the stackDepth should be equal to 0 
2826
	// the stackDepth should be equal to 0
3391
	try {
2827
	checkOffset(classFileOffset);
3392
		position++;
2828
	position++;
3393
		bCodeStream[classFileOffset++] = OPC_ireturn;
2829
	bCodeStream[classFileOffset++] = OPC_ireturn;
3394
	} catch (IndexOutOfBoundsException e) {
3395
		resizeByteArray(OPC_ireturn);
3396
	}
3397
}
2830
}
3398
public boolean isDefinitelyAssigned(Scope scope, int initStateIndex, LocalVariableBinding local) {
2831
public boolean isDefinitelyAssigned(Scope scope, int initStateIndex, LocalVariableBinding local) {
3399
	// Dependant of UnconditionalFlowInfo.isDefinitelyAssigned(..)
2832
	// Dependant of UnconditionalFlowInfo.isDefinitelyAssigned(..)
Lines 3421-3443 Link Here
3421
	if (DEBUG) System.out.println(position + "\t\tishl"); //$NON-NLS-1$
2854
	if (DEBUG) System.out.println(position + "\t\tishl"); //$NON-NLS-1$
3422
	countLabels = 0;
2855
	countLabels = 0;
3423
	stackDepth--;
2856
	stackDepth--;
3424
	try {
2857
	checkOffset(classFileOffset);
3425
		position++;
2858
	position++;
3426
		bCodeStream[classFileOffset++] = OPC_ishl;
2859
	bCodeStream[classFileOffset++] = OPC_ishl;
3427
	} catch (IndexOutOfBoundsException e) {
3428
		resizeByteArray(OPC_ishl);
3429
	}
3430
}
2860
}
3431
final public void ishr() {
2861
final public void ishr() {
3432
	if (DEBUG) System.out.println(position + "\t\tishr"); //$NON-NLS-1$
2862
	if (DEBUG) System.out.println(position + "\t\tishr"); //$NON-NLS-1$
3433
	countLabels = 0;
2863
	countLabels = 0;
3434
	stackDepth--;
2864
	stackDepth--;
3435
	try {
2865
	checkOffset(classFileOffset);
3436
		position++;
2866
	position++;
3437
		bCodeStream[classFileOffset++] = OPC_ishr;
2867
	bCodeStream[classFileOffset++] = OPC_ishr;
3438
	} catch (IndexOutOfBoundsException e) {
3439
		resizeByteArray(OPC_ishr);
3440
	}
3441
}
2868
}
3442
final public void istore(int iArg) {
2869
final public void istore(int iArg) {
3443
	if (DEBUG) System.out.println(position + "\t\tistore:"+iArg); //$NON-NLS-1$
2870
	if (DEBUG) System.out.println(position + "\t\tistore:"+iArg); //$NON-NLS-1$
Lines 3446-3478 Link Here
3446
	if (maxLocals <= iArg) {
2873
	if (maxLocals <= iArg) {
3447
		maxLocals = iArg + 1;
2874
		maxLocals = iArg + 1;
3448
	}
2875
	}
2876
	checkOffset(classFileOffset + 1);
2877
	position+=2;
3449
	if (iArg > 255) { // Widen
2878
	if (iArg > 255) { // Widen
3450
		try {
2879
		bCodeStream[classFileOffset++] = OPC_wide;
3451
			position++;
2880
		bCodeStream[classFileOffset++] = OPC_istore;
3452
			bCodeStream[classFileOffset++] = OPC_wide;
3453
		} catch (IndexOutOfBoundsException e) {
3454
			resizeByteArray(OPC_wide);
3455
		}
3456
		try {
3457
			position++;
3458
			bCodeStream[classFileOffset++] = OPC_istore;
3459
		} catch (IndexOutOfBoundsException e) {
3460
			resizeByteArray(OPC_istore);
3461
		}
3462
		writeUnsignedShort(iArg);
2881
		writeUnsignedShort(iArg);
3463
	} else {
2882
	} else {
3464
		try {
2883
		bCodeStream[classFileOffset++] = OPC_istore;
3465
			position++;
2884
		bCodeStream[classFileOffset++] = (byte)iArg;
3466
			bCodeStream[classFileOffset++] = OPC_istore;
3467
		} catch (IndexOutOfBoundsException e) {
3468
			resizeByteArray(OPC_istore);
3469
		}
3470
		try {
3471
			position++;
3472
			bCodeStream[classFileOffset++] = (byte) iArg;
3473
		} catch (IndexOutOfBoundsException e) {
3474
			resizeByteArray((byte) iArg);
3475
		}
3476
	}
2885
	}
3477
}
2886
}
3478
final public void istore_0() {
2887
final public void istore_0() {
Lines 3482-3493 Link Here
3482
	if (maxLocals == 0) {
2891
	if (maxLocals == 0) {
3483
		maxLocals = 1;
2892
		maxLocals = 1;
3484
	}
2893
	}
3485
	try {
2894
	checkOffset(classFileOffset);
3486
		position++;
2895
	position++;
3487
		bCodeStream[classFileOffset++] = OPC_istore_0;
2896
	bCodeStream[classFileOffset++] = OPC_istore_0;
3488
	} catch (IndexOutOfBoundsException e) {
3489
		resizeByteArray(OPC_istore_0);
3490
	}
3491
}
2897
}
3492
final public void istore_1() {
2898
final public void istore_1() {
3493
	if (DEBUG) System.out.println(position + "\t\tistore_1"); //$NON-NLS-1$
2899
	if (DEBUG) System.out.println(position + "\t\tistore_1"); //$NON-NLS-1$
Lines 3496-3507 Link Here
3496
	if (maxLocals <= 1) {
2902
	if (maxLocals <= 1) {
3497
		maxLocals = 2;
2903
		maxLocals = 2;
3498
	}
2904
	}
3499
	try {
2905
	checkOffset(classFileOffset);
3500
		position++;
2906
	position++;
3501
		bCodeStream[classFileOffset++] = OPC_istore_1;
2907
	bCodeStream[classFileOffset++] = OPC_istore_1;
3502
	} catch (IndexOutOfBoundsException e) {
3503
		resizeByteArray(OPC_istore_1);
3504
	}
3505
}
2908
}
3506
final public void istore_2() {
2909
final public void istore_2() {
3507
	if (DEBUG) System.out.println(position + "\t\tistore_2"); //$NON-NLS-1$
2910
	if (DEBUG) System.out.println(position + "\t\tistore_2"); //$NON-NLS-1$
Lines 3510-3521 Link Here
3510
	if (maxLocals <= 2) {
2913
	if (maxLocals <= 2) {
3511
		maxLocals = 3;
2914
		maxLocals = 3;
3512
	}
2915
	}
3513
	try {
2916
	checkOffset(classFileOffset);
3514
		position++;
2917
	position++;
3515
		bCodeStream[classFileOffset++] = OPC_istore_2;
2918
	bCodeStream[classFileOffset++] = OPC_istore_2;
3516
	} catch (IndexOutOfBoundsException e) {
3517
		resizeByteArray(OPC_istore_2);
3518
	}
3519
}
2919
}
3520
final public void istore_3() {
2920
final public void istore_3() {
3521
	if (DEBUG) System.out.println(position + "\t\tistore_3"); //$NON-NLS-1$
2921
	if (DEBUG) System.out.println(position + "\t\tistore_3"); //$NON-NLS-1$
Lines 3524-3568 Link Here
3524
	if (maxLocals <= 3) {
2924
	if (maxLocals <= 3) {
3525
		maxLocals = 4;
2925
		maxLocals = 4;
3526
	}
2926
	}
3527
	try {
2927
	checkOffset(classFileOffset);
3528
		position++;
2928
	position++;
3529
		bCodeStream[classFileOffset++] = OPC_istore_3;
2929
	bCodeStream[classFileOffset++] = OPC_istore_3;
3530
	} catch (IndexOutOfBoundsException e) {
3531
		resizeByteArray(OPC_istore_3);
3532
	}
3533
}
2930
}
3534
final public void isub() {
2931
final public void isub() {
3535
	if (DEBUG) System.out.println(position + "\t\tisub"); //$NON-NLS-1$
2932
	if (DEBUG) System.out.println(position + "\t\tisub"); //$NON-NLS-1$
3536
	countLabels = 0;
2933
	countLabels = 0;
3537
	stackDepth--;
2934
	stackDepth--;
3538
	try {
2935
	checkOffset(classFileOffset);
3539
		position++;
2936
	position++;
3540
		bCodeStream[classFileOffset++] = OPC_isub;
2937
	bCodeStream[classFileOffset++] = OPC_isub;
3541
	} catch (IndexOutOfBoundsException e) {
3542
		resizeByteArray(OPC_isub);
3543
	}
3544
}
2938
}
3545
final public void iushr() {
2939
final public void iushr() {
3546
	if (DEBUG) System.out.println(position + "\t\tiushr"); //$NON-NLS-1$
2940
	if (DEBUG) System.out.println(position + "\t\tiushr"); //$NON-NLS-1$
3547
	countLabels = 0;
2941
	countLabels = 0;
3548
	stackDepth--;
2942
	stackDepth--;
3549
	try {
2943
	checkOffset(classFileOffset);
3550
		position++;
2944
	position++;
3551
		bCodeStream[classFileOffset++] = OPC_iushr;
2945
	bCodeStream[classFileOffset++] = OPC_iushr;
3552
	} catch (IndexOutOfBoundsException e) {
3553
		resizeByteArray(OPC_iushr);
3554
	}
3555
}
2946
}
3556
final public void ixor() {
2947
final public void ixor() {
3557
	if (DEBUG) System.out.println(position + "\t\tixor"); //$NON-NLS-1$
2948
	if (DEBUG) System.out.println(position + "\t\tixor"); //$NON-NLS-1$
3558
	countLabels = 0;
2949
	countLabels = 0;
3559
	stackDepth--;
2950
	stackDepth--;
3560
	try {
2951
	checkOffset(classFileOffset);
3561
		position++;
2952
	position++;
3562
		bCodeStream[classFileOffset++] = OPC_ixor;
2953
	bCodeStream[classFileOffset++] = OPC_ixor;
3563
	} catch (IndexOutOfBoundsException e) {
3564
		resizeByteArray(OPC_ixor);
3565
	}
3566
}
2954
}
3567
final public void jsr(Label lbl) {
2955
final public void jsr(Label lbl) {
3568
	if (this.wideMode) {
2956
	if (this.wideMode) {
Lines 3571-3680 Link Here
3571
	}
2959
	}
3572
	if (DEBUG) System.out.println(position + "\t\tjsr"+lbl); //$NON-NLS-1$
2960
	if (DEBUG) System.out.println(position + "\t\tjsr"+lbl); //$NON-NLS-1$
3573
	countLabels = 0;
2961
	countLabels = 0;
3574
	try {
2962
	checkOffset(classFileOffset);
3575
		position++;
2963
	position++;
3576
		bCodeStream[classFileOffset++] = OPC_jsr;
2964
	bCodeStream[classFileOffset++] = OPC_jsr;
3577
	} catch (IndexOutOfBoundsException e) {
3578
		resizeByteArray(OPC_jsr);
3579
	}
3580
	lbl.branch();
2965
	lbl.branch();
3581
}
2966
}
3582
final public void jsr_w(Label lbl) {
2967
final public void jsr_w(Label lbl) {
3583
	if (DEBUG) System.out.println(position + "\t\tjsr_w"+lbl); //$NON-NLS-1$
2968
	if (DEBUG) System.out.println(position + "\t\tjsr_w"+lbl); //$NON-NLS-1$
3584
	countLabels = 0;
2969
	countLabels = 0;
3585
	try {
2970
	checkOffset(classFileOffset);
3586
		position++;
2971
	position++;
3587
		bCodeStream[classFileOffset++] = OPC_jsr_w;
2972
	bCodeStream[classFileOffset++] = OPC_jsr_w;
3588
	} catch (IndexOutOfBoundsException e) {
3589
		resizeByteArray(OPC_jsr_w);
3590
	}
3591
	lbl.branchWide();
2973
	lbl.branchWide();
3592
}
2974
}
3593
final public void l2d() {
2975
final public void l2d() {
3594
	if (DEBUG) System.out.println(position + "\t\tl2d"); //$NON-NLS-1$
2976
	if (DEBUG) System.out.println(position + "\t\tl2d"); //$NON-NLS-1$
3595
	countLabels = 0;
2977
	countLabels = 0;
3596
	try {
2978
	checkOffset(classFileOffset);
3597
		position++;
2979
	position++;
3598
		bCodeStream[classFileOffset++] = OPC_l2d;
2980
	bCodeStream[classFileOffset++] = OPC_l2d;
3599
	} catch (IndexOutOfBoundsException e) {
3600
		resizeByteArray(OPC_l2d);
3601
	}
3602
}
2981
}
3603
final public void l2f() {
2982
final public void l2f() {
3604
	if (DEBUG) System.out.println(position + "\t\tl2f"); //$NON-NLS-1$
2983
	if (DEBUG) System.out.println(position + "\t\tl2f"); //$NON-NLS-1$
3605
	countLabels = 0;
2984
	countLabels = 0;
3606
	stackDepth--;
2985
	stackDepth--;
3607
	try {
2986
	checkOffset(classFileOffset);
3608
		position++;
2987
	position++;
3609
		bCodeStream[classFileOffset++] = OPC_l2f;
2988
	bCodeStream[classFileOffset++] = OPC_l2f;
3610
	} catch (IndexOutOfBoundsException e) {
3611
		resizeByteArray(OPC_l2f);
3612
	}
3613
}
2989
}
3614
final public void l2i() {
2990
final public void l2i() {
3615
	if (DEBUG) System.out.println(position + "\t\tl2i"); //$NON-NLS-1$
2991
	if (DEBUG) System.out.println(position + "\t\tl2i"); //$NON-NLS-1$
3616
	countLabels = 0;
2992
	countLabels = 0;
3617
	stackDepth--;
2993
	stackDepth--;
3618
	try {
2994
	checkOffset(classFileOffset);
3619
		position++;
2995
	position++;
3620
		bCodeStream[classFileOffset++] = OPC_l2i;
2996
	bCodeStream[classFileOffset++] = OPC_l2i;
3621
	} catch (IndexOutOfBoundsException e) {
3622
		resizeByteArray(OPC_l2i);
3623
	}
3624
}
2997
}
3625
final public void ladd() {
2998
final public void ladd() {
3626
	if (DEBUG) System.out.println(position + "\t\tladd"); //$NON-NLS-1$
2999
	if (DEBUG) System.out.println(position + "\t\tladd"); //$NON-NLS-1$
3627
	countLabels = 0;
3000
	countLabels = 0;
3628
	stackDepth -= 2;
3001
	stackDepth -= 2;
3629
	try {
3002
	checkOffset(classFileOffset);
3630
		position++;
3003
	position++;
3631
		bCodeStream[classFileOffset++] = OPC_ladd;
3004
	bCodeStream[classFileOffset++] = OPC_ladd;
3632
	} catch (IndexOutOfBoundsException e) {
3633
		resizeByteArray(OPC_ladd);
3634
	}
3635
}
3005
}
3636
final public void laload() {
3006
final public void laload() {
3637
	if (DEBUG) System.out.println(position + "\t\tlaload"); //$NON-NLS-1$
3007
	if (DEBUG) System.out.println(position + "\t\tlaload"); //$NON-NLS-1$
3638
	countLabels = 0;
3008
	countLabels = 0;
3639
	try {
3009
	checkOffset(classFileOffset);
3640
		position++;
3010
	position++;
3641
		bCodeStream[classFileOffset++] = OPC_laload;
3011
	bCodeStream[classFileOffset++] = OPC_laload;
3642
	} catch (IndexOutOfBoundsException e) {
3643
		resizeByteArray(OPC_laload);
3644
	}
3645
}
3012
}
3646
final public void land() {
3013
final public void land() {
3647
	if (DEBUG) System.out.println(position + "\t\tland"); //$NON-NLS-1$
3014
	if (DEBUG) System.out.println(position + "\t\tland"); //$NON-NLS-1$
3648
	countLabels = 0;
3015
	countLabels = 0;
3649
	stackDepth -= 2;
3016
	stackDepth -= 2;
3650
	try {
3017
	checkOffset(classFileOffset);
3651
		position++;
3018
	position++;
3652
		bCodeStream[classFileOffset++] = OPC_land;
3019
	bCodeStream[classFileOffset++] = OPC_land;
3653
	} catch (IndexOutOfBoundsException e) {
3654
		resizeByteArray(OPC_land);
3655
	}
3656
}
3020
}
3657
final public void lastore() {
3021
final public void lastore() {
3658
	if (DEBUG) System.out.println(position + "\t\tlastore"); //$NON-NLS-1$
3022
	if (DEBUG) System.out.println(position + "\t\tlastore"); //$NON-NLS-1$
3659
	countLabels = 0;
3023
	countLabels = 0;
3660
	stackDepth -= 4;
3024
	stackDepth -= 4;
3661
	try {
3025
	checkOffset(classFileOffset);
3662
		position++;
3026
	position++;
3663
		bCodeStream[classFileOffset++] = OPC_lastore;
3027
	bCodeStream[classFileOffset++] = OPC_lastore;
3664
	} catch (IndexOutOfBoundsException e) {
3665
		resizeByteArray(OPC_lastore);
3666
	}
3667
}
3028
}
3668
final public void lcmp() {
3029
final public void lcmp() {
3669
	if (DEBUG) System.out.println(position + "\t\tlcmp"); //$NON-NLS-1$
3030
	if (DEBUG) System.out.println(position + "\t\tlcmp"); //$NON-NLS-1$
3670
	countLabels = 0;
3031
	countLabels = 0;
3671
	stackDepth -= 3;
3032
	stackDepth -= 3;
3672
	try {
3033
	checkOffset(classFileOffset);
3673
		position++;
3034
	position++;
3674
		bCodeStream[classFileOffset++] = OPC_lcmp;
3035
	bCodeStream[classFileOffset++] = OPC_lcmp;
3675
	} catch (IndexOutOfBoundsException e) {
3676
		resizeByteArray(OPC_lcmp);
3677
	}
3678
}
3036
}
3679
final public void lconst_0() {
3037
final public void lconst_0() {
3680
	if (DEBUG) System.out.println(position + "\t\tlconst_0"); //$NON-NLS-1$
3038
	if (DEBUG) System.out.println(position + "\t\tlconst_0"); //$NON-NLS-1$
Lines 3682-3693 Link Here
3682
	stackDepth += 2;
3040
	stackDepth += 2;
3683
	if (stackDepth > stackMax)
3041
	if (stackDepth > stackMax)
3684
		stackMax = stackDepth;
3042
		stackMax = stackDepth;
3685
	try {
3043
	checkOffset(classFileOffset);
3686
		position++;
3044
	position++;
3687
		bCodeStream[classFileOffset++] = OPC_lconst_0;
3045
	bCodeStream[classFileOffset++] = OPC_lconst_0;
3688
	} catch (IndexOutOfBoundsException e) {
3689
		resizeByteArray(OPC_lconst_0);
3690
	}
3691
}
3046
}
3692
final public void lconst_1() {
3047
final public void lconst_1() {
3693
	if (DEBUG) System.out.println(position + "\t\tlconst_1"); //$NON-NLS-1$
3048
	if (DEBUG) System.out.println(position + "\t\tlconst_1"); //$NON-NLS-1$
Lines 3695-3706 Link Here
3695
	stackDepth += 2;
3050
	stackDepth += 2;
3696
	if (stackDepth > stackMax)
3051
	if (stackDepth > stackMax)
3697
		stackMax = stackDepth;
3052
		stackMax = stackDepth;
3698
	try {
3053
	checkOffset(classFileOffset);
3699
		position++;
3054
	position++;
3700
		bCodeStream[classFileOffset++] = OPC_lconst_1;
3055
	bCodeStream[classFileOffset++] = OPC_lconst_1;
3701
	} catch (IndexOutOfBoundsException e) {
3702
		resizeByteArray(OPC_lconst_1);
3703
	}
3704
}
3056
}
3705
final public void ldc(float constant) {
3057
final public void ldc(float constant) {
3706
	if (DEBUG) System.out.println(position + "\t\tldc:"+constant); //$NON-NLS-1$
3058
	if (DEBUG) System.out.println(position + "\t\tldc:"+constant); //$NON-NLS-1$
Lines 3709-3731 Link Here
3709
	stackDepth++;
3061
	stackDepth++;
3710
	if (stackDepth > stackMax)
3062
	if (stackDepth > stackMax)
3711
		stackMax = stackDepth;
3063
		stackMax = stackDepth;
3064
	checkOffset(classFileOffset);
3065
	position++;
3712
	if (index > 255) {
3066
	if (index > 255) {
3713
		// Generate a ldc_w
3067
		// Generate a ldc_w
3714
		try {
3068
		bCodeStream[classFileOffset++] = OPC_ldc_w;
3715
			position++;
3716
			bCodeStream[classFileOffset++] = OPC_ldc_w;
3717
		} catch (IndexOutOfBoundsException e) {
3718
			resizeByteArray(OPC_ldc_w);
3719
		}
3720
		writeUnsignedShort(index);
3069
		writeUnsignedShort(index);
3721
	} else {
3070
	} else {
3722
		// Generate a ldc
3071
		// Generate a ldc
3723
		try {
3072
		bCodeStream[classFileOffset++] = OPC_ldc;
3724
			position++;
3725
			bCodeStream[classFileOffset++] = OPC_ldc;
3726
		} catch (IndexOutOfBoundsException e) {
3727
			resizeByteArray(OPC_ldc);
3728
		}
3729
		writeUnsignedByte(index);
3073
		writeUnsignedByte(index);
3730
	}
3074
	}
3731
}
3075
}
Lines 3736-3758 Link Here
3736
	stackDepth++;
3080
	stackDepth++;
3737
	if (stackDepth > stackMax)
3081
	if (stackDepth > stackMax)
3738
		stackMax = stackDepth;
3082
		stackMax = stackDepth;
3083
	checkOffset(classFileOffset);
3084
	position++;
3739
	if (index > 255) {
3085
	if (index > 255) {
3740
		// Generate a ldc_w
3086
		// Generate a ldc_w
3741
		try {
3087
		bCodeStream[classFileOffset++] = OPC_ldc_w;
3742
			position++;
3743
			bCodeStream[classFileOffset++] = OPC_ldc_w;
3744
		} catch (IndexOutOfBoundsException e) {
3745
			resizeByteArray(OPC_ldc_w);
3746
		}
3747
		writeUnsignedShort(index);
3088
		writeUnsignedShort(index);
3748
	} else {
3089
	} else {
3749
		// Generate a ldc
3090
		// Generate a ldc
3750
		try {
3091
		bCodeStream[classFileOffset++] = OPC_ldc;
3751
			position++;
3752
			bCodeStream[classFileOffset++] = OPC_ldc;
3753
		} catch (IndexOutOfBoundsException e) {
3754
			resizeByteArray(OPC_ldc);
3755
		}
3756
		writeUnsignedByte(index);
3092
		writeUnsignedByte(index);
3757
	}
3093
	}
3758
}
3094
}
Lines 3769-3791 Link Here
3769
		stackDepth++;
3105
		stackDepth++;
3770
		if (stackDepth > stackMax)
3106
		if (stackDepth > stackMax)
3771
			stackMax = stackDepth;
3107
			stackMax = stackDepth;
3108
		checkOffset(classFileOffset);
3109
		position++;
3772
		if (index > 255) {
3110
		if (index > 255) {
3773
			// Generate a ldc_w
3111
			// Generate a ldc_w
3774
			try {
3112
			bCodeStream[classFileOffset++] = OPC_ldc_w;
3775
				position++;
3776
				bCodeStream[classFileOffset++] = OPC_ldc_w;
3777
			} catch (IndexOutOfBoundsException e) {
3778
				resizeByteArray(OPC_ldc_w);
3779
			}
3780
			writeUnsignedShort(index);
3113
			writeUnsignedShort(index);
3781
		} else {
3114
		} else {
3782
			// Generate a ldc
3115
			// Generate a ldc
3783
			try {
3116
			bCodeStream[classFileOffset++] = OPC_ldc;
3784
				position++;
3785
				bCodeStream[classFileOffset++] = OPC_ldc;
3786
			} catch (IndexOutOfBoundsException e) {
3787
				resizeByteArray(OPC_ldc);
3788
			}
3789
			writeUnsignedByte(index);
3117
			writeUnsignedByte(index);
3790
		}
3118
		}
3791
	} else {
3119
	} else {
Lines 3840-3862 Link Here
3840
		stackDepth++;
3168
		stackDepth++;
3841
		if (stackDepth > stackMax)
3169
		if (stackDepth > stackMax)
3842
			stackMax = stackDepth;
3170
			stackMax = stackDepth;
3171
		checkOffset(classFileOffset);
3172
		position++;
3843
		if (index > 255) {
3173
		if (index > 255) {
3844
			// Generate a ldc_w
3174
			// Generate a ldc_w
3845
			try {
3175
			bCodeStream[classFileOffset++] = OPC_ldc_w;
3846
				position++;
3847
				bCodeStream[classFileOffset++] = OPC_ldc_w;
3848
			} catch (IndexOutOfBoundsException e) {
3849
				resizeByteArray(OPC_ldc_w);
3850
			}
3851
			writeUnsignedShort(index);
3176
			writeUnsignedShort(index);
3852
		} else {
3177
		} else {
3853
			// Generate a ldc
3178
			// Generate a ldc
3854
			try {
3179
			bCodeStream[classFileOffset++] = OPC_ldc;
3855
				position++;
3856
				bCodeStream[classFileOffset++] = OPC_ldc;
3857
			} catch (IndexOutOfBoundsException e) {
3858
				resizeByteArray(OPC_ldc);
3859
			}
3860
			writeUnsignedByte(index);
3180
			writeUnsignedByte(index);
3861
		}
3181
		}
3862
		// write the remaining part
3182
		// write the remaining part
Lines 3897-3919 Link Here
3897
			stackDepth++;
3217
			stackDepth++;
3898
			if (stackDepth > stackMax)
3218
			if (stackDepth > stackMax)
3899
				stackMax = stackDepth;
3219
				stackMax = stackDepth;
3220
			checkOffset(classFileOffset);
3221
			position++;
3900
			if (index > 255) {
3222
			if (index > 255) {
3901
				// Generate a ldc_w
3223
				// Generate a ldc_w
3902
				try {
3224
				bCodeStream[classFileOffset++] = OPC_ldc_w;
3903
					position++;
3904
					bCodeStream[classFileOffset++] = OPC_ldc_w;
3905
				} catch (IndexOutOfBoundsException e) {
3906
					resizeByteArray(OPC_ldc_w);
3907
				}
3908
				writeUnsignedShort(index);
3225
				writeUnsignedShort(index);
3909
			} else {
3226
			} else {
3910
				// Generate a ldc
3227
				// Generate a ldc
3911
				try {
3228
				bCodeStream[classFileOffset++] = OPC_ldc;
3912
					position++;
3913
					bCodeStream[classFileOffset++] = OPC_ldc;
3914
				} catch (IndexOutOfBoundsException e) {
3915
					resizeByteArray(OPC_ldc);
3916
				}
3917
				writeUnsignedByte(index);
3229
				writeUnsignedByte(index);
3918
			}
3230
			}
3919
			// now on the stack it should be a StringBuffer and a string.
3231
			// now on the stack it should be a StringBuffer and a string.
Lines 3931-3942 Link Here
3931
	if (stackDepth > stackMax)
3243
	if (stackDepth > stackMax)
3932
		stackMax = stackDepth;
3244
		stackMax = stackDepth;
3933
	// Generate a ldc2_w
3245
	// Generate a ldc2_w
3934
	try {
3246
	checkOffset(classFileOffset);
3935
		position++;
3247
	position++;
3936
		bCodeStream[classFileOffset++] = OPC_ldc2_w;
3248
	bCodeStream[classFileOffset++] = OPC_ldc2_w;
3937
	} catch (IndexOutOfBoundsException e) {
3938
		resizeByteArray(OPC_ldc2_w);
3939
	}
3940
	writeUnsignedShort(index);
3249
	writeUnsignedShort(index);
3941
}
3250
}
3942
final public void ldc2_w(long constant) {
3251
final public void ldc2_w(long constant) {
Lines 3947-3970 Link Here
3947
	if (stackDepth > stackMax)
3256
	if (stackDepth > stackMax)
3948
		stackMax = stackDepth;
3257
		stackMax = stackDepth;
3949
	// Generate a ldc2_w
3258
	// Generate a ldc2_w
3950
	try {
3259
	checkOffset(classFileOffset);
3951
		position++;
3260
	position++;
3952
		bCodeStream[classFileOffset++] = OPC_ldc2_w;
3261
	bCodeStream[classFileOffset++] = OPC_ldc2_w;
3953
	} catch (IndexOutOfBoundsException e) {
3954
		resizeByteArray(OPC_ldc2_w);
3955
	}
3956
	writeUnsignedShort(index);
3262
	writeUnsignedShort(index);
3957
}
3263
}
3958
final public void ldiv() {
3264
final public void ldiv() {
3959
	if (DEBUG) System.out.println(position + "\t\tldiv"); //$NON-NLS-1$
3265
	if (DEBUG) System.out.println(position + "\t\tldiv"); //$NON-NLS-1$
3960
	countLabels = 0;
3266
	countLabels = 0;
3961
	stackDepth -= 2;
3267
	stackDepth -= 2;
3962
	try {
3268
	checkOffset(classFileOffset);
3963
		position++;
3269
	position++;
3964
		bCodeStream[classFileOffset++] = OPC_ldiv;
3270
	bCodeStream[classFileOffset++] = OPC_ldiv;
3965
	} catch (IndexOutOfBoundsException e) {
3966
		resizeByteArray(OPC_ldiv);
3967
	}
3968
}
3271
}
3969
final public void lload(int iArg) {
3272
final public void lload(int iArg) {
3970
	if (DEBUG) System.out.println(position + "\t\tlload:"+iArg); //$NON-NLS-1$
3273
	if (DEBUG) System.out.println(position + "\t\tlload:"+iArg); //$NON-NLS-1$
Lines 3975-4007 Link Here
3975
	}
3278
	}
3976
	if (stackDepth > stackMax)
3279
	if (stackDepth > stackMax)
3977
		stackMax = stackDepth;
3280
		stackMax = stackDepth;
3281
	checkOffset(classFileOffset + 1);
3282
	position+=2;
3978
	if (iArg > 255) { // Widen
3283
	if (iArg > 255) { // Widen
3979
		try {
3284
		bCodeStream[classFileOffset++] = OPC_wide;
3980
			position++;
3285
		bCodeStream[classFileOffset++] = OPC_lload;
3981
			bCodeStream[classFileOffset++] = OPC_wide;
3982
		} catch (IndexOutOfBoundsException e) {
3983
			resizeByteArray(OPC_wide);
3984
		}
3985
		try {
3986
			position++;
3987
			bCodeStream[classFileOffset++] = OPC_lload;
3988
		} catch (IndexOutOfBoundsException e) {
3989
			resizeByteArray(OPC_lload);
3990
		}
3991
		writeUnsignedShort(iArg);
3286
		writeUnsignedShort(iArg);
3992
	} else {
3287
	} else {
3993
		try {
3288
		bCodeStream[classFileOffset++] = OPC_lload;
3994
			position++;
3289
		bCodeStream[classFileOffset++] = (byte)iArg;
3995
			bCodeStream[classFileOffset++] = OPC_lload;
3996
		} catch (IndexOutOfBoundsException e) {
3997
			resizeByteArray(OPC_lload);
3998
		}
3999
		try {
4000
			position++;
4001
			bCodeStream[classFileOffset++] = (byte) iArg;
4002
		} catch (IndexOutOfBoundsException e) {
4003
			resizeByteArray((byte) iArg);
4004
		}
4005
	}
3290
	}
4006
}
3291
}
4007
final public void lload_0() {
3292
final public void lload_0() {
Lines 4013-4024 Link Here
4013
	}
3298
	}
4014
	if (stackDepth > stackMax)
3299
	if (stackDepth > stackMax)
4015
		stackMax = stackDepth;
3300
		stackMax = stackDepth;
4016
	try {
3301
	checkOffset(classFileOffset);
4017
		position++;
3302
	position++;
4018
		bCodeStream[classFileOffset++] = OPC_lload_0;
3303
	bCodeStream[classFileOffset++] = OPC_lload_0;
4019
	} catch (IndexOutOfBoundsException e) {
4020
		resizeByteArray(OPC_lload_0);
4021
	}
4022
}
3304
}
4023
final public void lload_1() {
3305
final public void lload_1() {
4024
	if (DEBUG) System.out.println(position + "\t\tlload_1"); //$NON-NLS-1$
3306
	if (DEBUG) System.out.println(position + "\t\tlload_1"); //$NON-NLS-1$
Lines 4029-4040 Link Here
4029
	}
3311
	}
4030
	if (stackDepth > stackMax)
3312
	if (stackDepth > stackMax)
4031
		stackMax = stackDepth;
3313
		stackMax = stackDepth;
4032
	try {
3314
	checkOffset(classFileOffset);
4033
		position++;
3315
	position++;
4034
		bCodeStream[classFileOffset++] = OPC_lload_1;
3316
	bCodeStream[classFileOffset++] = OPC_lload_1;
4035
	} catch (IndexOutOfBoundsException e) {
4036
		resizeByteArray(OPC_lload_1);
4037
	}
4038
}
3317
}
4039
final public void lload_2() {
3318
final public void lload_2() {
4040
	if (DEBUG) System.out.println(position + "\t\tlload_2"); //$NON-NLS-1$
3319
	if (DEBUG) System.out.println(position + "\t\tlload_2"); //$NON-NLS-1$
Lines 4045-4056 Link Here
4045
	}
3324
	}
4046
	if (stackDepth > stackMax)
3325
	if (stackDepth > stackMax)
4047
		stackMax = stackDepth;
3326
		stackMax = stackDepth;
4048
	try {
3327
	checkOffset(classFileOffset);
4049
		position++;
3328
	position++;
4050
		bCodeStream[classFileOffset++] = OPC_lload_2;
3329
	bCodeStream[classFileOffset++] = OPC_lload_2;
4051
	} catch (IndexOutOfBoundsException e) {
4052
		resizeByteArray(OPC_lload_2);
4053
	}
4054
}
3330
}
4055
final public void lload_3() {
3331
final public void lload_3() {
4056
	if (DEBUG) System.out.println(position + "\t\tlload_3"); //$NON-NLS-1$
3332
	if (DEBUG) System.out.println(position + "\t\tlload_3"); //$NON-NLS-1$
Lines 4061-4093 Link Here
4061
	}
3337
	}
4062
	if (stackDepth > stackMax)
3338
	if (stackDepth > stackMax)
4063
		stackMax = stackDepth;
3339
		stackMax = stackDepth;
4064
	try {
3340
	checkOffset(classFileOffset);
4065
		position++;
3341
	position++;
4066
		bCodeStream[classFileOffset++] = OPC_lload_3;
3342
	bCodeStream[classFileOffset++] = OPC_lload_3;
4067
	} catch (IndexOutOfBoundsException e) {
4068
		resizeByteArray(OPC_lload_3);
4069
	}
4070
}
3343
}
4071
final public void lmul() {
3344
final public void lmul() {
4072
	if (DEBUG) System.out.println(position + "\t\tlmul"); //$NON-NLS-1$
3345
	if (DEBUG) System.out.println(position + "\t\tlmul"); //$NON-NLS-1$
4073
	countLabels = 0;
3346
	countLabels = 0;
4074
	stackDepth -= 2;
3347
	stackDepth -= 2;
4075
	try {
3348
	checkOffset(classFileOffset);
4076
		position++;
3349
	position++;
4077
		bCodeStream[classFileOffset++] = OPC_lmul;
3350
	bCodeStream[classFileOffset++] = OPC_lmul;
4078
	} catch (IndexOutOfBoundsException e) {
4079
		resizeByteArray(OPC_lmul);
4080
	}
4081
}
3351
}
4082
final public void lneg() {
3352
final public void lneg() {
4083
	if (DEBUG) System.out.println(position + "\t\tlneg"); //$NON-NLS-1$
3353
	if (DEBUG) System.out.println(position + "\t\tlneg"); //$NON-NLS-1$
4084
	countLabels = 0;
3354
	countLabels = 0;
4085
	try {
3355
	checkOffset(classFileOffset);
4086
		position++;
3356
	position++;
4087
		bCodeStream[classFileOffset++] = OPC_lneg;
3357
	bCodeStream[classFileOffset++] = OPC_lneg;
4088
	} catch (IndexOutOfBoundsException e) {
4089
		resizeByteArray(OPC_lneg);
4090
	}
4091
}
3358
}
4092
public final void load(LocalVariableBinding localBinding) {
3359
public final void load(LocalVariableBinding localBinding) {
4093
	countLabels = 0;
3360
	countLabels = 0;
Lines 4383-4401 Link Here
4383
	for (int i = 0; i < length; i++) {
3650
	for (int i = 0; i < length; i++) {
4384
		casesLabel[i].placeInstruction();
3651
		casesLabel[i].placeInstruction();
4385
	}
3652
	}
4386
	try {
3653
	
4387
		position++;
3654
	int lookupCount = (3 - (pos % 4));
4388
		bCodeStream[classFileOffset++] = OPC_lookupswitch;
3655
	checkOffset(classFileOffset + lookupCount);
4389
	} catch (IndexOutOfBoundsException e) {
3656
	position+= lookupCount + 1;
4390
		resizeByteArray(OPC_lookupswitch);
3657
	bCodeStream[classFileOffset++] = OPC_lookupswitch;
4391
	}
3658
	for (int i = lookupCount; i > 0; i--) {
4392
	for (int i = (3 - (pos % 4)); i > 0; i--) {
3659
		bCodeStream[classFileOffset++] = (byte)0;
4393
		try {
4394
			position++;
4395
			bCodeStream[classFileOffset++] = 0;
4396
		} catch (IndexOutOfBoundsException e) {
4397
			resizeByteArray((byte)0);
4398
		}
4399
	}
3660
	}
4400
	defaultLabel.branch();
3661
	defaultLabel.branch();
4401
	writeSignedWord(length);
3662
	writeSignedWord(length);
Lines 4408-4464 Link Here
4408
	if (DEBUG) System.out.println(position + "\t\tlor"); //$NON-NLS-1$
3669
	if (DEBUG) System.out.println(position + "\t\tlor"); //$NON-NLS-1$
4409
	countLabels = 0;
3670
	countLabels = 0;
4410
	stackDepth -= 2;
3671
	stackDepth -= 2;
4411
	try {
3672
	checkOffset(classFileOffset);
4412
		position++;
3673
	position++;
4413
		bCodeStream[classFileOffset++] = OPC_lor;
3674
	bCodeStream[classFileOffset++] = OPC_lor;
4414
	} catch (IndexOutOfBoundsException e) {
4415
		resizeByteArray(OPC_lor);
4416
	}
4417
}
3675
}
4418
final public void lrem() {
3676
final public void lrem() {
4419
	if (DEBUG) System.out.println(position + "\t\tlrem"); //$NON-NLS-1$
3677
	if (DEBUG) System.out.println(position + "\t\tlrem"); //$NON-NLS-1$
4420
	countLabels = 0;
3678
	countLabels = 0;
4421
	stackDepth -= 2;
3679
	stackDepth -= 2;
4422
	try {
3680
	checkOffset(classFileOffset);
4423
		position++;
3681
	position++;
4424
		bCodeStream[classFileOffset++] = OPC_lrem;
3682
	bCodeStream[classFileOffset++] = OPC_lrem;
4425
	} catch (IndexOutOfBoundsException e) {
4426
		resizeByteArray(OPC_lrem);
4427
	}
4428
}
3683
}
4429
final public void lreturn() {
3684
final public void lreturn() {
4430
	if (DEBUG) System.out.println(position + "\t\tlreturn"); //$NON-NLS-1$
3685
	if (DEBUG) System.out.println(position + "\t\tlreturn"); //$NON-NLS-1$
4431
	countLabels = 0;
3686
	countLabels = 0;
4432
	stackDepth -= 2;
3687
	stackDepth -= 2;
4433
	// the stackDepth should be equal to 0 
3688
	// the stackDepth should be equal to 0
4434
	try {
3689
	checkOffset(classFileOffset);
4435
		position++;
3690
	position++;
4436
		bCodeStream[classFileOffset++] = OPC_lreturn;
3691
	bCodeStream[classFileOffset++] = OPC_lreturn;
4437
	} catch (IndexOutOfBoundsException e) {
4438
		resizeByteArray(OPC_lreturn);
4439
	}
4440
}
3692
}
4441
final public void lshl() {
3693
final public void lshl() {
4442
	if (DEBUG) System.out.println(position + "\t\tlshl"); //$NON-NLS-1$
3694
	if (DEBUG) System.out.println(position + "\t\tlshl"); //$NON-NLS-1$
4443
	countLabels = 0;
3695
	countLabels = 0;
4444
	stackDepth--;
3696
	stackDepth--;
4445
	try {
3697
	checkOffset(classFileOffset);
4446
		position++;
3698
	position++;
4447
		bCodeStream[classFileOffset++] = OPC_lshl;
3699
	bCodeStream[classFileOffset++] = OPC_lshl;
4448
	} catch (IndexOutOfBoundsException e) {
4449
		resizeByteArray(OPC_lshl);
4450
	}
4451
}
3700
}
4452
final public void lshr() {
3701
final public void lshr() {
4453
	if (DEBUG) System.out.println(position + "\t\tlshr"); //$NON-NLS-1$
3702
	if (DEBUG) System.out.println(position + "\t\tlshr"); //$NON-NLS-1$
4454
	countLabels = 0;
3703
	countLabels = 0;
4455
	stackDepth--;
3704
	stackDepth--;
4456
	try {
3705
	checkOffset(classFileOffset);
4457
		position++;
3706
	position++;
4458
		bCodeStream[classFileOffset++] = OPC_lshr;
3707
	bCodeStream[classFileOffset++] = OPC_lshr;
4459
	} catch (IndexOutOfBoundsException e) {
4460
		resizeByteArray(OPC_lshr);
4461
	}
4462
}
3708
}
4463
final public void lstore(int iArg) {
3709
final public void lstore(int iArg) {
4464
	if (DEBUG) System.out.println(position + "\t\tlstore:"+iArg); //$NON-NLS-1$
3710
	if (DEBUG) System.out.println(position + "\t\tlstore:"+iArg); //$NON-NLS-1$
Lines 4467-4499 Link Here
4467
	if (maxLocals <= iArg + 1) {
3713
	if (maxLocals <= iArg + 1) {
4468
		maxLocals = iArg + 2;
3714
		maxLocals = iArg + 2;
4469
	}
3715
	}
3716
	checkOffset(classFileOffset + 1);
3717
	position+=2;
4470
	if (iArg > 255) { // Widen
3718
	if (iArg > 255) { // Widen
4471
		try {
3719
		bCodeStream[classFileOffset++] = OPC_wide;
4472
			position++;
3720
		bCodeStream[classFileOffset++] = OPC_lstore;
4473
			bCodeStream[classFileOffset++] = OPC_wide;
4474
		} catch (IndexOutOfBoundsException e) {
4475
			resizeByteArray(OPC_wide);
4476
		}
4477
		try {
4478
			position++;
4479
			bCodeStream[classFileOffset++] = OPC_lstore;
4480
		} catch (IndexOutOfBoundsException e) {
4481
			resizeByteArray(OPC_lstore);
4482
		}
4483
		writeUnsignedShort(iArg);
3721
		writeUnsignedShort(iArg);
4484
	} else {
3722
	} else {
4485
		try {
3723
		bCodeStream[classFileOffset++] = OPC_lstore;
4486
			position++;
3724
		bCodeStream[classFileOffset++] = (byte)iArg;
4487
			bCodeStream[classFileOffset++] = OPC_lstore;
4488
		} catch (IndexOutOfBoundsException e) {
4489
			resizeByteArray(OPC_lstore);
4490
		}
4491
		try {
4492
			position++;
4493
			bCodeStream[classFileOffset++] = (byte) iArg;
4494
		} catch (IndexOutOfBoundsException e) {
4495
			resizeByteArray((byte) iArg);
4496
		}
4497
	}
3725
	}
4498
}
3726
}
4499
final public void lstore_0() {
3727
final public void lstore_0() {
Lines 4503-4514 Link Here
4503
	if (maxLocals < 2) {
3731
	if (maxLocals < 2) {
4504
		maxLocals = 2;
3732
		maxLocals = 2;
4505
	}
3733
	}
4506
	try {
3734
	checkOffset(classFileOffset);
4507
		position++;
3735
	position++;
4508
		bCodeStream[classFileOffset++] = OPC_lstore_0;
3736
	bCodeStream[classFileOffset++] = OPC_lstore_0;
4509
	} catch (IndexOutOfBoundsException e) {
4510
		resizeByteArray(OPC_lstore_0);
4511
	}
4512
}
3737
}
4513
final public void lstore_1() {
3738
final public void lstore_1() {
4514
	if (DEBUG) System.out.println(position + "\t\tlstore_1"); //$NON-NLS-1$
3739
	if (DEBUG) System.out.println(position + "\t\tlstore_1"); //$NON-NLS-1$
Lines 4517-4528 Link Here
4517
	if (maxLocals < 3) {
3742
	if (maxLocals < 3) {
4518
		maxLocals = 3;
3743
		maxLocals = 3;
4519
	}
3744
	}
4520
	try {
3745
	checkOffset(classFileOffset);
4521
		position++;
3746
	position++;
4522
		bCodeStream[classFileOffset++] = OPC_lstore_1;
3747
	bCodeStream[classFileOffset++] = OPC_lstore_1;
4523
	} catch (IndexOutOfBoundsException e) {
4524
		resizeByteArray(OPC_lstore_1);
4525
	}
4526
}
3748
}
4527
final public void lstore_2() {
3749
final public void lstore_2() {
4528
	if (DEBUG) System.out.println(position + "\t\tlstore_2"); //$NON-NLS-1$
3750
	if (DEBUG) System.out.println(position + "\t\tlstore_2"); //$NON-NLS-1$
Lines 4531-4542 Link Here
4531
	if (maxLocals < 4) {
3753
	if (maxLocals < 4) {
4532
		maxLocals = 4;
3754
		maxLocals = 4;
4533
	}
3755
	}
4534
	try {
3756
	checkOffset(classFileOffset);
4535
		position++;
3757
	position++;
4536
		bCodeStream[classFileOffset++] = OPC_lstore_2;
3758
	bCodeStream[classFileOffset++] = OPC_lstore_2;
4537
	} catch (IndexOutOfBoundsException e) {
4538
		resizeByteArray(OPC_lstore_2);
4539
	}
4540
}
3759
}
4541
final public void lstore_3() {
3760
final public void lstore_3() {
4542
	if (DEBUG) System.out.println(position + "\t\tlstore_3"); //$NON-NLS-1$
3761
	if (DEBUG) System.out.println(position + "\t\tlstore_3"); //$NON-NLS-1$
Lines 4545-4622 Link Here
4545
	if (maxLocals < 5) {
3764
	if (maxLocals < 5) {
4546
		maxLocals = 5;
3765
		maxLocals = 5;
4547
	}
3766
	}
4548
	try {
3767
	checkOffset(classFileOffset);
4549
		position++;
3768
	position++;
4550
		bCodeStream[classFileOffset++] = OPC_lstore_3;
3769
	bCodeStream[classFileOffset++] = OPC_lstore_3;
4551
	} catch (IndexOutOfBoundsException e) {
4552
		resizeByteArray(OPC_lstore_3);
4553
	}
4554
}
3770
}
4555
final public void lsub() {
3771
final public void lsub() {
4556
	if (DEBUG) System.out.println(position + "\t\tlsub"); //$NON-NLS-1$
3772
	if (DEBUG) System.out.println(position + "\t\tlsub"); //$NON-NLS-1$
4557
	countLabels = 0;
3773
	countLabels = 0;
4558
	stackDepth -= 2;
3774
	stackDepth -= 2;
4559
	try {
3775
	checkOffset(classFileOffset);
4560
		position++;
3776
	position++;
4561
		bCodeStream[classFileOffset++] = OPC_lsub;
3777
	bCodeStream[classFileOffset++] = OPC_lsub;
4562
	} catch (IndexOutOfBoundsException e) {
4563
		resizeByteArray(OPC_lsub);
4564
	}
4565
}
3778
}
4566
final public void lushr() {
3779
final public void lushr() {
4567
	if (DEBUG) System.out.println(position + "\t\tlushr"); //$NON-NLS-1$
3780
	if (DEBUG) System.out.println(position + "\t\tlushr"); //$NON-NLS-1$
4568
	countLabels = 0;
3781
	countLabels = 0;
4569
	stackDepth--;
3782
	stackDepth--;
4570
	try {
3783
	checkOffset(classFileOffset);
4571
		position++;
3784
	position++;
4572
		bCodeStream[classFileOffset++] = OPC_lushr;
3785
	bCodeStream[classFileOffset++] = OPC_lushr;
4573
	} catch (IndexOutOfBoundsException e) {
4574
		resizeByteArray(OPC_lushr);
4575
	}
4576
}
3786
}
4577
final public void lxor() {
3787
final public void lxor() {
4578
	if (DEBUG) System.out.println(position + "\t\tlxor"); //$NON-NLS-1$
3788
	if (DEBUG) System.out.println(position + "\t\tlxor"); //$NON-NLS-1$
4579
	countLabels = 0;
3789
	countLabels = 0;
4580
	stackDepth -= 2;
3790
	stackDepth -= 2;
4581
	try {
3791
	checkOffset(classFileOffset);
4582
		position++;
3792
	position++;
4583
		bCodeStream[classFileOffset++] = OPC_lxor;
3793
	bCodeStream[classFileOffset++] = OPC_lxor;
4584
	} catch (IndexOutOfBoundsException e) {
4585
		resizeByteArray(OPC_lxor);
4586
	}
4587
}
3794
}
4588
final public void monitorenter() {
3795
final public void monitorenter() {
4589
	if (DEBUG) System.out.println(position + "\t\tmonitorenter"); //$NON-NLS-1$
3796
	if (DEBUG) System.out.println(position + "\t\tmonitorenter"); //$NON-NLS-1$
4590
	countLabels = 0;
3797
	countLabels = 0;
4591
	stackDepth--;
3798
	stackDepth--;
4592
	try {
3799
	checkOffset(classFileOffset);
4593
		position++;
3800
	position++;
4594
		bCodeStream[classFileOffset++] = OPC_monitorenter;
3801
	bCodeStream[classFileOffset++] = OPC_monitorenter;
4595
	} catch (IndexOutOfBoundsException e) {
4596
		resizeByteArray(OPC_monitorenter);
4597
	}
4598
}
3802
}
4599
final public void monitorexit() {
3803
final public void monitorexit() {
4600
	if (DEBUG) System.out.println(position + "\t\tmonitorexit"); //$NON-NLS-1$
3804
	if (DEBUG) System.out.println(position + "\t\tmonitorexit"); //$NON-NLS-1$
4601
	countLabels = 0;
3805
	countLabels = 0;
4602
	stackDepth--;
3806
	stackDepth--;
4603
	try {
3807
	checkOffset(classFileOffset);
4604
		position++;
3808
	position++;
4605
		bCodeStream[classFileOffset++] = OPC_monitorexit;
3809
	bCodeStream[classFileOffset++] = OPC_monitorexit;
4606
	} catch (IndexOutOfBoundsException e) {
4607
		resizeByteArray(OPC_monitorexit);
4608
	}
4609
}
3810
}
4610
final public void multianewarray(TypeBinding typeBinding, int dimensions) {
3811
final public void multianewarray(TypeBinding typeBinding, int dimensions) {
4611
	if (DEBUG) System.out.println(position + "\t\tmultinewarray:"+typeBinding+","+dimensions); //$NON-NLS-1$ //$NON-NLS-2$
3812
	if (DEBUG) System.out.println(position + "\t\tmultinewarray:"+typeBinding+","+dimensions); //$NON-NLS-1$ //$NON-NLS-2$
4612
	countLabels = 0;
3813
	countLabels = 0;
4613
	stackDepth += (1 - dimensions);
3814
	stackDepth += (1 - dimensions);
4614
	try {
3815
	checkOffset(classFileOffset);
4615
		position++;
3816
	position++;
4616
		bCodeStream[classFileOffset++] = OPC_multianewarray;
3817
	bCodeStream[classFileOffset++] = OPC_multianewarray;
4617
	} catch (IndexOutOfBoundsException e) {
4618
		resizeByteArray(OPC_multianewarray);
4619
	}
4620
	writeUnsignedShort(constantPool.literalIndex(typeBinding));
3818
	writeUnsignedShort(constantPool.literalIndex(typeBinding));
4621
	writeUnsignedByte(dimensions);
3819
	writeUnsignedByte(dimensions);
4622
}
3820
}
Lines 4629-4651 Link Here
4629
	stackDepth++;
3827
	stackDepth++;
4630
	if (stackDepth > stackMax)
3828
	if (stackDepth > stackMax)
4631
		stackMax = stackDepth;
3829
		stackMax = stackDepth;
4632
	try {
3830
	checkOffset(classFileOffset);
4633
		position++;
3831
	position++;
4634
		bCodeStream[classFileOffset++] = OPC_new;
3832
	bCodeStream[classFileOffset++] = OPC_new;
4635
	} catch (IndexOutOfBoundsException e) {
4636
		resizeByteArray(OPC_new);
4637
	}
4638
	writeUnsignedShort(constantPool.literalIndex(typeBinding));
3833
	writeUnsignedShort(constantPool.literalIndex(typeBinding));
4639
}
3834
}
4640
final public void newarray(int array_Type) {
3835
final public void newarray(int array_Type) {
4641
	if (DEBUG) System.out.println(position + "\t\tnewarray:"+array_Type); //$NON-NLS-1$
3836
	if (DEBUG) System.out.println(position + "\t\tnewarray:"+array_Type); //$NON-NLS-1$
4642
	countLabels = 0;
3837
	countLabels = 0;
4643
	try {
3838
	checkOffset(classFileOffset);
4644
		position++;
3839
	position++;
4645
		bCodeStream[classFileOffset++] = OPC_newarray;
3840
	bCodeStream[classFileOffset++] = OPC_newarray;
4646
	} catch (IndexOutOfBoundsException e) {
4647
		resizeByteArray(OPC_newarray);
4648
	}
4649
	writeUnsignedByte(array_Type);
3841
	writeUnsignedByte(array_Type);
4650
}
3842
}
4651
public void newArray(Scope scope, ArrayBinding arrayBinding) {
3843
public void newArray(Scope scope, ArrayBinding arrayBinding) {
Lines 4686-4697 Link Here
4686
	stackDepth++;
3878
	stackDepth++;
4687
	if (stackDepth > stackMax)
3879
	if (stackDepth > stackMax)
4688
		stackMax = stackDepth;
3880
		stackMax = stackDepth;
4689
	try {
3881
	checkOffset(classFileOffset);
4690
		position++;
3882
	position++;
4691
		bCodeStream[classFileOffset++] = OPC_new;
3883
	bCodeStream[classFileOffset++] = OPC_new;
4692
	} catch (IndexOutOfBoundsException e) {
4693
		resizeByteArray(OPC_new);
4694
	}
4695
	writeUnsignedShort(constantPool.literalIndexForJavaLangError());
3884
	writeUnsignedShort(constantPool.literalIndexForJavaLangError());
4696
}
3885
}
4697
3886
Lines 4702-4713 Link Here
4702
	stackDepth++;
3891
	stackDepth++;
4703
	if (stackDepth > stackMax)
3892
	if (stackDepth > stackMax)
4704
		stackMax = stackDepth;
3893
		stackMax = stackDepth;
4705
	try {
3894
	checkOffset(classFileOffset);
4706
		position++;
3895
	position++;
4707
		bCodeStream[classFileOffset++] = OPC_new;
3896
	bCodeStream[classFileOffset++] = OPC_new;
4708
	} catch (IndexOutOfBoundsException e) {
4709
		resizeByteArray(OPC_new);
4710
	}
4711
	writeUnsignedShort(constantPool.literalIndexForJavaLangAssertionError());
3897
	writeUnsignedShort(constantPool.literalIndexForJavaLangAssertionError());
4712
}
3898
}
4713
3899
Lines 4718-4729 Link Here
4718
	stackDepth++;
3904
	stackDepth++;
4719
	if (stackDepth > stackMax)
3905
	if (stackDepth > stackMax)
4720
		stackMax = stackDepth;
3906
		stackMax = stackDepth;
4721
	try {
3907
	checkOffset(classFileOffset);
4722
		position++;
3908
	position++;
4723
		bCodeStream[classFileOffset++] = OPC_new;
3909
	bCodeStream[classFileOffset++] = OPC_new;
4724
	} catch (IndexOutOfBoundsException e) {
4725
		resizeByteArray(OPC_new);
4726
	}
4727
	writeUnsignedShort(constantPool.literalIndexForJavaLangNoClassDefFoundError());
3910
	writeUnsignedShort(constantPool.literalIndexForJavaLangNoClassDefFoundError());
4728
}
3911
}
4729
public void newStringBuffer() {
3912
public void newStringBuffer() {
Lines 4733-4744 Link Here
4733
	stackDepth++;
3916
	stackDepth++;
4734
	if (stackDepth > stackMax)
3917
	if (stackDepth > stackMax)
4735
		stackMax = stackDepth;
3918
		stackMax = stackDepth;
4736
	try {
3919
	checkOffset(classFileOffset);
4737
		position++;
3920
	position++;
4738
		bCodeStream[classFileOffset++] = OPC_new;
3921
	bCodeStream[classFileOffset++] = OPC_new;
4739
	} catch (IndexOutOfBoundsException e) {
4740
		resizeByteArray(OPC_new);
4741
	}
4742
	writeUnsignedShort(constantPool.literalIndexForJavaLangStringBuffer());
3922
	writeUnsignedShort(constantPool.literalIndexForJavaLangStringBuffer());
4743
}
3923
}
4744
public void newWrapperFor(int typeID) {
3924
public void newWrapperFor(int typeID) {
Lines 4746-4757 Link Here
4746
	stackDepth++;
3926
	stackDepth++;
4747
	if (stackDepth > stackMax)
3927
	if (stackDepth > stackMax)
4748
		stackMax = stackDepth;
3928
		stackMax = stackDepth;
4749
	try {
3929
	checkOffset(classFileOffset);
4750
		position++;
3930
	position++;
4751
		bCodeStream[classFileOffset++] = OPC_new;
3931
	bCodeStream[classFileOffset++] = OPC_new;
4752
	} catch (IndexOutOfBoundsException e) {
4753
		resizeByteArray(OPC_new);
4754
	}
4755
	switch (typeID) {
3932
	switch (typeID) {
4756
		case T_int : // new: java.lang.Integer
3933
		case T_int : // new: java.lang.Integer
4757
			if (DEBUG) System.out.println(position + "\t\tnew: java.lang.Integer"); //$NON-NLS-1$
3934
			if (DEBUG) System.out.println(position + "\t\tnew: java.lang.Integer"); //$NON-NLS-1$
Lines 4793-4826 Link Here
4793
final public void nop() {
3970
final public void nop() {
4794
	if (DEBUG) System.out.println(position + "\t\tnop"); //$NON-NLS-1$
3971
	if (DEBUG) System.out.println(position + "\t\tnop"); //$NON-NLS-1$
4795
	countLabels = 0;
3972
	countLabels = 0;
4796
	try {
3973
	checkOffset(classFileOffset);
4797
		position++;
3974
	position++;
4798
		bCodeStream[classFileOffset++] = OPC_nop;
3975
	bCodeStream[classFileOffset++] = OPC_nop;
4799
	} catch (IndexOutOfBoundsException e) {
4800
		resizeByteArray(OPC_nop);
4801
	}
4802
}
3976
}
4803
final public void pop() {
3977
final public void pop() {
4804
	if (DEBUG) System.out.println(position + "\t\tpop"); //$NON-NLS-1$
3978
	if (DEBUG) System.out.println(position + "\t\tpop"); //$NON-NLS-1$
4805
	countLabels = 0;
3979
	countLabels = 0;
4806
	stackDepth--;
3980
	stackDepth--;
4807
	try {
3981
	checkOffset(classFileOffset);
4808
		position++;
3982
	position++;
4809
		bCodeStream[classFileOffset++] = OPC_pop;
3983
	bCodeStream[classFileOffset++] = OPC_pop;
4810
	} catch (IndexOutOfBoundsException e) {
4811
		resizeByteArray(OPC_pop);
4812
	}
4813
}
3984
}
4814
final public void pop2() {
3985
final public void pop2() {
4815
	if (DEBUG) System.out.println(position + "\t\tpop2"); //$NON-NLS-1$
3986
	if (DEBUG) System.out.println(position + "\t\tpop2"); //$NON-NLS-1$
4816
	countLabels = 0;
3987
	countLabels = 0;
4817
	stackDepth -= 2;
3988
	stackDepth -= 2;
4818
	try {
3989
	checkOffset(classFileOffset);
4819
		position++;
3990
	position++;
4820
		bCodeStream[classFileOffset++] = OPC_pop2;
3991
	bCodeStream[classFileOffset++] = OPC_pop2;
4821
	} catch (IndexOutOfBoundsException e) {
4822
		resizeByteArray(OPC_pop2);
4823
	}
4824
}
3992
}
4825
final public void putfield(FieldBinding fieldBinding) {
3993
final public void putfield(FieldBinding fieldBinding) {
4826
	if (DEBUG) System.out.println(position + "\t\tputfield:"+fieldBinding); //$NON-NLS-1$
3994
	if (DEBUG) System.out.println(position + "\t\tputfield:"+fieldBinding); //$NON-NLS-1$
Lines 4832-4843 Link Here
4832
		stackDepth -= 2;
4000
		stackDepth -= 2;
4833
	if (stackDepth > stackMax)
4001
	if (stackDepth > stackMax)
4834
		stackMax = stackDepth;
4002
		stackMax = stackDepth;
4835
	try {
4003
	checkOffset(classFileOffset);
4836
		position++;
4004
	position++;
4837
		bCodeStream[classFileOffset++] = OPC_putfield;
4005
	bCodeStream[classFileOffset++] = OPC_putfield;
4838
	} catch (IndexOutOfBoundsException e) {
4839
		resizeByteArray(OPC_putfield);
4840
	}
4841
	writeUnsignedShort(constantPool.literalIndex(fieldBinding));
4006
	writeUnsignedShort(constantPool.literalIndex(fieldBinding));
4842
}
4007
}
4843
final public void putstatic(FieldBinding fieldBinding) {
4008
final public void putstatic(FieldBinding fieldBinding) {
Lines 4850-4861 Link Here
4850
		stackDepth -= 1;
4015
		stackDepth -= 1;
4851
	if (stackDepth > stackMax)
4016
	if (stackDepth > stackMax)
4852
		stackMax = stackDepth;
4017
		stackMax = stackDepth;
4853
	try {
4018
	checkOffset(classFileOffset);
4854
		position++;
4019
	position++;
4855
		bCodeStream[classFileOffset++] = OPC_putstatic;
4020
	bCodeStream[classFileOffset++] = OPC_putstatic;
4856
	} catch (IndexOutOfBoundsException e) {
4857
		resizeByteArray(OPC_putstatic);
4858
	}
4859
	writeUnsignedShort(constantPool.literalIndex(fieldBinding));
4021
	writeUnsignedShort(constantPool.literalIndex(fieldBinding));
4860
}
4022
}
4861
public void record(LocalVariableBinding local) {
4023
public void record(LocalVariableBinding local) {
Lines 5040-5109 Link Here
5040
	resizeByteArray();
4202
	resizeByteArray();
5041
	bCodeStream[classFileOffset - 1] = b;
4203
	bCodeStream[classFileOffset - 1] = b;
5042
}
4204
}
4205
protected final void checkOffset(int offset) {
4206
	if (offset >= bCodeStream.length)
4207
		resizeByteArray();
4208
}
4209
5043
final public void ret(int index) {
4210
final public void ret(int index) {
5044
	if (DEBUG) System.out.println(position + "\t\tret:"+index); //$NON-NLS-1$
4211
	if (DEBUG) System.out.println(position + "\t\tret:"+index); //$NON-NLS-1$
5045
	countLabels = 0;
4212
	countLabels = 0;
4213
	checkOffset(classFileOffset + 1);
4214
	position+=2;
5046
	if (index > 255) { // Widen
4215
	if (index > 255) { // Widen
5047
		try {
4216
		bCodeStream[classFileOffset++] = OPC_wide;
5048
			position++;
4217
		bCodeStream[classFileOffset++] = OPC_ret;
5049
			bCodeStream[classFileOffset++] = OPC_wide;
5050
		} catch (IndexOutOfBoundsException e) {
5051
			resizeByteArray(OPC_wide);
5052
		}
5053
		try {
5054
			position++;
5055
			bCodeStream[classFileOffset++] = OPC_ret;
5056
		} catch (IndexOutOfBoundsException e) {
5057
			resizeByteArray(OPC_ret);
5058
		}
5059
		writeUnsignedShort(index);
4218
		writeUnsignedShort(index);
5060
	} else { // Don't Widen
4219
	} else { // Don't Widen
5061
		try {
4220
		bCodeStream[classFileOffset++] = OPC_ret;
5062
			position++;
4221
		bCodeStream[classFileOffset++] = (byte)index;
5063
			bCodeStream[classFileOffset++] = OPC_ret;
5064
		} catch (IndexOutOfBoundsException e) {
5065
			resizeByteArray(OPC_ret);
5066
		}
5067
		try {
5068
			position++;
5069
			bCodeStream[classFileOffset++] = (byte) index;
5070
		} catch (IndexOutOfBoundsException e) {
5071
			resizeByteArray((byte) index);
5072
		}
5073
	}
4222
	}
5074
}
4223
}
5075
final public void return_() {
4224
final public void return_() {
5076
	if (DEBUG) System.out.println(position + "\t\treturn"); //$NON-NLS-1$
4225
	if (DEBUG) System.out.println(position + "\t\treturn"); //$NON-NLS-1$
5077
	countLabels = 0;
4226
	countLabels = 0;
5078
	// the stackDepth should be equal to 0 
4227
	// the stackDepth should be equal to 0
5079
	try {
4228
	checkOffset(classFileOffset);
5080
		position++;
4229
	position++;
5081
		bCodeStream[classFileOffset++] = OPC_return;
4230
	bCodeStream[classFileOffset++] = OPC_return;
5082
	} catch (IndexOutOfBoundsException e) {
5083
		resizeByteArray(OPC_return);
5084
	}
5085
}
4231
}
5086
final public void saload() {
4232
final public void saload() {
5087
	if (DEBUG) System.out.println(position + "\t\tsaload"); //$NON-NLS-1$
4233
	if (DEBUG) System.out.println(position + "\t\tsaload"); //$NON-NLS-1$
5088
	countLabels = 0;
4234
	countLabels = 0;
5089
	stackDepth--;
4235
	stackDepth--;
5090
	try {
4236
	checkOffset(classFileOffset);
5091
		position++;
4237
	position++;
5092
		bCodeStream[classFileOffset++] = OPC_saload;
4238
	bCodeStream[classFileOffset++] = OPC_saload;
5093
	} catch (IndexOutOfBoundsException e) {
5094
		resizeByteArray(OPC_saload);
5095
	}
5096
}
4239
}
5097
final public void sastore() {
4240
final public void sastore() {
5098
	if (DEBUG) System.out.println(position + "\t\tsastore"); //$NON-NLS-1$
4241
	if (DEBUG) System.out.println(position + "\t\tsastore"); //$NON-NLS-1$
5099
	countLabels = 0;
4242
	countLabels = 0;
5100
	stackDepth -= 3;
4243
	stackDepth -= 3;
5101
	try {
4244
	checkOffset(classFileOffset);
5102
		position++;
4245
	position++;
5103
		bCodeStream[classFileOffset++] = OPC_sastore;
4246
	bCodeStream[classFileOffset++] = OPC_sastore;
5104
	} catch (IndexOutOfBoundsException e) {
5105
		resizeByteArray(OPC_sastore);
5106
	}
5107
}
4247
}
5108
/**
4248
/**
5109
 * @param operatorConstant int
4249
 * @param operatorConstant int
Lines 5232-5243 Link Here
5232
	stackDepth++;
4372
	stackDepth++;
5233
	if (stackDepth > stackMax)
4373
	if (stackDepth > stackMax)
5234
		stackMax = stackDepth;
4374
		stackMax = stackDepth;
5235
	try {
4375
	checkOffset(classFileOffset);
5236
		position++;
4376
	position++;
5237
		bCodeStream[classFileOffset++] = OPC_sipush;
4377
	bCodeStream[classFileOffset++] = OPC_sipush;
5238
	} catch (IndexOutOfBoundsException e) {
5239
		resizeByteArray(OPC_sipush);
5240
	}
5241
	writeSignedShort(s);
4378
	writeSignedShort(s);
5242
}
4379
}
5243
public static final void sort(int[] tab, int lo0, int hi0, int[] result) {
4380
public static final void sort(int[] tab, int lo0, int hi0, int[] result) {
Lines 5532-5543 Link Here
5532
final public void swap() {
4669
final public void swap() {
5533
	if (DEBUG) System.out.println(position + "\t\tswap"); //$NON-NLS-1$
4670
	if (DEBUG) System.out.println(position + "\t\tswap"); //$NON-NLS-1$
5534
	countLabels = 0;
4671
	countLabels = 0;
5535
	try {
4672
	checkOffset(classFileOffset);
5536
		position++;
4673
	position++;
5537
		bCodeStream[classFileOffset++] = OPC_swap;
4674
	bCodeStream[classFileOffset++] = OPC_swap;	
5538
	} catch (IndexOutOfBoundsException e) {
5539
		resizeByteArray(OPC_swap);
5540
	}
5541
}
4675
}
5542
private static final void swap(int a[], int i, int j, int result[]) {
4676
private static final void swap(int a[], int i, int j, int result[]) {
5543
	int T;
4677
	int T;
Lines 5557-5575 Link Here
5557
	defaultLabel.placeInstruction();
4691
	defaultLabel.placeInstruction();
5558
	for (int i = 0; i < length; i++)
4692
	for (int i = 0; i < length; i++)
5559
		casesLabel[i].placeInstruction();
4693
		casesLabel[i].placeInstruction();
5560
	try {
4694
	int switchCount = (3 - (pos % 4));
5561
		position++;
4695
	checkOffset(classFileOffset + switchCount);
5562
		bCodeStream[classFileOffset++] = OPC_tableswitch;
4696
	position+= switchCount + 1;
5563
	} catch (IndexOutOfBoundsException e) {
4697
	bCodeStream[classFileOffset++] = OPC_tableswitch;
5564
		resizeByteArray(OPC_tableswitch);
4698
	for (int i = switchCount; i > 0; i--) {
5565
	}
4699
		bCodeStream[classFileOffset++] = (byte)0;
5566
	for (int i = (3 - (pos % 4)); i > 0; i--) {
5567
		try {
5568
			position++;
5569
			bCodeStream[classFileOffset++] = 0;
5570
		} catch (IndexOutOfBoundsException e) {
5571
			resizeByteArray((byte)0);
5572
		}
5573
	}
4700
	}
5574
	defaultLabel.branch();
4701
	defaultLabel.branch();
5575
	writeSignedWord(low);
4702
	writeSignedWord(low);
Lines 5637-5822 Link Here
5637
final public void wide() {
4764
final public void wide() {
5638
	if (DEBUG) System.out.println(position + "\t\twide"); //$NON-NLS-1$
4765
	if (DEBUG) System.out.println(position + "\t\twide"); //$NON-NLS-1$
5639
	countLabels = 0;
4766
	countLabels = 0;
5640
	try {
4767
	checkOffset(classFileOffset);
5641
		position++;
4768
	position++;
5642
		bCodeStream[classFileOffset++] = OPC_wide;
4769
	bCodeStream[classFileOffset++] = OPC_wide;
5643
	} catch (IndexOutOfBoundsException e) {
5644
		resizeByteArray(OPC_wide);
5645
	}
5646
}
4770
}
5647
public final void writeByte(byte value) {
4771
public final void writeByte(byte value) {
5648
	try {
4772
	checkOffset(classFileOffset);
5649
		position++;
4773
	position++;
5650
		bCodeStream[classFileOffset++] = value;
4774
	bCodeStream[classFileOffset++] = (byte)value;
5651
	} catch (IndexOutOfBoundsException e) {
5652
		resizeByteArray(value);
5653
	}
5654
}
4775
}
5655
public final void writeByteAtPos(int pos, byte value) {
4776
public final void writeByteAtPos(int pos, byte value) {
5656
	try {
4777
	checkOffset(pos);
5657
		bCodeStream[pos] = value;
4778
	bCodeStream[pos] = value; 
5658
	} catch (IndexOutOfBoundsException ex) {
5659
		resizeByteArray();
5660
		bCodeStream[pos] = value;
5661
	}
5662
}
4779
}
5663
/**
4780
/**
5664
 * Write a unsigned 8 bits value into the byte array
4781
 * Write a unsigned 8 bits value into the byte array
5665
 * @param b the signed byte
4782
 * @param b the signed byte
5666
 */
4783
 */
5667
public final void writeSignedByte(int value) {
4784
public final void writeSignedByte(int value) {
5668
	try {
4785
	checkOffset(classFileOffset);
5669
		position++;
4786
	position++;
5670
		bCodeStream[classFileOffset++] = (byte) value;
4787
	bCodeStream[classFileOffset++] = (byte)value;
5671
	} catch (IndexOutOfBoundsException e) {
5672
		resizeByteArray((byte) value);
5673
	}
5674
}
4788
}
5675
/**
4789
/**
5676
 * Write a signed 16 bits value into the byte array
4790
 * Write a signed 16 bits value into the byte array
5677
 * @param value the signed short
4791
 * @param value the signed short
5678
 */
4792
 */
5679
public final void writeSignedShort(int value) {
4793
public final void writeSignedShort(int value) {
5680
	try {
4794
	checkOffset(classFileOffset + 1);
5681
		position++;
4795
	position+=2;
5682
		bCodeStream[classFileOffset++] = (byte) (value >> 8);
4796
	bCodeStream[classFileOffset++] = (byte) (value >> 8);
5683
	} catch (IndexOutOfBoundsException e) {
4797
	bCodeStream[classFileOffset++] = (byte)value;
5684
		resizeByteArray((byte) (value >> 8));
5685
	}
5686
	try {
5687
		position++;
5688
		bCodeStream[classFileOffset++] = (byte) value;
5689
	} catch (IndexOutOfBoundsException e) {
5690
		resizeByteArray((byte) value);
5691
	}
5692
}
4798
}
5693
public final void writeSignedShort(int pos, int value) {
4799
public final void writeSignedShort(int pos, int value) {
5694
	int currentOffset = startingClassFileOffset + pos;
4800
	int currentOffset = startingClassFileOffset + pos;
5695
	try {
4801
	checkOffset(currentOffset + 1);
5696
		bCodeStream[currentOffset] = (byte) (value >> 8);
4802
	bCodeStream[currentOffset++] = (byte) (value >> 8);
5697
	} catch (IndexOutOfBoundsException e) {
4803
	bCodeStream[currentOffset] = (byte) value;
5698
		resizeByteArray();
5699
		bCodeStream[currentOffset] = (byte) (value >> 8);
5700
	}
5701
	try {
5702
		bCodeStream[currentOffset + 1] = (byte) value;
5703
	} catch (IndexOutOfBoundsException e) {
5704
		resizeByteArray();
5705
		bCodeStream[currentOffset + 1] = (byte) value;
5706
	}
5707
}
4804
}
5708
public final void writeSignedWord(int value) {
4805
public final void writeSignedWord(int value) {
5709
	try {
4806
	checkOffset(classFileOffset + 3);
5710
		position++;
4807
	position+=4;
5711
		bCodeStream[classFileOffset++] = (byte) ((value & 0xFF000000) >> 24);
4808
	bCodeStream[classFileOffset++] = (byte) ((value & 0xFF000000) >> 24);
5712
	} catch (IndexOutOfBoundsException e) {
4809
	bCodeStream[classFileOffset++] = (byte) ((value & 0xFF0000) >> 16);
5713
		resizeByteArray((byte) ((value & 0xFF000000) >> 24));
4810
	bCodeStream[classFileOffset++] = (byte) ((value & 0xFF00) >> 8);
5714
	}
4811
	bCodeStream[classFileOffset++] = (byte) (value & 0xFF);
5715
	try {
5716
		position++;
5717
		bCodeStream[classFileOffset++] = (byte) ((value & 0xFF0000) >> 16);
5718
	} catch (IndexOutOfBoundsException e) {
5719
		resizeByteArray((byte) ((value & 0xFF0000) >> 16));
5720
	}
5721
	try {
5722
		position++;
5723
		bCodeStream[classFileOffset++] = (byte) ((value & 0xFF00) >> 8);
5724
	} catch (IndexOutOfBoundsException e) {
5725
		resizeByteArray((byte) ((value & 0xFF00) >> 8));
5726
	}
5727
	try {
5728
		position++;
5729
		bCodeStream[classFileOffset++] = (byte) (value & 0xFF);
5730
	} catch (IndexOutOfBoundsException e) {
5731
		resizeByteArray((byte) (value & 0xFF));
5732
	}
5733
}
4812
}
5734
public final void writeSignedWord(int pos, int value) {
4813
public final void writeSignedWord(int pos, int value) {
5735
	int currentOffset = startingClassFileOffset + pos;
4814
	int currentOffset = startingClassFileOffset + pos;
5736
	try {
4815
	checkOffset(currentOffset + 3);
5737
		bCodeStream[currentOffset++] = (byte) ((value & 0xFF000000) >> 24);
4816
	bCodeStream[currentOffset++] = (byte) ((value & 0xFF000000) >> 24);
5738
	} catch (IndexOutOfBoundsException e) {
4817
	bCodeStream[currentOffset++] = (byte) ((value & 0xFF0000) >> 16);
5739
		resizeByteArray();
4818
	bCodeStream[currentOffset++] = (byte) ((value & 0xFF00) >> 8);
5740
		bCodeStream[currentOffset-1] = (byte) ((value & 0xFF000000) >> 24);
4819
	bCodeStream[currentOffset] = (byte) (value & 0xFF);
5741
	}
5742
	try {
5743
		bCodeStream[currentOffset++] = (byte) ((value & 0xFF0000) >> 16);
5744
	} catch (IndexOutOfBoundsException e) {
5745
		resizeByteArray();
5746
		bCodeStream[currentOffset-1] = (byte) ((value & 0xFF0000) >> 16);
5747
	}
5748
	try {
5749
		bCodeStream[currentOffset++] = (byte) ((value & 0xFF00) >> 8);
5750
	} catch (IndexOutOfBoundsException e) {
5751
		resizeByteArray();
5752
		bCodeStream[currentOffset-1] = (byte) ((value & 0xFF00) >> 8);
5753
	}
5754
	try {
5755
		bCodeStream[currentOffset++] = (byte) (value & 0xFF);
5756
	} catch (IndexOutOfBoundsException e) {
5757
		resizeByteArray();
5758
		bCodeStream[currentOffset-1] = (byte) (value & 0xFF);
5759
	}
5760
}
4820
}
5761
/**
4821
/**
5762
 * Write a unsigned 8 bits value into the byte array
4822
 * Write a unsigned 8 bits value into the byte array
5763
 * @param b the unsigned byte
4823
 * @param b the unsigned byte
5764
 */
4824
 */
5765
public final void writeUnsignedByte(int value) {
4825
public final void writeUnsignedByte(int value) {
5766
	try {
4826
	checkOffset(classFileOffset);
5767
		position++;
4827
	position++;
5768
		bCodeStream[classFileOffset++] = (byte) value;
4828
	bCodeStream[classFileOffset++] = (byte) value;
5769
	} catch (IndexOutOfBoundsException e) {
5770
		resizeByteArray((byte) value);
5771
	}
5772
}
4829
}
5773
/**
4830
/**
5774
 * Write a unsigned 16 bits value into the byte array
4831
 * Write a unsigned 16 bits value into the byte array
5775
 * @param b the unsigned short
4832
 * @param b the unsigned short
5776
 */
4833
 */
5777
public final void writeUnsignedShort(int value) {
4834
public final void writeUnsignedShort(int value) {
5778
	try {
4835
	checkOffset(classFileOffset + 1);
5779
		position++;
4836
	position+=2;
5780
		bCodeStream[classFileOffset++] = (byte) (value >>> 8);
4837
	bCodeStream[classFileOffset++] = (byte) (value >>> 8);
5781
	} catch (IndexOutOfBoundsException e) {
4838
	bCodeStream[classFileOffset++] = (byte) value;
5782
		resizeByteArray((byte) (value >>> 8));
5783
	}
5784
	try {
5785
		position++;
5786
		bCodeStream[classFileOffset++] = (byte) value;
5787
	} catch (IndexOutOfBoundsException e) {
5788
		resizeByteArray((byte) value);
5789
	}
5790
}
4839
}
5791
/**
4840
/**
5792
 * Write a unsigned 32 bits value into the byte array
4841
 * Write a unsigned 32 bits value into the byte array
5793
 * @param value the unsigned word
4842
 * @param value the unsigned word
5794
 */
4843
 */
5795
public final void writeUnsignedWord(int value) {
4844
public final void writeUnsignedWord(int value) {
5796
	try {
4845
	checkOffset(classFileOffset + 3);
5797
		position++;
4846
	position+=4;
5798
		bCodeStream[classFileOffset++] = (byte) (value >>> 24);
4847
	bCodeStream[classFileOffset++] = ((byte) (value >>> 24));
5799
	} catch (IndexOutOfBoundsException e) {
4848
	bCodeStream[classFileOffset++] = ((byte) (value >>> 16));
5800
		resizeByteArray((byte) (value >>> 24));
4849
	bCodeStream[classFileOffset++] = ((byte) (value >>> 8));
5801
	}
4850
	bCodeStream[classFileOffset++] = ((byte) value);
5802
	try {
5803
		position++;
5804
		bCodeStream[classFileOffset++] = (byte) (value >>> 16);
5805
	} catch (IndexOutOfBoundsException e) {
5806
		resizeByteArray((byte) (value >>> 16));
5807
	}
5808
	try {
5809
		position++;
5810
		bCodeStream[classFileOffset++] = (byte) (value >>> 8);
5811
	} catch (IndexOutOfBoundsException e) {
5812
		resizeByteArray((byte) (value >>> 8));
5813
	}
5814
	try {
5815
		position++;
5816
		bCodeStream[classFileOffset++] = (byte) value;
5817
	} catch (IndexOutOfBoundsException e) {
5818
		resizeByteArray((byte) value);
5819
	}
5820
}
4851
}
5821
4852
5822
4853
Lines 5830-5841 Link Here
5830
 */
4861
 */
5831
public void generateWideRevertedConditionalBranch(byte revertedOpcode, Label wideTarget) {
4862
public void generateWideRevertedConditionalBranch(byte revertedOpcode, Label wideTarget) {
5832
		Label intermediate = new Label(this);
4863
		Label intermediate = new Label(this);
5833
		try {
4864
		checkOffset(classFileOffset);
5834
			position++;
4865
		position++;
5835
			bCodeStream[classFileOffset++] = revertedOpcode;
4866
		bCodeStream[classFileOffset++] = revertedOpcode;
5836
		} catch (IndexOutOfBoundsException e) {
5837
			resizeByteArray(revertedOpcode);
5838
		}
5839
		intermediate.branch();
4867
		intermediate.branch();
5840
		this.goto_w(wideTarget);
4868
		this.goto_w(wideTarget);
5841
		intermediate.place();
4869
		intermediate.place();
(-)compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java (-49 / +17 lines)
Lines 766-779 Link Here
766
		writeU1(DoubleTag);
766
		writeU1(DoubleTag);
767
		// Then add the 8 bytes representing the double
767
		// Then add the 8 bytes representing the double
768
		long temp = java.lang.Double.doubleToLongBits(key);
768
		long temp = java.lang.Double.doubleToLongBits(key);
769
		checkOffset(currentOffset + 7);
769
		for (int i = 0; i < 8; i++) {
770
		for (int i = 0; i < 8; i++) {
770
			try {
771
			poolContent[currentOffset++] =(byte) (temp >>> (56 - (i << 3)));
771
				poolContent[currentOffset++] = (byte) (temp >>> (56 - (i << 3)));
772
			} catch (IndexOutOfBoundsException e) { //currentOffset has been ++ already (see the -1)
773
				int length = poolContent.length;
774
				System.arraycopy(poolContent, 0, (poolContent = new byte[(length << 1) + CONSTANTPOOL_INITIAL_SIZE]), 0, length);
775
				poolContent[currentOffset - 1] = (byte) (temp >>> (56 - (i << 3)));
776
			}
777
		}
772
		}
778
	}
773
	}
779
	return index;
774
	return index;
Lines 804-817 Link Here
804
		writeU1(FloatTag);
799
		writeU1(FloatTag);
805
		// Then add the 4 bytes representing the float
800
		// Then add the 4 bytes representing the float
806
		int temp = java.lang.Float.floatToIntBits(key);
801
		int temp = java.lang.Float.floatToIntBits(key);
802
		checkOffset(currentOffset + 3);
807
		for (int i = 0; i < 4; i++) {
803
		for (int i = 0; i < 4; i++) {
808
			try {
804
			poolContent[currentOffset++] = (byte) (temp >>> (24 - i * 8));
809
				poolContent[currentOffset++] = (byte) (temp >>> (24 - i * 8));
810
			} catch (IndexOutOfBoundsException e) { //currentOffset has been ++ already (see the -1)
811
				int length = poolContent.length;
812
				System.arraycopy(poolContent, 0, (poolContent = new byte[length * 2 + CONSTANTPOOL_INITIAL_SIZE]), 0, length);
813
				poolContent[currentOffset - 1] = (byte) (temp >>> (24 - i * 8));
814
			}
815
		}
805
		}
816
	}
806
	}
817
	return index;
807
	return index;
Lines 841-854 Link Here
841
		// First add the tag
831
		// First add the tag
842
		writeU1(IntegerTag);
832
		writeU1(IntegerTag);
843
		// Then add the 4 bytes representing the int
833
		// Then add the 4 bytes representing the int
834
		checkOffset(currentOffset + 3);
844
		for (int i = 0; i < 4; i++) {
835
		for (int i = 0; i < 4; i++) {
845
			try {
836
			poolContent[currentOffset++] = (byte) (key >>> (24 - i * 8));
846
				poolContent[currentOffset++] = (byte) (key >>> (24 - i * 8));
847
			} catch (IndexOutOfBoundsException e) { //currentOffset has been ++ already (see the -1)
848
				int length = poolContent.length;
849
				System.arraycopy(poolContent, 0, (poolContent = new byte[length * 2 + CONSTANTPOOL_INITIAL_SIZE]), 0, length);
850
				poolContent[currentOffset - 1] = (byte) (key >>> (24 - i * 8));
851
			}
852
		}
837
		}
853
	}
838
	}
854
	return index;
839
	return index;
Lines 881-894 Link Here
881
		// First add the tag
866
		// First add the tag
882
		writeU1(LongTag);
867
		writeU1(LongTag);
883
		// Then add the 8 bytes representing the long
868
		// Then add the 8 bytes representing the long
869
		checkOffset(currentOffset + 7);
884
		for (int i = 0; i < 8; i++) {
870
		for (int i = 0; i < 8; i++) {
885
			try {
871
			poolContent[currentOffset++] = (byte) (key >>> (56 - (i << 3)));
886
				poolContent[currentOffset++] = (byte) (key >>> (56 - (i << 3)));
887
			} catch (IndexOutOfBoundsException e) { //currentOffset has been ++ already (see the -1)
888
				int length = poolContent.length;
889
				System.arraycopy(poolContent, 0, (poolContent = new byte[(length << 1) + CONSTANTPOOL_INITIAL_SIZE]), 0, length);
890
				poolContent[currentOffset - 1] = (byte) (key >>> (56 - (i << 3)));
891
			}
892
		}
872
		}
893
	}
873
	}
894
	return index;
874
	return index;
Lines 3090-3103 Link Here
3090
 * @param <CODE>int</CODE> The value to write into the byte array
3070
 * @param <CODE>int</CODE> The value to write into the byte array
3091
 */
3071
 */
3092
protected final void writeU1(int value) {
3072
protected final void writeU1(int value) {
3093
	try {
3073
	checkOffset(currentOffset);
3094
		poolContent[currentOffset++] = (byte) value;
3074
	poolContent[currentOffset++] = (byte)value;
3095
	} catch (IndexOutOfBoundsException e) {
3096
		//currentOffset has been ++ already (see the -1)
3097
		int length = poolContent.length;
3098
		System.arraycopy(poolContent, 0, (poolContent = new byte[length + CONSTANTPOOL_GROW_SIZE]), 0, length);
3099
		poolContent[currentOffset - 1] = (byte) value;
3100
	}
3101
}
3075
}
3102
/**
3076
/**
3103
 * Write a unsigned byte into the byte array
3077
 * Write a unsigned byte into the byte array
Lines 3106-3126 Link Here
3106
 */
3080
 */
3107
protected final void writeU2(int value) {
3081
protected final void writeU2(int value) {
3108
	//first byte
3082
	//first byte
3109
	try {
3083
	checkOffset(currentOffset + 1);
3110
		poolContent[currentOffset++] = (byte) (value >> 8);
3084
	poolContent[currentOffset++] = (byte) (value >> 8);
3111
	} catch (IndexOutOfBoundsException e) {
3085
	poolContent[currentOffset++] = (byte) value;
3112
		 //currentOffset has been ++ already (see the -1)
3086
}
3113
		int length = poolContent.length;
3087
3114
		System.arraycopy(poolContent, 0, (poolContent = new byte[length + CONSTANTPOOL_GROW_SIZE]), 0, length);
3088
protected final void checkOffset(int offset) {
3115
		poolContent[currentOffset - 1] = (byte) (value >> 8);
3089
	if (offset >= poolContent.length) {
3116
	}
3117
	try {
3118
		poolContent[currentOffset++] = (byte) value;
3119
	} catch (IndexOutOfBoundsException e) {
3120
		 //currentOffset has been ++ already (see the -1)
3121
		int length = poolContent.length;
3090
		int length = poolContent.length;
3122
		System.arraycopy(poolContent, 0, (poolContent = new byte[length + CONSTANTPOOL_GROW_SIZE]), 0, length);
3091
		System.arraycopy(poolContent, 0, (poolContent = new byte[length + CONSTANTPOOL_GROW_SIZE]), 0, length);
3123
		poolContent[currentOffset - 1] = (byte) value;
3124
	}
3092
	}
3125
}
3093
}
3126
}
3094
}
(-)compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java (-29 / +16 lines)
Lines 5841-5900 Link Here
5841
	/*add a new obj on top of the ast stack
5841
	/*add a new obj on top of the ast stack
5842
	astPtr points on the top*/
5842
	astPtr points on the top*/
5843
5843
5844
	try {
5844
	this.astPtr++;
5845
		this.astStack[++this.astPtr] = node;
5845
	if (this.astPtr == this.astStack.length) {
5846
	} catch (IndexOutOfBoundsException e) {
5847
		int oldStackLength = this.astStack.length;
5846
		int oldStackLength = this.astStack.length;
5848
		ASTNode[] oldStack = this.astStack;
5847
		ASTNode[] oldStack = this.astStack;
5849
		this.astStack = new ASTNode[oldStackLength + AstStackIncrement];
5848
		this.astStack = new ASTNode[oldStackLength + AstStackIncrement];
5850
		System.arraycopy(oldStack, 0, this.astStack, 0, oldStackLength);
5849
		System.arraycopy(oldStack, 0, this.astStack, 0, oldStackLength);
5851
		this.astPtr = oldStackLength;
5850
		this.astPtr = oldStackLength;
5852
		this.astStack[this.astPtr] = node;
5853
	}
5851
	}
5852
	this.astStack[this.astPtr] = node;
5854
5853
5855
	try {
5854
	this.astLengthPtr++;
5856
		this.astLengthStack[++this.astLengthPtr] = 1;
5855
	if (this.astLengthPtr == this.astLengthStack.length) {
5857
	} catch (IndexOutOfBoundsException e) {
5858
		int oldStackLength = this.astLengthStack.length;
5856
		int oldStackLength = this.astLengthStack.length;
5859
		int[] oldPos = this.astLengthStack;
5857
		int[] oldPos = this.astLengthStack;
5860
		this.astLengthStack = new int[oldStackLength + AstStackIncrement];
5858
		this.astLengthStack = new int[oldStackLength + AstStackIncrement];
5861
		System.arraycopy(oldPos, 0, this.astLengthStack, 0, oldStackLength);
5859
		System.arraycopy(oldPos, 0, this.astLengthStack, 0, oldStackLength);
5862
		this.astLengthStack[this.astLengthPtr] = 1;
5863
	}
5860
	}
5861
	this.astLengthStack[this.astLengthPtr] = 1;
5864
}
5862
}
5865
protected void pushOnExpressionStack(Expression expr) {
5863
protected void pushOnExpressionStack(Expression expr) {
5866
5864
	this.expressionPtr++;
5867
	try {
5865
	if (this.expressionPtr == this.expressionStack.length) {
5868
		this.expressionStack[++this.expressionPtr] = expr;
5869
	} catch (IndexOutOfBoundsException e) {
5870
		//this.expressionPtr is correct 
5871
		int oldStackLength = this.expressionStack.length;
5866
		int oldStackLength = this.expressionStack.length;
5872
		Expression[] oldStack = this.expressionStack;
5867
		Expression[] oldStack = this.expressionStack;
5873
		this.expressionStack = new Expression[oldStackLength + ExpressionStackIncrement];
5868
		this.expressionStack = new Expression[oldStackLength + ExpressionStackIncrement];
5874
		System.arraycopy(oldStack, 0, this.expressionStack, 0, oldStackLength);
5869
		System.arraycopy(oldStack, 0, this.expressionStack, 0, oldStackLength);		
5875
		this.expressionStack[this.expressionPtr] = expr;
5876
	}
5870
	}
5877
5871
5878
	try {
5872
	this.expressionStack[this.expressionPtr] = expr;
5879
		this.expressionLengthStack[++this.expressionLengthPtr] = 1;
5873
	pushOnExpressionStackLengthStack(1);
5880
	} catch (IndexOutOfBoundsException e) {
5881
		int oldStackLength = this.expressionLengthStack.length;
5882
		int[] oldPos = this.expressionLengthStack;
5883
		this.expressionLengthStack = new int[oldStackLength + ExpressionStackIncrement];
5884
		System.arraycopy(oldPos, 0, this.expressionLengthStack, 0, oldStackLength);
5885
		this.expressionLengthStack[this.expressionLengthPtr] = 1;
5886
	}
5887
}
5874
}
5888
protected void pushOnExpressionStackLengthStack(int pos) {
5875
protected void pushOnExpressionStackLengthStack(int pos) {
5889
	try {
5876
	this.expressionLengthPtr++;
5890
		this.expressionLengthStack[++this.expressionLengthPtr] = pos;
5877
	if (this.expressionLengthPtr == this.expressionLengthStack.length) {
5891
	} catch (IndexOutOfBoundsException e) {
5892
		int oldStackLength = this.expressionLengthStack.length;
5878
		int oldStackLength = this.expressionLengthStack.length;
5893
		int[] oldPos = this.expressionLengthStack;
5879
		int[] oldPos = this.expressionLengthStack;
5894
		this.expressionLengthStack = new int[oldStackLength + StackIncrement];
5880
		this.expressionLengthStack = new int[oldStackLength + StackIncrement];
5895
		System.arraycopy(oldPos, 0, this.expressionLengthStack, 0, oldStackLength);
5881
		System.arraycopy(oldPos, 0, this.expressionLengthStack, 0, oldStackLength);		
5896
		this.expressionLengthStack[this.expressionLengthPtr] = pos;
5897
	}
5882
	}
5883
	
5884
	this.expressionLengthStack[this.expressionLengthPtr] = pos;
5898
}
5885
}
5899
protected void pushOnIntStack(int pos) {
5886
protected void pushOnIntStack(int pos) {
5900
5887
(-)compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java (-14 / +11 lines)
Lines 2235-2250 Link Here
2235
		//TODO (olivier) david - why the following line was "if ((this.linePtr > 0) && (this.lineEnds[this.linePtr] >= separatorPos)) return;" ?
2235
		//TODO (olivier) david - why the following line was "if ((this.linePtr > 0) && (this.lineEnds[this.linePtr] >= separatorPos)) return;" ?
2236
		if ((this.linePtr >= 0) && (this.lineEnds[this.linePtr] >= separatorPos)) return;
2236
		if ((this.linePtr >= 0) && (this.lineEnds[this.linePtr] >= separatorPos)) return;
2237
		//System.out.println("CR-" + separatorPos);
2237
		//System.out.println("CR-" + separatorPos);
2238
		try {
2238
		this.linePtr++;
2239
			this.lineEnds[++this.linePtr] = separatorPos;
2239
		if (this.linePtr == this.lineEnds.length) {
2240
		} catch (IndexOutOfBoundsException e) {
2241
			//this.linePtr value is correct
2240
			//this.linePtr value is correct
2242
			int oldLength = this.lineEnds.length;
2241
			int oldLength = this.lineEnds.length;
2243
			int[] old = this.lineEnds;
2242
			int[] old = this.lineEnds;
2244
			this.lineEnds = new int[oldLength + INCREMENT];
2243
			this.lineEnds = new int[oldLength + INCREMENT];
2245
			System.arraycopy(old, 0, this.lineEnds, 0, oldLength);
2244
			System.arraycopy(old, 0, this.lineEnds, 0, oldLength);
2246
			this.lineEnds[this.linePtr] = separatorPos;
2247
		}
2245
		}
2246
		this.lineEnds[this.linePtr] = separatorPos;
2247
2248
		// look-ahead for merged cr+lf
2248
		// look-ahead for merged cr+lf
2249
		try {
2249
		try {
2250
			if (this.source[this.currentPosition] == '\n') {
2250
			if (this.source[this.currentPosition] == '\n') {
Lines 2268-2284 Link Here
2268
				int separatorPos = this.currentPosition - 1;
2268
				int separatorPos = this.currentPosition - 1;
2269
				//TODO (olivier) david - why the following line was "if ((this.linePtr > 0) && (this.lineEnds[this.linePtr] >= separatorPos)) return;" ?
2269
				//TODO (olivier) david - why the following line was "if ((this.linePtr > 0) && (this.lineEnds[this.linePtr] >= separatorPos)) return;" ?
2270
				if ((this.linePtr >= 0) && (this.lineEnds[this.linePtr] >= separatorPos)) return;
2270
				if ((this.linePtr >= 0) && (this.lineEnds[this.linePtr] >= separatorPos)) return;
2271
				// System.out.println("LF-" + separatorPos);							
2271
				// System.out.println("LF-" + separatorPos);
2272
				try {
2272
				++this.linePtr;
2273
					this.lineEnds[++this.linePtr] = separatorPos;
2273
				if (this.linePtr == this.lineEnds.length) {
2274
				} catch (IndexOutOfBoundsException e) {
2275
					//this.linePtr value is correct
2276
					int oldLength = this.lineEnds.length;
2274
					int oldLength = this.lineEnds.length;
2277
					int[] old = this.lineEnds;
2275
					int[] old = this.lineEnds;
2278
					this.lineEnds = new int[oldLength + INCREMENT];
2276
					this.lineEnds = new int[oldLength + INCREMENT];
2279
					System.arraycopy(old, 0, this.lineEnds, 0, oldLength);
2277
					System.arraycopy(old, 0, this.lineEnds, 0, oldLength);
2280
					this.lineEnds[this.linePtr] = separatorPos;
2281
				}
2278
				}
2279
				this.lineEnds[this.linePtr] = separatorPos;
2282
			}
2280
			}
2283
			this.wasAcr = false;
2281
			this.wasAcr = false;
2284
		}
2282
		}
Lines 2317-2335 Link Here
2317
	}
2315
	}
2318
2316
2319
	// a new comment is recorded
2317
	// a new comment is recorded
2320
	try {
2318
	this.commentPtr++;
2321
		this.commentStops[++this.commentPtr] = stopPosition;
2319
	if (this.commentPtr == this.commentStops.length) {
2322
	} catch (IndexOutOfBoundsException e) {
2323
		int oldStackLength = this.commentStops.length;
2320
		int oldStackLength = this.commentStops.length;
2324
		int[] oldStack = this.commentStops;
2321
		int[] oldStack = this.commentStops;
2325
		this.commentStops = new int[oldStackLength + 30];
2322
		this.commentStops = new int[oldStackLength + 30];
2326
		System.arraycopy(oldStack, 0, this.commentStops, 0, oldStackLength);
2323
		System.arraycopy(oldStack, 0, this.commentStops, 0, oldStackLength);
2327
		this.commentStops[this.commentPtr] = stopPosition;
2328
		//grows the positions buffers too
2324
		//grows the positions buffers too
2329
		int[] old = this.commentStarts;
2325
		int[] old = this.commentStarts;
2330
		this.commentStarts = new int[oldStackLength + 30];
2326
		this.commentStarts = new int[oldStackLength + 30];
2331
		System.arraycopy(old, 0, this.commentStarts, 0, oldStackLength);
2327
		System.arraycopy(old, 0, this.commentStarts, 0, oldStackLength);
2332
	}
2328
	}
2329
	this.commentStops[this.commentPtr] = stopPosition;
2333
2330
2334
	//the buffer is of a correct size here
2331
	//the buffer is of a correct size here
2335
	this.commentStarts[this.commentPtr] = this.startPosition;
2332
	this.commentStarts[this.commentPtr] = this.startPosition;
(-)model/org/eclipse/jdt/internal/core/util/CommentRecorderParser.java (-7 / +4 lines)
Lines 234-255 Link Here
234
			int scannerStart = this.scanner.commentStarts[i]<0 ? -this.scanner.commentStarts[i] : this.scanner.commentStarts[i];
234
			int scannerStart = this.scanner.commentStarts[i]<0 ? -this.scanner.commentStarts[i] : this.scanner.commentStarts[i];
235
			int commentStart = this.commentPtr == -1 ? -1 : (this.commentStarts[this.commentPtr]<0 ? -this.commentStarts[this.commentPtr] : this.commentStarts[this.commentPtr]);
235
			int commentStart = this.commentPtr == -1 ? -1 : (this.commentStarts[this.commentPtr]<0 ? -this.commentStarts[this.commentPtr] : this.commentStarts[this.commentPtr]);
236
			if (commentStart == -1 ||  scannerStart > commentStart) {
236
			if (commentStart == -1 ||  scannerStart > commentStart) {
237
				try {
237
				this.commentPtr++;
238
					this.commentPtr++;
238
				if (commentPtr == this.commentStarts.length) {
239
					this.commentStarts[this.commentPtr] = this.scanner.commentStarts[i];
240
					this.commentStops[this.commentPtr] = this.scanner.commentStops[i];
241
				} catch (IndexOutOfBoundsException e) {
242
					// this.commentPtr is still correct 
239
					// this.commentPtr is still correct 
243
					int oldStackLength = this.commentStarts.length;
240
					int oldStackLength = this.commentStarts.length;
244
					int oldCommentStarts[] = this.commentStarts;
241
					int oldCommentStarts[] = this.commentStarts;
245
					this.commentStarts = new int[oldStackLength + CommentIncrement];
242
					this.commentStarts = new int[oldStackLength + CommentIncrement];
246
					System.arraycopy(oldCommentStarts, 0, this.commentStarts, 0, oldStackLength);
243
					System.arraycopy(oldCommentStarts, 0, this.commentStarts, 0, oldStackLength);
247
					this.commentStarts[this.commentPtr] = this.scanner.commentStarts[i];
248
					int oldCommentStops[] = this.commentStops;
244
					int oldCommentStops[] = this.commentStops;
249
					this.commentStops = new int[oldStackLength + CommentIncrement];
245
					this.commentStops = new int[oldStackLength + CommentIncrement];
250
					System.arraycopy(oldCommentStops, 0, this.commentStops, 0, oldStackLength);
246
					System.arraycopy(oldCommentStops, 0, this.commentStops, 0, oldStackLength);
251
					this.commentStops[this.commentPtr] = this.scanner.commentStops[i];
252
				}
247
				}
248
				this.commentStarts[this.commentPtr] = this.scanner.commentStarts[i];
249
				this.commentStops[this.commentPtr] = this.scanner.commentStops[i];
253
			}
250
			}
254
		}
251
		}
255
	}
252
	}

Return to bug 61075