vhf/v8-bailout-reasons

Unsupported phi use of const or let variable

vsemozhetbyt opened this issue · 3 comments

New example ( v8 5.4.500.45 / Node.js 7.4.0):

'use strict';

let i;

for (i = 0; i < 1e7; i++) {}

let j;

for (j = 0; j < 1e7; j++) {}
[marking 000001F62D3DF079 <JS Function (SharedFunctionInfo 000002B36CA679C1)> for optimized recompilation, reason: small function, ICs with typeinfo: 2/4 (50%), generic ICs: 0/4 (0%)]
[compiling method 000001F62D3DF079 <JS Function (SharedFunctionInfo 000002B36CA679C1)> using Crankshaft OSR]
[aborted optimizing 000001F62D3DF079 <JS Function (SharedFunctionInfo 000002B36CA679C1)> because: Unsupported phi use of const or let variable]
[disabled optimization for 000002B36CA679C1 <SharedFunctionInfo>, reason: Unsupported phi use of const or let variable]

It seems the deopt concerns some internal function for loops.

Compare:

'use strict';

let i;

for (i = 0; i < 1e7; i++) {}

for (i = 0; i < 1e7; i++) {}
[marking 0000020E1C4DF059 <JS Function (SharedFunctionInfo 000000D6C4E679C1)> for optimized recompilation, reason: small function, ICs with typeinfo: 2/4 (50%), generic ICs: 0/4 (0%)]
[compiling method 0000020E1C4DF059 <JS Function (SharedFunctionInfo 000000D6C4E679C1)> using Crankshaft OSR]
[optimizing 0000020E1C4DF059 <JS Function (SharedFunctionInfo 000000D6C4E679C1)> - took 0.135, 0.174, 0.072 ms]
[deoptimizing (DEOPT soft): begin 0000020E1C4DF059 <JS Function (SharedFunctionInfo 000000D6C4E679C1)> (opt #0) @3, FP to SP delta: 32, caller sp: 0x002fe718]
            ;;; deoptimize at 456: Insufficient type feedback for combined type of binary operation
  reading input frame  => node=60, args=6, height=2; inputs:
      0: 0x20e1c4df059 ; [fp - 16] 0000020E1C4DF059 <JS Function (SharedFunctionInfo 000000D6C4E679C1)>
      1: 0x20e1c4dc9c1 ; rdx 0000020E1C4DC9C1 <an Object with map 000002C946807011>
      2: 0x23bbfa04311 ; (literal 2) 0000023BBFA04311 <undefined>
      3: 0x23bbfa04311 ; (literal 2) 0000023BBFA04311 <undefined>
      4: 0x23bbfa04311 ; (literal 2) 0000023BBFA04311 <undefined>
      5: 0x23bbfa04311 ; (literal 2) 0000023BBFA04311 <undefined>
      6: 0x23bbfa04311 ; (literal 2) 0000023BBFA04311 <undefined>
      7: 0x23bbfa9e3f1 ; rbx 0000023BBFA9E3F1 <FixedArray[179]>
      8: 0x00000000 ; rax 0
  translating frame  => node=60, height=8
    0x002fe710: [top + 80] <- 0x20e1c4dc9c1 ;  0000020E1C4DC9C1 <an Object with map 000002C946807011>  (input #1)
    0x002fe708: [top + 72] <- 0x23bbfa04311 ;  0000023BBFA04311 <undefined>  (input #2)
    0x002fe700: [top + 64] <- 0x23bbfa04311 ;  0000023BBFA04311 <undefined>  (input #3)
    0x002fe6f8: [top + 56] <- 0x23bbfa04311 ;  0000023BBFA04311 <undefined>  (input #4)
    0x002fe6f0: [top + 48] <- 0x23bbfa04311 ;  0000023BBFA04311 <undefined>  (input #5)
    0x002fe6e8: [top + 40] <- 0x23bbfa04311 ;  0000023BBFA04311 <undefined>  (input #6)
    0x002fe6e0: [top + 32] <- 0xfb38444ce8 ;  caller's pc
    0x002fe6d8: [top + 24] <- 0x002fe788 ;  caller's fp
    0x002fe6d0: [top + 16] <- 0x23bbfa9e3f1 ;  context    0000023BBFA9E3F1 <FixedArray[179]>  (input #7)
    0x002fe6c8: [top + 8] <- 0x20e1c4df059 ;  function    0000020E1C4DF059 <JS Function (SharedFunctionInfo 000000D6C4E679C1)>  (input #0)
    0x002fe6c0: [top + 0] <- 0x00000000 ;  0  (input #8)
[deoptimizing (soft): end 0000020E1C4DF059 <JS Function (SharedFunctionInfo 000000D6C4E679C1)> @3 => node=60, pc=0xfb38445195, caller sp=0x002fe718, state=NO_REGISTERS, took 33.615 ms]
[removing optimized code for: ]
[evicting entry from optimizing code map (notify deoptimized) for 000000D6C4E679C1 <SharedFunctionInfo> (osr ast id 26)]
[marking 0000020E1C4DF059 <JS Function (SharedFunctionInfo 000000D6C4E679C1)> for optimized recompilation, reason: small function, ICs with typeinfo: 4/4 (100%), generic ICs: 0/4 (0%)]
[compiling method 0000020E1C4DF059 <JS Function (SharedFunctionInfo 000000D6C4E679C1)> using Crankshaft OSR]
[optimizing 0000020E1C4DF059 <JS Function (SharedFunctionInfo 000000D6C4E679C1)> - took 0.150, 0.255, 0.112 ms]

A v8 issue with more info.

It seems this is a bug posted and forgotten by myself)

https://bugs.chromium.org/p/v8/issues/detail?id=5666