View | Details | Raw Unified | Return to bug 180471 | Differences between
and this patch

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/ForStatement.java (-23 / +32 lines)
Lines 248-265 Link Here
248
		actionLabel.tagBits |= BranchLabel.USED;
248
		actionLabel.tagBits |= BranchLabel.USED;
249
		BranchLabel conditionLabel = new BranchLabel(codeStream);
249
		BranchLabel conditionLabel = new BranchLabel(codeStream);
250
		breakLabel.initialize(codeStream);
250
		breakLabel.initialize(codeStream);
251
		if (this.continueLabel != null) {
251
		if (this.continueLabel == null) {
252
			conditionLabel.place();
253
			if ((condition != null) && (condition.constant == Constant.NotAConstant)) {
254
				condition.generateOptimizedBoolean(scope, codeStream, null, breakLabel, true);
255
			}
256
		} else {
252
			this.continueLabel.initialize(codeStream);
257
			this.continueLabel.initialize(codeStream);
258
			// jump over the actionBlock
259
			if ((condition != null)
260
				&& (condition.constant == Constant.NotAConstant)
261
				&& !((action == null || action.isEmptyBlock()) && (increments == null))) {
262
				conditionLabel.tagBits |= BranchLabel.USED;
263
				int jumpPC = codeStream.position;
264
				codeStream.goto_(conditionLabel);
265
				codeStream.recordPositionsFrom(jumpPC, condition.sourceStart);
266
			}
253
		}
267
		}
254
		// jump over the actionBlock
268
255
		if ((condition != null)
256
			&& (condition.constant == Constant.NotAConstant)
257
			&& !((action == null || action.isEmptyBlock()) && (increments == null))) {
258
			conditionLabel.tagBits |= BranchLabel.USED;
259
			int jumpPC = codeStream.position;
260
			codeStream.goto_(conditionLabel);
261
			codeStream.recordPositionsFrom(jumpPC, condition.sourceStart);
262
		}
263
		// generate the loop action
269
		// generate the loop action
264
		if (action != null) {
270
		if (action != null) {
265
			// Required to fix 1PR0XVS: LFRE:WINNT - Compiler: variable table for method appears incorrect
271
			// Required to fix 1PR0XVS: LFRE:WINNT - Compiler: variable table for method appears incorrect
Lines 287-309 Link Here
287
					increments[i].generateCode(scope, codeStream);
293
					increments[i].generateCode(scope, codeStream);
288
				}
294
				}
289
			}
295
			}
290
		}
296
			// May loose some local variable initializations : affecting the local variable attributes
291
297
			if (preCondInitStateIndex != -1) {
292
		// May loose some local variable initializations : affecting the local variable attributes
298
				codeStream.removeNotDefinitelyAssignedVariables(currentScope, preCondInitStateIndex);
293
		if (preCondInitStateIndex != -1) {
299
			}		
294
			codeStream.removeNotDefinitelyAssignedVariables(currentScope, preCondInitStateIndex);
300
			// generate the condition
295
		}
301
			conditionLabel.place();
296
302
			if ((condition != null) && (condition.constant == Constant.NotAConstant)) {
297
		// generate the condition
303
				condition.generateOptimizedBoolean(scope, codeStream, actionLabel, null, true);
298
		conditionLabel.place();
304
			} else {
299
		if ((condition != null) && (condition.constant == Constant.NotAConstant)) {
300
			condition.generateOptimizedBoolean(scope, codeStream, actionLabel, null, true);
301
		} else {
302
			if (continueLabel != null) {
303
				codeStream.goto_(actionLabel);
305
				codeStream.goto_(actionLabel);
304
			}
306
			}
307
			
308
		} else {
309
			// May loose some local variable initializations : affecting the local variable attributes
310
			if (preCondInitStateIndex != -1) {
311
				codeStream.removeNotDefinitelyAssignedVariables(currentScope, preCondInitStateIndex);
312
			}
305
		}
313
		}
306
314
315
307
		// May loose some local variable initializations : affecting the local variable attributes
316
		// May loose some local variable initializations : affecting the local variable attributes
308
		if (neededScope) {
317
		if (neededScope) {
309
			codeStream.exitUserScope(scope);
318
			codeStream.exitUserScope(scope);
(-)compiler/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java (-32 / +54 lines)
Lines 134-141 Link Here
134
				if (!hasEmptyAction
134
				if (!hasEmptyAction
135
						|| this.elementVariable.binding.resolvedPosition != -1) {				
135
						|| this.elementVariable.binding.resolvedPosition != -1) {				
136
					this.collectionVariable.useFlag = LocalVariableBinding.USED;
136
					this.collectionVariable.useFlag = LocalVariableBinding.USED;
137
					this.indexVariable.useFlag = LocalVariableBinding.USED;
137
					if (this.continueLabel != null) {
138
					this.maxVariable.useFlag = LocalVariableBinding.USED;
138
						this.indexVariable.useFlag = LocalVariableBinding.USED;
139
						this.maxVariable.useFlag = LocalVariableBinding.USED;
140
					}
139
				}
141
				}
140
				break;
142
				break;
141
			case RAW_ITERABLE :
143
			case RAW_ITERABLE :
Lines 192-203 Link Here
192
		switch(this.kind) {
194
		switch(this.kind) {
193
			case ARRAY :
195
			case ARRAY :
194
				collection.generateCode(scope, codeStream, true);
196
				collection.generateCode(scope, codeStream, true);
195
				codeStream.store(this.collectionVariable, false);
197
				codeStream.store(this.collectionVariable, true); 
196
				codeStream.iconst_0();
198
				if (this.continueLabel != null) {
197
				codeStream.store(this.indexVariable, false);
199
					// int length = (collectionVariable = [collection]).length;
198
				codeStream.load(this.collectionVariable);
200
					codeStream.arraylength();
199
				codeStream.arraylength();
201
					codeStream.store(this.maxVariable, false);
200
				codeStream.store(this.maxVariable, false);
202
					codeStream.iconst_0();
203
					codeStream.store(this.indexVariable, false);
204
				} else {
205
					// leave collectionVariable on execution stack (will be consumed when swapping condition further down)
206
				}
201
				break;
207
				break;
202
			case RAW_ITERABLE :
208
			case RAW_ITERABLE :
203
			case GENERIC_ITERABLE :
209
			case GENERIC_ITERABLE :
Lines 225-236 Link Here
225
		BranchLabel conditionLabel = new BranchLabel(codeStream);
231
		BranchLabel conditionLabel = new BranchLabel(codeStream);
226
		conditionLabel.tagBits |= BranchLabel.USED;
232
		conditionLabel.tagBits |= BranchLabel.USED;
227
		breakLabel.initialize(codeStream);
233
		breakLabel.initialize(codeStream);
228
		if (this.continueLabel != null) {
234
		if (this.continueLabel == null) {
235
			// generate the condition (swapped for optimizing)
236
			conditionLabel.place();
237
			int conditionPC = codeStream.position;
238
			switch(this.kind) {
239
				case ARRAY :
240
					// inline the arraylength call
241
					// collectionVariable is already on execution stack
242
					codeStream.arraylength();					
243
					codeStream.ifeq(breakLabel);
244
					break;
245
				case RAW_ITERABLE :
246
				case GENERIC_ITERABLE :
247
					codeStream.load(this.indexVariable);
248
					codeStream.invokeJavaUtilIteratorHasNext();
249
					codeStream.ifeq(breakLabel);
250
					break;
251
			}
252
			codeStream.recordPositionsFrom(conditionPC, this.elementVariable.sourceStart);			
253
		} else {
229
			this.continueLabel.initialize(codeStream);
254
			this.continueLabel.initialize(codeStream);
230
			this.continueLabel.tagBits |= BranchLabel.USED;
255
			this.continueLabel.tagBits |= BranchLabel.USED;
256
			// jump over the actionBlock
257
			codeStream.goto_(conditionLabel);
231
		}
258
		}
232
		// jump over the actionBlock
233
		codeStream.goto_(conditionLabel);
234
259
235
		// generate the loop action
260
		// generate the loop action
236
		actionLabel.place();
261
		actionLabel.place();
Lines 240-246 Link Here
240
			case ARRAY :
265
			case ARRAY :
241
				if (this.elementVariable.binding.resolvedPosition != -1) {
266
				if (this.elementVariable.binding.resolvedPosition != -1) {
242
					codeStream.load(this.collectionVariable);
267
					codeStream.load(this.collectionVariable);
243
					codeStream.load(this.indexVariable);
268
					if (this.continueLabel == null) {
269
						codeStream.iconst_0(); // no continue, thus simply hardcode offset 0
270
					} else {
271
						codeStream.load(this.indexVariable);
272
					}
244
					codeStream.arrayAt(this.collectionElementType.id);
273
					codeStream.arrayAt(this.collectionElementType.id);
245
					if (this.elementVariableImplicitWidening != -1) {
274
					if (this.elementVariableImplicitWidening != -1) {
246
						codeStream.generateImplicitConversion(this.elementVariableImplicitWidening);
275
						codeStream.generateImplicitConversion(this.elementVariableImplicitWidening);
Lines 294-326 Link Here
294
			// generate the increments for next iteration
323
			// generate the increments for next iteration
295
			switch(this.kind) {
324
			switch(this.kind) {
296
				case ARRAY :
325
				case ARRAY :
297
					if (hasEmptyAction && this.elementVariable.binding.resolvedPosition == -1) break;
326
					if (!hasEmptyAction || this.elementVariable.binding.resolvedPosition >= 0) {
298
					codeStream.iinc(this.indexVariable.resolvedPosition, 1);
327
						codeStream.iinc(this.indexVariable.resolvedPosition, 1);
328
					}
329
					// generate the condition
330
					conditionLabel.place();
331
					codeStream.load(this.indexVariable);
332
					codeStream.load(this.maxVariable);
333
					codeStream.if_icmplt(actionLabel);
299
					break;
334
					break;
300
				case RAW_ITERABLE :
335
				case RAW_ITERABLE :
301
				case GENERIC_ITERABLE :
336
				case GENERIC_ITERABLE :
337
					// generate the condition
338
					conditionLabel.place();
339
					codeStream.load(this.indexVariable);
340
					codeStream.invokeJavaUtilIteratorHasNext();
341
					codeStream.ifne(actionLabel);
302
					break;
342
					break;
303
			}
343
			}
304
			codeStream.recordPositionsFrom(continuationPC, this.elementVariable.sourceStart);
344
			codeStream.recordPositionsFrom(continuationPC, this.elementVariable.sourceStart);
305
		}
345
		}
306
		// generate the condition
307
		conditionLabel.place();
308
		int conditionPC = codeStream.position;
309
		switch(this.kind) {
310
			case ARRAY :
311
				codeStream.load(this.indexVariable);
312
				codeStream.load(this.maxVariable);
313
				codeStream.if_icmplt(actionLabel);
314
				break;
315
			case RAW_ITERABLE :
316
			case GENERIC_ITERABLE :
317
				codeStream.load(this.indexVariable);
318
				codeStream.invokeJavaUtilIteratorHasNext();
319
				codeStream.ifne(actionLabel);
320
				break;
321
		}
322
		codeStream.recordPositionsFrom(conditionPC, this.elementVariable.sourceStart);
323
324
		codeStream.exitUserScope(scope);
346
		codeStream.exitUserScope(scope);
325
		if (mergedInitStateIndex != -1) {
347
		if (mergedInitStateIndex != -1) {
326
			codeStream.removeNotDefinitelyAssignedVariables(currentScope, mergedInitStateIndex);
348
			codeStream.removeNotDefinitelyAssignedVariables(currentScope, mergedInitStateIndex);
(-)buildnotes_jdt-core.html (-1 / +3 lines)
Lines 52-58 Link Here
52
<h2>What's new in this drop</h2>
52
<h2>What's new in this drop</h2>
53
53
54
<h3>Problem Reports Fixed</h3>
54
<h3>Problem Reports Fixed</h3>
55
<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=176320">176320</a>
55
<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=180471">180471</a>
56
[compiler] Unoptimal code generation for for-loops when no continuation point
57
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=176320">176320</a>
56
Non linear progress in open type dialog
58
Non linear progress in open type dialog
57
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=176472">176472</a>
59
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=176472">176472</a>
58
[compiler][null] extraneous error in case of a labeled while(true) statement
60
[compiler][null] extraneous error in case of a labeled while(true) statement
(-)src/org/eclipse/jdt/core/tests/compiler/regression/ForeachStatementTest.java (-302 / +459 lines)
Lines 257-294 Link Here
257
		"    46  iastore\n" + 
257
		"    46  iastore\n" + 
258
		"    47  astore_2 [tab]\n" + 
258
		"    47  astore_2 [tab]\n" + 
259
		"    48  aload_2 [tab]\n" + 
259
		"    48  aload_2 [tab]\n" + 
260
		"    49  astore 6\n" + 
260
		"    49  dup\n" + 
261
		"    51  iconst_0\n" + 
261
		"    50  astore 6\n" + 
262
		"    52  istore 4\n" + 
262
		"    52  arraylength\n" + 
263
		"    54  aload 6\n" + 
263
		"    53  istore 5\n" + 
264
		"    56  arraylength\n" + 
264
		"    55  iconst_0\n" + 
265
		"    57  istore 5\n" + 
265
		"    56  istore 4\n" + 
266
		"    59  goto 73\n" + 
266
		"    58  goto 72\n" + 
267
		"    62  aload 6\n" + 
267
		"    61  aload 6\n" + 
268
		"    64  iload 4\n" + 
268
		"    63  iload 4\n" + 
269
		"    66  iaload\n" + 
269
		"    65  iaload\n" + 
270
		"    67  istore_3 [e]\n" + 
270
		"    66  istore_3 [e]\n" + 
271
		"    68  iload_3 [e]\n" + 
271
		"    67  iload_3 [e]\n" + 
272
		"    69  istore_1\n" + 
272
		"    68  istore_1\n" + 
273
		"    70  iinc 4 1\n" + 
273
		"    69  iinc 4 1\n" + 
274
		"    73  iload 4\n" + 
274
		"    72  iload 4\n" + 
275
		"    75  iload 5\n" + 
275
		"    74  iload 5\n" + 
276
		"    77  if_icmplt 62\n" + 
276
		"    76  if_icmplt 61\n" + 
277
		"    80  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
277
		"    79  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
278
		"    83  ldc <String \"SUCCESS\"> [22]\n" + 
278
		"    82  ldc <String \"SUCCESS\"> [22]\n" + 
279
		"    85  invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n" + 
279
		"    84  invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n" + 
280
		"    88  return\n" + 
280
		"    87  return\n" + 
281
		"      Line numbers:\n" + 
281
		"      Line numbers:\n" + 
282
		"        [pc: 0, line: 5]\n" + 
282
		"        [pc: 0, line: 5]\n" + 
283
		"        [pc: 48, line: 6]\n" + 
283
		"        [pc: 48, line: 6]\n" + 
284
		"        [pc: 68, line: 7]\n" + 
284
		"        [pc: 67, line: 7]\n" + 
285
		"        [pc: 70, line: 6]\n" + 
285
		"        [pc: 69, line: 6]\n" + 
286
		"        [pc: 80, line: 9]\n" + 
286
		"        [pc: 79, line: 9]\n" + 
287
		"        [pc: 88, line: 10]\n" + 
287
		"        [pc: 87, line: 10]\n" + 
288
		"      Local variable table:\n" + 
288
		"      Local variable table:\n" + 
289
		"        [pc: 0, pc: 89] local: args index: 0 type: java.lang.String[]\n" + 
289
		"        [pc: 0, pc: 88] local: args index: 0 type: java.lang.String[]\n" + 
290
		"        [pc: 48, pc: 89] local: tab index: 2 type: int[]\n" + 
290
		"        [pc: 48, pc: 88] local: tab index: 2 type: int[]\n" + 
291
		"        [pc: 68, pc: 70] local: e index: 3 type: int\n";
291
		"        [pc: 67, pc: 69] local: e index: 3 type: int\n";
292
	
292
	
293
	try {
293
	try {
294
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
294
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
Lines 595-623 Link Here
595
		"     6  iastore\n" + 
595
		"     6  iastore\n" + 
596
		"     7  astore_1 [tab]\n" + 
596
		"     7  astore_1 [tab]\n" + 
597
		"     8  aload_1 [tab]\n" + 
597
		"     8  aload_1 [tab]\n" + 
598
		"     9  astore 4\n" + 
598
		"     9  dup\n" + 
599
		"    11  iconst_0\n" + 
599
		"    10  astore 4\n" + 
600
		"    12  istore_2\n" + 
600
		"    12  arraylength\n" + 
601
		"    13  aload 4\n" + 
601
		"    13  istore_3\n" + 
602
		"    15  arraylength\n" + 
602
		"    14  iconst_0\n" + 
603
		"    16  istore_3\n" + 
603
		"    15  istore_2\n" + 
604
		"    17  goto 23\n" + 
604
		"    16  goto 22\n" + 
605
		"    20  iinc 2 1\n" + 
605
		"    19  iinc 2 1\n" + 
606
		"    23  iload_2\n" + 
606
		"    22  iload_2\n" + 
607
		"    24  iload_3\n" + 
607
		"    23  iload_3\n" + 
608
		"    25  if_icmplt 20\n" + 
608
		"    24  if_icmplt 19\n" + 
609
		"    28  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
609
		"    27  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
610
		"    31  ldc <String \"SUCCESS\"> [22]\n" + 
610
		"    30  ldc <String \"SUCCESS\"> [22]\n" + 
611
		"    33  invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n" + 
611
		"    32  invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n" + 
612
		"    36  return\n" + 
612
		"    35  return\n" + 
613
		"      Line numbers:\n" + 
613
		"      Line numbers:\n" + 
614
		"        [pc: 0, line: 4]\n" + 
614
		"        [pc: 0, line: 4]\n" + 
615
		"        [pc: 8, line: 5]\n" + 
615
		"        [pc: 8, line: 5]\n" + 
616
		"        [pc: 28, line: 7]\n" + 
616
		"        [pc: 27, line: 7]\n" + 
617
		"        [pc: 36, line: 8]\n" + 
617
		"        [pc: 35, line: 8]\n" + 
618
		"      Local variable table:\n" + 
618
		"      Local variable table:\n" + 
619
		"        [pc: 0, pc: 37] local: args index: 0 type: java.lang.String[]\n" + 
619
		"        [pc: 0, pc: 36] local: args index: 0 type: java.lang.String[]\n" + 
620
		"        [pc: 8, pc: 37] local: tab index: 1 type: int[]\n";
620
		"        [pc: 8, pc: 36] local: tab index: 1 type: int[]\n";
621
	
621
	
622
	try {
622
	try {
623
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
623
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
Lines 677-683 Link Here
677
		"1");
677
		"1");
678
	String expectedOutput =
678
	String expectedOutput =
679
		"  // Method descriptor #15 ([Ljava/lang/String;)V\n" + 
679
		"  // Method descriptor #15 ([Ljava/lang/String;)V\n" + 
680
		"  // Stack: 4, Locals: 6\n" + 
680
		"  // Stack: 4, Locals: 4\n" + 
681
		"  public static void main(java.lang.String[] args);\n" + 
681
		"  public static void main(java.lang.String[] args);\n" + 
682
		"     0  iconst_1\n" + 
682
		"     0  iconst_1\n" + 
683
		"     1  newarray int [10]\n" + 
683
		"     1  newarray int [10]\n" + 
Lines 687-722 Link Here
687
		"     6  iastore\n" + 
687
		"     6  iastore\n" + 
688
		"     7  astore_1 [tab]\n" + 
688
		"     7  astore_1 [tab]\n" + 
689
		"     8  aload_1 [tab]\n" + 
689
		"     8  aload_1 [tab]\n" + 
690
		"     9  astore 5\n" + 
690
		"     9  dup\n" + 
691
		"    11  iconst_0\n" + 
691
		"    10  astore_3\n" + 
692
		"    12  istore_3\n" + 
692
		"    11  arraylength\n" + 
693
		"    13  aload 5\n" + 
693
		"    12  ifeq 26\n" + 
694
		"    15  arraylength\n" + 
694
		"    15  aload_3\n" + 
695
		"    16  istore 4\n" + 
695
		"    16  iconst_0\n" + 
696
		"    18  goto 36\n" + 
696
		"    17  iaload\n" + 
697
		"    21  aload 5\n" + 
697
		"    18  istore_2 [e]\n" + 
698
		"    23  iload_3\n" + 
698
		"    19  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
699
		"    24  iaload\n" + 
699
		"    22  iload_2 [e]\n" + 
700
		"    25  istore_2 [e]\n" + 
700
		"    23  invokevirtual java.io.PrintStream.println(int) : void [22]\n" + 
701
		"    26  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
701
		"    26  return\n" + 
702
		"    29  iload_2 [e]\n" + 
703
		"    30  invokevirtual java.io.PrintStream.println(int) : void [22]\n" + 
704
		"    33  goto 42\n" + 
705
		"    36  iload_3\n" + 
706
		"    37  iload 4\n" + 
707
		"    39  if_icmplt 21\n" + 
708
		"    42  return\n" + 
709
		"      Line numbers:\n" + 
702
		"      Line numbers:\n" + 
710
		"        [pc: 0, line: 4]\n" + 
703
		"        [pc: 0, line: 4]\n" + 
711
		"        [pc: 8, line: 5]\n" + 
704
		"        [pc: 8, line: 5]\n" + 
712
		"        [pc: 26, line: 6]\n" + 
705
		"        [pc: 19, line: 6]\n" + 
713
		"        [pc: 33, line: 7]\n" + 
706
		"        [pc: 26, line: 9]\n" + 
714
		"        [pc: 36, line: 5]\n" + 
707
		"      Local variable table:\n" + 
715
		"        [pc: 42, line: 9]\n" + 
708
		"        [pc: 0, pc: 27] local: args index: 0 type: java.lang.String[]\n" + 
716
		"      Local variable table:\n" + 
709
		"        [pc: 8, pc: 27] local: tab index: 1 type: int[]\n" + 
717
		"        [pc: 0, pc: 43] local: args index: 0 type: java.lang.String[]\n" + 
710
		"        [pc: 19, pc: 26] local: e index: 2 type: int\n";
718
		"        [pc: 8, pc: 43] local: tab index: 1 type: int[]\n" + 
719
		"        [pc: 26, pc: 36] local: e index: 2 type: int\n";
720
	
711
	
721
	try {
712
	try {
722
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
713
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
Lines 760-766 Link Here
760
	
751
	
761
	String expectedOutput =
752
	String expectedOutput =
762
		"  // Method descriptor #15 ([Ljava/lang/String;)V\n" + 
753
		"  // Method descriptor #15 ([Ljava/lang/String;)V\n" + 
763
		"  // Stack: 2, Locals: 5\n" + 
754
		"  // Stack: 2, Locals: 3\n" + 
764
		"  public static void main(java.lang.String[] args);\n" + 
755
		"  public static void main(java.lang.String[] args);\n" + 
765
		"     0  iconst_0\n" + 
756
		"     0  iconst_0\n" + 
766
		"     1  newarray int [10]\n" + 
757
		"     1  newarray int [10]\n" + 
Lines 769-804 Link Here
769
		"     7  ldc <String \"SUC\"> [22]\n" + 
760
		"     7  ldc <String \"SUC\"> [22]\n" + 
770
		"     9  invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + 
761
		"     9  invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + 
771
		"    12  aload_1 [tab]\n" + 
762
		"    12  aload_1 [tab]\n" + 
772
		"    13  astore 4\n" + 
763
		"    13  dup\n" + 
773
		"    15  iconst_0\n" + 
764
		"    14  astore_2\n" + 
774
		"    16  istore_2\n" + 
765
		"    15  arraylength\n" + 
775
		"    17  aload 4\n" + 
766
		"    16  ifeq 27\n" + 
776
		"    19  arraylength\n" + 
767
		"    19  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
777
		"    20  istore_3\n" + 
768
		"    22  ldc <String \"1x\"> [30]\n" + 
778
		"    21  goto 35\n" + 
769
		"    24  invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + 
779
		"    24  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
770
		"    27  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
780
		"    27  ldc <String \"1x\"> [30]\n" + 
771
		"    30  ldc <String \"CESS\"> [32]\n" + 
781
		"    29  invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + 
772
		"    32  invokevirtual java.io.PrintStream.println(java.lang.String) : void [34]\n" + 
782
		"    32  goto 40\n" + 
773
		"    35  return\n" + 
783
		"    35  iload_2\n" + 
784
		"    36  iload_3\n" + 
785
		"    37  if_icmplt 24\n" + 
786
		"    40  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
787
		"    43  ldc <String \"CESS\"> [32]\n" + 
788
		"    45  invokevirtual java.io.PrintStream.println(java.lang.String) : void [34]\n" + 
789
		"    48  return\n" + 
790
		"      Line numbers:\n" + 
774
		"      Line numbers:\n" + 
791
		"        [pc: 0, line: 4]\n" + 
775
		"        [pc: 0, line: 4]\n" + 
792
		"        [pc: 4, line: 5]\n" + 
776
		"        [pc: 4, line: 5]\n" + 
793
		"        [pc: 12, line: 6]\n" + 
777
		"        [pc: 12, line: 6]\n" + 
794
		"        [pc: 24, line: 7]\n" + 
778
		"        [pc: 19, line: 7]\n" + 
795
		"        [pc: 32, line: 8]\n" + 
779
		"        [pc: 27, line: 10]\n" + 
796
		"        [pc: 35, line: 6]\n" + 
780
		"        [pc: 35, line: 11]\n" + 
797
		"        [pc: 40, line: 10]\n" + 
798
		"        [pc: 48, line: 11]\n" + 
799
		"      Local variable table:\n" + 
781
		"      Local variable table:\n" + 
800
		"        [pc: 0, pc: 49] local: args index: 0 type: java.lang.String[]\n" + 
782
		"        [pc: 0, pc: 36] local: args index: 0 type: java.lang.String[]\n" + 
801
		"        [pc: 4, pc: 49] local: tab index: 1 type: int[]\n";
783
		"        [pc: 4, pc: 36] local: tab index: 1 type: int[]\n";
802
	
784
	
803
	try {
785
	try {
804
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
786
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
Lines 851-885 Link Here
851
		"     7  ldc <String \"SUC\"> [22]\n" + 
833
		"     7  ldc <String \"SUC\"> [22]\n" + 
852
		"     9  invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + 
834
		"     9  invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + 
853
		"    12  aload_1 [tab]\n" + 
835
		"    12  aload_1 [tab]\n" + 
854
		"    13  astore 4\n" + 
836
		"    13  dup\n" + 
855
		"    15  iconst_0\n" + 
837
		"    14  astore 4\n" + 
856
		"    16  istore_2\n" + 
838
		"    16  arraylength\n" + 
857
		"    17  aload 4\n" + 
839
		"    17  istore_3\n" + 
858
		"    19  arraylength\n" + 
840
		"    18  iconst_0\n" + 
859
		"    20  istore_3\n" + 
841
		"    19  istore_2\n" + 
860
		"    21  goto 35\n" + 
842
		"    20  goto 34\n" + 
861
		"    24  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
843
		"    23  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
862
		"    27  ldc <String \"1x\"> [30]\n" + 
844
		"    26  ldc <String \"1x\"> [30]\n" + 
863
		"    29  invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + 
845
		"    28  invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + 
864
		"    32  iinc 2 1\n" + 
846
		"    31  iinc 2 1\n" + 
865
		"    35  iload_2\n" + 
847
		"    34  iload_2\n" + 
866
		"    36  iload_3\n" + 
848
		"    35  iload_3\n" + 
867
		"    37  if_icmplt 24\n" + 
849
		"    36  if_icmplt 23\n" + 
868
		"    40  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
850
		"    39  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
869
		"    43  ldc <String \"CESS\"> [32]\n" + 
851
		"    42  ldc <String \"CESS\"> [32]\n" + 
870
		"    45  invokevirtual java.io.PrintStream.println(java.lang.String) : void [34]\n" + 
852
		"    44  invokevirtual java.io.PrintStream.println(java.lang.String) : void [34]\n" + 
871
		"    48  return\n" + 
853
		"    47  return\n" + 
872
		"      Line numbers:\n" + 
854
		"      Line numbers:\n" + 
873
		"        [pc: 0, line: 4]\n" + 
855
		"        [pc: 0, line: 4]\n" + 
874
		"        [pc: 4, line: 5]\n" + 
856
		"        [pc: 4, line: 5]\n" + 
875
		"        [pc: 12, line: 6]\n" + 
857
		"        [pc: 12, line: 6]\n" + 
876
		"        [pc: 24, line: 7]\n" + 
858
		"        [pc: 23, line: 7]\n" + 
877
		"        [pc: 32, line: 6]\n" + 
859
		"        [pc: 31, line: 6]\n" + 
878
		"        [pc: 40, line: 10]\n" + 
860
		"        [pc: 39, line: 10]\n" + 
879
		"        [pc: 48, line: 11]\n" + 
861
		"        [pc: 47, line: 11]\n" + 
880
		"      Local variable table:\n" + 
862
		"      Local variable table:\n" + 
881
		"        [pc: 0, pc: 49] local: args index: 0 type: java.lang.String[]\n" + 
863
		"        [pc: 0, pc: 48] local: args index: 0 type: java.lang.String[]\n" + 
882
		"        [pc: 4, pc: 49] local: tab index: 1 type: int[]\n";
864
		"        [pc: 4, pc: 48] local: tab index: 1 type: int[]\n";
883
	
865
	
884
	try {
866
	try {
885
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
867
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
Lines 976-1034 Link Here
976
		"     51  istore_3 [i]\n" + 
958
		"     51  istore_3 [i]\n" + 
977
		"     52  iinc 3 1 [i]\n" + 
959
		"     52  iinc 3 1 [i]\n" + 
978
		"     55  aload_1 [tab]\n" + 
960
		"     55  aload_1 [tab]\n" + 
979
		"     56  astore 7\n" + 
961
		"     56  dup\n" + 
980
		"     58  iconst_0\n" + 
962
		"     57  astore 7\n" + 
981
		"     59  istore 5\n" + 
963
		"     59  arraylength\n" + 
982
		"     61  aload 7\n" + 
964
		"     60  istore 6\n" + 
983
		"     63  arraylength\n" + 
965
		"     62  iconst_0\n" + 
984
		"     64  istore 6\n" + 
966
		"     63  istore 5\n" + 
985
		"     66  goto 101\n" + 
967
		"     65  goto 100\n" + 
986
		"     69  aload 7\n" + 
968
		"     68  aload 7\n" + 
987
		"     71  iload 5\n" + 
969
		"     70  iload 5\n" + 
988
		"     73  iaload\n" + 
970
		"     72  iaload\n" + 
989
		"     74  istore 4 [e]\n" + 
971
		"     73  istore 4 [e]\n" + 
990
		"     76  iload_2 [sum]\n" + 
972
		"     75  iload_2 [sum]\n" + 
991
		"     77  iload 4 [e]\n" + 
973
		"     76  iload 4 [e]\n" + 
992
		"     79  iadd\n" + 
974
		"     78  iadd\n" + 
993
		"     80  istore_2 [sum]\n" + 
975
		"     79  istore_2 [sum]\n" + 
994
		"     81  iload_3 [i]\n" + 
976
		"     80  iload_3 [i]\n" + 
995
		"     82  iconst_3\n" + 
977
		"     81  iconst_3\n" + 
996
		"     83  if_icmpne 89\n" + 
978
		"     82  if_icmpne 88\n" + 
997
		"     86  goto 111\n" + 
979
		"     85  goto 110\n" + 
998
		"     89  iload 4 [e]\n" + 
980
		"     88  iload 4 [e]\n" + 
999
		"     91  iconst_5\n" + 
981
		"     90  iconst_5\n" + 
1000
		"     92  if_icmpne 98\n" + 
982
		"     91  if_icmpne 97\n" + 
1001
		"     95  goto 52\n" + 
983
		"     94  goto 52\n" + 
1002
		"     98  iinc 5 1\n" + 
984
		"     97  iinc 5 1\n" + 
1003
		"    101  iload 5\n" + 
985
		"    100  iload 5\n" + 
1004
		"    103  iload 6\n" + 
986
		"    102  iload 6\n" + 
1005
		"    105  if_icmplt 69\n" + 
987
		"    104  if_icmplt 68\n" + 
1006
		"    108  goto 52\n" + 
988
		"    107  goto 52\n" + 
1007
		"    111  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
989
		"    110  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
1008
		"    114  iload_2 [sum]\n" + 
990
		"    113  iload_2 [sum]\n" + 
1009
		"    115  invokevirtual java.io.PrintStream.println(int) : void [22]\n" + 
991
		"    114  invokevirtual java.io.PrintStream.println(int) : void [22]\n" + 
1010
		"    118  return\n" + 
992
		"    117  return\n" + 
1011
		"      Line numbers:\n" + 
993
		"      Line numbers:\n" + 
1012
		"        [pc: 0, line: 3]\n" + 
994
		"        [pc: 0, line: 3]\n" + 
1013
		"        [pc: 48, line: 4]\n" + 
995
		"        [pc: 48, line: 4]\n" + 
1014
		"        [pc: 50, line: 5]\n" + 
996
		"        [pc: 50, line: 5]\n" + 
1015
		"        [pc: 52, line: 7]\n" + 
997
		"        [pc: 52, line: 7]\n" + 
1016
		"        [pc: 55, line: 8]\n" + 
998
		"        [pc: 55, line: 8]\n" + 
1017
		"        [pc: 76, line: 9]\n" + 
999
		"        [pc: 75, line: 9]\n" + 
1018
		"        [pc: 81, line: 10]\n" + 
1000
		"        [pc: 80, line: 10]\n" + 
1019
		"        [pc: 86, line: 11]\n" + 
1001
		"        [pc: 85, line: 11]\n" + 
1020
		"        [pc: 89, line: 12]\n" + 
1002
		"        [pc: 88, line: 12]\n" + 
1021
		"        [pc: 95, line: 13]\n" + 
1003
		"        [pc: 94, line: 13]\n" + 
1022
		"        [pc: 98, line: 8]\n" + 
1004
		"        [pc: 97, line: 8]\n" + 
1023
		"        [pc: 108, line: 6]\n" + 
1005
		"        [pc: 107, line: 6]\n" + 
1024
		"        [pc: 111, line: 19]\n" + 
1006
		"        [pc: 110, line: 19]\n" + 
1025
		"        [pc: 118, line: 20]\n" + 
1007
		"        [pc: 117, line: 20]\n" + 
1026
		"      Local variable table:\n" + 
1008
		"      Local variable table:\n" + 
1027
		"        [pc: 0, pc: 119] local: args index: 0 type: java.lang.String[]\n" + 
1009
		"        [pc: 0, pc: 118] local: args index: 0 type: java.lang.String[]\n" + 
1028
		"        [pc: 48, pc: 119] local: tab index: 1 type: int[]\n" + 
1010
		"        [pc: 48, pc: 118] local: tab index: 1 type: int[]\n" + 
1029
		"        [pc: 50, pc: 119] local: sum index: 2 type: int\n" + 
1011
		"        [pc: 50, pc: 118] local: sum index: 2 type: int\n" + 
1030
		"        [pc: 52, pc: 119] local: i index: 3 type: int\n" + 
1012
		"        [pc: 52, pc: 118] local: i index: 3 type: int\n" + 
1031
		"        [pc: 76, pc: 98] local: e index: 4 type: int\n";
1013
		"        [pc: 75, pc: 97] local: e index: 4 type: int\n";
1032
	
1014
	
1033
	try {
1015
	try {
1034
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
1016
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
Lines 1221-1275 Link Here
1221
		"    14  invokespecial java.util.ArrayList() [22]\n" + 
1203
		"    14  invokespecial java.util.ArrayList() [22]\n" + 
1222
		"    17  astore_2 [list]\n" + 
1204
		"    17  astore_2 [list]\n" + 
1223
		"    18  aload_1 [tab]\n" + 
1205
		"    18  aload_1 [tab]\n" + 
1224
		"    19  astore 6\n" + 
1206
		"    19  dup\n" + 
1225
		"    21  iconst_0\n" + 
1207
		"    20  astore 6\n" + 
1226
		"    22  istore 4\n" + 
1208
		"    22  arraylength\n" + 
1227
		"    24  aload 6\n" + 
1209
		"    23  istore 5\n" + 
1228
		"    26  arraylength\n" + 
1210
		"    25  iconst_0\n" + 
1229
		"    27  istore 5\n" + 
1211
		"    26  istore 4\n" + 
1230
		"    29  goto 49\n" + 
1212
		"    28  goto 48\n" + 
1231
		"    32  aload 6\n" + 
1213
		"    31  aload 6\n" + 
1232
		"    34  iload 4\n" + 
1214
		"    33  iload 4\n" + 
1233
		"    36  aaload\n" + 
1215
		"    35  aaload\n" + 
1234
		"    37  astore_3 [arg]\n" + 
1216
		"    36  astore_3 [arg]\n" + 
1235
		"    38  aload_2 [list]\n" + 
1217
		"    37  aload_2 [list]\n" + 
1236
		"    39  aload_3 [arg]\n" + 
1218
		"    38  aload_3 [arg]\n" + 
1237
		"    40  invokeinterface java.util.List.add(java.lang.Object) : boolean [23] [nargs: 2]\n" + 
1219
		"    39  invokeinterface java.util.List.add(java.lang.Object) : boolean [23] [nargs: 2]\n" + 
1238
		"    45  pop\n" + 
1220
		"    44  pop\n" + 
1239
		"    46  iinc 4 1\n" + 
1221
		"    45  iinc 4 1\n" + 
1240
		"    49  iload 4\n" + 
1222
		"    48  iload 4\n" + 
1241
		"    51  iload 5\n" + 
1223
		"    50  iload 5\n" + 
1242
		"    53  if_icmplt 32\n" + 
1224
		"    52  if_icmplt 31\n" + 
1243
		"    56  aload_2 [list]\n" + 
1225
		"    55  aload_2 [list]\n" + 
1244
		"    57  invokeinterface java.util.List.iterator() : java.util.Iterator [29] [nargs: 1]\n" + 
1226
		"    56  invokeinterface java.util.List.iterator() : java.util.Iterator [29] [nargs: 1]\n" + 
1245
		"    62  astore 4\n" + 
1227
		"    61  astore 4\n" + 
1246
		"    64  goto 82\n" + 
1228
		"    63  goto 81\n" + 
1247
		"    67  aload 4\n" + 
1229
		"    66  aload 4\n" + 
1248
		"    69  invokeinterface java.util.Iterator.next() : java.lang.Object [33] [nargs: 1]\n" + 
1230
		"    68  invokeinterface java.util.Iterator.next() : java.lang.Object [33] [nargs: 1]\n" + 
1249
		"    74  astore_3 [arg]\n" + 
1231
		"    73  astore_3 [arg]\n" + 
1250
		"    75  getstatic java.lang.System.out : java.io.PrintStream [39]\n" + 
1232
		"    74  getstatic java.lang.System.out : java.io.PrintStream [39]\n" + 
1251
		"    78  aload_3 [arg]\n" + 
1233
		"    77  aload_3 [arg]\n" + 
1252
		"    79  invokevirtual java.io.PrintStream.print(java.lang.Object) : void [45]\n" + 
1234
		"    78  invokevirtual java.io.PrintStream.print(java.lang.Object) : void [45]\n" + 
1253
		"    82  aload 4\n" + 
1235
		"    81  aload 4\n" + 
1254
		"    84  invokeinterface java.util.Iterator.hasNext() : boolean [51] [nargs: 1]\n" + 
1236
		"    83  invokeinterface java.util.Iterator.hasNext() : boolean [51] [nargs: 1]\n" + 
1255
		"    89  ifne 67\n" + 
1237
		"    88  ifne 66\n" + 
1256
		"    92  return\n" + 
1238
		"    91  return\n" + 
1257
		"      Line numbers:\n" + 
1239
		"      Line numbers:\n" + 
1258
		"        [pc: 0, line: 6]\n" + 
1240
		"        [pc: 0, line: 6]\n" + 
1259
		"        [pc: 10, line: 7]\n" + 
1241
		"        [pc: 10, line: 7]\n" + 
1260
		"        [pc: 18, line: 8]\n" + 
1242
		"        [pc: 18, line: 8]\n" + 
1261
		"        [pc: 38, line: 9]\n" + 
1243
		"        [pc: 37, line: 9]\n" + 
1262
		"        [pc: 46, line: 8]\n" + 
1244
		"        [pc: 45, line: 8]\n" + 
1263
		"        [pc: 56, line: 11]\n" + 
1245
		"        [pc: 55, line: 11]\n" + 
1264
		"        [pc: 75, line: 12]\n" + 
1246
		"        [pc: 74, line: 12]\n" + 
1265
		"        [pc: 82, line: 11]\n" + 
1247
		"        [pc: 81, line: 11]\n" + 
1266
		"        [pc: 92, line: 14]\n" + 
1248
		"        [pc: 91, line: 14]\n" + 
1267
		"      Local variable table:\n" + 
1249
		"      Local variable table:\n" + 
1268
		"        [pc: 0, pc: 93] local: args index: 0 type: java.lang.String[]\n" + 
1250
		"        [pc: 0, pc: 92] local: args index: 0 type: java.lang.String[]\n" + 
1269
		"        [pc: 10, pc: 93] local: tab index: 1 type: java.lang.String[]\n" + 
1251
		"        [pc: 10, pc: 92] local: tab index: 1 type: java.lang.String[]\n" + 
1270
		"        [pc: 18, pc: 93] local: list index: 2 type: java.util.List\n" + 
1252
		"        [pc: 18, pc: 92] local: list index: 2 type: java.util.List\n" + 
1271
		"        [pc: 38, pc: 46] local: arg index: 3 type: java.lang.String\n" + 
1253
		"        [pc: 37, pc: 45] local: arg index: 3 type: java.lang.String\n" + 
1272
		"        [pc: 75, pc: 82] local: arg index: 3 type: java.lang.Object\n";
1254
		"        [pc: 74, pc: 81] local: arg index: 3 type: java.lang.Object\n";
1273
	
1255
	
1274
	try {
1256
	try {
1275
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
1257
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
Lines 1360-1404 Link Here
1360
		
1342
		
1361
	String expectedOutput =
1343
	String expectedOutput =
1362
		"  // Method descriptor #15 ([Ljava/lang/String;)V\n" + 
1344
		"  // Method descriptor #15 ([Ljava/lang/String;)V\n" + 
1363
		"  // Stack: 2, Locals: 5\n" + 
1345
		"  // Stack: 2, Locals: 3\n" + 
1364
		"  public static void main(java.lang.String[] args);\n" + 
1346
		"  public static void main(java.lang.String[] args);\n" + 
1365
		"     0  iconst_0\n" + 
1347
		"     0  iconst_0\n" + 
1366
		"     1  anewarray java.lang.Object [3]\n" + 
1348
		"     1  anewarray java.lang.Object [3]\n" + 
1367
		"     4  astore_1 [array]\n" + 
1349
		"     4  astore_1 [array]\n" + 
1368
		"     5  aload_1 [array]\n" + 
1350
		"     5  aload_1 [array]\n" + 
1369
		"     6  astore 4\n" + 
1351
		"     6  dup\n" + 
1370
		"     8  iconst_0\n" + 
1352
		"     7  astore_2\n" + 
1371
		"     9  istore_2\n" + 
1353
		"     8  arraylength\n" + 
1372
		"    10  aload 4\n" + 
1354
		"     9  ifeq 22\n" + 
1373
		"    12  arraylength\n" + 
1355
		"    12  aload_0 [args]\n" + 
1374
		"    13  istore_3\n" + 
1356
		"    13  ifnonnull 21\n" + 
1375
		"    14  goto 27\n" + 
1357
		"    16  aconst_null\n" + 
1376
		"    17  aload_0 [args]\n" + 
1358
		"    17  pop\n" + 
1377
		"    18  ifnonnull 26\n" + 
1359
		"    18  goto 22\n" + 
1378
		"    21  aconst_null\n" + 
1360
		"    21  return\n" + 
1379
		"    22  pop\n" + 
1361
		"    22  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
1380
		"    23  goto 32\n" + 
1362
		"    25  ldc <String \"SUCCESS\"> [22]\n" + 
1381
		"    26  return\n" + 
1363
		"    27  invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n" + 
1382
		"    27  iload_2\n" + 
1364
		"    30  return\n" + 
1383
		"    28  iload_3\n" + 
1384
		"    29  if_icmplt 17\n" + 
1385
		"    32  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
1386
		"    35  ldc <String \"SUCCESS\"> [22]\n" + 
1387
		"    37  invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]\n" + 
1388
		"    40  return\n" + 
1389
		"      Line numbers:\n" + 
1365
		"      Line numbers:\n" + 
1390
		"        [pc: 0, line: 3]\n" + 
1366
		"        [pc: 0, line: 3]\n" + 
1391
		"        [pc: 5, line: 6]\n" + 
1367
		"        [pc: 5, line: 6]\n" + 
1392
		"        [pc: 17, line: 7]\n" + 
1368
		"        [pc: 12, line: 7]\n" + 
1393
		"        [pc: 21, line: 8]\n" + 
1369
		"        [pc: 16, line: 8]\n" + 
1394
		"        [pc: 23, line: 9]\n" + 
1370
		"        [pc: 18, line: 9]\n" + 
1395
		"        [pc: 26, line: 11]\n" + 
1371
		"        [pc: 21, line: 11]\n" + 
1396
		"        [pc: 27, line: 6]\n" + 
1372
		"        [pc: 22, line: 13]\n" + 
1397
		"        [pc: 32, line: 13]\n" + 
1373
		"        [pc: 30, line: 14]\n" + 
1398
		"        [pc: 40, line: 14]\n" + 
1399
		"      Local variable table:\n" + 
1374
		"      Local variable table:\n" + 
1400
		"        [pc: 0, pc: 41] local: args index: 0 type: java.lang.String[]\n" + 
1375
		"        [pc: 0, pc: 31] local: args index: 0 type: java.lang.String[]\n" + 
1401
		"        [pc: 5, pc: 41] local: array index: 1 type: java.lang.Object[]\n";
1376
		"        [pc: 5, pc: 31] local: array index: 1 type: java.lang.Object[]\n";
1402
	
1377
	
1403
	try {
1378
	try {
1404
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
1379
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
Lines 2386-2412 Link Here
2386
		"  // Stack: 2, Locals: 5\n" + 
2361
		"  // Stack: 2, Locals: 5\n" + 
2387
		"  public static void main(java.lang.String[] args);\n" + 
2362
		"  public static void main(java.lang.String[] args);\n" + 
2388
		"     0  invokestatic X.initForEach() : int[] [16]\n" + 
2363
		"     0  invokestatic X.initForEach() : int[] [16]\n" + 
2389
		"     3  astore 4\n" + 
2364
		"     3  dup\n" + 
2390
		"     5  iconst_0\n" + 
2365
		"     4  astore 4\n" + 
2391
		"     6  istore_2\n" + 
2366
		"     6  arraylength\n" + 
2392
		"     7  aload 4\n" + 
2367
		"     7  istore_3\n" + 
2393
		"     9  arraylength\n" + 
2368
		"     8  iconst_0\n" + 
2394
		"    10  istore_3\n" + 
2369
		"     9  istore_2\n" + 
2395
		"    11  goto 22\n" + 
2370
		"    10  goto 21\n" + 
2396
		"    14  aload 4\n" + 
2371
		"    13  aload 4\n" + 
2397
		"    16  iload_2\n" + 
2372
		"    15  iload_2\n" + 
2398
		"    17  iaload\n" + 
2373
		"    16  iaload\n" + 
2399
		"    18  istore_1\n" + 
2374
		"    17  istore_1\n" + 
2400
		"    19  iinc 2 1\n" + 
2375
		"    18  iinc 2 1\n" + 
2401
		"    22  iload_2\n" + 
2376
		"    21  iload_2\n" + 
2402
		"    23  iload_3\n" + 
2377
		"    22  iload_3\n" + 
2403
		"    24  if_icmplt 14\n" + 
2378
		"    23  if_icmplt 13\n" + 
2404
		"    27  return\n" + 
2379
		"    26  return\n" + 
2405
		"      Line numbers:\n" + 
2380
		"      Line numbers:\n" + 
2406
		"        [pc: 0, line: 3]\n" + 
2381
		"        [pc: 0, line: 3]\n" + 
2407
		"        [pc: 27, line: 5]\n" + 
2382
		"        [pc: 26, line: 5]\n" + 
2408
		"      Local variable table:\n" + 
2383
		"      Local variable table:\n" + 
2409
		"        [pc: 0, pc: 28] local: args index: 0 type: java.lang.String[]\n";
2384
		"        [pc: 0, pc: 27] local: args index: 0 type: java.lang.String[]\n";
2410
	
2385
	
2411
	try {
2386
	try {
2412
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
2387
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
Lines 2510-2521 Link Here
2510
		"  // Stack: 2, Locals: 4\n" + 
2485
		"  // Stack: 2, Locals: 4\n" + 
2511
		"  public static void foo();\n" + 
2486
		"  public static void foo();\n" + 
2512
		"     0  invokestatic X.initForEach() : int[] [21]\n" + 
2487
		"     0  invokestatic X.initForEach() : int[] [21]\n" + 
2513
		"     3  astore_3\n" + 
2488
		"     3  dup\n" + 
2514
		"     4  iconst_0\n" + 
2489
		"     4  astore_3\n" + 
2515
		"     5  istore_1\n" + 
2490
		"     5  arraylength\n" + 
2516
		"     6  aload_3\n" + 
2491
		"     6  istore_2\n" + 
2517
		"     7  arraylength\n" + 
2492
		"     7  iconst_0\n" + 
2518
		"     8  istore_2\n" + 
2493
		"     8  istore_1\n" + 
2519
		"     9  goto 19\n" + 
2494
		"     9  goto 19\n" + 
2520
		"    12  aload_3\n" + 
2495
		"    12  aload_3\n" + 
2521
		"    13  iload_1\n" + 
2496
		"    13  iload_1\n" + 
Lines 2579-2611 Link Here
2579
		"  // Stack: 2, Locals: 5\n" + 
2554
		"  // Stack: 2, Locals: 5\n" + 
2580
		"  public static void main(java.lang.String[] args);\n" + 
2555
		"  public static void main(java.lang.String[] args);\n" + 
2581
		"     0  invokestatic X.initForEach() : int[] [16]\n" + 
2556
		"     0  invokestatic X.initForEach() : int[] [16]\n" + 
2582
		"     3  astore 4\n" + 
2557
		"     3  dup\n" + 
2583
		"     5  iconst_0\n" + 
2558
		"     4  astore 4\n" + 
2584
		"     6  istore_2\n" + 
2559
		"     6  arraylength\n" + 
2585
		"     7  aload 4\n" + 
2560
		"     7  istore_3\n" + 
2586
		"     9  arraylength\n" + 
2561
		"     8  iconst_0\n" + 
2587
		"    10  istore_3\n" + 
2562
		"     9  istore_2\n" + 
2588
		"    11  goto 30\n" + 
2563
		"    10  goto 29\n" + 
2589
		"    14  aload 4\n" + 
2564
		"    13  aload 4\n" + 
2590
		"    16  iload_2\n" + 
2565
		"    15  iload_2\n" + 
2591
		"    17  iaload\n" + 
2566
		"    16  iaload\n" + 
2592
		"    18  istore_1 [i]\n" + 
2567
		"    17  istore_1 [i]\n" + 
2593
		"    19  getstatic java.lang.System.out : java.io.PrintStream [20]\n" + 
2568
		"    18  getstatic java.lang.System.out : java.io.PrintStream [20]\n" + 
2594
		"    22  bipush 97\n" + 
2569
		"    21  bipush 97\n" + 
2595
		"    24  invokevirtual java.io.PrintStream.print(char) : void [26]\n" + 
2570
		"    23  invokevirtual java.io.PrintStream.print(char) : void [26]\n" + 
2596
		"    27  iinc 2 1\n" + 
2571
		"    26  iinc 2 1\n" + 
2597
		"    30  iload_2\n" + 
2572
		"    29  iload_2\n" + 
2598
		"    31  iload_3\n" + 
2573
		"    30  iload_3\n" + 
2599
		"    32  if_icmplt 14\n" + 
2574
		"    31  if_icmplt 13\n" + 
2600
		"    35  return\n" + 
2575
		"    34  return\n" + 
2601
		"      Line numbers:\n" + 
2576
		"      Line numbers:\n" + 
2602
		"        [pc: 0, line: 3]\n" + 
2577
		"        [pc: 0, line: 3]\n" + 
2603
		"        [pc: 19, line: 4]\n" + 
2578
		"        [pc: 18, line: 4]\n" + 
2604
		"        [pc: 27, line: 3]\n" + 
2579
		"        [pc: 26, line: 3]\n" + 
2605
		"        [pc: 35, line: 6]\n" + 
2580
		"        [pc: 34, line: 6]\n" + 
2606
		"      Local variable table:\n" + 
2581
		"      Local variable table:\n" + 
2607
		"        [pc: 0, pc: 36] local: args index: 0 type: java.lang.String[]\n" + 
2582
		"        [pc: 0, pc: 35] local: args index: 0 type: java.lang.String[]\n" + 
2608
		"        [pc: 19, pc: 27] local: i index: 1 type: int\n";
2583
		"        [pc: 18, pc: 26] local: i index: 1 type: int\n";
2609
	
2584
	
2610
	try {
2585
	try {
2611
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
2586
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
Lines 2656-2667 Link Here
2656
		"  // Stack: 2, Locals: 4\n" + 
2631
		"  // Stack: 2, Locals: 4\n" + 
2657
		"  public static void main(java.lang.String[] args);\n" + 
2632
		"  public static void main(java.lang.String[] args);\n" + 
2658
		"     0  invokestatic X.initForEach() : int[] [16]\n" + 
2633
		"     0  invokestatic X.initForEach() : int[] [16]\n" + 
2659
		"     3  astore_3\n" + 
2634
		"     3  dup\n" + 
2660
		"     4  iconst_0\n" + 
2635
		"     4  astore_3\n" + 
2661
		"     5  istore_1\n" + 
2636
		"     5  arraylength\n" + 
2662
		"     6  aload_3\n" + 
2637
		"     6  istore_2\n" + 
2663
		"     7  arraylength\n" + 
2638
		"     7  iconst_0\n" + 
2664
		"     8  istore_2\n" + 
2639
		"     8  istore_1\n" + 
2665
		"     9  goto 23\n" + 
2640
		"     9  goto 23\n" + 
2666
		"    12  getstatic java.lang.System.out : java.io.PrintStream [20]\n" + 
2641
		"    12  getstatic java.lang.System.out : java.io.PrintStream [20]\n" + 
2667
		"    15  bipush 97\n" + 
2642
		"    15  bipush 97\n" + 
Lines 2697-2702 Link Here
2697
		assertTrue(false);
2672
		assertTrue(false);
2698
	}
2673
	}
2699
}
2674
}
2675
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=180471
2676
public void test047() { 
2677
	this.runConformTest(
2678
		new String[] {
2679
			"X.java",
2680
			"public class X {\n" + 
2681
			"	void foo3(int[] array) {\n" + 
2682
			"		for (int i : array) {\n" + 
2683
			"			System.out.println(i);\n" + 
2684
			"			break;\n" + 
2685
			"		}\n" + 
2686
			"	}\n" + 
2687
			"}\n", // =================
2688
		},
2689
		"");
2690
2691
	String expectedOutput =
2692
		"  // Method descriptor #15 ([I)V\n" + 
2693
		"  // Stack: 2, Locals: 4\n" + 
2694
		"  void foo3(int[] array);\n" + 
2695
		"     0  aload_1 [array]\n" + 
2696
		"     1  dup\n" + 
2697
		"     2  astore_3\n" + 
2698
		"     3  arraylength\n" + 
2699
		"     4  ifeq 18\n" + 
2700
		"     7  aload_3\n" + 
2701
		"     8  iconst_0\n" + 
2702
		"     9  iaload\n" + 
2703
		"    10  istore_2 [i]\n" + 
2704
		"    11  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
2705
		"    14  iload_2 [i]\n" + 
2706
		"    15  invokevirtual java.io.PrintStream.println(int) : void [22]\n" + 
2707
		"    18  return\n" + 
2708
		"      Line numbers:\n" + 
2709
		"        [pc: 0, line: 3]\n" + 
2710
		"        [pc: 11, line: 4]\n" + 
2711
		"        [pc: 18, line: 7]\n" + 
2712
		"      Local variable table:\n" + 
2713
		"        [pc: 0, pc: 19] local: this index: 0 type: X\n" + 
2714
		"        [pc: 0, pc: 19] local: array index: 1 type: int[]\n" + 
2715
		"        [pc: 11, pc: 18] local: i index: 2 type: int\n";
2716
	
2717
	try {
2718
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
2719
		byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
2720
		ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
2721
		String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
2722
		int index = result.indexOf(expectedOutput);
2723
		if (index == -1 || expectedOutput.length() == 0) {
2724
			System.out.println(Util.displayString(result, 3));
2725
		}
2726
		if (index == -1) {
2727
			assertEquals("Wrong contents", expectedOutput, result);
2728
		}
2729
	} catch (org.eclipse.jdt.core.util.ClassFormatException e) {
2730
		assertTrue(false);
2731
	} catch (IOException e) {
2732
		assertTrue(false);
2733
	}
2734
}
2735
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=180471 - variation
2736
public void test048() { 
2737
	this.runConformTest(
2738
		new String[] {
2739
			"X.java",
2740
			"public class X {\n" + 
2741
			"	void foo3(java.util.List<String> ls) {\n" + 
2742
			"		for (String s : ls) {\n" + 
2743
			"			System.out.println(s);\n" + 
2744
			"			break;\n" + 
2745
			"		}\n" + 
2746
			"	}\n" + 
2747
			"}\n", // =================
2748
		},
2749
		"");
2750
2751
	String expectedOutput =
2752
		"  // Method descriptor #15 ([I)V\n" + 
2753
		"  // Stack: 2, Locals: 4\n" + 
2754
		"  void foo3(int[] array);\n" + 
2755
		"     0  aload_1 [array]\n" + 
2756
		"     1  dup\n" + 
2757
		"     2  astore_3\n" + 
2758
		"     3  arraylength\n" + 
2759
		"     4  ifeq 18\n" + 
2760
		"     7  aload_3\n" + 
2761
		"     8  iconst_0\n" + 
2762
		"     9  iaload\n" + 
2763
		"    10  istore_2 [i]\n" + 
2764
		"    11  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
2765
		"    14  iload_2 [i]\n" + 
2766
		"    15  invokevirtual java.io.PrintStream.println(int) : void [22]\n" + 
2767
		"    18  return\n" + 
2768
		"      Line numbers:\n" + 
2769
		"        [pc: 0, line: 3]\n" + 
2770
		"        [pc: 11, line: 4]\n" + 
2771
		"        [pc: 18, line: 7]\n" + 
2772
		"      Local variable table:\n" + 
2773
		"        [pc: 0, pc: 19] local: this index: 0 type: X\n" + 
2774
		"        [pc: 0, pc: 19] local: array index: 1 type: int[]\n" + 
2775
		"        [pc: 11, pc: 18] local: i index: 2 type: int\n";
2776
	
2777
	try {
2778
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
2779
		byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
2780
		ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
2781
		String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
2782
		int index = result.indexOf(expectedOutput);
2783
		if (index == -1 || expectedOutput.length() == 0) {
2784
			System.out.println(Util.displayString(result, 3));
2785
		}
2786
		if (index == -1) {
2787
			assertEquals("Wrong contents", expectedOutput, result);
2788
		}
2789
	} catch (org.eclipse.jdt.core.util.ClassFormatException e) {
2790
		assertTrue(false);
2791
	} catch (IOException e) {
2792
		assertTrue(false);
2793
	}
2794
}
2795
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=180471 - variation
2796
public void test049() { 
2797
	this.runConformTest(
2798
		new String[] {
2799
			"X.java",
2800
			"public class X {\n" + 
2801
			"	void foo3(int[] array) {\n" + 
2802
			"	void foo3(java.util.List l) {\n" + 
2803
			"		for (Object o : l) {\n" + 
2804
			"			System.out.println(o);\n" + 
2805
			"			break;\n" + 
2806
			"		}\n" + 
2807
			"	}\n" + 
2808
			"	}\n" + 
2809
			"}\n", // =================
2810
		},
2811
		"");
2812
2813
	String expectedOutput =
2814
		"  // Method descriptor #15 ([I)V\n" + 
2815
		"  // Stack: 2, Locals: 4\n" + 
2816
		"  void foo3(int[] array);\n" + 
2817
		"     0  aload_1 [array]\n" + 
2818
		"     1  dup\n" + 
2819
		"     2  astore_3\n" + 
2820
		"     3  arraylength\n" + 
2821
		"     4  ifeq 18\n" + 
2822
		"     7  aload_3\n" + 
2823
		"     8  iconst_0\n" + 
2824
		"     9  iaload\n" + 
2825
		"    10  istore_2 [i]\n" + 
2826
		"    11  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
2827
		"    14  iload_2 [i]\n" + 
2828
		"    15  invokevirtual java.io.PrintStream.println(int) : void [22]\n" + 
2829
		"    18  return\n" + 
2830
		"      Line numbers:\n" + 
2831
		"        [pc: 0, line: 3]\n" + 
2832
		"        [pc: 11, line: 4]\n" + 
2833
		"        [pc: 18, line: 7]\n" + 
2834
		"      Local variable table:\n" + 
2835
		"        [pc: 0, pc: 19] local: this index: 0 type: X\n" + 
2836
		"        [pc: 0, pc: 19] local: array index: 1 type: int[]\n" + 
2837
		"        [pc: 11, pc: 18] local: i index: 2 type: int\n";
2838
	
2839
	try {
2840
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
2841
		byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
2842
		ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
2843
		String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
2844
		int index = result.indexOf(expectedOutput);
2845
		if (index == -1 || expectedOutput.length() == 0) {
2846
			System.out.println(Util.displayString(result, 3));
2847
		}
2848
		if (index == -1) {
2849
			assertEquals("Wrong contents", expectedOutput, result);
2850
		}
2851
	} catch (org.eclipse.jdt.core.util.ClassFormatException e) {
2852
		assertTrue(false);
2853
	} catch (IOException e) {
2854
		assertTrue(false);
2855
	}
2856
}
2700
public static Class testClass() {
2857
public static Class testClass() {
2701
	return ForeachStatementTest.class;
2858
	return ForeachStatementTest.class;
2702
}
2859
}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java (-41 / +41 lines)
Lines 1734-1786 Link Here
1734
			"     2  iconst_0\n" + 
1734
			"     2  iconst_0\n" + 
1735
			"     3  istore_2 [n]\n" + 
1735
			"     3  istore_2 [n]\n" + 
1736
			"     4  invokestatic X.values() : X[] [46]\n" + 
1736
			"     4  invokestatic X.values() : X[] [46]\n" + 
1737
			"     7  astore 6\n" + 
1737
			"     7  dup\n" + 
1738
			"     9  iconst_0\n" + 
1738
			"     8  astore 6\n" + 
1739
			"    10  istore 4\n" + 
1739
			"    10  arraylength\n" + 
1740
			"    12  aload 6\n" + 
1740
			"    11  istore 5\n" + 
1741
			"    14  arraylength\n" + 
1741
			"    13  iconst_0\n" + 
1742
			"    15  istore 5\n" + 
1742
			"    14  istore 4\n" + 
1743
			"    17  goto 49\n" + 
1743
			"    16  goto 48\n" + 
1744
			"    20  aload 6\n" + 
1744
			"    19  aload 6\n" + 
1745
			"    22  iload 4\n" + 
1745
			"    21  iload 4\n" + 
1746
			"    24  aaload\n" + 
1746
			"    23  aaload\n" + 
1747
			"    25  astore_3 [e]\n" + 
1747
			"    24  astore_3 [e]\n" + 
1748
			"    26  iload_2 [n]\n" + 
1748
			"    25  iload_2 [n]\n" + 
1749
			"    27  iconst_1\n" + 
1749
			"    26  iconst_1\n" + 
1750
			"    28  if_icmpne 34\n" + 
1750
			"    27  if_icmpne 33\n" + 
1751
			"    31  goto 46\n" + 
1751
			"    30  goto 45\n" + 
1752
			"    34  aload_3 [e]\n" + 
1752
			"    33  aload_3 [e]\n" + 
1753
			"    35  invokevirtual X.value() : int [50]\n" + 
1753
			"    34  invokevirtual X.value() : int [50]\n" + 
1754
			"    38  istore_0 [val]\n" + 
1754
			"    37  istore_0 [val]\n" + 
1755
			"    39  getstatic java.lang.System.out : java.io.PrintStream [52]\n" + 
1755
			"    38  getstatic java.lang.System.out : java.io.PrintStream [52]\n" + 
1756
			"    42  iload_0 [val]\n" + 
1756
			"    41  iload_0 [val]\n" + 
1757
			"    43  invokevirtual java.io.PrintStream.println(int) : void [58]\n" + 
1757
			"    42  invokevirtual java.io.PrintStream.println(int) : void [58]\n" + 
1758
			"    46  iinc 4 1\n" + 
1758
			"    45  iinc 4 1\n" + 
1759
			"    49  iload 4\n" + 
1759
			"    48  iload 4\n" + 
1760
			"    51  iload 5\n" + 
1760
			"    50  iload 5\n" + 
1761
			"    53  if_icmplt 20\n" + 
1761
			"    52  if_icmplt 19\n" + 
1762
			"    56  iload_1 [res]\n" + 
1762
			"    55  iload_1 [res]\n" + 
1763
			"    57  ireturn\n" + 
1763
			"    56  ireturn\n" + 
1764
			"      Line numbers:\n" + 
1764
			"      Line numbers:\n" + 
1765
			"        [pc: 0, line: 14]\n" + 
1765
			"        [pc: 0, line: 14]\n" + 
1766
			"        [pc: 2, line: 15]\n" + 
1766
			"        [pc: 2, line: 15]\n" + 
1767
			"        [pc: 4, line: 16]\n" + 
1767
			"        [pc: 4, line: 16]\n" + 
1768
			"        [pc: 26, line: 17]\n" + 
1768
			"        [pc: 25, line: 17]\n" + 
1769
			"        [pc: 31, line: 18]\n" + 
1769
			"        [pc: 30, line: 18]\n" + 
1770
			"        [pc: 34, line: 20]\n" + 
1770
			"        [pc: 33, line: 20]\n" + 
1771
			"        [pc: 39, line: 21]\n" + 
1771
			"        [pc: 38, line: 21]\n" + 
1772
			"        [pc: 46, line: 16]\n" + 
1772
			"        [pc: 45, line: 16]\n" + 
1773
			"        [pc: 56, line: 23]\n" + 
1773
			"        [pc: 55, line: 23]\n" + 
1774
			"      Local variable table:\n" + 
1774
			"      Local variable table:\n" + 
1775
			"        [pc: 39, pc: 46] local: val index: 0 type: int\n" + 
1775
			"        [pc: 38, pc: 45] local: val index: 0 type: int\n" + 
1776
			"        [pc: 2, pc: 58] local: res index: 1 type: int\n" + 
1776
			"        [pc: 2, pc: 57] local: res index: 1 type: int\n" + 
1777
			"        [pc: 4, pc: 58] local: n index: 2 type: int\n" + 
1777
			"        [pc: 4, pc: 57] local: n index: 2 type: int\n" + 
1778
			"        [pc: 26, pc: 46] local: e index: 3 type: X\n" + 
1778
			"        [pc: 25, pc: 45] local: e index: 3 type: X\n" + 
1779
			"      Stack map table: number of frames 4\n" + 
1779
			"      Stack map table: number of frames 4\n" + 
1780
			"        [pc: 20, full, stack: {}, locals: {_, int, int, _, int, int, X[]}]\n" + 
1780
			"        [pc: 19, full, stack: {}, locals: {_, int, int, _, int, int, X[]}]\n" + 
1781
			"        [pc: 34, full, stack: {}, locals: {_, int, int, X, int, int, X[]}]\n" + 
1781
			"        [pc: 33, full, stack: {}, locals: {_, int, int, X, int, int, X[]}]\n" + 
1782
			"        [pc: 46, full, stack: {}, locals: {_, int, int, _, int, int, X[]}]\n" + 
1782
			"        [pc: 45, full, stack: {}, locals: {_, int, int, _, int, int, X[]}]\n" + 
1783
			"        [pc: 49, same]\n";
1783
			"        [pc: 48, same]\n";
1784
1784
1785
		int index = actualOutput.indexOf(expectedOutput);
1785
		int index = actualOutput.indexOf(expectedOutput);
1786
		if (index == -1 || expectedOutput.length() == 0) {
1786
		if (index == -1 || expectedOutput.length() == 0) {
(-)src/org/eclipse/jdt/core/tests/compiler/regression/ForStatementTest.java (+163 lines)
Lines 10-19 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.jdt.core.tests.compiler.regression;
11
package org.eclipse.jdt.core.tests.compiler.regression;
12
12
13
import java.io.File;
14
import java.io.IOException;
13
import java.util.Map;
15
import java.util.Map;
14
16
15
import junit.framework.Test;
17
import junit.framework.Test;
16
18
19
import org.eclipse.jdt.core.ToolFactory;
20
import org.eclipse.jdt.core.tests.util.Util;
21
import org.eclipse.jdt.core.util.ClassFileBytesDisassembler;
17
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
22
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
18
23
19
public class ForStatementTest extends AbstractRegressionTest {
24
public class ForStatementTest extends AbstractRegressionTest {
Lines 71-76 Link Here
71
		},
76
		},
72
		"SUCCESS");
77
		"SUCCESS");
73
}
78
}
79
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=180471
80
public void test002() { 
81
	this.runConformTest(
82
		new String[] {
83
			"X.java",
84
			"public class X {\n" + 
85
			"	void foo2(int[] array) {\n" + 
86
			"		for (int i = 0; i < array.length; i++) {\n" + 
87
			"			System.out.println(i);\n" + 
88
			"			break;\n" + 
89
			"		}\n" + 
90
			"	}\n" + 
91
			"}\n", // =================
92
		},
93
		"");
94
95
	String expectedOutput =
96
		"  // Method descriptor #15 ([I)V\n" + 
97
		"  // Stack: 2, Locals: 3\n" + 
98
		"  void foo2(int[] array);\n" + 
99
		"     0  iconst_0\n" + 
100
		"     1  istore_2 [i]\n" + 
101
		"     2  iload_2 [i]\n" + 
102
		"     3  aload_1 [array]\n" + 
103
		"     4  arraylength\n" + 
104
		"     5  if_icmpge 15\n" + 
105
		"     8  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
106
		"    11  iload_2 [i]\n" + 
107
		"    12  invokevirtual java.io.PrintStream.println(int) : void [22]\n" + 
108
		"    15  return\n" + 
109
		"      Line numbers:\n" + 
110
		"        [pc: 0, line: 3]\n" + 
111
		"        [pc: 8, line: 4]\n" + 
112
		"        [pc: 15, line: 7]\n" + 
113
		"      Local variable table:\n" + 
114
		"        [pc: 0, pc: 16] local: this index: 0 type: X\n" + 
115
		"        [pc: 0, pc: 16] local: array index: 1 type: int[]\n" + 
116
		"        [pc: 2, pc: 15] local: i index: 2 type: int\n";
117
	
118
	try {
119
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
120
		byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
121
		ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
122
		String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
123
		int index = result.indexOf(expectedOutput);
124
		if (index == -1 || expectedOutput.length() == 0) {
125
			System.out.println(Util.displayString(result, 3));
126
		}
127
		if (index == -1) {
128
			assertEquals("Wrong contents", expectedOutput, result);
129
		}
130
	} catch (org.eclipse.jdt.core.util.ClassFormatException e) {
131
		assertTrue(false);
132
	} catch (IOException e) {
133
		assertTrue(false);
134
	}
135
}
136
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=180471 - variation
137
public void test003() { 
138
	this.runConformTest(
139
		new String[] {
140
			"X.java",
141
			"public class X {\n" + 
142
			"	void foo4(int[] array) {\n" + 
143
			"		do {\n" + 
144
			"			System.out.println();\n" + 
145
			"			break;\n" + 
146
			"		} while (array.length > 0);\n" + 
147
			"	}\n" + 
148
			"}\n", // =================
149
		},
150
		"");
151
152
	String expectedOutput =
153
		"  // Method descriptor #15 ([I)V\n" + 
154
		"  // Stack: 1, Locals: 2\n" + 
155
		"  void foo4(int[] array);\n" + 
156
		"    0  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
157
		"    3  invokevirtual java.io.PrintStream.println() : void [22]\n" + 
158
		"    6  return\n" + 
159
		"      Line numbers:\n" + 
160
		"        [pc: 0, line: 4]\n" + 
161
		"        [pc: 6, line: 7]\n" + 
162
		"      Local variable table:\n" + 
163
		"        [pc: 0, pc: 7] local: this index: 0 type: X\n" + 
164
		"        [pc: 0, pc: 7] local: array index: 1 type: int[]\n";
165
	
166
	try {
167
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
168
		byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
169
		ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
170
		String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
171
		int index = result.indexOf(expectedOutput);
172
		if (index == -1 || expectedOutput.length() == 0) {
173
			System.out.println(Util.displayString(result, 3));
174
		}
175
		if (index == -1) {
176
			assertEquals("Wrong contents", expectedOutput, result);
177
		}
178
	} catch (org.eclipse.jdt.core.util.ClassFormatException e) {
179
		assertTrue(false);
180
	} catch (IOException e) {
181
		assertTrue(false);
182
	}
183
}
184
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=180471 - variation
185
public void test004() { 
186
	this.runConformTest(
187
		new String[] {
188
			"X.java",
189
			"public class X {\n" + 
190
			"	void foo1(int[] array) {\n" + 
191
			"		while (array.length > 0) {\n" + 
192
			"			System.out.println();\n" + 
193
			"			break;\n" + 
194
			"		}\n" + 
195
			"	}\n" + 
196
			"}\n", // =================
197
		},
198
		"");
199
200
	String expectedOutput =
201
		"  // Method descriptor #15 ([I)V\n" + 
202
		"  // Stack: 1, Locals: 2\n" + 
203
		"  void foo1(int[] array);\n" + 
204
		"     0  aload_1 [array]\n" + 
205
		"     1  arraylength\n" + 
206
		"     2  ifle 11\n" + 
207
		"     5  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
208
		"     8  invokevirtual java.io.PrintStream.println() : void [22]\n" + 
209
		"    11  return\n" + 
210
		"      Line numbers:\n" + 
211
		"        [pc: 0, line: 3]\n" + 
212
		"        [pc: 5, line: 4]\n" + 
213
		"        [pc: 11, line: 7]\n" + 
214
		"      Local variable table:\n" + 
215
		"        [pc: 0, pc: 12] local: this index: 0 type: X\n" + 
216
		"        [pc: 0, pc: 12] local: array index: 1 type: int[]\n";
217
	
218
	try {
219
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
220
		byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
221
		ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
222
		String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
223
		int index = result.indexOf(expectedOutput);
224
		if (index == -1 || expectedOutput.length() == 0) {
225
			System.out.println(Util.displayString(result, 3));
226
		}
227
		if (index == -1) {
228
			assertEquals("Wrong contents", expectedOutput, result);
229
		}
230
	} catch (org.eclipse.jdt.core.util.ClassFormatException e) {
231
		assertTrue(false);
232
	} catch (IOException e) {
233
		assertTrue(false);
234
	}
235
}
236
74
public static Class testClass() {
237
public static Class testClass() {
75
	return ForStatementTest.class;
238
	return ForStatementTest.class;
76
}
239
}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/TryStatementTest.java (-125 / +103 lines)
Lines 3633-3660 Link Here
3633
			"  float foo4();\n" + 
3633
			"  float foo4();\n" + 
3634
			"     0  iconst_0\n" + 
3634
			"     0  iconst_0\n" + 
3635
			"     1  istore_1 [i]\n" + 
3635
			"     1  istore_1 [i]\n" + 
3636
			"     2  goto 7\n" + 
3636
			"     2  aload_0 [this]\n" + 
3637
			"     5  fconst_0\n" + 
3637
			"     3  invokevirtual X.bool() : boolean [17]\n" + 
3638
			"     6  freturn\n" + 
3638
			"     6  ifeq 12\n" + 
3639
			"     7  aload_0 [this]\n" + 
3639
			"     9  fconst_0\n" + 
3640
			"     8  invokevirtual X.bool() : boolean [17]\n" + 
3640
			"    10  freturn\n" + 
3641
			"    11  ifne 5\n" + 
3641
			"    11  astore_1\n" + 
3642
			"    14  goto 18\n" + 
3642
			"    12  fconst_1\n" + 
3643
			"    17  astore_1\n" + 
3643
			"    13  freturn\n" + 
3644
			"    18  fconst_1\n" + 
3645
			"    19  freturn\n" + 
3646
			"      Exception Table:\n" + 
3644
			"      Exception Table:\n" + 
3647
			"        [pc: 0, pc: 5] -> 17 when : java.lang.Exception\n" + 
3645
			"        [pc: 0, pc: 9] -> 11 when : java.lang.Exception\n" + 
3648
			"        [pc: 7, pc: 14] -> 17 when : java.lang.Exception\n" + 
3649
			"      Line numbers:\n" + 
3646
			"      Line numbers:\n" + 
3650
			"        [pc: 0, line: 31]\n" + 
3647
			"        [pc: 0, line: 31]\n" + 
3651
			"        [pc: 5, line: 32]\n" + 
3648
			"        [pc: 9, line: 32]\n" + 
3652
			"        [pc: 7, line: 31]\n" + 
3649
			"        [pc: 11, line: 34]\n" + 
3653
			"        [pc: 17, line: 34]\n" + 
3650
			"        [pc: 12, line: 36]\n" + 
3654
			"        [pc: 18, line: 36]\n" + 
3655
			"      Local variable table:\n" + 
3651
			"      Local variable table:\n" + 
3656
			"        [pc: 0, pc: 20] local: this index: 0 type: X\n" + 
3652
			"        [pc: 0, pc: 14] local: this index: 0 type: X\n" + 
3657
			"        [pc: 2, pc: 14] local: i index: 1 type: int\n" + 
3653
			"        [pc: 2, pc: 11] local: i index: 1 type: int\n" + 
3658
			"  \n" + 
3654
			"  \n" + 
3659
			"  // Method descriptor #30 ()D\n" + 
3655
			"  // Method descriptor #30 ()D\n" + 
3660
			"  // Stack: 2, Locals: 1\n" + 
3656
			"  // Stack: 2, Locals: 1\n" + 
Lines 3783-3815 Link Here
3783
			"  float foo4();\n" + 
3779
			"  float foo4();\n" + 
3784
			"     0  iconst_0\n" + 
3780
			"     0  iconst_0\n" + 
3785
			"     1  istore_1 [i]\n" + 
3781
			"     1  istore_1 [i]\n" + 
3786
			"     2  goto 7\n" + 
3782
			"     2  aload_0 [this]\n" + 
3787
			"     5  fconst_0\n" + 
3783
			"     3  invokevirtual X.bool() : boolean [17]\n" + 
3788
			"     6  freturn\n" + 
3784
			"     6  ifeq 12\n" + 
3789
			"     7  aload_0 [this]\n" + 
3785
			"     9  fconst_0\n" + 
3790
			"     8  invokevirtual X.bool() : boolean [17]\n" + 
3786
			"    10  freturn\n" + 
3791
			"    11  ifne 5\n" + 
3787
			"    11  astore_1\n" + 
3792
			"    14  goto 18\n" + 
3788
			"    12  fconst_1\n" + 
3793
			"    17  astore_1\n" + 
3789
			"    13  freturn\n" + 
3794
			"    18  fconst_1\n" + 
3795
			"    19  freturn\n" + 
3796
			"      Exception Table:\n" + 
3790
			"      Exception Table:\n" + 
3797
			"        [pc: 0, pc: 5] -> 17 when : java.lang.Exception\n" + 
3791
			"        [pc: 0, pc: 9] -> 11 when : java.lang.Exception\n" + 
3798
			"        [pc: 7, pc: 14] -> 17 when : java.lang.Exception\n" + 
3799
			"      Line numbers:\n" + 
3792
			"      Line numbers:\n" + 
3800
			"        [pc: 0, line: 31]\n" + 
3793
			"        [pc: 0, line: 31]\n" + 
3801
			"        [pc: 5, line: 32]\n" + 
3794
			"        [pc: 9, line: 32]\n" + 
3802
			"        [pc: 7, line: 31]\n" + 
3795
			"        [pc: 11, line: 34]\n" + 
3803
			"        [pc: 17, line: 34]\n" + 
3796
			"        [pc: 12, line: 36]\n" + 
3804
			"        [pc: 18, line: 36]\n" + 
3805
			"      Local variable table:\n" + 
3797
			"      Local variable table:\n" + 
3806
			"        [pc: 0, pc: 20] local: this index: 0 type: X\n" + 
3798
			"        [pc: 0, pc: 14] local: this index: 0 type: X\n" + 
3807
			"        [pc: 2, pc: 14] local: i index: 1 type: int\n" + 
3799
			"        [pc: 2, pc: 11] local: i index: 1 type: int\n" + 
3808
			"      Stack map table: number of frames 4\n" + 
3800
			"      Stack map table: number of frames 3\n" + 
3809
			"        [pc: 5, append: {int}]\n" + 
3801
			"        [pc: 9, append: {int}]\n" + 
3810
			"        [pc: 7, same]\n" + 
3802
			"        [pc: 11, full, stack: {java.lang.Exception}, locals: {X}]\n" + 
3811
			"        [pc: 17, full, stack: {java.lang.Exception}, locals: {X}]\n" + 
3803
			"        [pc: 12, same]\n" + 
3812
			"        [pc: 18, same]\n" + 
3813
			"  \n" + 
3804
			"  \n" + 
3814
			"  // Method descriptor #31 ()D\n" + 
3805
			"  // Method descriptor #31 ()D\n" + 
3815
			"  // Stack: 2, Locals: 1\n" + 
3806
			"  // Stack: 2, Locals: 1\n" + 
Lines 4024-4051 Link Here
4024
			"  void foo4();\n" + 
4015
			"  void foo4();\n" + 
4025
			"     0  iconst_0\n" + 
4016
			"     0  iconst_0\n" + 
4026
			"     1  istore_1 [i]\n" + 
4017
			"     1  istore_1 [i]\n" + 
4027
			"     2  goto 13\n" + 
4018
			"     2  aload_0 [this]\n" + 
4028
			"     5  new java.lang.NullPointerException [19]\n" + 
4019
			"     3  invokevirtual X.bool() : boolean [17]\n" + 
4029
			"     8  dup\n" + 
4020
			"     6  ifeq 18\n" + 
4030
			"     9  invokespecial java.lang.NullPointerException() [21]\n" + 
4021
			"     9  new java.lang.NullPointerException [19]\n" + 
4031
			"    12  athrow\n" + 
4022
			"    12  dup\n" + 
4032
			"    13  aload_0 [this]\n" + 
4023
			"    13  invokespecial java.lang.NullPointerException() [21]\n" + 
4033
			"    14  invokevirtual X.bool() : boolean [17]\n" + 
4024
			"    16  athrow\n" + 
4034
			"    17  ifne 5\n" + 
4025
			"    17  astore_1\n" + 
4035
			"    20  goto 24\n" + 
4026
			"    18  return\n" + 
4036
			"    23  astore_1\n" + 
4037
			"    24  return\n" + 
4038
			"      Exception Table:\n" + 
4027
			"      Exception Table:\n" + 
4039
			"        [pc: 0, pc: 20] -> 23 when : java.lang.Exception\n" + 
4028
			"        [pc: 0, pc: 17] -> 17 when : java.lang.Exception\n" + 
4040
			"      Line numbers:\n" + 
4029
			"      Line numbers:\n" + 
4041
			"        [pc: 0, line: 29]\n" + 
4030
			"        [pc: 0, line: 29]\n" + 
4042
			"        [pc: 5, line: 30]\n" + 
4031
			"        [pc: 9, line: 30]\n" + 
4043
			"        [pc: 13, line: 29]\n" + 
4032
			"        [pc: 17, line: 32]\n" + 
4044
			"        [pc: 23, line: 32]\n" + 
4033
			"        [pc: 18, line: 34]\n" + 
4045
			"        [pc: 24, line: 34]\n" + 
4046
			"      Local variable table:\n" + 
4034
			"      Local variable table:\n" + 
4047
			"        [pc: 0, pc: 25] local: this index: 0 type: X\n" + 
4035
			"        [pc: 0, pc: 19] local: this index: 0 type: X\n" + 
4048
			"        [pc: 2, pc: 20] local: i index: 1 type: int\n" + 
4036
			"        [pc: 2, pc: 17] local: i index: 1 type: int\n" + 
4049
			"  \n" + 
4037
			"  \n" + 
4050
			"  // Method descriptor #6 ()V\n" + 
4038
			"  // Method descriptor #6 ()V\n" + 
4051
			"  // Stack: 2, Locals: 1\n" + 
4039
			"  // Stack: 2, Locals: 1\n" + 
Lines 4185-4217 Link Here
4185
			"  void foo4();\n" + 
4173
			"  void foo4();\n" + 
4186
			"     0  iconst_0\n" + 
4174
			"     0  iconst_0\n" + 
4187
			"     1  istore_1 [i]\n" + 
4175
			"     1  istore_1 [i]\n" + 
4188
			"     2  goto 13\n" + 
4176
			"     2  aload_0 [this]\n" + 
4189
			"     5  new java.lang.NullPointerException [19]\n" + 
4177
			"     3  invokevirtual X.bool() : boolean [17]\n" + 
4190
			"     8  dup\n" + 
4178
			"     6  ifeq 18\n" + 
4191
			"     9  invokespecial java.lang.NullPointerException() [21]\n" + 
4179
			"     9  new java.lang.NullPointerException [19]\n" + 
4192
			"    12  athrow\n" + 
4180
			"    12  dup\n" + 
4193
			"    13  aload_0 [this]\n" + 
4181
			"    13  invokespecial java.lang.NullPointerException() [21]\n" + 
4194
			"    14  invokevirtual X.bool() : boolean [17]\n" + 
4182
			"    16  athrow\n" + 
4195
			"    17  ifne 5\n" + 
4183
			"    17  astore_1\n" + 
4196
			"    20  goto 24\n" + 
4184
			"    18  return\n" + 
4197
			"    23  astore_1\n" + 
4198
			"    24  return\n" + 
4199
			"      Exception Table:\n" + 
4185
			"      Exception Table:\n" + 
4200
			"        [pc: 0, pc: 20] -> 23 when : java.lang.Exception\n" + 
4186
			"        [pc: 0, pc: 17] -> 17 when : java.lang.Exception\n" + 
4201
			"      Line numbers:\n" + 
4187
			"      Line numbers:\n" + 
4202
			"        [pc: 0, line: 29]\n" + 
4188
			"        [pc: 0, line: 29]\n" + 
4203
			"        [pc: 5, line: 30]\n" + 
4189
			"        [pc: 9, line: 30]\n" + 
4204
			"        [pc: 13, line: 29]\n" + 
4190
			"        [pc: 17, line: 32]\n" + 
4205
			"        [pc: 23, line: 32]\n" + 
4191
			"        [pc: 18, line: 34]\n" + 
4206
			"        [pc: 24, line: 34]\n" + 
4207
			"      Local variable table:\n" + 
4192
			"      Local variable table:\n" + 
4208
			"        [pc: 0, pc: 25] local: this index: 0 type: X\n" + 
4193
			"        [pc: 0, pc: 19] local: this index: 0 type: X\n" + 
4209
			"        [pc: 2, pc: 20] local: i index: 1 type: int\n" + 
4194
			"        [pc: 2, pc: 17] local: i index: 1 type: int\n" + 
4210
			"      Stack map table: number of frames 4\n" + 
4195
			"      Stack map table: number of frames 3\n" + 
4211
			"        [pc: 5, append: {int}]\n" + 
4196
			"        [pc: 9, append: {int}]\n" + 
4212
			"        [pc: 13, same]\n" + 
4197
			"        [pc: 17, full, stack: {java.lang.Exception}, locals: {X}]\n" + 
4213
			"        [pc: 23, full, stack: {java.lang.Exception}, locals: {X}]\n" + 
4198
			"        [pc: 18, same]\n" + 
4214
			"        [pc: 24, same]\n" + 
4215
			"  \n" + 
4199
			"  \n" + 
4216
			"  // Method descriptor #6 ()V\n" + 
4200
			"  // Method descriptor #6 ()V\n" + 
4217
			"  // Stack: 2, Locals: 1\n" + 
4201
			"  // Stack: 2, Locals: 1\n" + 
Lines 4420-4426 Link Here
4420
			"     1  istore_1 [i]\n" + 
4404
			"     1  istore_1 [i]\n" + 
4421
			"     2  aload_0 [this]\n" + 
4405
			"     2  aload_0 [this]\n" + 
4422
			"     3  invokevirtual X.bool() : boolean [17]\n" + 
4406
			"     3  invokevirtual X.bool() : boolean [17]\n" + 
4423
			"     6  ifne 13\n" + 
4407
			"     6  ifeq 13\n" + 
4424
			"     9  goto 13\n" + 
4408
			"     9  goto 13\n" + 
4425
			"    12  astore_1\n" + 
4409
			"    12  astore_1\n" + 
4426
			"    13  return\n" + 
4410
			"    13  return\n" + 
Lines 4428-4438 Link Here
4428
			"        [pc: 0, pc: 9] -> 12 when : java.lang.Exception\n" + 
4412
			"        [pc: 0, pc: 9] -> 12 when : java.lang.Exception\n" + 
4429
			"      Line numbers:\n" + 
4413
			"      Line numbers:\n" + 
4430
			"        [pc: 0, line: 29]\n" + 
4414
			"        [pc: 0, line: 29]\n" + 
4415
			"        [pc: 9, line: 30]\n" + 
4431
			"        [pc: 12, line: 32]\n" + 
4416
			"        [pc: 12, line: 32]\n" + 
4432
			"        [pc: 13, line: 34]\n" + 
4417
			"        [pc: 13, line: 34]\n" + 
4433
			"      Local variable table:\n" + 
4418
			"      Local variable table:\n" + 
4434
			"        [pc: 0, pc: 14] local: this index: 0 type: X\n" + 
4419
			"        [pc: 0, pc: 14] local: this index: 0 type: X\n" + 
4435
			"        [pc: 2, pc: 9] local: i index: 1 type: int\n" + 
4420
			"        [pc: 2, pc: 12] local: i index: 1 type: int\n" + 
4436
			"  \n" + 
4421
			"  \n" + 
4437
			"  // Method descriptor #6 ()V\n" + 
4422
			"  // Method descriptor #6 ()V\n" + 
4438
			"  // Stack: 1, Locals: 1\n" + 
4423
			"  // Stack: 1, Locals: 1\n" + 
Lines 4552-4558 Link Here
4552
			"     1  istore_1 [i]\n" + 
4537
			"     1  istore_1 [i]\n" + 
4553
			"     2  aload_0 [this]\n" + 
4538
			"     2  aload_0 [this]\n" + 
4554
			"     3  invokevirtual X.bool() : boolean [17]\n" + 
4539
			"     3  invokevirtual X.bool() : boolean [17]\n" + 
4555
			"     6  ifne 13\n" + 
4540
			"     6  ifeq 13\n" + 
4556
			"     9  goto 13\n" + 
4541
			"     9  goto 13\n" + 
4557
			"    12  astore_1\n" + 
4542
			"    12  astore_1\n" + 
4558
			"    13  return\n" + 
4543
			"    13  return\n" + 
Lines 4560-4572 Link Here
4560
			"        [pc: 0, pc: 9] -> 12 when : java.lang.Exception\n" + 
4545
			"        [pc: 0, pc: 9] -> 12 when : java.lang.Exception\n" + 
4561
			"      Line numbers:\n" + 
4546
			"      Line numbers:\n" + 
4562
			"        [pc: 0, line: 29]\n" + 
4547
			"        [pc: 0, line: 29]\n" + 
4548
			"        [pc: 9, line: 30]\n" + 
4563
			"        [pc: 12, line: 32]\n" + 
4549
			"        [pc: 12, line: 32]\n" + 
4564
			"        [pc: 13, line: 34]\n" + 
4550
			"        [pc: 13, line: 34]\n" + 
4565
			"      Local variable table:\n" + 
4551
			"      Local variable table:\n" + 
4566
			"        [pc: 0, pc: 14] local: this index: 0 type: X\n" + 
4552
			"        [pc: 0, pc: 14] local: this index: 0 type: X\n" + 
4567
			"        [pc: 2, pc: 9] local: i index: 1 type: int\n" + 
4553
			"        [pc: 2, pc: 12] local: i index: 1 type: int\n" + 
4568
			"      Stack map table: number of frames 3\n" + 
4554
			"      Stack map table: number of frames 3\n" + 
4569
			"        [pc: 2, append: {int}]\n" + 
4555
			"        [pc: 9, append: {int}]\n" + 
4570
			"        [pc: 12, full, stack: {java.lang.Exception}, locals: {X}]\n" + 
4556
			"        [pc: 12, full, stack: {java.lang.Exception}, locals: {X}]\n" + 
4571
			"        [pc: 13, same]\n" + 
4557
			"        [pc: 13, same]\n" + 
4572
			"  \n" + 
4558
			"  \n" + 
Lines 4777-4829 Link Here
4777
			"  public static void main(java.lang.String[] argv);\n" + 
4763
			"  public static void main(java.lang.String[] argv);\n" + 
4778
			"     0  iconst_0\n" + 
4764
			"     0  iconst_0\n" + 
4779
			"     1  istore_1 [i]\n" + 
4765
			"     1  istore_1 [i]\n" + 
4780
			"     2  goto 8\n" + 
4766
			"     2  iload_1 [i]\n" + 
4781
			"     5  goto 5\n" + 
4767
			"     3  ifge 10\n" + 
4782
			"     8  iload_1 [i]\n" + 
4768
			"     6  goto 6\n" + 
4783
			"     9  iflt 5\n" + 
4769
			"     9  astore_1\n" + 
4784
			"    12  goto 16\n" + 
4770
			"    10  return\n" + 
4785
			"    15  astore_1\n" + 
4786
			"    16  return\n" + 
4787
			"      Exception Table:\n" + 
4771
			"      Exception Table:\n" + 
4788
			"        [pc: 0, pc: 12] -> 15 when : java.lang.Exception\n" + 
4772
			"        [pc: 0, pc: 9] -> 9 when : java.lang.Exception\n" + 
4789
			"      Line numbers:\n" + 
4773
			"      Line numbers:\n" + 
4790
			"        [pc: 0, line: 4]\n" + 
4774
			"        [pc: 0, line: 4]\n" + 
4791
			"        [pc: 5, line: 5]\n" + 
4775
			"        [pc: 6, line: 5]\n" + 
4792
			"        [pc: 8, line: 4]\n" + 
4776
			"        [pc: 9, line: 6]\n" + 
4793
			"        [pc: 15, line: 6]\n" + 
4777
			"        [pc: 10, line: 8]\n" + 
4794
			"        [pc: 16, line: 8]\n" + 
4795
			"      Local variable table:\n" + 
4778
			"      Local variable table:\n" + 
4796
			"        [pc: 0, pc: 17] local: argv index: 0 type: java.lang.String[]\n" + 
4779
			"        [pc: 0, pc: 11] local: argv index: 0 type: java.lang.String[]\n" + 
4797
			"        [pc: 2, pc: 12] local: i index: 1 type: int\n"
4780
			"        [pc: 2, pc: 9] local: i index: 1 type: int\n"
4798
		:	
4781
		:	
4799
			"  // Method descriptor #15 ([Ljava/lang/String;)V\n" + 
4782
			"  // Method descriptor #15 ([Ljava/lang/String;)V\n" + 
4800
			"  // Stack: 1, Locals: 2\n" + 
4783
			"  // Stack: 1, Locals: 2\n" + 
4801
			"  public static void main(java.lang.String[] argv);\n" + 
4784
			"  public static void main(java.lang.String[] argv);\n" + 
4802
			"     0  iconst_0\n" + 
4785
			"     0  iconst_0\n" + 
4803
			"     1  istore_1 [i]\n" + 
4786
			"     1  istore_1 [i]\n" + 
4804
			"     2  goto 8\n" + 
4787
			"     2  iload_1 [i]\n" + 
4805
			"     5  goto 5\n" + 
4788
			"     3  ifge 10\n" + 
4806
			"     8  iload_1 [i]\n" + 
4789
			"     6  goto 6\n" + 
4807
			"     9  iflt 5\n" + 
4790
			"     9  astore_1\n" + 
4808
			"    12  goto 16\n" + 
4791
			"    10  return\n" + 
4809
			"    15  astore_1\n" + 
4810
			"    16  return\n" + 
4811
			"      Exception Table:\n" + 
4792
			"      Exception Table:\n" + 
4812
			"        [pc: 0, pc: 12] -> 15 when : java.lang.Exception\n" + 
4793
			"        [pc: 0, pc: 9] -> 9 when : java.lang.Exception\n" + 
4813
			"      Line numbers:\n" + 
4794
			"      Line numbers:\n" + 
4814
			"        [pc: 0, line: 4]\n" + 
4795
			"        [pc: 0, line: 4]\n" + 
4815
			"        [pc: 5, line: 5]\n" + 
4796
			"        [pc: 6, line: 5]\n" + 
4816
			"        [pc: 8, line: 4]\n" + 
4797
			"        [pc: 9, line: 6]\n" + 
4817
			"        [pc: 15, line: 6]\n" + 
4798
			"        [pc: 10, line: 8]\n" + 
4818
			"        [pc: 16, line: 8]\n" + 
4819
			"      Local variable table:\n" + 
4799
			"      Local variable table:\n" + 
4820
			"        [pc: 0, pc: 17] local: argv index: 0 type: java.lang.String[]\n" + 
4800
			"        [pc: 0, pc: 11] local: argv index: 0 type: java.lang.String[]\n" + 
4821
			"        [pc: 2, pc: 12] local: i index: 1 type: int\n" + 
4801
			"        [pc: 2, pc: 9] local: i index: 1 type: int\n" + 
4822
			"      Stack map table: number of frames 4\n" + 
4802
			"      Stack map table: number of frames 3\n" + 
4823
			"        [pc: 5, append: {int}]\n" + 
4803
			"        [pc: 6, append: {int}]\n" + 
4824
			"        [pc: 8, same]\n" + 
4804
			"        [pc: 9, full, stack: {java.lang.Exception}, locals: {java.lang.String[]}]\n" + 
4825
			"        [pc: 15, full, stack: {java.lang.Exception}, locals: {java.lang.String[]}]\n" + 
4805
			"        [pc: 10, same]\n";
4826
			"        [pc: 16, same]\n";
4827
	
4806
	
4828
	try {
4807
	try {
4829
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
4808
		File f = new File(OUTPUT_DIR + File.separator + "X.class");
Lines 4868-4874 Link Here
4868
			"     0  bipush 7\n" + 
4847
			"     0  bipush 7\n" + 
4869
			"     2  istore_1 [val]\n" + 
4848
			"     2  istore_1 [val]\n" + 
4870
			"     3  iload_1 [val]\n" + 
4849
			"     3  iload_1 [val]\n" + 
4871
			"     4  ifgt 7\n" + 
4850
			"     4  ifle 7\n" + 
4872
			"     7  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
4851
			"     7  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
4873
			"    10  iload_1 [val]\n" + 
4852
			"    10  iload_1 [val]\n" + 
4874
			"    11  invokevirtual java.io.PrintStream.println(int) : void [22]\n" + 
4853
			"    11  invokevirtual java.io.PrintStream.println(int) : void [22]\n" + 
Lines 4892-4898 Link Here
4892
			"     0  bipush 7\n" + 
4871
			"     0  bipush 7\n" + 
4893
			"     2  istore_1 [val]\n" + 
4872
			"     2  istore_1 [val]\n" + 
4894
			"     3  iload_1 [val]\n" + 
4873
			"     3  iload_1 [val]\n" + 
4895
			"     4  ifgt 7\n" + 
4874
			"     4  ifle 7\n" + 
4896
			"     7  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
4875
			"     7  getstatic java.lang.System.out : java.io.PrintStream [16]\n" + 
4897
			"    10  iload_1 [val]\n" + 
4876
			"    10  iload_1 [val]\n" + 
4898
			"    11  invokevirtual java.io.PrintStream.println(int) : void [22]\n" + 
4877
			"    11  invokevirtual java.io.PrintStream.println(int) : void [22]\n" + 
Lines 4909-4917 Link Here
4909
			"      Local variable table:\n" + 
4888
			"      Local variable table:\n" + 
4910
			"        [pc: 0, pc: 19] local: args index: 0 type: java.lang.String[]\n" + 
4889
			"        [pc: 0, pc: 19] local: args index: 0 type: java.lang.String[]\n" + 
4911
			"        [pc: 3, pc: 17] local: val index: 1 type: int\n" + 
4890
			"        [pc: 3, pc: 17] local: val index: 1 type: int\n" + 
4912
			"      Stack map table: number of frames 4\n" + 
4891
			"      Stack map table: number of frames 3\n" + 
4913
			"        [pc: 3, append: {int}]\n" + 
4892
			"        [pc: 7, append: {int}]\n" + 
4914
			"        [pc: 7, same]\n" + 
4915
			"        [pc: 17, full, stack: {java.lang.Exception}, locals: {java.lang.String[]}]\n" + 
4893
			"        [pc: 17, full, stack: {java.lang.Exception}, locals: {java.lang.String[]}]\n" + 
4916
			"        [pc: 18, same]\n";
4894
			"        [pc: 18, same]\n";
4917
	
4895
	

Return to bug 180471