|
Lines 27-32
Link Here
|
| 27 |
* Bug 415291 - [1.8][null] differentiate type incompatibilities due to null annotations |
27 |
* Bug 415291 - [1.8][null] differentiate type incompatibilities due to null annotations |
| 28 |
* Andy Clement - Contributions for |
28 |
* Andy Clement - Contributions for |
| 29 |
* Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work) |
29 |
* Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work) |
|
|
30 |
* Bug 409250 - [1.8][compiler] Various loose ends in 308 code generation |
| 30 |
*******************************************************************************/ |
31 |
*******************************************************************************/ |
| 31 |
package org.eclipse.jdt.internal.compiler.ast; |
32 |
package org.eclipse.jdt.internal.compiler.ast; |
| 32 |
|
33 |
|
|
Lines 301-307
public void generateArguments(MethodBinding binding, Expression[] arguments, Blo
Link Here
|
| 301 |
// called with (argLength - lastIndex) elements : foo(1, 2) or foo(1, 2, 3, 4) |
302 |
// called with (argLength - lastIndex) elements : foo(1, 2) or foo(1, 2, 3, 4) |
| 302 |
// need to gen elements into an array, then gen each remaining element into created array |
303 |
// need to gen elements into an array, then gen each remaining element into created array |
| 303 |
codeStream.generateInlinedValue(argLength - varArgIndex); |
304 |
codeStream.generateInlinedValue(argLength - varArgIndex); |
| 304 |
codeStream.newArray(null, codeGenVarArgsType); // create a mono-dimensional array |
305 |
codeStream.newArray(codeGenVarArgsType); // create a mono-dimensional array |
| 305 |
for (int i = varArgIndex; i < argLength; i++) { |
306 |
for (int i = varArgIndex; i < argLength; i++) { |
| 306 |
codeStream.dup(); |
307 |
codeStream.dup(); |
| 307 |
codeStream.generateInlinedValue(i - varArgIndex); |
308 |
codeStream.generateInlinedValue(i - varArgIndex); |
|
Lines 320-326
public void generateArguments(MethodBinding binding, Expression[] arguments, Blo
Link Here
|
| 320 |
// right number but not directly compatible or too many arguments - wrap extra into array |
321 |
// right number but not directly compatible or too many arguments - wrap extra into array |
| 321 |
// need to gen elements into an array, then gen each remaining element into created array |
322 |
// need to gen elements into an array, then gen each remaining element into created array |
| 322 |
codeStream.generateInlinedValue(1); |
323 |
codeStream.generateInlinedValue(1); |
| 323 |
codeStream.newArray(null, codeGenVarArgsType); // create a mono-dimensional array |
324 |
codeStream.newArray(codeGenVarArgsType); // create a mono-dimensional array |
| 324 |
codeStream.dup(); |
325 |
codeStream.dup(); |
| 325 |
codeStream.generateInlinedValue(0); |
326 |
codeStream.generateInlinedValue(0); |
| 326 |
arguments[varArgIndex].generateCode(currentScope, codeStream, true); |
327 |
arguments[varArgIndex].generateCode(currentScope, codeStream, true); |
|
Lines 330-336
public void generateArguments(MethodBinding binding, Expression[] arguments, Blo
Link Here
|
| 330 |
// scenario: foo(1) --> foo(1, new int[0]) |
331 |
// scenario: foo(1) --> foo(1, new int[0]) |
| 331 |
// generate code for an empty array of parameterType |
332 |
// generate code for an empty array of parameterType |
| 332 |
codeStream.generateInlinedValue(0); |
333 |
codeStream.generateInlinedValue(0); |
| 333 |
codeStream.newArray(null, codeGenVarArgsType); // create a mono-dimensional array |
334 |
codeStream.newArray(codeGenVarArgsType); // create a mono-dimensional array |
| 334 |
} |
335 |
} |
| 335 |
} else if (arguments != null) { // standard generation for method arguments |
336 |
} else if (arguments != null) { // standard generation for method arguments |
| 336 |
for (int i = 0, max = arguments.length; i < max; i++) |
337 |
for (int i = 0, max = arguments.length; i < max; i++) |