Skip to content

Add/elim static this #624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed

Conversation

odersky
Copy link
Contributor

@odersky odersky commented May 29, 2015

For what it's worth, here's a phase to eliminate This(...) from static methods. Not sure whether it does anything useful. Impossible to say without tests working. @DarkDimius maybe it's useful for your fixes.

odersky added 7 commits May 29, 2015 15:45
Constants that are adapted to a different supertype need to do this
explicitly (not just by changing the type). Otherwise tree checkers
will compute the original type and fail.

This caused a test failure in pos/harmonize. The mystery is why this
was not caught in the checkin tests.
…nclosing class is also the top-level class"

This reverts commit 6898d2c.
Previously was only done for DefDefs. Caused backend failure.
@DarkDimius
Copy link
Contributor

we are experiencing a silend failure of VM here.
@lrytz @retronym have you seen such behaviour ever?
Interpreter reaches _shouldnotreachhere instruction

java -cp .:/Users/dark/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.5.jar:/Users/da/workspace/dotty/target/scala-2.11/dotty_2.11-0.1-SNAPSHOT.jar -XX:+UnlockDiagnosticVMOptions -XX:+PrintInterpreter Test

----------------------------------------------------------------------
Interpreter

code size        =    129K bytes
total space      =    255K bytes
wasted space     =    126K bytes

# of codelets    =    265
avg codelet size =    499 bytes


----------------------------------------------------------------------
slow signature handler  [0x0000000107121380, 0x0000000107121540]  448 bytes

Could not load hsdis-amd64.dylib; library not loadable; PrintAssembly is disabled

----------------------------------------------------------------------
error exits  [0x0000000107121560, 0x0000000107121660]  256 bytes


----------------------------------------------------------------------
return entry points  [0x0000000107121680, 0x0000000107123140]  6848 bytes


----------------------------------------------------------------------
invoke return entry points  [0x0000000107123160, 0x0000000107123a60]  2304 bytes


----------------------------------------------------------------------
earlyret entry points  [0x0000000107123a80, 0x0000000107125200]  6016 bytes


----------------------------------------------------------------------
deoptimization entry points  [0x0000000107125220, 0x000000010712b280]  24672 bytes


----------------------------------------------------------------------
result handlers for native calls  [0x000000010712b2a0, 0x000000010712b2c0]  32 bytes


----------------------------------------------------------------------
continuation entry points  [0x000000010712b2e0, 0x000000010712b3e0]  256 bytes


----------------------------------------------------------------------
safepoint entry points  [0x000000010712b400, 0x000000010712b980]  1408 bytes


----------------------------------------------------------------------
exception handling  [0x000000010712b9a0, 0x000000010712c4e0]  2880 bytes


----------------------------------------------------------------------
throw exception entrypoints  [0x000000010712c500, 0x000000010712c920]  1056 bytes


----------------------------------------------------------------------
method entry point (kind = zerolocals)  [0x000000010712c940, 0x000000010712cdc0]  1152 bytes


----------------------------------------------------------------------
method entry point (kind = zerolocals_synchronized)  [0x000000010712cde0, 0x000000010712d3e0]  1536 bytes


----------------------------------------------------------------------
method entry point (kind = empty)  [0x000000010712d400, 0x000000010712d880]  1152 bytes


----------------------------------------------------------------------
method entry point (kind = accessor)  [0x000000010712d8a0, 0x000000010712dd20]  1152 bytes


----------------------------------------------------------------------
method entry point (kind = abstract)  [0x000000010712dd40, 0x000000010712de60]  288 bytes


----------------------------------------------------------------------
method entry point (kind = java_lang_math_sin)  [0x000000010712de80, 0x000000010712e1e0]  864 bytes


----------------------------------------------------------------------
method entry point (kind = java_lang_math_cos)  [0x000000010712e200, 0x000000010712e560]  864 bytes


----------------------------------------------------------------------
method entry point (kind = java_lang_math_tan)  [0x000000010712e580, 0x000000010712e8e0]  864 bytes


----------------------------------------------------------------------
method entry point (kind = java_lang_math_abs)  [0x000000010712e900, 0x000000010712e920]  32 bytes


----------------------------------------------------------------------
method entry point (kind = java_lang_math_sqrt)  [0x000000010712e940, 0x000000010712e960]  32 bytes


----------------------------------------------------------------------
method entry point (kind = java_lang_math_log)  [0x000000010712e980, 0x000000010712e9a0]  32 bytes


----------------------------------------------------------------------
method entry point (kind = java_lang_math_log10)  [0x000000010712e9c0, 0x000000010712e9e0]  32 bytes


----------------------------------------------------------------------
method entry point (kind = java_lang_math_exp)  [0x000000010712ea00, 0x000000010712edc0]  960 bytes


----------------------------------------------------------------------
method entry point (kind = java_lang_math_pow)  [0x000000010712ede0, 0x000000010712f260]  1152 bytes


----------------------------------------------------------------------
method entry point (kind = java_lang_ref_reference_get)  [0x000000010712f280, 0x000000010712f700]  1152 bytes


----------------------------------------------------------------------
method entry point (kind = java_util_zip_CRC32_update)  [0x000000010712f720, 0x0000000107130060]  2368 bytes


----------------------------------------------------------------------
method entry point (kind = java_util_zip_CRC32_updateBytes)  [0x0000000107130080, 0x00000001071309c0]  2368 bytes


----------------------------------------------------------------------
method entry point (kind = java_util_zip_CRC32_updateByteBuffer)  [0x00000001071309e0, 0x0000000107131320]  2368 bytes


----------------------------------------------------------------------
method entry point (kind = native)  [0x0000000107131340, 0x0000000107131c40]  2304 bytes


----------------------------------------------------------------------
method entry point (kind = native_synchronized)  [0x0000000107131c60, 0x00000001071326e0]  2688 bytes


----------------------------------------------------------------------
nop  0 nop  [0x0000000107132700, 0x0000000107132760]  96 bytes


----------------------------------------------------------------------
aconst_null  1 aconst_null  [0x0000000107132780, 0x00000001071327e0]  96 bytes


----------------------------------------------------------------------
iconst_m1  2 iconst_m1  [0x0000000107132800, 0x0000000107132860]  96 bytes


----------------------------------------------------------------------
iconst_0  3 iconst_0  [0x0000000107132880, 0x00000001071328e0]  96 bytes


----------------------------------------------------------------------
iconst_1  4 iconst_1  [0x0000000107132900, 0x0000000107132960]  96 bytes


----------------------------------------------------------------------
iconst_2  5 iconst_2  [0x0000000107132980, 0x00000001071329e0]  96 bytes


----------------------------------------------------------------------
iconst_3  6 iconst_3  [0x0000000107132a00, 0x0000000107132a60]  96 bytes


----------------------------------------------------------------------
iconst_4  7 iconst_4  [0x0000000107132a80, 0x0000000107132ae0]  96 bytes


----------------------------------------------------------------------
iconst_5  8 iconst_5  [0x0000000107132b00, 0x0000000107132b60]  96 bytes


----------------------------------------------------------------------
lconst_0  9 lconst_0  [0x0000000107132b80, 0x0000000107132be0]  96 bytes


----------------------------------------------------------------------
lconst_1  10 lconst_1  [0x0000000107132c00, 0x0000000107132c60]  96 bytes


----------------------------------------------------------------------
fconst_0  11 fconst_0  [0x0000000107132c80, 0x0000000107132ce0]  96 bytes


----------------------------------------------------------------------
fconst_1  12 fconst_1  [0x0000000107132d00, 0x0000000107132d60]  96 bytes


----------------------------------------------------------------------
fconst_2  13 fconst_2  [0x0000000107132d80, 0x0000000107132de0]  96 bytes


----------------------------------------------------------------------
dconst_0  14 dconst_0  [0x0000000107132e00, 0x0000000107132e60]  96 bytes


----------------------------------------------------------------------
dconst_1  15 dconst_1  [0x0000000107132e80, 0x0000000107132ee0]  96 bytes


----------------------------------------------------------------------
bipush  16 bipush  [0x0000000107132f00, 0x0000000107132f60]  96 bytes


----------------------------------------------------------------------
sipush  17 sipush  [0x0000000107132f80, 0x0000000107132fe0]  96 bytes


----------------------------------------------------------------------
ldc  18 ldc  [0x0000000107133000, 0x0000000107133140]  320 bytes


----------------------------------------------------------------------
ldc_w  19 ldc_w  [0x0000000107133160, 0x00000001071332a0]  320 bytes


----------------------------------------------------------------------
ldc2_w  20 ldc2_w  [0x00000001071332c0, 0x0000000107133360]  160 bytes


----------------------------------------------------------------------
iload  21 iload  [0x0000000107133380, 0x0000000107133440]  192 bytes


----------------------------------------------------------------------
lload  22 lload  [0x0000000107133460, 0x00000001071334e0]  128 bytes


----------------------------------------------------------------------
fload  23 fload  [0x0000000107133500, 0x0000000107133580]  128 bytes


----------------------------------------------------------------------
dload  24 dload  [0x00000001071335a0, 0x0000000107133640]  160 bytes


----------------------------------------------------------------------
aload  25 aload  [0x0000000107133660, 0x00000001071336e0]  128 bytes


----------------------------------------------------------------------
iload_0  26 iload_0  [0x0000000107133700, 0x0000000107133760]  96 bytes


----------------------------------------------------------------------
iload_1  27 iload_1  [0x0000000107133780, 0x00000001071337e0]  96 bytes


----------------------------------------------------------------------
iload_2  28 iload_2  [0x0000000107133800, 0x0000000107133860]  96 bytes


----------------------------------------------------------------------
iload_3  29 iload_3  [0x0000000107133880, 0x00000001071338e0]  96 bytes


----------------------------------------------------------------------
lload_0  30 lload_0  [0x0000000107133900, 0x0000000107133960]  96 bytes


----------------------------------------------------------------------
lload_1  31 lload_1  [0x0000000107133980, 0x00000001071339e0]  96 bytes


----------------------------------------------------------------------
lload_2  32 lload_2  [0x0000000107133a00, 0x0000000107133a60]  96 bytes


----------------------------------------------------------------------
lload_3  33 lload_3  [0x0000000107133a80, 0x0000000107133ae0]  96 bytes


----------------------------------------------------------------------
fload_0  34 fload_0  [0x0000000107133b00, 0x0000000107133b60]  96 bytes


----------------------------------------------------------------------
fload_1  35 fload_1  [0x0000000107133b80, 0x0000000107133be0]  96 bytes


----------------------------------------------------------------------
fload_2  36 fload_2  [0x0000000107133c00, 0x0000000107133c60]  96 bytes


----------------------------------------------------------------------
fload_3  37 fload_3  [0x0000000107133c80, 0x0000000107133ce0]  96 bytes


----------------------------------------------------------------------
dload_0  38 dload_0  [0x0000000107133d00, 0x0000000107133d60]  96 bytes


----------------------------------------------------------------------
dload_1  39 dload_1  [0x0000000107133d80, 0x0000000107133de0]  96 bytes


----------------------------------------------------------------------
dload_2  40 dload_2  [0x0000000107133e00, 0x0000000107133e60]  96 bytes


----------------------------------------------------------------------
dload_3  41 dload_3  [0x0000000107133e80, 0x0000000107133ee0]  96 bytes


----------------------------------------------------------------------
aload_0  42 aload_0  [0x0000000107133f00, 0x0000000107133fa0]  160 bytes


----------------------------------------------------------------------
aload_1  43 aload_1  [0x0000000107133fc0, 0x0000000107134020]  96 bytes


----------------------------------------------------------------------
aload_2  44 aload_2  [0x0000000107134040, 0x00000001071340a0]  96 bytes


----------------------------------------------------------------------
aload_3  45 aload_3  [0x00000001071340c0, 0x0000000107134120]  96 bytes


----------------------------------------------------------------------
iaload  46 iaload  [0x0000000107134140, 0x0000000107134180]  64 bytes


----------------------------------------------------------------------
laload  47 laload  [0x00000001071341a0, 0x00000001071341e0]  64 bytes


----------------------------------------------------------------------
faload  48 faload  [0x0000000107134200, 0x0000000107134240]  64 bytes


----------------------------------------------------------------------
daload  49 daload  [0x0000000107134260, 0x00000001071342a0]  64 bytes


----------------------------------------------------------------------
aaload  50 aaload  [0x00000001071342c0, 0x0000000107134300]  64 bytes


----------------------------------------------------------------------
baload  51 baload  [0x0000000107134320, 0x0000000107134360]  64 bytes


----------------------------------------------------------------------
caload  52 caload  [0x0000000107134380, 0x00000001071343c0]  64 bytes


----------------------------------------------------------------------
saload  53 saload  [0x00000001071343e0, 0x0000000107134420]  64 bytes


----------------------------------------------------------------------
istore  54 istore  [0x0000000107134440, 0x00000001071344a0]  96 bytes


----------------------------------------------------------------------
lstore  55 lstore  [0x00000001071344c0, 0x0000000107134520]  96 bytes


----------------------------------------------------------------------
fstore  56 fstore  [0x0000000107134540, 0x00000001071345c0]  128 bytes


----------------------------------------------------------------------
dstore  57 dstore  [0x00000001071345e0, 0x0000000107134660]  128 bytes


----------------------------------------------------------------------
astore  58 astore  [0x0000000107134680, 0x0000000107134700]  128 bytes


----------------------------------------------------------------------
istore_0  59 istore_0  [0x0000000107134720, 0x0000000107134740]  32 bytes


----------------------------------------------------------------------
istore_1  60 istore_1  [0x0000000107134760, 0x00000001071347a0]  64 bytes


----------------------------------------------------------------------
istore_2  61 istore_2  [0x00000001071347c0, 0x0000000107134800]  64 bytes


----------------------------------------------------------------------
istore_3  62 istore_3  [0x0000000107134820, 0x0000000107134860]  64 bytes


----------------------------------------------------------------------
lstore_0  63 lstore_0  [0x0000000107134880, 0x00000001071348c0]  64 bytes


----------------------------------------------------------------------
lstore_1  64 lstore_1  [0x00000001071348e0, 0x0000000107134920]  64 bytes


----------------------------------------------------------------------
lstore_2  65 lstore_2  [0x0000000107134940, 0x0000000107134980]  64 bytes


----------------------------------------------------------------------
lstore_3  66 lstore_3  [0x00000001071349a0, 0x00000001071349e0]  64 bytes


----------------------------------------------------------------------
fstore_0  67 fstore_0  [0x0000000107134a00, 0x0000000107134a40]  64 bytes


----------------------------------------------------------------------
fstore_1  68 fstore_1  [0x0000000107134a60, 0x0000000107134aa0]  64 bytes


----------------------------------------------------------------------
fstore_2  69 fstore_2  [0x0000000107134ac0, 0x0000000107134b00]  64 bytes


----------------------------------------------------------------------
fstore_3  70 fstore_3  [0x0000000107134b20, 0x0000000107134b60]  64 bytes


----------------------------------------------------------------------
dstore_0  71 dstore_0  [0x0000000107134b80, 0x0000000107134bc0]  64 bytes


----------------------------------------------------------------------
dstore_1  72 dstore_1  [0x0000000107134be0, 0x0000000107134c20]  64 bytes


----------------------------------------------------------------------
dstore_2  73 dstore_2  [0x0000000107134c40, 0x0000000107134c80]  64 bytes


----------------------------------------------------------------------
dstore_3  74 dstore_3  [0x0000000107134ca0, 0x0000000107134ce0]  64 bytes


----------------------------------------------------------------------
astore_0  75 astore_0  [0x0000000107134d00, 0x0000000107134d60]  96 bytes


----------------------------------------------------------------------
astore_1  76 astore_1  [0x0000000107134d80, 0x0000000107134de0]  96 bytes


----------------------------------------------------------------------
astore_2  77 astore_2  [0x0000000107134e00, 0x0000000107134e60]  96 bytes


----------------------------------------------------------------------
astore_3  78 astore_3  [0x0000000107134e80, 0x0000000107134ee0]  96 bytes


----------------------------------------------------------------------
iastore  79 iastore  [0x0000000107134f00, 0x0000000107134f40]  64 bytes


----------------------------------------------------------------------
lastore  80 lastore  [0x0000000107134f60, 0x0000000107134fa0]  64 bytes


----------------------------------------------------------------------
fastore  81 fastore  [0x0000000107134fc0, 0x0000000107135000]  64 bytes


----------------------------------------------------------------------
dastore  82 dastore  [0x0000000107135020, 0x0000000107135060]  64 bytes


----------------------------------------------------------------------
aastore  83 aastore  [0x0000000107135080, 0x0000000107135260]  480 bytes


----------------------------------------------------------------------
bastore  84 bastore  [0x0000000107135280, 0x00000001071352c0]  64 bytes


----------------------------------------------------------------------
castore  85 castore  [0x00000001071352e0, 0x0000000107135320]  64 bytes


----------------------------------------------------------------------
sastore  86 sastore  [0x0000000107135340, 0x0000000107135380]  64 bytes


----------------------------------------------------------------------
pop  87 pop  [0x00000001071353a0, 0x0000000107135400]  96 bytes


----------------------------------------------------------------------
pop2  88 pop2  [0x0000000107135420, 0x0000000107135480]  96 bytes


----------------------------------------------------------------------
dup  89 dup  [0x00000001071354a0, 0x0000000107135500]  96 bytes


----------------------------------------------------------------------
dup_x1  90 dup_x1  [0x0000000107135520, 0x0000000107135580]  96 bytes


----------------------------------------------------------------------
dup_x2  91 dup_x2  [0x00000001071355a0, 0x0000000107135620]  128 bytes


----------------------------------------------------------------------
dup2  92 dup2  [0x0000000107135640, 0x00000001071356a0]  96 bytes


----------------------------------------------------------------------
dup2_x1  93 dup2_x1  [0x00000001071356c0, 0x0000000107135740]  128 bytes


----------------------------------------------------------------------
dup2_x2  94 dup2_x2  [0x0000000107135760, 0x00000001071357e0]  128 bytes


----------------------------------------------------------------------
swap  95 swap  [0x0000000107135800, 0x0000000107135860]  96 bytes


----------------------------------------------------------------------
iadd  96 iadd  [0x0000000107135880, 0x00000001071358c0]  64 bytes


----------------------------------------------------------------------
ladd  97 ladd  [0x00000001071358e0, 0x0000000107135920]  64 bytes


----------------------------------------------------------------------
fadd  98 fadd  [0x0000000107135940, 0x0000000107135980]  64 bytes


----------------------------------------------------------------------
dadd  99 dadd  [0x00000001071359a0, 0x00000001071359e0]  64 bytes


----------------------------------------------------------------------
isub  100 isub  [0x0000000107135a00, 0x0000000107135a40]  64 bytes


----------------------------------------------------------------------
lsub  101 lsub  [0x0000000107135a60, 0x0000000107135aa0]  64 bytes


----------------------------------------------------------------------
fsub  102 fsub  [0x0000000107135ac0, 0x0000000107135b00]  64 bytes


----------------------------------------------------------------------
dsub  103 dsub  [0x0000000107135b20, 0x0000000107135b60]  64 bytes


----------------------------------------------------------------------
imul  104 imul  [0x0000000107135b80, 0x0000000107135bc0]  64 bytes


----------------------------------------------------------------------
lmul  105 lmul  [0x0000000107135be0, 0x0000000107135c20]  64 bytes


----------------------------------------------------------------------
fmul  106 fmul  [0x0000000107135c40, 0x0000000107135c80]  64 bytes


----------------------------------------------------------------------
dmul  107 dmul  [0x0000000107135ca0, 0x0000000107135ce0]  64 bytes


----------------------------------------------------------------------
idiv  108 idiv  [0x0000000107135d00, 0x0000000107135d40]  64 bytes


----------------------------------------------------------------------
ldiv  109 ldiv  [0x0000000107135d60, 0x0000000107135dc0]  96 bytes


----------------------------------------------------------------------
fdiv  110 fdiv  [0x0000000107135de0, 0x0000000107135e20]  64 bytes


----------------------------------------------------------------------
ddiv  111 ddiv  [0x0000000107135e40, 0x0000000107135e80]  64 bytes


----------------------------------------------------------------------
irem  112 irem  [0x0000000107135ea0, 0x0000000107135f00]  96 bytes


----------------------------------------------------------------------
lrem  113 lrem  [0x0000000107135f20, 0x0000000107135f80]  96 bytes


----------------------------------------------------------------------
frem  114 frem  [0x0000000107135fa0, 0x0000000107136000]  96 bytes


----------------------------------------------------------------------
drem  115 drem  [0x0000000107136020, 0x0000000107136080]  96 bytes


----------------------------------------------------------------------
ineg  116 ineg  [0x00000001071360a0, 0x00000001071360c0]  32 bytes


----------------------------------------------------------------------
lneg  117 lneg  [0x00000001071360e0, 0x0000000107136120]  64 bytes


----------------------------------------------------------------------
fneg  118 fneg  [0x0000000107136140, 0x0000000107136180]  64 bytes


----------------------------------------------------------------------
dneg  119 dneg  [0x00000001071361a0, 0x00000001071361e0]  64 bytes


----------------------------------------------------------------------
ishl  120 ishl  [0x0000000107136200, 0x0000000107136240]  64 bytes


----------------------------------------------------------------------
lshl  121 lshl  [0x0000000107136260, 0x00000001071362a0]  64 bytes


----------------------------------------------------------------------
ishr  122 ishr  [0x00000001071362c0, 0x0000000107136300]  64 bytes


----------------------------------------------------------------------
lshr  123 lshr  [0x0000000107136320, 0x0000000107136360]  64 bytes


----------------------------------------------------------------------
iushr  124 iushr  [0x0000000107136380, 0x00000001071363c0]  64 bytes


----------------------------------------------------------------------
lushr  125 lushr  [0x00000001071363e0, 0x0000000107136420]  64 bytes


----------------------------------------------------------------------
iand  126 iand  [0x0000000107136440, 0x0000000107136480]  64 bytes


----------------------------------------------------------------------
land  127 land  [0x00000001071364a0, 0x00000001071364e0]  64 bytes


----------------------------------------------------------------------
ior  128 ior  [0x0000000107136500, 0x0000000107136540]  64 bytes


----------------------------------------------------------------------
lor  129 lor  [0x0000000107136560, 0x00000001071365a0]  64 bytes


----------------------------------------------------------------------
ixor  130 ixor  [0x00000001071365c0, 0x0000000107136600]  64 bytes


----------------------------------------------------------------------
lxor  131 lxor  [0x0000000107136620, 0x0000000107136660]  64 bytes


----------------------------------------------------------------------
iinc  132 iinc  [0x0000000107136680, 0x0000000107136720]  160 bytes


----------------------------------------------------------------------
i2l  133 i2l  [0x0000000107136740, 0x0000000107136760]  32 bytes


----------------------------------------------------------------------
i2f  134 i2f  [0x0000000107136780, 0x00000001071367c0]  64 bytes


----------------------------------------------------------------------
i2d  135 i2d  [0x00000001071367e0, 0x0000000107136820]  64 bytes


----------------------------------------------------------------------
l2i  136 l2i  [0x0000000107136840, 0x0000000107136860]  32 bytes


----------------------------------------------------------------------
l2f  137 l2f  [0x0000000107136880, 0x00000001071368c0]  64 bytes


----------------------------------------------------------------------
l2d  138 l2d  [0x00000001071368e0, 0x0000000107136920]  64 bytes


----------------------------------------------------------------------
f2i  139 f2i  [0x0000000107136940, 0x00000001071369a0]  96 bytes


----------------------------------------------------------------------
f2l  140 f2l  [0x00000001071369c0, 0x0000000107136a20]  96 bytes


----------------------------------------------------------------------
f2d  141 f2d  [0x0000000107136a40, 0x0000000107136a80]  64 bytes


----------------------------------------------------------------------
d2i  142 d2i  [0x0000000107136aa0, 0x0000000107136b00]  96 bytes


----------------------------------------------------------------------
d2l  143 d2l  [0x0000000107136b20, 0x0000000107136b80]  96 bytes


----------------------------------------------------------------------
d2f  144 d2f  [0x0000000107136ba0, 0x0000000107136be0]  64 bytes


----------------------------------------------------------------------
i2b  145 i2b  [0x0000000107136c00, 0x0000000107136c20]  32 bytes


----------------------------------------------------------------------
i2c  146 i2c  [0x0000000107136c40, 0x0000000107136c60]  32 bytes


----------------------------------------------------------------------
i2s  147 i2s  [0x0000000107136c80, 0x0000000107136ca0]  32 bytes


----------------------------------------------------------------------
lcmp  148 lcmp  [0x0000000107136cc0, 0x0000000107136d00]  64 bytes


----------------------------------------------------------------------
fcmpl  149 fcmpl  [0x0000000107136d20, 0x0000000107136d60]  64 bytes


----------------------------------------------------------------------
fcmpg  150 fcmpg  [0x0000000107136d80, 0x0000000107136dc0]  64 bytes


----------------------------------------------------------------------
dcmpl  151 dcmpl  [0x0000000107136de0, 0x0000000107136e20]  64 bytes


----------------------------------------------------------------------
dcmpg  152 dcmpg  [0x0000000107136e40, 0x0000000107136e80]  64 bytes


----------------------------------------------------------------------
ifeq  153 ifeq  [0x0000000107136ea0, 0x0000000107137260]  960 bytes


----------------------------------------------------------------------
ifne  154 ifne  [0x0000000107137280, 0x0000000107137640]  960 bytes


----------------------------------------------------------------------
iflt  155 iflt  [0x0000000107137660, 0x0000000107137a20]  960 bytes


----------------------------------------------------------------------
ifge  156 ifge  [0x0000000107137a40, 0x0000000107137e00]  960 bytes


----------------------------------------------------------------------
ifgt  157 ifgt  [0x0000000107137e20, 0x00000001071381e0]  960 bytes


----------------------------------------------------------------------
ifle  158 ifle  [0x0000000107138200, 0x00000001071385c0]  960 bytes


----------------------------------------------------------------------
if_icmpeq  159 if_icmpeq  [0x00000001071385e0, 0x00000001071389a0]  960 bytes


----------------------------------------------------------------------
if_icmpne  160 if_icmpne  [0x00000001071389c0, 0x0000000107138d80]  960 bytes


----------------------------------------------------------------------
if_icmplt  161 if_icmplt  [0x0000000107138da0, 0x0000000107139160]  960 bytes


----------------------------------------------------------------------
if_icmpge  162 if_icmpge  [0x0000000107139180, 0x0000000107139540]  960 bytes


----------------------------------------------------------------------
if_icmpgt  163 if_icmpgt  [0x0000000107139560, 0x0000000107139920]  960 bytes


----------------------------------------------------------------------
if_icmple  164 if_icmple  [0x0000000107139940, 0x0000000107139d00]  960 bytes


----------------------------------------------------------------------
if_acmpeq  165 if_acmpeq  [0x0000000107139d20, 0x000000010713a0e0]  960 bytes


----------------------------------------------------------------------
if_acmpne  166 if_acmpne  [0x000000010713a100, 0x000000010713a4c0]  960 bytes


----------------------------------------------------------------------
goto  167 goto  [0x000000010713a4e0, 0x000000010713a880]  928 bytes


----------------------------------------------------------------------
jsr  168 jsr  [0x000000010713a8a0, 0x000000010713a940]  160 bytes


----------------------------------------------------------------------
ret  169 ret  [0x000000010713a960, 0x000000010713abc0]  608 bytes


----------------------------------------------------------------------
tableswitch  170 tableswitch  [0x000000010713abe0, 0x000000010713ac80]  160 bytes


----------------------------------------------------------------------
lookupswitch  171 lookupswitch  [0x000000010713aca0, 0x000000010713ad20]  128 bytes


----------------------------------------------------------------------
ireturn  172 ireturn  [0x000000010713ad40, 0x000000010713b0e0]  928 bytes


----------------------------------------------------------------------
lreturn  173 lreturn  [0x000000010713b100, 0x000000010713b4a0]  928 bytes


----------------------------------------------------------------------
freturn  174 freturn  [0x000000010713b4c0, 0x000000010713b860]  928 bytes


----------------------------------------------------------------------
dreturn  175 dreturn  [0x000000010713b880, 0x000000010713bc20]  928 bytes


----------------------------------------------------------------------
areturn  176 areturn  [0x000000010713bc40, 0x000000010713bfc0]  896 bytes


----------------------------------------------------------------------
return  177 return  [0x000000010713bfe0, 0x000000010713c380]  928 bytes


----------------------------------------------------------------------
getstatic  178 getstatic  [0x000000010713c3a0, 0x000000010713c560]  448 bytes


----------------------------------------------------------------------
putstatic  179 putstatic  [0x000000010713c580, 0x000000010713c780]  512 bytes


----------------------------------------------------------------------
getfield  180 getfield  [0x000000010713c7a0, 0x000000010713c9c0]  544 bytes


----------------------------------------------------------------------
putfield  181 putfield  [0x000000010713c9e0, 0x000000010713cd60]  896 bytes


----------------------------------------------------------------------
invokevirtual  182 invokevirtual  [0x000000010713cd80, 0x000000010713d220]  1184 bytes


----------------------------------------------------------------------
invokespecial  183 invokespecial  [0x000000010713d240, 0x000000010713d4e0]  672 bytes


----------------------------------------------------------------------
invokestatic  184 invokestatic  [0x000000010713d500, 0x000000010713d780]  640 bytes


----------------------------------------------------------------------
invokeinterface  185 invokeinterface  [0x000000010713d7a0, 0x000000010713e120]  2432 bytes


----------------------------------------------------------------------
invokedynamic  186 invokedynamic  [0x000000010713e140, 0x000000010713e400]  704 bytes


----------------------------------------------------------------------
new  187 new  [0x000000010713e420, 0x000000010713e620]  512 bytes


----------------------------------------------------------------------
newarray  188 newarray  [0x000000010713e640, 0x000000010713e720]  224 bytes


----------------------------------------------------------------------
anewarray  189 anewarray  [0x000000010713e740, 0x000000010713e820]  224 bytes


----------------------------------------------------------------------
arraylength  190 arraylength  [0x000000010713e840, 0x000000010713e860]  32 bytes


----------------------------------------------------------------------
athrow  191 athrow  [0x000000010713e880, 0x000000010713e8a0]  32 bytes


----------------------------------------------------------------------
checkcast  192 checkcast  [0x000000010713e8c0, 0x000000010713eae0]  544 bytes


----------------------------------------------------------------------
instanceof  193 instanceof  [0x000000010713eb00, 0x000000010713ed20]  544 bytes


----------------------------------------------------------------------
monitorenter  194 monitorenter  [0x000000010713ed40, 0x000000010713ef20]  480 bytes


----------------------------------------------------------------------
monitorexit  195 monitorexit  [0x000000010713ef40, 0x000000010713f140]  512 bytes


----------------------------------------------------------------------
wide  196 wide  [0x000000010713f160, 0x000000010713f1c0]  96 bytes


----------------------------------------------------------------------
multianewarray  197 multianewarray  [0x000000010713f1e0, 0x000000010713f2e0]  256 bytes


----------------------------------------------------------------------
ifnull  198 ifnull  [0x000000010713f300, 0x000000010713f6a0]  928 bytes


----------------------------------------------------------------------
ifnonnull  199 ifnonnull  [0x000000010713f6c0, 0x000000010713fa60]  928 bytes


----------------------------------------------------------------------
goto_w  200 goto_w  [0x000000010713fa80, 0x000000010713fe40]  960 bytes


----------------------------------------------------------------------
jsr_w  201 jsr_w  [0x000000010713fe60, 0x000000010713ff00]  160 bytes


----------------------------------------------------------------------
breakpoint  202 breakpoint  [0x000000010713ff20, 0x0000000107140080]  352 bytes


----------------------------------------------------------------------
fast_agetfield  203 fast_agetfield  [0x00000001071400a0, 0x00000001071400e0]  64 bytes


----------------------------------------------------------------------
fast_bgetfield  204 fast_bgetfield  [0x0000000107140100, 0x0000000107140140]  64 bytes


----------------------------------------------------------------------
fast_cgetfield  205 fast_cgetfield  [0x0000000107140160, 0x00000001071401a0]  64 bytes


----------------------------------------------------------------------
fast_dgetfield  206 fast_dgetfield  [0x00000001071401c0, 0x0000000107140200]  64 bytes


----------------------------------------------------------------------
fast_fgetfield  207 fast_fgetfield  [0x0000000107140220, 0x0000000107140260]  64 bytes


----------------------------------------------------------------------
fast_igetfield  208 fast_igetfield  [0x0000000107140280, 0x00000001071402c0]  64 bytes


----------------------------------------------------------------------
fast_lgetfield  209 fast_lgetfield  [0x00000001071402e0, 0x0000000107140320]  64 bytes


----------------------------------------------------------------------
fast_sgetfield  210 fast_sgetfield  [0x0000000107140340, 0x0000000107140380]  64 bytes


----------------------------------------------------------------------
fast_aputfield  211 fast_aputfield  [0x00000001071403a0, 0x0000000107140400]  96 bytes


----------------------------------------------------------------------
fast_bputfield  212 fast_bputfield  [0x0000000107140420, 0x0000000107140480]  96 bytes


----------------------------------------------------------------------
fast_cputfield  213 fast_cputfield  [0x00000001071404a0, 0x0000000107140500]  96 bytes


----------------------------------------------------------------------
fast_dputfield  214 fast_dputfield  [0x0000000107140520, 0x0000000107140580]  96 bytes


----------------------------------------------------------------------
fast_fputfield  215 fast_fputfield  [0x00000001071405a0, 0x0000000107140600]  96 bytes


----------------------------------------------------------------------
fast_iputfield  216 fast_iputfield  [0x0000000107140620, 0x0000000107140680]  96 bytes


----------------------------------------------------------------------
fast_lputfield  217 fast_lputfield  [0x00000001071406a0, 0x0000000107140700]  96 bytes


----------------------------------------------------------------------
fast_sputfield  218 fast_sputfield  [0x0000000107140720, 0x0000000107140780]  96 bytes


----------------------------------------------------------------------
fast_aload_0  219 fast_aload_0  [0x00000001071407a0, 0x0000000107140800]  96 bytes


----------------------------------------------------------------------
fast_iaccess_0  220 fast_iaccess_0  [0x0000000107140820, 0x00000001071408a0]  128 bytes


----------------------------------------------------------------------
fast_aaccess_0  221 fast_aaccess_0  [0x00000001071408c0, 0x0000000107140940]  128 bytes


----------------------------------------------------------------------
fast_faccess_0  222 fast_faccess_0  [0x0000000107140960, 0x00000001071409e0]  128 bytes


----------------------------------------------------------------------
fast_iload  223 fast_iload  [0x0000000107140a00, 0x0000000107140a60]  96 bytes


----------------------------------------------------------------------
fast_iload2  224 fast_iload2  [0x0000000107140a80, 0x0000000107140ae0]  96 bytes


----------------------------------------------------------------------
fast_icaload  225 fast_icaload  [0x0000000107140b00, 0x0000000107140b80]  128 bytes


----------------------------------------------------------------------
fast_invokevfinal  226 fast_invokevfinal  [0x0000000107140ba0, 0x0000000107140c60]  192 bytes


----------------------------------------------------------------------
fast_linearswitch  227 fast_linearswitch  [0x0000000107140c80, 0x0000000107140d20]  160 bytes


----------------------------------------------------------------------
fast_binaryswitch  228 fast_binaryswitch  [0x0000000107140d40, 0x0000000107140e20]  224 bytes


----------------------------------------------------------------------
fast_aldc  229 fast_aldc  [0x0000000107140e40, 0x0000000107140f60]  288 bytes


----------------------------------------------------------------------
fast_aldc_w  230 fast_aldc_w  [0x0000000107140f80, 0x00000001071410a0]  288 bytes


----------------------------------------------------------------------
return_register_finalizer  231 return_register_finalizer  [0x00000001071410c0, 0x0000000107141500]  1088 bytes


----------------------------------------------------------------------
invokehandle  232 invokehandle  [0x0000000107141520, 0x00000001071417e0]  704 bytes


----------------------------------------------------------------------
_shouldnotreachhere  233 _shouldnotreachhere  [0x0000000107141800, 0x00000001071418c0]  192 bytes

----------------------------------------------------------------------
Classfile /Users/dark/workspace/dotty/tests/run/Test$.class
  Last modified May 30, 2015; size 2979 bytes
  MD5 checksum 5b4653cf57a6591342c46e57fabc9f4c
  Compiled from "t5375.scala"
public final class Test$ extends dotty.runtime.LegacyApp
  minor version: 0
  major version: 52
  flags: ACC_PUBLIC, ACC_FINAL, ACC_SUPER
Constant pool:
    #1 = Utf8               Test$
    #2 = Class              #1            // Test$
    #3 = Utf8               dotty/runtime/LegacyApp
    #4 = Class              #3            // dotty/runtime/LegacyApp
    #5 = Utf8               t5375.scala
    #6 = Utf8               scala/collection/immutable/Range$Inclusive
    #7 = Class              #6            // scala/collection/immutable/Range$Inclusive
    #8 = Utf8               scala/collection/immutable/Range$
    #9 = Class              #8            // scala/collection/immutable/Range$
   #10 = Utf8               Range$Inclusive
   #11 = Utf8               MODULE$
   #12 = Utf8               LTest$;
   #13 = Utf8               <clinit>
   #14 = Utf8               ()V
   #15 = Utf8               <init>
   #16 = NameAndType        #15:#14       // "<init>":()V
   #17 = Methodref          #2.#16        // Test$."<init>":()V
   #18 = Methodref          #4.#16        // dotty/runtime/LegacyApp."<init>":()V
   #19 = NameAndType        #11:#12       // MODULE$:LTest$;
   #20 = Fieldref           #2.#19        // Test$.MODULE$:LTest$;
   #21 = Utf8               scala/Predef$
   #22 = Class              #21           // scala/Predef$
   #23 = Utf8               Lscala/Predef$;
   #24 = NameAndType        #11:#23       // MODULE$:Lscala/Predef$;
   #25 = Fieldref           #22.#24       // scala/Predef$.MODULE$:Lscala/Predef$;
   #26 = Utf8               scala/runtime/RichInt$
   #27 = Class              #26           // scala/runtime/RichInt$
   #28 = Utf8               Lscala/runtime/RichInt$;
   #29 = NameAndType        #11:#28       // MODULE$:Lscala/runtime/RichInt$;
   #30 = Fieldref           #27.#29       // scala/runtime/RichInt$.MODULE$:Lscala/runtime/RichInt$;
   #31 = Utf8               scala/LowPriorityImplicits
   #32 = Class              #31           // scala/LowPriorityImplicits
   #33 = Utf8               intWrapper
   #34 = Utf8               (I)I
   #35 = NameAndType        #33:#34       // intWrapper:(I)I
   #36 = Methodref          #32.#35       // scala/LowPriorityImplicits.intWrapper:(I)I
   #37 = Utf8               to$extension0
   #38 = Utf8               (II)Lscala/collection/immutable/Range$Inclusive;
   #39 = NameAndType        #37:#38       // to$extension0:(II)Lscala/collection/immutable/Range$Inclusive;
   #40 = Methodref          #27.#39       // scala/runtime/RichInt$.to$extension0:(II)Lscala/collection/immutable/Range$Inclusive;
   #41 = Utf8               scala/collection/immutable/Range
   #42 = Class              #41           // scala/collection/immutable/Range
   #43 = Utf8               toSeq
   #44 = Utf8               ()Lscala/collection/immutable/Range;
   #45 = NameAndType        #43:#44       // toSeq:()Lscala/collection/immutable/Range;
   #46 = Methodref          #42.#45       // scala/collection/immutable/Range.toSeq:()Lscala/collection/immutable/Range;
   #47 = Utf8               par
   #48 = Utf8               ()Lscala/collection/parallel/immutable/ParRange;
   #49 = NameAndType        #47:#48       // par:()Lscala/collection/parallel/immutable/ParRange;
   #50 = Methodref          #42.#49       // scala/collection/immutable/Range.par:()Lscala/collection/parallel/immutable/ParRange;
   #51 = Utf8               java/lang/invoke/LambdaMetafactory
   #52 = Class              #51           // java/lang/invoke/LambdaMetafactory
   #53 = Utf8               metafactory
   #54 = Utf8               (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
   #55 = NameAndType        #53:#54       // metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
   #56 = Methodref          #52.#55       // java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
   #57 = MethodHandle       #6:#56        // invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
   #58 = MethodType         #34           //  (I)I
   #59 = Utf8               $anonfun$$init$$1
   #60 = NameAndType        #59:#34       // $anonfun$$init$$1:(I)I
   #61 = Methodref          #2.#60        // Test$.$anonfun$$init$$1:(I)I
   #62 = MethodHandle       #6:#61        // invokestatic Test$.$anonfun$$init$$1:(I)I
   #63 = Utf8               apply$mcII$sp
   #64 = Utf8               ()Lscala/compat/java8/JFunction1$mcII$sp;
   #65 = NameAndType        #63:#64       // apply$mcII$sp:()Lscala/compat/java8/JFunction1$mcII$sp;
   #66 = InvokeDynamic      #0:#65        // #0:apply$mcII$sp:()Lscala/compat/java8/JFunction1$mcII$sp;
   #67 = Utf8               scala/collection/parallel/immutable/ParSeq$
   #68 = Class              #67           // scala/collection/parallel/immutable/ParSeq$
   #69 = Utf8               Lscala/collection/parallel/immutable/ParSeq$;
   #70 = NameAndType        #11:#69       // MODULE$:Lscala/collection/parallel/immutable/ParSeq$;
   #71 = Fieldref           #68.#70       // scala/collection/parallel/immutable/ParSeq$.MODULE$:Lscala/collection/parallel/immutable/ParSeq$;
   #72 = Utf8               canBuildFrom
   #73 = Utf8               ()Lscala/collection/generic/CanCombineFrom;
   #74 = NameAndType        #72:#73       // canBuildFrom:()Lscala/collection/generic/CanCombineFrom;
   #75 = Methodref          #68.#74       // scala/collection/parallel/immutable/ParSeq$.canBuildFrom:()Lscala/collection/generic/CanCombineFrom;
   #76 = Utf8               scala/collection/parallel/ParIterableLike
   #77 = Class              #76           // scala/collection/parallel/ParIterableLike
   #78 = Utf8               map
   #79 = Utf8               (Lscala/Function1;Lscala/collection/generic/CanBuildFrom;)Ljava/lang/Object;
   #80 = NameAndType        #78:#79       // map:(Lscala/Function1;Lscala/collection/generic/CanBuildFrom;)Ljava/lang/Object;
   #81 = InterfaceMethodref #77.#80       // scala/collection/parallel/ParIterableLike.map:(Lscala/Function1;Lscala/collection/generic/CanBuildFrom;)Ljava/lang/Object;
   #82 = Utf8               locally
   #83 = Utf8               (Ljava/lang/Object;)Ljava/lang/Object;
   #84 = NameAndType        #82:#83       // locally:(Ljava/lang/Object;)Ljava/lang/Object;
   #85 = Methodref          #22.#84       // scala/Predef$.locally:(Ljava/lang/Object;)Ljava/lang/Object;
   #86 = Utf8               foos
   #87 = Utf8               Lscala/collection/immutable/Range;
   #88 = Utf8               this
   #89 = Utf8               scala/sys/package$
   #90 = Class              #89           // scala/sys/package$
   #91 = Utf8               Lscala/sys/package$;
   #92 = NameAndType        #11:#91       // MODULE$:Lscala/sys/package$;
   #93 = Fieldref           #90.#92       // scala/sys/package$.MODULE$:Lscala/sys/package$;
   #94 = Utf8               i div 37
   #95 = String             #94           // i div 37
   #96 = Utf8               error
   #97 = Utf8               (Ljava/lang/String;)Lscala/runtime/Nothing$;
   #98 = NameAndType        #96:#97       // error:(Ljava/lang/String;)Lscala/runtime/Nothing$;
   #99 = Methodref          #90.#98       // scala/sys/package$.error:(Ljava/lang/String;)Lscala/runtime/Nothing$;
  #100 = Utf8               i
  #101 = Utf8               I
  #102 = Utf8               java/lang/Throwable
  #103 = Class              #102          // java/lang/Throwable
  #104 = Utf8               Code
  #105 = Utf8               LocalVariableTable
  #106 = Utf8               LineNumberTable
  #107 = Utf8               StackMapTable
  #108 = Utf8               BootstrapMethods
  #109 = Utf8               SourceFile
  #110 = Utf8               InnerClasses
  #111 = Utf8               TASTY
  #112 = Utf8               ScalaSig
{
  public static final Test$ MODULE$;
    descriptor: LTest$;
    flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL

  public static {};
    descriptor: ()V
    flags: ACC_PUBLIC, ACC_STATIC
    Code:
      stack=1, locals=0, args_size=0
         0: new           #2                  // class Test$
         3: invokespecial #17                 // Method "<init>":()V
         6: return

  public Test$();
    descriptor: ()V
    flags: ACC_PUBLIC
    Code:
      stack=4, locals=2, args_size=1
         0: aload_0
         1: invokespecial #18                 // Method dotty/runtime/LegacyApp."<init>":()V
         4: aload_0
         5: putstatic     #20                 // Field MODULE$:LTest$;
         8: getstatic     #25                 // Field scala/Predef$.MODULE$:Lscala/Predef$;
        11: getstatic     #30                 // Field scala/runtime/RichInt$.MODULE$:Lscala/runtime/RichInt$;
        14: getstatic     #25                 // Field scala/Predef$.MODULE$:Lscala/Predef$;
        17: iconst_1
        18: invokevirtual #36                 // Method scala/LowPriorityImplicits.intWrapper:(I)I
        21: sipush        1000
        24: invokevirtual #40                 // Method scala/runtime/RichInt$.to$extension0:(II)Lscala/collection/immutable/Range$Inclusive;
        27: invokevirtual #46                 // Method scala/collection/immutable/Range.toSeq:()Lscala/collection/immutable/Range;
        30: astore_1
        31: aload_1
        32: invokevirtual #50                 // Method scala/collection/immutable/Range.par:()Lscala/collection/parallel/immutable/ParRange;
        35: invokedynamic #66,  0             // InvokeDynamic #0:apply$mcII$sp:()Lscala/compat/java8/JFunction1$mcII$sp;
        40: getstatic     #71                 // Field scala/collection/parallel/immutable/ParSeq$.MODULE$:Lscala/collection/parallel/immutable/ParSeq$;
        43: invokevirtual #75                 // Method scala/collection/parallel/immutable/ParSeq$.canBuildFrom:()Lscala/collection/generic/CanCombineFrom;
        46: invokeinterface #81,  3           // InterfaceMethod scala/collection/parallel/ParIterableLike.map:(Lscala/Function1;Lscala/collection/generic/CanBuildFrom;)Ljava/lang/Object;
        51: invokevirtual #85                 // Method scala/Predef$.locally:(Ljava/lang/Object;)Ljava/lang/Object;
        54: pop
        55: return
      LocalVariableTable:
        Start  Length  Slot  Name   Signature
           30      21     1  foos   Lscala/collection/immutable/Range;
            0      56     0  this   LTest$;
      LineNumberTable:
        line 0: 0
        line 1: 8
        line 2: 11
        line 4: 31
        line 0: 55

  private static int $anonfun$$init$$1(int);
    descriptor: (I)I
    flags: ACC_PRIVATE, ACC_STATIC
    Code:
      stack=2, locals=1, args_size=1
         0: iload_0
         1: bipush        37
         3: irem
         4: iconst_0
         5: if_icmpeq     11
         8: goto          23
        11: getstatic     #93                 // Field scala/sys/package$.MODULE$:Lscala/sys/package$;
        14: ldc           #95                 // String i div 37
        16: invokevirtual #99                 // Method scala/sys/package$.error:(Ljava/lang/String;)Lscala/runtime/Nothing$;
        19: athrow
        20: nop
        21: nop
        22: athrow
        23: iload_0
        24: ireturn
      LocalVariableTable:
        Start  Length  Slot  Name   Signature
            0      25     0     i   I
      LineNumberTable:
        line 4: 0
      StackMapTable: number_of_entries = 3
        frame_type = 11 /* same */
        frame_type = 255 /* full_frame */
          offset_delta = 8
          locals = []
          stack = [ class java/lang/Throwable ]
        frame_type = 252 /* append */
          offset_delta = 2
          locals = [ int ]
}
BootstrapMethods:
  0: #57 invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
    Method arguments:
      #58 (I)I
      #62 invokestatic Test$.$anonfun$$init$$1:(I)I
      #58 (I)I
SourceFile: "t5375.scala"
InnerClasses:
     public static #10= #7 of #9; //Range$Inclusive=class scala/collection/immutable/Range$Inclusive of class scala/collection/immutable/Range$

@retronym
Copy link
Member

@DarkDimius I haven't seen that failure mode before. Would be interested to see what it minimizes to.

@smarter
Copy link
Member

smarter commented May 30, 2015

@DarkDimius : are you sure the interpreter reaches _shouldnotreachhere? The trace you posted looks to me to be just the list of instructions ordered by their opcode (nop, aconst_null, ...) and with private/special opcodes at the end.

@DarkDimius
Copy link
Contributor

@smarter, I'm not sure what's happening here, to be honest. What I see, is that when running this test, we have a infinitely running java process, which has no code compiled by JIT, which has no monitors grabbed, all threads are in state runnable, and uses 0% cpu. This really feels like JVM stops in interpreter and just sleeps forever.

If you have any clues, I'd welcome them).
I'm out of PC-reach today, I'll continue investigation tomorrow evening.

@smarter
Copy link
Member

smarter commented May 30, 2015

OK, I've managed to reduce this as much as I could.

import scala.collection.parallel.immutable.ParVector

object Test {

  val f: Int => Int = x => x + 1

  val pv = ParVector(1, 2)
  println("A")
  pv.map(f) // Comment this line to avoid the deadlock
  println("B")

  def main(args: Array[String]): Unit = {
    println("C")
  }
}

In Dotty, this will print "A" then get stuck. In scalac 2.11.6, it will work correctly by default, but if you use -Ydelambdafy:method it will also get stuck, so this is not a dotty-specific problem. It seems that the problem happens when f.apply tries to use a method on Test$, the following gets stuck with both dotty and scalac 2.11.6 without any special flag:

import scala.runtime.AbstractFunction1
import scala.collection.parallel.immutable.ParVector

object Test {
  def something: Int = 42

  val f: Int => Int = new AbstractFunction1[Int, Int] {
    def apply(x: Int): Int = {
      println("before calling something")
      something
      println("after calling something")
      0
    }
  }

  val pv = ParVector(1, 2)
  println("A")
  pv.map(f) // Comment this line to avoid the deadlock
  println("B")

  def main(args: Array[String]): Unit = {
    println("C")
  }
}

With both compiler it prints:

A
before calling something
before calling something

Then gets stuck.

I think that the following happens at the bytecode level:

  • Test.main gets a static field from Test$:
public final class Test {
  public static void main(java.lang.String[]);
    Code:
       0: getstatic     #16                 // Field Test$.MODULE$:LTest$;
  • The static initializer for Test$ is run:
  public static {};
    Code:
       0: new           #2                  // class Test$
       3: invokespecial #12                 // Method "<init>":()V
       6: return
  • The constructor of Test$ is run, at some point it calls pv.map(f), so at some later point f.apply will be run. It will then try to get the same static field Test$.MODULE$:LTest$;, which means running the same static initializer that we're in the middle of calling:
  public int apply$mcII$sp(int);
    Code:
       0: getstatic     #22                 // Field scala/Predef$.MODULE$:Lscala/Predef$;
       3: ldc           #24                 // String before calling something
       5: invokevirtual #28                 // Method scala/Predef$.println:(Ljava/lang/Object;)V
       8: getstatic     #31                 // Field Test$.MODULE$:LTest$;
      11: invokevirtual #35                 // Method Test$.something:()I
      14: pop
      15: getstatic     #22                 // Field scala/Predef$.MODULE$:Lscala/Predef$;
      18: ldc           #37                 // String after calling something
      20: invokevirtual #28                 // Method scala/Predef$.println:(Ljava/lang/Object;)V
      23: iconst_0
      24: ireturn
  • 💥 Deadlock! 💥

@smarter
Copy link
Member

smarter commented May 30, 2015

This can be trivially worked around by calling pv.map(f) in main instead of in the constructor of Test, I'll push a commit to do that.

smarter added a commit to dotty-staging/dotty that referenced this pull request May 30, 2015
@DarkDimius
Copy link
Contributor

@smarter, good catch. Indeed this looks like classloading order problem. Interesting though, this deadlock cannot be seen from jvisualvm or jstack, as they say that none of threads own any locks.

@DarkDimius
Copy link
Contributor

@smarter, can you push your commit to #623 instead? it has ElimStaticThis already fixed.

smarter added a commit to dotty-staging/dotty that referenced this pull request May 30, 2015
@smarter
Copy link
Member

smarter commented May 30, 2015

OK, pushed there also.

@DarkDimius
Copy link
Contributor

I guess this wouldn't be the last test failing, there are plenty of run-tests that either use multithreading or parallel collections(github finds 10 pages of references to .par).
I believe that there could be a more systematic fix for them, other than rewriting every single one of those.
I would play around it tomorrow, I have several ideas, that look like they could work.

@smarter
Copy link
Member

smarter commented May 30, 2015

I think that the more systematic fix would be to implement App and DelayedInit.

@DarkDimius
Copy link
Contributor

Note that this is actual difference in behavior with respect to scalac: by maing lambda implementation static, we do not capture this parameter of module, but instead we could introduce a deadlock, when calling static implementations of lambdas.

For normal classes, not capturing this could be an advantage, as it will not stop the owner of closure from being garbage collected. For static object, the only advantage is smaller size of closure, but that comes at cost of difference in behavior, that is non-obvious to spot.

The simple solution that I see now, is to make lambda implemetations static in Test, not in Test$. This will fix the deadlock.

@DarkDimius
Copy link
Contributor

@smarter This is not specific to DelayedInit at all, this is a behavioral difference for all globally visible objects.

@smarter
Copy link
Member

smarter commented May 30, 2015

Yes, but if you use object Test extends App then you at least know that the static initialization of Test will not deadlock no matter what you do

@DarkDimius
Copy link
Contributor

@smarter, code that you wrote above

import scala.runtime.AbstractFunction1
import scala.collection.parallel.immutable.ParVector

object Test {
  def something: Int = 42

  val f: Int => Int = new AbstractFunction1[Int, Int] {
    def apply(x: Int): Int = {
      println("before calling something")
      something
      println("after calling something")
      0
    }
  }

  val pv = ParVector(1, 2)
  println("A")
  pv.map(f) // Comment this line to avoid the deadlock
  println("B")

  def main(args: Array[String]): Unit = {
    println("C")
  }
}

is perfectly valid scala code. It should work out-of-the box. The fact that we make some methods static, and by this we could introduce a deadlock I would consider an implementation detail. As an implementation detail, this should be transparent to user.

@smarter
Copy link
Member

smarter commented May 30, 2015

Yes, I agree that a solution that avoids all deadlock would be even better, but that seems harder :).

smarter added a commit to dotty-staging/dotty that referenced this pull request May 30, 2015
@smarter smarter force-pushed the add/elim-static-this branch from 2c60e0a to fc1d8e6 Compare May 30, 2015 17:44
smarter added a commit to dotty-staging/dotty that referenced this pull request May 30, 2015
@odersky
Copy link
Contributor Author

odersky commented May 30, 2015

@smarter Great analysis! @DarkDimius Yes, I think we should put static functions in the companion class, not the module class.

@smarter
Copy link
Member

smarter commented May 31, 2015

This PR should be closed, it is superseded by #623 (I don't have the rights to close it myself)

@DarkDimius DarkDimius closed this May 31, 2015
odersky added a commit to dotty-staging/dotty that referenced this pull request Jun 1, 2015
See scala#624 (comment)
for a lengthy explanation.

We now solve the problem in LambdaLift. The formerly failing tests are
all reverted to theor original, failing, version.
@retronym
Copy link
Member

retronym commented Jun 1, 2016

For normal classes, not capturing this could be an advantage, as it will not stop the owner of closure from being garbage collected. For static object, the only advantage is smaller size of closure, but that comes at cost of difference in behavior, that is non-obvious to spot.

Another advantage is that the lambda can be serializable, even if the enclosing module class is not.

We are working on similar issues in scala/scala#5099

@retronym
Copy link
Member

retronym commented Jun 1, 2016

@smarter, good catch. Indeed this looks like classloading order problem. Interesting though, this deadlock cannot be seen from jvisualvm or jstack, as they say that none of threads own any locks.

This confused me when I first saw it. The trick is to know that <clinit> implies that that class is locked, as specced in section 5.5 of JVMS.

Synchronize on the initialization lock, LC, for C. This involves waiting until the
current thread can acquire LC.

@DarkDimius
Copy link
Contributor

@retronym, note that code written in this PR had a bug that caused most methods not to emitted as static.
Recently, we had a followup PR: https://github.com/lampepfl/dotty/pull/1281/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants