Skip to content

Instantly share code, notes, and snippets.

@blackavec
Created January 21, 2020 08:29
Show Gist options
  • Save blackavec/b7de8df873fd2dafe6b1ba57cdd8b0cc to your computer and use it in GitHub Desktop.
Save blackavec/b7de8df873fd2dafe6b1ba57cdd8b0cc to your computer and use it in GitHub Desktop.
% node --print-bytecode --print-bytecode-filter=testFor scenarios/bytecode/benchmark.js
[generated bytecode for function: testFor]
Parameter count 2
Frame size 16
78 E> 0x596d72600ba @ 0 : a0 StackCheck
96 S> 0x596d72600bb @ 1 : 0c 0a LdaSmi [10]
0x596d72600bd @ 3 : 26 fb Star r0
102 E> 0x596d72600bf @ 5 : a0 StackCheck
116 S> 0x596d72600c0 @ 6 : 25 fb Ldar r0
0x596d72600c2 @ 8 : 73 00 ToNumeric [0]
0x596d72600c4 @ 10 : 26 fa Star r1
0x596d72600c6 @ 12 : 4b 00 Dec [0]
0x596d72600c8 @ 14 : 26 fb Star r0
0x596d72600ca @ 16 : 0b LdaZero
124 E> 0x596d72600cb @ 17 : 65 fa 01 TestEqualStrict r1, [1]
0x596d72600ce @ 20 : 94 04 JumpIfFalse [4] (0x596d72600d2 @ 24)
137 S> 0x596d72600d0 @ 22 : 10 LdaTrue
148 S> 0x596d72600d1 @ 23 : a4 Return
0x596d72600d2 @ 24 : 85 13 00 JumpLoop [19], [0] (0x596d72600bf @ 5)
0x596d72600d5 @ 27 : 0d LdaUndefined
153 S> 0x596d72600d6 @ 28 : a4 Return
Constant pool (size = 0)
Handler Table (size = 0)
% node --print-bytecode --print-bytecode-filter=testWhile scenarios/bytecode/benchmark.js
[generated bytecode for function: testWhile]
Parameter count 2
Frame size 16
174 E> 0xd527ffe021a @ 0 : a0 StackCheck
192 S> 0xd527ffe021b @ 1 : 0c 0a LdaSmi [10]
0xd527ffe021d @ 3 : 26 fb Star r0
198 E> 0xd527ffe021f @ 5 : a0 StackCheck
216 S> 0xd527ffe0220 @ 6 : 25 fb Ldar r0
0xd527ffe0222 @ 8 : 73 00 ToNumeric [0]
0xd527ffe0224 @ 10 : 26 fa Star r1
0xd527ffe0226 @ 12 : 4b 00 Dec [0]
0xd527ffe0228 @ 14 : 26 fb Star r0
0xd527ffe022a @ 16 : 0b LdaZero
224 E> 0xd527ffe022b @ 17 : 65 fa 01 TestEqualStrict r1, [1]
0xd527ffe022e @ 20 : 94 04 JumpIfFalse [4] (0xd527ffe0232 @ 24)
237 S> 0xd527ffe0230 @ 22 : 10 LdaTrue
248 S> 0xd527ffe0231 @ 23 : a4 Return
0xd527ffe0232 @ 24 : 85 13 00 JumpLoop [19], [0] (0xd527ffe021f @ 5)
0xd527ffe0235 @ 27 : 0d LdaUndefined
253 S> 0xd527ffe0236 @ 28 : a4 Return
Constant pool (size = 0)
Handler Table (size = 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment