Skip to content
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

Varience in IA32 vs X64 flow-graph optimization results of hashmap[] #17552

Closed
andersjohnsen opened this issue Mar 18, 2014 · 2 comments
Closed
Labels
area-vm closed-cannot-reproduce Closed as we were unable to reproduce the reported issue type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@andersjohnsen
Copy link

In a IO program, I've seen the following (please ping me for the source-code):

IA32:

*** BEGIN CFG
After SSA
==== dart:collection__HashMap@0x23c35ea0_[]
B0[graph]:2 {
      v0 <- Constant:158(#null)
      v1 <- Constant:160(#<optimized out>)
      v2 <- Parameter:162(0)
      v3 <- Parameter:164(1)
      v7 <- Constant:166(#­1)
      v14 <- Constant:168(#true)
}
B1[target]:0
    CheckStackOverflow:4()
    PushArgument:8(v3)
    v4 <- InstanceCall:10(get:hashCode, v3 IC[2: _Smi@0x36924d72 #­428 <0xeba65089> | _OneByteString@0x36924d72 #­4359 <0xeba7f6f9>])
    PushArgument:16(v2)
    v5 <- InstanceCall:18(get:_buckets@0x23c35ea0, v2 IC[2: _HashMap@0x23c35ea0 #­3918 <0xebb6ae99> | _LinkedHashMap@0x23c35ea0 #­869 <0xebb6ae99>])
    PushArgument:24(v4)
    PushArgument:28(v5)
    v6 <- InstanceCall:30(get:length, v5 IC[1: _List@0x36924d72 #­4787 <0xeba81599>])
    PushArgument:32(v6)
    PushArgument:36(v7)
    v8 <- InstanceCall:38(-, v6, v7 IC[1: _Smi@0x36924d72, _Smi@0x36924d72 #­4787 <0xeba707b1>])
    PushArgument:40(v8)
    v9 <- InstanceCall:42(&, v4, v8 IC[1: _Smi@0x36924d72, _Smi@0x36924d72 #­4787 <0xeba70a41>])
    PushArgument:48(v5)
    PushArgument:52(v9)
    v10 <- InstanceCall:54([], v5, v9 IC[1: _List@0x36924d72 #­4787 <0xeba81459>])
    goto:144 8
B8[join]:140 pred(B1, B4) {
      v11 <- phi(v10, v15) alive
}
    CheckStackOverflow:142(depth 1)
    Branch if StrictCompare:62(!==, v11, v0, with number check) goto (7, 9)
B7[target]:138
    PushArgument:68(v4)
    PushArgument:72(v11)
    v12 <- InstanceCall:74(get:hashCode, v11 IC[2: _HashMapEntry@0x23c35ea0 #­1886 <0xebb71bf9> | _LinkedHashMapEntry@0x23c35ea0 #­688 <0xebb71bf9>])
    PushArgument:76(v12)
    v13 <- InstanceCall:78(==, v4, v12 IC[1: _Smi@0x36924d72, _Smi@0x36924d72 #­2574 <0xeba71301>])
    Branch if StrictCompare:82(===, v13, v14) goto (2, 5)
B2[target]:106
    PushArgument:88(v11)
    v16 <- InstanceCall:90(get:key, v11 IC[2: _HashMapEntry@0x23c35ea0 #­1719 <0xebb719f9> | _LinkedHashMapEntry@0x23c35ea0 #­169 <0xebb719f9>])
    PushArgument:92(v16)
    PushArgument:96(v3)
    v17 <- InstanceCall:98(==, v16, v3 IC[2: _Smi@0x36924d72, _Smi@0x36924d72 #­389 <0xeba71301> | _OneByteString@0x36924d72, _OneByteString@0x36924d72 #­1499 <0xeba7f7c9>])
    Branch if StrictCompare:102(===, v17, v14) goto (3, 6)
B3[target]:118
    PushArgument:110(v11)
    v18 <- InstanceCall:112(get:value, v11 IC[2: _HashMapEntry@0x23c35ea0 #­1720 <0xebb71aa1> | _LinkedHashMapEntry@0x23c35ea0 #­169 <0xebb71aa1>])
    DebugStepCheck:114()
    Return:116(v18)
B6[target]:126
    goto:128 4
B5[target]:122
    goto:124 4
B4[join]:120 pred(B5, B6)
    PushArgument:132(v11)
    v15 <- InstanceCall:134(get:next, v11 IC[2: _LinkedHashMapEntry@0x23c35ea0 #­519 <0xebb71cc9> | HashMapEntry@0x23c35ea0 #­167 <0xebb71cc9>])
    goto:146 8
B9[target]:148
    DebugStepCheck:152()
    Return:154(v0)
*** END CFG
*** BEGIN CFG
After Optimizations
==== dart:collection__HashMap@0x23c35ea0
[]
  0: B0[graph]:2 {
      v0 <- Constant:158(#null) T{null, Null, Type: class 'Null'}
      v1 <- Constant:160(#<optimized out>) T{not-null, _OneByteString@0x36924d72, Type: class '_OneByteString@0x36924d72'}
      v2 <- Parameter:162(0) T{not-null, dynamic, Type: class '_HashMap@0x23c35ea0', args:[TypeArguments: [TypeParameter: name K; index: 0; class: _HashMap@0x23c35ea0; bound: Object] [TypeParameter: name V; index: 1; class: _HashMap@0x23c35ea0; bound: Object]]}
      v3 <- Parameter:164(1) T{null, dynamic, Type: class 'dynamic'}
      v7 <- Constant:166(#­1) [1, 1] T{not-null, _Smi@0x36924d72, Type: class '_Smi@0x36924d72'}
      v14 <- Constant:168(#true) T{not-null, bool, Type: class 'bool'}
      v39 <- Constant:226(#Type: class 'num') T{not-null, _Type@0x36924d72, Type: class '_Type@0x36924d72'}
      v40 <- Constant:228(#false) T{not-null, bool, Type: class 'bool'}
}
  2: B1[target]:0 ParallelMove eax <- S-1
  4: CheckStackOverflow:4()
  6: v51 <- LoadClassId:266(v3) [-1073741824, 1073741823] T{not-null, _Smi@0x36924d72, ?}
  8: v52 <- Constant:268(#­42) [42, 42] T{not-null, _Smi@0x36924d72, Type: class '_Smi@0x36924d72'}
 10: Branch if StrictCompare:10(===, v51, v52) goto (22, 24)
 12: B22[target]:0
 14: v63 <- LoadClassId:292(v3) [-1073741824, 1073741823] T{not-null, _Smi@0x36924d72, ?}
 16: Branch if StrictCompare:10(===, v63, v52) goto (27, 29)
 18: B27[target]:0
 20: ParallelMove eax <- eax goto:10 30
 22: B29[target]:10
 24: PushArgument:8(v3) T{null, dynamic, Type: class 'dynamic'}
 26: v65 <- PolymorphicInstanceCall:10(get:_identityHashCode@0x36924d72, v3 IC[2: _HttpClientConnection@0x1da10ec4 #­656 <0xeba650e9> | _NativeSocket@0x1da10ec4 #­33 <0xeba650e9>]) T{null, dynamic, Type: class 'dynamic'}
 27: ParallelMove eax <- eax
 28: ParallelMove eax <- eax goto:11 30
 30: B30[join]:11 pred(B27, B29) {
      v66 <- phi(v3, v65) alive T{null, dynamic, Type: class 'dynamic'}
}
 32: ParallelMove ecx <- eax, eax <- S-2 goto:14 25
 34: B24[target]:10
 36: PushArgument:8(v3) T{null, dynamic, Type: class 'dynamic'}
 38: v53 <- PolymorphicInstanceCall:10(get:hashCode, v3 IC[1: _OneByteString@0x36924d72 #­4359 <0xeba7f6f9>]) T{null, dynamic, Type: class 'dynamic'}
 39: ParallelMove eax <- eax
 40: ParallelMove ecx <- eax, eax <- S-2 goto:11 25
 42: B25[join]:11 pred(B24, B30) {
      v54 <- phi(v53, v66) alive T{null, dynamic, Type: class 'dynamic'}
}
 43: ParallelMove S+1 <- ecx
 44: v5 <- LoadField:172(v2, 12 {_buckets@0x23c35ea0} [non-nullable _List@0x36924d72], immutable=0) T{not-null, _List@0x36924d72, ?}
 46: v58 <- LoadField:6(v5, 8, immutable=1) [0, 268435455] T{not-null, _Smi@0x36924d72, ?}
 48: ParallelMove ebx <- eax
 48: v8 <- BinarySmiOp:38(-, v58, v7) [v58-1, v58-1] T{not-null, _Smi@0x36924d72, ?} -o -t
 50: CheckSmi:42(v54)
 52: ParallelMove edi <- ecx
 52: v9 <- BinarySmiOp:42(&, v54 T{not-null, _Smi@0x36924d72, ?}, v8) [-1073741824, 1073741823] T{not-null, _Smi@0x36924d72, ?} +o -t
 54: CheckArrayBound:54(v58, v9)
 56: v20 <- LoadIndexed(v5, v9) T{null, dynamic, Type: class 'dynamic'}
 58: ParallelMove edx <- eax, eax <- S-1 goto:144 8
 60: B8[join]:140 pred(B4, B25) {
      v11 <- phi(v15, v20) alive T{null, dynamic, Type: class 'dynamic'}
}
 61: ParallelMove S+0 <- edx
 62: CheckStackOverflow:142(depth 1)
 64: Branch if StrictCompare:62(!==, v11, v0) goto (7, 9)
 66: B7[target]:138
 68: CheckClass:74(v11 T{not-null, dynamic, Type: class 'dynamic'} IC[2: _HashMapEntry@0x23c35ea0 #­1886 <0xebb71bf9> | _LinkedHashMapEntry@0x23c35ea0 #­688 <0xebb71bf9>])
 70: v12 <- LoadField:200(v11 T{not-null, dynamic, Type: class 'dynamic'}, 12 {hashCode} [non-nullable _Smi@0x36924d72], immutable=1) [-1073741824, 1073741823] T{not-null, _Smi@0x36924d72, ?}
 72: Branch if EqualityCompare:78(v54 T{not-null, _Smi@0x36924d72, ?} == v12) T{not-null, bool, Type: class 'bool'} goto (2, 5)
 74: B2[target]:106
 76: v16 <- LoadField:210(v11 T{not-null, dynamic, Type: class 'dynamic'}, 4 {key} [nullable dynamic], immutable=1) T{null, dynamic, ?}
 78: v41 <- LoadClassId:232(v16) [-1073741824, 1073741823] T{not-null, _Smi@0x36924d72, ?}
 80: v42 <- Constant:234(#­60) [60, 60] T{not-null, _Smi@0x36924d72, Type: class '_Smi@0x36924d72'}
 82: Branch if StrictCompare:98(===, v41, v42) goto (11, 20)
 84: B11[target]:0
 86: Branch if StrictCompare:10(===, v3, v0) goto (12, 13)
 88: B12[target]:22
 90: Branch if StrictCompare:18(===, v16, v0) T{not-null, bool, Type: class 'bool'} goto (31, 32)
 92: B31[target]:118
 94: ParallelMove ecx <- edx goto:118 3
 96: B32[target]:126
 98: ParallelMove ecx <- edx goto:126 6
100: B13[target]:24
102: PushArgument:28(v16) T{null, dynamic, Type: class 'dynamic'}
104: PushArgument:32(v3 T{not-null, dynamic, Type: class 'dynamic'}) T{null, dynamic, Type: class 'dynamic'}
106: v25 <- StaticCall:34(== v16, v3 T{not-null, dynamic, Type: class 'dynamic'}) T{null, dynamic, Type: class 'dynamic'}
107: ParallelMove eax <- eax
108: Branch if StrictCompare:102(===, v25, v14) goto (33, 34)
110: B33[target]:118
112: ParallelMove ecx <- S+0 goto:118 3
114: B34[target]:126
116: ParallelMove ecx <- S+0 goto:126 6
118: B20[target]:98
120: CheckSmi:98(v16)
122: Branch if StrictCompare:10(===, v3, v0) goto (15, 16)
124: B15[target]:22
126: goto:18 36
128: B36[join]:126 pred(B15)
130: ParallelMove ecx <- S+0 goto:126 6
132: B16[target]:24
134: CheckClass:46(v3 T{not-null, dynamic, Type: class 'dynamic'} IC[2: _Smi@0x36924d72 #­1 <0xeba65459> | _Mint@0x36924d72 #­49 <0xeba65459>])
136: goto:52 17
138: B17[join]:68 pred(B16)
140: PushArgument:56(v3 T{not-null, dynamic, Type: class 'dynamic'}) T{null, dynamic, Type: class 'dynamic'}
142: PushArgument:60(v16 T{not-null, _Smi@0x36924d72, ?}) T{null, dynamic, Type: class 'dynamic'}
144: v36 <- PolymorphicInstanceCall:62(_equalToInteger@0x36924d72, v3 T{not-null, dynamic, Type: class 'dynamic'}, v16 T{not-null, _Smi@0x36924d72, ?} IC[2: _Smi@0x36924d72 #­1 <0xeba71371> | _Mint@0x36924d72 #­49 <0xeba71371>]) T{null, dynamic, Type: class 'dynamic'}
145: ParallelMove eax <- eax
146: Branch if StrictCompare:102(===, v36, v14) goto (37, 38)
148: B37[target]:118
150: ParallelMove ecx <- S+0 goto:118 3
152: B3[join]:118 pred(B31, B33, B37)
154: v18 <- LoadField:216(v11 T{not-null, dynamic, Type: class 'dynamic'}, 8 {value} [nullable dynamic], immutable=0) T{null, dynamic, ?}
155: ParallelMove eax <- eax
156: Return:116(v18)
158: B38[target]:126 ParallelMove ecx <- S+0
160: goto:126 6
162: B6[join]:126 pred(B32, B34, B36, B38)
164: goto:128 4
166: B5[target]:122 ParallelMove ecx <- edx
168: goto:124 4
170: B4[join]:120 pred(B5, B6)
172: CheckClass:134(v11 T{not-null, dynamic, Type: class 'dynamic'} IC[2: _LinkedHashMapEntry@0x23c35ea0 #­519 <0xebb71cc9> | _HashMapEntry@0x23c35ea0 #­167 <0xebb71cc9>])
174: v15 <- LoadField:220(v11 T{not-null, dynamic, Type: class 'dynamic'}, 16 {next} [nullable dynamic], immutable=0) T{null, dynamic, Type: class 'dynamic'}
176: ParallelMove edx <- edx, eax <- S-1, ecx <- S+1 goto:146 8
178: B9[target]:148
179: ParallelMove eax <- C
180: Return:154(v0)
*** END CFG

And x64:

*** BEGIN CFG
After SSA
==== dart:collection__HashMap@0x23c35ea0_[]
B0[graph]:2 {
      v0 <- Constant:158(#null)
      v1 <- Constant:160(#<optimized out>)
      v2 <- Parameter:162(0)
      v3 <- Parameter:164(1)
      v7 <- Constant:166(#­1)
      v14 <- Constant:168(#true)
}
B1[target]:0
    CheckStackOverflow:4()
    PushArgument:8(v3)
    v4 <- InstanceCall:10(get:hashCode, v3 IC[2: _Smi@0x36924d72 #­1562 <0x7fe0b3009ff1> | _OneByteString@0x36924d72 #­19191 <0x7fe0b2fbbb01>])
    PushArgument:16(v2)
    v5 <- InstanceCall:18(get:_buckets@0x23c35ea0, v2 IC[2: _HashMap@0x23c35ea0 #­17021 <0x7fe0b3244211> | _LinkedHashMap@0x23c35ea0 #­3732 <0x7fe0b3244211>])
    PushArgument:24(v4)
    PushArgument:28(v5)
    v6 <- InstanceCall:30(get:length, v5 IC[1: _List@0x36924d72 #­20753 <0x7fe0b2fbf3a1>])
    PushArgument:32(v6)
    PushArgument:36(v7)
    v8 <- InstanceCall:38(-, v6, v7 IC[1: _Smi@0x36924d72, _Smi@0x36924d72 #­20753 <0x7fe0b301f981>])
    PushArgument:40(v8)
    v9 <- InstanceCall:42(&, v4, v8 IC[1: _Smi@0x36924d72, _Smi@0x36924d72 #­20753 <0x7fe0b301fe41>])
    PushArgument:48(v5)
    PushArgument:52(v9)
    v10 <- InstanceCall:54([], v5, v9 IC[1: _List@0x36924d72 #­20753 <0x7fe0b2fbf151>])
    goto:144 8
B8[join]:140 pred(B1, B4) {
      v11 <- phi(v10, v15) alive
}
    CheckStackOverflow:142(depth 1)
    Branch if StrictCompare:62(!==, v11, v0, with number check) goto (7, 9)
B7[target]:138
    PushArgument:68(v4)
    PushArgument:72(v11)
    v12 <- InstanceCall:74(get:hashCode, v11 IC[2: _HashMapEntry@0x23c35ea0 #­8188 <0x7fe0b32fd091> | _LinkedHashMapEntry@0x23c35ea0 #­2958 <0x7fe0b32fd091>])
    PushArgument:76(v12)
    v13 <- InstanceCall:78(==, v4, v12 IC[1: _Smi@0x36924d72, _Smi@0x36924d72 #­11146 <0x7fe0b3020e81>])
    Branch if StrictCompare:82(===, v13, v14) goto (2, 5)
B2[target]:106
    PushArgument:88(v11)
    v16 <- InstanceCall:90(get:key, v11 IC[2: _HashMapEntry@0x23c35ea0 #­7444 <0x7fe0b32ff0a1> | _LinkedHashMapEntry@0x23c35ea0 #­728 <0x7fe0b32ff0a1>])
    PushArgument:92(v16)
    PushArgument:96(v3)
    v17 <- InstanceCall:98(==, v16, v3 IC[2: _Smi@0x36924d72, _Smi@0x36924d72 #­1523 <0x7fe0b3020e81> | _OneByteString@0x36924d72, _OneByteString@0x36924d72 #­6649 <0x7fe0b2fbbc81>])
    Branch if StrictCompare:102(===, v17, v14) goto (3, 6)
B3[target]:118
    PushArgument:110(v11)
    v18 <- InstanceCall:112(get:value, v11 IC[2: _HashMapEntry@0x23c35ea0 #­7444 <0x7fe0b32fef51> | _LinkedHashMapEntry@0x23c35ea0 #­728 <0x7fe0b32fef51>])
    DebugStepCheck:114()
    Return:116(v18)
B6[target]:126
    goto:128 4
B5[target]:122
    goto:124 4
B4[join]:120 pred(B5, B6)
    PushArgument:132(v11)
    v15 <- InstanceCall:134(get:next, v11 IC[2: _LinkedHashMapEntry@0x23c35ea0 #­2230 <0x7fe0b32fcb21> | HashMapEntry@0x23c35ea0 #­744 <0x7fe0b32fcb21>])
    goto:146 8
B9[target]:148
    DebugStepCheck:152()
    Return:154(v0)
*** END CFG
*** BEGIN CFG
After Optimizations
==== dart:collection__HashMap@0x23c35ea0
[]
  0: B0[graph]:2 {
      v0 <- Constant:158(#null) T{null, Null, Type: class 'Null'}
      v1 <- Constant:160(#<optimized out>) T{not-null, _OneByteString@0x36924d72, Type: class '_OneByteString@0x36924d72'}
      v2 <- Parameter:162(0) T{not-null, dynamic, Type: class '_HashMap@0x23c35ea0', args:[TypeArguments: [TypeParameter: name K; index: 0; class: _HashMap@0x23c35ea0; bound: Object] [TypeParameter: name V; index: 1; class: _HashMap@0x23c35ea0; bound: Object]]}
      v3 <- Parameter:164(1) T{null, dynamic, Type: class 'dynamic'}
      v7 <- Constant:166(#­1) [1, 1] T{not-null, _Smi@0x36924d72, Type: class '_Smi@0x36924d72'}
      v14 <- Constant:168(#true) T{not-null, bool, Type: class 'bool'}
}
  2: B1[target]:0 ParallelMove rax <- S-2
  4: CheckStackOverflow:4()
  6: PushArgument:8(v3) T{null, dynamic, Type: class 'dynamic'}
  8: v4 <- PolymorphicInstanceCall:10(get:hashCode, v3 IC[2: _Smi@0x36924d72 #­1562 <0x7fe0b3009ff1> | _OneByteString@0x36924d72 #­19191 <0x7fe0b2fbbb01>]) T{null, dynamic, Type: class 'dynamic'}
  9: ParallelMove rcx <- rax, rax <- S-2
 10: ParallelMove S+1 <- rcx
 10: v5 <- LoadField:172(v2, 24 {_buckets@0x23c35ea0} [non-nullable _List@0x36924d72], immutable=0) T{not-null, _List@0x36924d72, ?}
 11: ParallelMove S+0 <- rdx
 12: PushArgument:28(v5) T{null, dynamic, Type: class 'dynamic'}
 14: v6 <- PolymorphicInstanceCall:30(get:length, v5 IC[1: _List@0x36924d72 #­20753 <0x7fe0b2fbf3a1>]) T{null, dynamic, Type: class 'dynamic'}
 15: ParallelMove rax <- rax
 16: CheckSmi:38(v6)
 18: ParallelMove rcx <- rax
 18: v8 <- BinarySmiOp:38(-, v6 T{not-null, _Smi@0x36924d72, ?}, v7) [-inf, 4611686018427387902] T{not-null, _Smi@0x36924d72, ?} +o -t
 19: ParallelMove rax <- S+1
 20: CheckSmi:42(v4)
 22: ParallelMove rdx <- rax
 22: v9 <- BinarySmiOp:42(&, v4 T{not-null, _Smi@0x36924d72, ?}, v8) [-4611686018427387904, 4611686018427387903] T{not-null, _Smi@0x36924d72, ?} +o -t
 23: ParallelMove rcx <- S+0
 24: v19 <- LoadField:190(v5, 16, immutable=1) [0, 576460752303423487] T{not-null, _Smi@0x36924d72, ?}
 26: CheckArrayBound:54(v19, v9)
 28: v20 <- LoadIndexed(v5, v9) T{null, dynamic, Type: class 'dynamic'}
 30: ParallelMove rcx <- rbx goto:144 8
 32: B8[join]:140 pred(B1, B4) {
      v11 <- phi(v20, v15) alive T{null, dynamic, Type: class 'dynamic'}
}
 33: ParallelMove S+0 <- rcx
 34: CheckStackOverflow:142(depth 1)
 36: Branch if StrictCompare:62(!==, v11, v0) goto (7, 9)
 38: B7[target]:138
 40: CheckClass:74(v11 T{not-null, dynamic, Type: class 'dynamic'} IC[2: _HashMapEntry@0x23c35ea0 #­8188 <0x7fe0b32fd091> | _LinkedHashMapEntry@0x23c35ea0 #­2958 <0x7fe0b32fd091>])
 42: v12 <- LoadField:200(v11 T{not-null, dynamic, Type: class 'dynamic'}, 24 {hashCode} [non-nullable _Smi@0x36924d72], immutable=1) [-4611686018427387904, 4611686018427387903] T{not-null, _Smi@0x36924d72, ?}
 44: Branch if EqualityCompare:78(v4 T{not-null, _Smi@0x36924d72, ?} == v12) T{not-null, bool, Type: class 'bool'} goto (2, 5)
 46: B2[target]:106
 48: v16 <- LoadField:210(v11 T{not-null, dynamic, Type: class 'dynamic'}, 8 {key} [nullable dynamic], immutable=1) T{null, dynamic, ?}
 50: PushArgument:92(v16) T{null, dynamic, Type: class 'dynamic'}
 52: PushArgument:96(v3) T{null, dynamic, Type: class 'dynamic'}
 54: v17 <- PolymorphicInstanceCall:98(==, v16, v3 IC[2: _Smi@0x36924d72 #­1523 <0x7fe0b3020e81> | _OneByteString@0x36924d72 #­6649 <0x7fe0b2fbbc81>]) T{null, dynamic, Type: class 'dynamic'}
 55: ParallelMove rax <- rax
 56: Branch if StrictCompare:102(===, v17, v14) goto (3, 6)
 58: B3[target]:118 ParallelMove rcx <- S+0
 60: v18 <- LoadField:216(v11 T{not-null, dynamic, Type: class 'dynamic'}, 16 {value} [nullable dynamic], immutable=0) T{null, dynamic, ?}
 61: ParallelMove rax <- rax
 62: Return:116(v18)
 64: B6[target]:126 ParallelMove rcx <- S+0
 66: goto:128 4
 68: B5[target]:122
 70: goto:124 4
 72: B4[join]:120 pred(B5, B6)
 74: CheckClass:134(v11 T{not-null, dynamic, Type: class 'dynamic'} IC[2: _LinkedHashMapEntry@0x23c35ea0 #­2230 <0x7fe0b32fcb21> | _HashMapEntry@0x23c35ea0 #­744 <0x7fe0b32fcb21>])
 76: v15 <- LoadField:220(v11 T{not-null, dynamic, Type: class 'dynamic'}, 32 {next} [nullable dynamic], immutable=0) T{null, dynamic, Type: class 'dynamic'}
 78: ParallelMove rcx <- rax, rax <- S+1 goto:146 8
 80: B9[target]:148
 81: ParallelMove rax <- C
 82: Return:154(v0)
*** END CFG

@andersjohnsen
Copy link
Author

Shorter repro:

import 'dart:collection';

class A {}

var a = new A();

var map = new HashMap();
void index() {
  var val = map[0];
  map[0] = val;
  val = map[a];
  map[a] = val;
}

void main() {
  for (int i = 0; i < 10000000; i++) {
    index();
  }
}

ia32 has 2 deopt, while the x64 has 11 and ends with a less performing version.

@kevmoo kevmoo added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed priority-unassigned labels Feb 29, 2016
@mraleph mraleph closed this as completed Apr 24, 2018
@mraleph mraleph added the closed-cannot-reproduce Closed as we were unable to reproduce the reported issue label Apr 24, 2018
@mraleph
Copy link
Member

mraleph commented Apr 24, 2018

This is stale - the reproduction does not yield deoptimizations anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm closed-cannot-reproduce Closed as we were unable to reproduce the reported issue type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants