Created
May 30, 2015 14:02
-
-
Save ngryman/05421736fc1b6c067e4b to your computer and use it in GitHub Desktop.
Strange deopt.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[deoptimize global object @ 0x30ea29d106e9] | |
--- FUNCTION SOURCE (optCompare) id{0,0} --- | |
(a, b) { | |
return a['foo'] === b['foo'] | |
} | |
--- END --- | |
--- FUNCTION SOURCE (deoptCompare) id{1,0} --- | |
(a, b) { | |
var prop = 'foo' | |
return a[prop] === b[prop] | |
} | |
--- END --- | |
[deoptimizing (DEOPT eager): begin 0x1c1b6309f759 deoptCompare (opt #1) @9, FP to SP delta: 16] | |
Deferred TaggedToI: NaN | |
translating deoptCompare => node=3, height=8 | |
0x7fff5fbff228: [top + 56] <- 0x30ea29d04121 ; [sp + 48] 0x30ea29d04121 <undefined> | |
0x7fff5fbff220: [top + 48] <- 0x1c1b6309f849 ; rax 0x1c1b6309f849 <an Object with map 0x2c0d3604f59> | |
0x7fff5fbff218: [top + 40] <- 0x1c1b6309f8c9 ; [sp + 32] 0x1c1b6309f8c9 <an Object with map 0x2c0d3604f59> | |
0x7fff5fbff210: [top + 32] <- 0x21150d0a833b ; caller's pc | |
0x7fff5fbff208: [top + 24] <- 0x7fff5fbff268 ; caller's fp | |
0x7fff5fbff200: [top + 16] <- 0x30ea29d6f679; context | |
0x7fff5fbff1f8: [top + 8] <- 0x1c1b6309f759; function | |
0x7fff5fbff1f0: [top + 0] <- 0x30ea29d04121 <undefined> ; literal | |
[deoptimizing (eager): end 0x1c1b6309f759 deoptCompare @9 => node=3, pc=0x21150d0a89ca, state=NO_REGISTERS, alignment=no padding, took 0.043 ms] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin_compilation | |
name "optCompare" | |
method "optCompare:0" | |
date 1432994466000 | |
end_compilation | |
begin_cfg | |
name "Z_Code generation" | |
begin_block | |
name "B0" | |
from_bci -1 | |
to_bci -1 | |
predecessors | |
successors "B1" | |
xhandlers | |
flags | |
loop_depth 0 | |
first_lir_id 0 | |
last_lir_id 22 | |
begin_states | |
begin_locals | |
size 0 | |
method "None" | |
end_locals | |
end_states | |
begin_HIR | |
0 0 v0 BlockEntry type:Tagged <|@ | |
0 2 t21 Constant 0x30ea29d04161 <false> [map 0x1abbf6c04461] <|@ | |
0 2 t20 Constant 0x30ea29d04141 <true> [map 0x1abbf6c04461] <|@ | |
0 3 t1 Context type:Tagged <|@ | |
0 2 t2 Parameter 0 type:Tagged <|@ | |
0 7 t3 Parameter 1 type:Tagged <|@ | |
0 7 t4 Parameter 2 type:Tagged <|@ | |
0 0 t5 ArgumentsObject t2 t3 t4 type:Tagged <|@ | |
0 0 v7 Simulate id=2 var[3] = t1, var[2] = t4, var[1] = t3, var[0] = t2 type:Tagged <|@ | |
0 0 v8 Goto B1 type:Tagged <|@ | |
end_HIR | |
begin_LIR | |
0 label () () () () [hir:v0] <|@ | |
2 gap () () () () [hir:v0] <|@ | |
4 context [rsi|R]= [hir:t1] <|@ | |
6 gap ((0) = [rsi|R];) () () () [hir:t1] <|@ | |
8 parameter [stack:-3]= [hir:t2] <|@ | |
10 gap () ([stack:-3];) () () [hir:t2] <|@ | |
12 parameter [stack:-2]= [hir:t3] <|@ | |
14 gap () ([stack:-2];) () () [hir:t3] <|@ | |
16 parameter [stack:-1]= [hir:t4] <|@ | |
18 gap () ([stack:-1];) () () [hir:t4] <|@ | |
20 gap () () () () [hir:v8] <|@ | |
22 goto B1 [hir:v8] <|@ | |
end_LIR | |
end_block | |
begin_block | |
name "B1" | |
from_bci -1 | |
to_bci -1 | |
predecessors "B0" | |
successors "B3" "B2" | |
xhandlers | |
flags | |
dominator "B0" | |
loop_depth 0 | |
first_lir_id 24 | |
last_lir_id 62 | |
begin_states | |
begin_locals | |
size 0 | |
method "None" | |
end_locals | |
end_states | |
begin_HIR | |
0 0 v9 BlockEntry type:Tagged <|@ | |
0 0 v10 Simulate id=3 type:Tagged <|@ | |
0 0 v11 StackCheck t1 changes[NewSpacePromotion] type:Tagged <|@ | |
0 0 t13 CheckHeapObject t3 pos:18 <|@ | |
0 0 t14 CheckMaps t3 [0x2c0d3604f59] pos:18 <|@ | |
0 1 i15 LoadNamedField t3.foo[in-object]@24 type:Smi pos:18 <|@ | |
0 0 t16 CheckHeapObject t4 pos:31 <|@ | |
0 0 t17 CheckMaps t4 [0x2c0d3604f59] pos:31 <|@ | |
0 1 i18 LoadNamedField t4.foo[in-object]@24 type:Smi pos:31 <|@ | |
0 0 i19 CompareNumericAndBranch EQ_STRICT i15 i18 goto (B3, B2) type:Tagged pos:27 <|@ | |
end_HIR | |
begin_LIR | |
24 label () () () () [hir:v9] <|@ | |
26 gap () ([rsi|R];) () () [hir:v9] <|@ | |
28 stack-check = [rsi|R] [id=3|parameters=3|arguments_stack_height=0|[stack:-3];[stack:-2];[stack:-1]] {[rsi|R]} [hir:v11] <|@ | |
30 gap () () () () [hir:v11] <|@ | |
32 lazy-bailout = [id=3|deopt_id=0|parameters=3|arguments_stack_height=0|[stack:-3];[stack:-2];[stack:-1]] [hir:v11] <|@ | |
34 gap () () ([rax|R] = [stack:-2];) () [hir:v11] <|@ | |
36 check-non-smi = [rax|R] [id=3|deopt_id=1|parameters=3|arguments_stack_height=0|[stack:-3];[rax|R];[stack:-1]] [hir:t13] <|@ | |
38 gap () () () () [hir:t13] <|@ | |
40 check-maps = [rax|R] [id=3|deopt_id=2|parameters=3|arguments_stack_height=0|[stack:-3];[rax|R];[stack:-1]] [hir:t14] <|@ | |
42 gap () () () () [hir:t14] <|@ | |
44 load-named-field [rbx|R]= [rax|R] [hir:i15] <|@ | |
46 gap ((0) = [rbx|R];) () ([rdx|R] = [stack:-1];) () [hir:i15] <|@ | |
48 check-non-smi = [rdx|R] [id=3|deopt_id=3|parameters=3|arguments_stack_height=0|[stack:-3];[rax|R];[rdx|R]] [hir:t16] <|@ | |
50 gap () () () () [hir:t16] <|@ | |
52 check-maps = [rdx|R] [id=3|deopt_id=4|parameters=3|arguments_stack_height=0|[stack:-3];[rax|R];[rdx|R]] [hir:t17] <|@ | |
54 gap () () () () [hir:t17] <|@ | |
56 load-named-field [rax|R]= [rdx|R] [hir:i18] <|@ | |
58 gap ((0) = [rax|R];) () () () [hir:i18] <|@ | |
60 gap () () () () [hir:i19] <|@ | |
62 compare-numeric-and-branch if [rbx|R] === [rax|R] then B3 else B2 [hir:i19] <|@ | |
end_LIR | |
end_block | |
begin_block | |
name "B2" | |
from_bci -1 | |
to_bci -1 | |
predecessors "B1" | |
successors "B4" | |
xhandlers | |
flags | |
dominator "B1" | |
loop_depth 0 | |
first_lir_id 64 | |
last_lir_id 70 | |
begin_states | |
begin_locals | |
size 0 | |
method "None" | |
end_locals | |
end_states | |
begin_HIR | |
0 0 v25 BlockEntry type:Tagged pos:27 <|@ | |
0 0 v26 Simulate id=18 push t21 type:Tagged pos:27 <|@ | |
0 0 v27 Goto B4 type:Tagged pos:27 <|@ | |
end_HIR | |
begin_LIR | |
64 label () () () () [hir:v25] <|@ | |
66 gap () () () () [hir:v25] <|@ | |
68 gap () ([rax|R] = [constant:21];) () () [hir:v27] <|@ | |
70 goto B4 [hir:v27] <|@ | |
end_LIR | |
end_block | |
begin_block | |
name "B3" | |
from_bci -1 | |
to_bci -1 | |
predecessors "B1" | |
successors "B4" | |
xhandlers | |
flags | |
dominator "B1" | |
loop_depth 0 | |
first_lir_id 72 | |
last_lir_id 78 | |
begin_states | |
begin_locals | |
size 0 | |
method "None" | |
end_locals | |
end_states | |
begin_HIR | |
0 0 v22 BlockEntry type:Tagged pos:27 <|@ | |
0 0 v23 Simulate id=18 push t20 type:Tagged pos:27 <|@ | |
0 0 v24 Goto B4 type:Tagged pos:27 <|@ | |
end_HIR | |
begin_LIR | |
72 label () () () () [hir:v22] <|@ | |
74 gap () () () () [hir:v22] <|@ | |
76 gap () ([rax|R] = [constant:20];) () () [hir:v24] <|@ | |
78 goto B4 [hir:v24] <|@ | |
end_LIR | |
end_block | |
begin_block | |
name "B4" | |
from_bci -1 | |
to_bci -1 | |
predecessors "B3" "B2" | |
successors | |
xhandlers | |
flags | |
dominator "B1" | |
loop_depth 0 | |
first_lir_id 80 | |
last_lir_id 86 | |
begin_states | |
begin_locals | |
size 1 | |
method "None" | |
4 t28 [ t20 t21 uses:1_0s_0i_0d_0t] | |
end_locals | |
end_states | |
begin_HIR | |
0 0 v29 BlockEntry type:Tagged pos:27 <|@ | |
0 1 s33 Constant 2 type:Smi pos:27 <|@ | |
0 0 v31 Return t28 (pop s33 values) type:Tagged pos:27 <|@ | |
end_HIR | |
begin_LIR | |
80 label () ((0) = [rax|R];) () () [hir:v29] <|@ | |
82 gap () ([rax|R];) () () [hir:v29] <|@ | |
84 return = [rax|R] NULL [constant:33] [hir:v31] <|@ | |
86 gap () () () () [hir:v31] <|@ | |
end_LIR | |
end_block | |
end_cfg | |
begin_compilation | |
name "deoptCompare" | |
method "deoptCompare:1" | |
date 1432994466000 | |
end_compilation | |
begin_cfg | |
name "Z_Code generation" | |
begin_block | |
name "B0" | |
from_bci -1 | |
to_bci -1 | |
predecessors | |
successors "B1" | |
xhandlers | |
flags | |
loop_depth 0 | |
first_lir_id 0 | |
last_lir_id 22 | |
begin_states | |
begin_locals | |
size 0 | |
method "None" | |
end_locals | |
end_states | |
begin_HIR | |
0 0 v0 BlockEntry type:Tagged <|@ | |
0 2 t31 Constant 0x30ea29d04161 <false> [map 0x1abbf6c04461] <|@ | |
0 2 t30 Constant 0x30ea29d04141 <true> [map 0x1abbf6c04461] <|@ | |
0 1 t6 Constant 0x30ea29d04121 <undefined> [map 0x1abbf6c04191] <|@ | |
0 3 t1 Context type:Tagged <|@ | |
0 2 t2 Parameter 0 type:Tagged <|@ | |
0 8 t3 Parameter 1 type:Tagged <|@ | |
0 8 t4 Parameter 2 type:Tagged <|@ | |
0 0 t5 ArgumentsObject t2 t3 t4 type:Tagged <|@ | |
0 0 v7 Simulate id=2 var[4] = t6, var[3] = t1, var[2] = t4, var[1] = t3, var[0] = t2 type:Tagged <|@ | |
0 0 v8 Goto B1 type:Tagged <|@ | |
end_HIR | |
begin_LIR | |
0 label () () () () [hir:v0] <|@ | |
2 gap () () () () [hir:v0] <|@ | |
4 context [rsi|R]= [hir:t1] <|@ | |
6 gap ((0) = [rsi|R];) () () () [hir:t1] <|@ | |
8 parameter [stack:-3]= [hir:t2] <|@ | |
10 gap () ([stack:-3];) () () [hir:t2] <|@ | |
12 parameter [stack:-2]= [hir:t3] <|@ | |
14 gap () ([stack:-2];) () () [hir:t3] <|@ | |
16 parameter [stack:-1]= [hir:t4] <|@ | |
18 gap () ([stack:-1];) () () [hir:t4] <|@ | |
20 gap () () () () [hir:v8] <|@ | |
22 goto B1 [hir:v8] <|@ | |
end_LIR | |
end_block | |
begin_block | |
name "B1" | |
from_bci -1 | |
to_bci -1 | |
predecessors "B0" | |
successors "B3" "B2" | |
xhandlers | |
flags | |
dominator "B0" | |
loop_depth 0 | |
first_lir_id 24 | |
last_lir_id 102 | |
begin_states | |
begin_locals | |
size 0 | |
method "None" | |
end_locals | |
end_states | |
begin_HIR | |
0 0 v9 BlockEntry type:Tagged <|@ | |
0 0 v10 Simulate id=3 type:Tagged <|@ | |
0 0 v11 StackCheck t1 changes[NewSpacePromotion] type:Tagged <|@ | |
0 3 t12 Constant 0x1d1e22b8f81 <String[3]: foo> [map 0x1abbf6c049b9] pos:22 <|@ | |
0 0 t16 CheckHeapObject t3 pos:39 <|@ | |
0 0 t17 CheckMaps t3 [0x2c0d3604f59] pos:39 <|@ | |
0 3 t18 LoadNamedField t3.%elements@16 type:Tagged pos:39 <|@ | |
0 1 i19 LoadNamedField t18.%length@8 type:Smi pos:39 <|@ | |
0 4 i44 Change t12 t to i type:TaggedNumber pos:39 <|@ | |
0 0 i20 BoundsCheck i44 i19 type:Tagged pos:39 <|@ | |
0 1 t21 LoadKeyed t18[i44] t3 type:Tagged pos:39 <|@ | |
0 0 t23 CheckHeapObject t4 pos:51 <|@ | |
0 0 t24 CheckMaps t4 [0x2c0d3604f59] pos:51 <|@ | |
0 3 t25 LoadNamedField t4.%elements@16 type:Tagged pos:51 <|@ | |
0 1 i26 LoadNamedField t25.%length@8 type:Smi pos:51 <|@ | |
0 0 i27 BoundsCheck i44 i26 type:Tagged pos:51 <|@ | |
0 1 t28 LoadKeyed t25[i44] t4 type:Tagged pos:51 <|@ | |
0 1 s45 Change t21 t to s type:TaggedNumber pos:38 <|@ | |
0 1 s46 Change t28 t to s type:TaggedNumber pos:50 <|@ | |
0 0 s29 CompareNumericAndBranch EQ_STRICT s45 s46 goto (B3, B2) type:Tagged pos:45 <|@ | |
end_HIR | |
begin_LIR | |
24 label () () () () [hir:v9] <|@ | |
26 gap () ([rsi|R];) () () [hir:v9] <|@ | |
28 stack-check = [rsi|R] [id=3|parameters=3|arguments_stack_height=0|[stack:-3];[stack:-2];[stack:-1];[constant:6]] {[rsi|R]} [hir:v11] <|@ | |
30 gap () () () () [hir:v11] <|@ | |
32 lazy-bailout = [id=3|deopt_id=0|parameters=3|arguments_stack_height=0|[stack:-3];[stack:-2];[stack:-1];[constant:6]] [hir:v11] <|@ | |
34 gap () () ([rax|R] = [stack:-2];) () [hir:v11] <|@ | |
36 check-non-smi = [rax|R] [id=3|deopt_id=1|parameters=3|arguments_stack_height=0|[stack:-3];[rax|R];[stack:-1];[constant:6]] [hir:t16] <|@ | |
38 gap () () () () [hir:t16] <|@ | |
40 check-maps = [rax|R] [id=3|deopt_id=2|parameters=3|arguments_stack_height=0|[stack:-3];[rax|R];[stack:-1];[constant:6]] [hir:t17] <|@ | |
42 gap () () () () [hir:t17] <|@ | |
44 load-named-field [rbx|R]= [rax|R] [hir:t18] <|@ | |
46 gap ((0) = [rbx|R];) () () () [hir:t18] <|@ | |
48 load-named-field [rdx|R]= [rbx|R] [hir:i19] <|@ | |
50 gap ((0) = [rdx|R];) () () () [hir:i19] <|@ | |
52 constant-t [rcx|R]= [hir:t12] <|@ | |
54 gap ((0) = [rcx|R];) ([rcx|R];) () () [hir:t12] <|@ | |
56 tagged-to-i [rcx|R]= [rcx|R] [id=3|deopt_id=9|parameters=3|arguments_stack_height=0|[stack:-3];[rax|R];[stack:-1];[constant:6]] [hir:i44] <|@ | |
58 gap ((0) = [rcx|R];) () () () [hir:i44] <|@ | |
60 bounds-check = [rcx|R] [rdx|R] [id=3|deopt_id=3|parameters=3|arguments_stack_height=0|[stack:-3];[rax|R];[stack:-1];[constant:6]] [hir:i20] <|@ | |
62 gap () () () () [hir:i20] <|@ | |
64 load-keyed [rbx|R][rbx|R][[rcx|R]] [hir:t21] <|@ | |
66 gap ((0) = [rbx|R];) () ([rdx|R] = [stack:-1];) () [hir:t21] <|@ | |
68 check-non-smi = [rdx|R] [id=3|deopt_id=4|parameters=3|arguments_stack_height=0|[stack:-3];[rax|R];[rdx|R];[constant:6]] [hir:t23] <|@ | |
70 gap () () () () [hir:t23] <|@ | |
72 check-maps = [rdx|R] [id=3|deopt_id=5|parameters=3|arguments_stack_height=0|[stack:-3];[rax|R];[rdx|R];[constant:6]] [hir:t24] <|@ | |
74 gap () () () () [hir:t24] <|@ | |
76 load-named-field [rsi|R]= [rdx|R] [hir:t25] <|@ | |
78 gap ((0) = [rsi|R];) () () () [hir:t25] <|@ | |
80 load-named-field [rdi|R]= [rsi|R] [hir:i26] <|@ | |
82 gap ((0) = [rdi|R];) () () () [hir:i26] <|@ | |
84 bounds-check = [rcx|R] [rdi|R] [id=3|deopt_id=6|parameters=3|arguments_stack_height=0|[stack:-3];[rax|R];[rdx|R];[constant:6]] [hir:i27] <|@ | |
86 gap () () () () [hir:i27] <|@ | |
88 load-keyed [rcx|R][rsi|R][[rcx|R]] [hir:t28] <|@ | |
90 gap ((0) = [rcx|R];) ([rbx|R];) () () [hir:t28] <|@ | |
92 check-smi [rbx|R]= [rbx|R] [id=3|deopt_id=7|parameters=3|arguments_stack_height=0|[stack:-3];[rax|R];[rdx|R];[constant:6]] [hir:s45] <|@ | |
94 gap ((0) = [rbx|R];) ([rcx|R];) () () [hir:s45] <|@ | |
96 check-smi [rcx|R]= [rcx|R] [id=3|deopt_id=8|parameters=3|arguments_stack_height=0|[stack:-3];[rax|R];[rdx|R];[constant:6]] [hir:s46] <|@ | |
98 gap ((0) = [rcx|R];) () () () [hir:s46] <|@ | |
100 gap () () () () [hir:s29] <|@ | |
102 compare-numeric-and-branch if [rbx|R] === [rcx|R] then B3 else B2 [hir:s29] <|@ | |
end_LIR | |
end_block | |
begin_block | |
name "B2" | |
from_bci -1 | |
to_bci -1 | |
predecessors "B1" | |
successors "B4" | |
xhandlers | |
flags | |
dominator "B1" | |
loop_depth 0 | |
first_lir_id 104 | |
last_lir_id 110 | |
begin_states | |
begin_locals | |
size 0 | |
method "None" | |
end_locals | |
end_states | |
begin_HIR | |
0 0 v35 BlockEntry type:Tagged pos:45 <|@ | |
0 0 v36 Simulate id=30 var[4] = t12, push t31 type:Tagged pos:45 <|@ | |
0 0 v37 Goto B4 type:Tagged pos:45 <|@ | |
end_HIR | |
begin_LIR | |
104 label () () () () [hir:v35] <|@ | |
106 gap () () () () [hir:v35] <|@ | |
108 gap () ([rax|R] = [constant:31];) () () [hir:v37] <|@ | |
110 goto B4 [hir:v37] <|@ | |
end_LIR | |
end_block | |
begin_block | |
name "B3" | |
from_bci -1 | |
to_bci -1 | |
predecessors "B1" | |
successors "B4" | |
xhandlers | |
flags | |
dominator "B1" | |
loop_depth 0 | |
first_lir_id 112 | |
last_lir_id 118 | |
begin_states | |
begin_locals | |
size 0 | |
method "None" | |
end_locals | |
end_states | |
begin_HIR | |
0 0 v32 BlockEntry type:Tagged pos:45 <|@ | |
0 0 v33 Simulate id=30 var[4] = t12, push t30 type:Tagged pos:45 <|@ | |
0 0 v34 Goto B4 type:Tagged pos:45 <|@ | |
end_HIR | |
begin_LIR | |
112 label () () () () [hir:v32] <|@ | |
114 gap () () () () [hir:v32] <|@ | |
116 gap () ([rax|R] = [constant:30];) () () [hir:v34] <|@ | |
118 goto B4 [hir:v34] <|@ | |
end_LIR | |
end_block | |
begin_block | |
name "B4" | |
from_bci -1 | |
to_bci -1 | |
predecessors "B3" "B2" | |
successors | |
xhandlers | |
flags | |
dominator "B1" | |
loop_depth 0 | |
first_lir_id 120 | |
last_lir_id 126 | |
begin_states | |
begin_locals | |
size 1 | |
method "None" | |
5 t38 [ t30 t31 uses:1_0s_0i_0d_0t] | |
end_locals | |
end_states | |
begin_HIR | |
0 0 v39 BlockEntry type:Tagged pos:45 <|@ | |
0 1 s47 Constant 2 type:Smi pos:45 <|@ | |
0 0 v41 Return t38 (pop s47 values) type:Tagged pos:45 <|@ | |
end_HIR | |
begin_LIR | |
120 label () ((0) = [rax|R];) () () [hir:v39] <|@ | |
122 gap () ([rax|R];) () () [hir:v39] <|@ | |
124 return = [rax|R] NULL [constant:47] [hir:v41] <|@ | |
126 gap () () () () [hir:v41] <|@ | |
end_LIR | |
end_block | |
end_cfg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var obj1 = { foo: 0 } | |
, obj2 = { foo: 0 } | |
function optCompare(a, b) { | |
return a['foo'] === b['foo'] | |
} | |
function deoptCompare(a, b) { | |
var prop = 'foo' | |
return a[prop] === b[prop] | |
} | |
optCompare(obj1, obj2) | |
optCompare(obj1, obj2) | |
;%OptimizeFunctionOnNextCall(optCompare) | |
optCompare(obj1, obj2) | |
deoptCompare(obj1, obj2) | |
deoptCompare(obj1, obj2) | |
;%OptimizeFunctionOnNextCall(deoptCompare) | |
deoptCompare(obj1, obj2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment