8010404: Lambda debugging: redundant LineNumberTable entry for lambda capture
Ignore indy entries in LineNumberTable Reviewed-by: jjg
This commit is contained in:
parent
08df98aa3c
commit
b4b6e4f82e
@ -470,7 +470,15 @@ public class Code {
|
||||
public void emitInvokedynamic(int desc, Type mtype) {
|
||||
// N.B. this format is under consideration by the JSR 292 EG
|
||||
int argsize = width(mtype.getParameterTypes());
|
||||
emitop(invokedynamic);
|
||||
int prevPos = pendingStatPos;
|
||||
try {
|
||||
//disable line number generation (we could have used 'emit1', that
|
||||
//bypasses stackmap generation - which is needed for indy calls)
|
||||
pendingStatPos = Position.NOPOS;
|
||||
emitop(invokedynamic);
|
||||
} finally {
|
||||
pendingStatPos = prevPos;
|
||||
}
|
||||
if (!alive) return;
|
||||
emit2(desc);
|
||||
emit2(0);
|
||||
|
@ -1748,10 +1748,13 @@ public class Gen extends JCTree.Visitor {
|
||||
// Generate code for all arguments, where the expected types are
|
||||
// the parameters of the method's external type (that is, any implicit
|
||||
// outer instance of a super(...) call appears as first parameter).
|
||||
MethodSymbol msym = (MethodSymbol)TreeInfo.symbol(tree.meth);
|
||||
genArgs(tree.args,
|
||||
TreeInfo.symbol(tree.meth).externalType(types).getParameterTypes());
|
||||
code.statBegin(tree.pos);
|
||||
code.markStatBegin();
|
||||
msym.externalType(types).getParameterTypes());
|
||||
if (!msym.isDynamic()) {
|
||||
code.statBegin(tree.pos);
|
||||
code.markStatBegin();
|
||||
}
|
||||
result = m.invoke();
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
/*
|
||||
* @test
|
||||
* @bug 7194586
|
||||
* @bug 8003280 8006694
|
||||
* @bug 8003280 8006694 8010404
|
||||
* @summary Add lambda tests
|
||||
* Add back-end support for invokedynamic
|
||||
* temporarily workaround combo tests are causing time out in several platforms
|
||||
@ -48,6 +48,7 @@ import com.sun.tools.classfile.ClassFile;
|
||||
import com.sun.tools.classfile.Code_attribute;
|
||||
import com.sun.tools.classfile.ConstantPool.*;
|
||||
import com.sun.tools.classfile.Instruction;
|
||||
import com.sun.tools.classfile.LineNumberTable_attribute;
|
||||
import com.sun.tools.classfile.Method;
|
||||
|
||||
import com.sun.tools.javac.api.JavacTaskImpl;
|
||||
@ -239,7 +240,7 @@ public class TestInvokeDynamic
|
||||
int id = checkCount.incrementAndGet();
|
||||
JavaSource source = new JavaSource(id);
|
||||
JavacTaskImpl ct = (JavacTaskImpl)comp.getTask(null, fm.get(), dc,
|
||||
null, null, Arrays.asList(source));
|
||||
Arrays.asList("-g"), null, Arrays.asList(source));
|
||||
Context context = ct.getContext();
|
||||
Symtab syms = Symtab.instance(context);
|
||||
Names names = Names.instance(context);
|
||||
@ -349,6 +350,16 @@ public class TestInvokeDynamic
|
||||
bsm_ref.getNameAndTypeInfo().getType() + " " +
|
||||
asBSMSignatureString());
|
||||
}
|
||||
|
||||
LineNumberTable_attribute lnt =
|
||||
(LineNumberTable_attribute)ea.attributes.get(Attribute.LineNumberTable);
|
||||
|
||||
if (lnt == null) {
|
||||
throw new Error("No LineNumberTable attribute");
|
||||
}
|
||||
if (lnt.line_number_table_length != 2) {
|
||||
throw new Error("Wrong number of entries in LineNumberTable");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new Error("error reading " + compiledTest +": " + e);
|
||||
@ -376,7 +387,10 @@ public class TestInvokeDynamic
|
||||
"}\n" +
|
||||
"class Test#ID {\n" +
|
||||
" void m() { }\n" +
|
||||
" void test() { m(); }\n" +
|
||||
" void test() {\n" +
|
||||
" Object o = this; // marker statement \n" +
|
||||
" m();\n" +
|
||||
" }\n" +
|
||||
"}";
|
||||
|
||||
String source;
|
||||
|
Loading…
x
Reference in New Issue
Block a user