test line number table generation in subroutines

This commit is contained in:
Joshua Warner 2014-05-03 23:28:27 -06:00 committed by Joshua Warner
parent 9273d5ca39
commit 37d104871c
2 changed files with 19 additions and 1 deletions

@ -6431,7 +6431,6 @@ object translateExceptionHandlerTable(MyThread* t,
object object
translateLineNumberTable(MyThread* t, Context* context, intptr_t start) translateLineNumberTable(MyThread* t, Context* context, intptr_t start)
{ {
// TODO: add line number table entries for subroutines (duplicated code)
object oldTable = codeLineNumberTable(t, methodCode(t, context->method)); object oldTable = codeLineNumberTable(t, methodCode(t, context->method));
if (oldTable) { if (oldTable) {
PROTECT(t, oldTable); PROTECT(t, oldTable);

@ -253,6 +253,16 @@ public class Subroutine {
return true; return true;
} }
private static int test6(boolean predicate) {
try {
if (predicate) {
return -2;
}
} finally {
return new Throwable().getStackTrace()[0].getLineNumber();
}
}
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
test(false, false); test(false, false);
test(false, true); test(false, true);
@ -311,6 +321,15 @@ public class Subroutine {
(null, new Object[0]); (null, new Object[0]);
stackMap(new Object()); stackMap(new Object());
{
int f = test6(false);
int t = test6(true);
System.out.println("line: " + f);
expect(f > 0);
expect(f == t);
}
} }
private static class DummyException extends RuntimeException { } private static class DummyException extends RuntimeException { }