Skip to content

Instantly share code, notes, and snippets.

@mattzeunert
Created August 20, 2015 00:15
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mattzeunert/ed89b07ef86eafe2dc02 to your computer and use it in GitHub Desktop.
Save mattzeunert/ed89b07ef86eafe2dc02 to your computer and use it in GitHub Desktop.
--- Raw source ---
function add(a, b){
return a + b;
}
print(add(15, 19));
for (var i=0;i<1000;i++){
add(i, 22);
}
--- Code ---
source_position = 0
kind = FUNCTION
Instructions (size = 456)
0x36953100 0 8b4c2404 mov ecx,[esp+0x4]
0x36953104 4 81f991806049 cmp ecx,0x49608091 ;; object: 0x49608091 <undefined>
0x3695310a 10 750a jnz 22 (0x36953116)
0x3695310c 12 8b4e13 mov ecx,[esi+0x13]
0x3695310f 15 8b4917 mov ecx,[ecx+0x17]
0x36953112 18 894c2404 mov [esp+0x4],ecx
0x36953116 22 55 push ebp
0x36953117 23 89e5 mov ebp,esp
0x36953119 25 56 push esi
0x3695311a 26 57 push edi
0x3695311b 27 6891806049 push 0x49608091 ;; object: 0x49608091 <undefined>
0x36953120 32 56 push esi
0x36953121 33 6879b59250 push 0x5092b579 ;; object: 0x5092b579 <FixedArray[4]>
0x36953126 38 6a00 push 0x0
0x36953128 40 b803000000 mov eax,0x3
0x3695312d 45 bb60555300 mov ebx,0x535560
0x36953132 50 e8897bfbff call 0x3690acc0 ;; debug: statement 0
;; code: STUB, CEntryStub, minor: 0
0x36953137 55 3b25ec418101 cmp esp,[0x18141ec]
0x3695313d 61 7305 jnc 68 (0x36953144)
0x3695313f 63 e8dc00feff call StackCheck (0x36933220) ;; code: BUILTIN
0x36953144 68 8b5613 mov edx,[esi+0x13]
0x36953147 71 b93555f220 mov ecx,0x20f25535 ;; object: 0x20f25535 <String[5]: print>
0x3695314c 76 e8efcbfdff call 0x3692fd40 ;; debug: statement 38
;; code: contextual, LOAD_IC, UNINITIALIZED
0x36953151 81 50 push eax
0x36953152 82 6891806049 push 0x49608091 ;; object: 0x49608091 <undefined>
0x36953157 87 8b5613 mov edx,[esi+0x13]
0x3695315a 90 b9ad2af120 mov ecx,0x20f12aad ;; object: 0x20f12aad <String[3]: add>
0x3695315f 95 e8dccbfdff call 0x3692fd40 ;; debug: position 44
;; code: contextual, LOAD_IC, UNINITIALIZED
0x36953164 100 50 push eax
0x36953165 101 6891806049 push 0x49608091 ;; object: 0x49608091 <undefined>
0x3695316a 106 6a1e push 0x1e
0x3695316c 108 6a26 push 0x26
0x3695316e 110 ba06000000 mov edx,0x6
0x36953173 115 8b7c240c mov edi,[esp+0xc]
0x36953177 119 e8844ffcff call 0x36918100 ;; code: CALL_IC, DEFAULT
0x3695317c 124 8b75fc mov esi,[ebp-0x4]
0x3695317f 127 890424 mov [esp],eax
0x36953182 130 ba08000000 mov edx,0x8
0x36953187 135 8b7c2408 mov edi,[esp+0x8]
0x3695318b 139 e81034fcff call 0x369165a0 ;; code: CALL_IC, DEFAULT
0x36953190 144 8b75fc mov esi,[ebp-0x4]
0x36953193 147 83c404 add esp,0x4
0x36953196 150 8945f4 mov [ebp-0xc],eax
0x36953199 153 33c0 xor eax,eax
0x3695319b 155 b94943f120 mov ecx,0x20f14349 ;; object: 0x20f14349 <String[1]: i>
0x369531a0 160 8b5613 mov edx,[esi+0x13]
0x369531a3 163 e838cbfdff call 0x3692fce0 ;; debug: statement 64
;; debug: position 69
;; code: STORE_IC, UNINITIALIZED
0x369531a8 168 e991000000 jmp 318 (0x3695323e)
0x369531ad 173 8b5613 mov edx,[esi+0x13]
0x369531b0 176 b9ad2af120 mov ecx,0x20f12aad ;; object: 0x20f12aad <String[3]: add>
0x369531b5 181 e886cbfdff call 0x3692fd40 ;; debug: statement 86
;; code: contextual, LOAD_IC, UNINITIALIZED
0x369531ba 186 50 push eax
0x369531bb 187 6891806049 push 0x49608091 ;; object: 0x49608091 <undefined>
0x369531c0 192 8b5613 mov edx,[esi+0x13]
0x369531c3 195 b94943f120 mov ecx,0x20f14349 ;; object: 0x20f14349 <String[1]: i>
0x369531c8 200 e873cbfdff call 0x3692fd40 ;; debug: position 90
;; code: contextual, LOAD_IC, UNINITIALIZED
0x369531cd 205 50 push eax
0x369531ce 206 6a2c push 0x2c
0x369531d0 208 ba0a000000 mov edx,0xa
0x369531d5 213 8b7c240c mov edi,[esp+0xc]
0x369531d9 217 e8224ffcff call 0x36918100 ;; code: CALL_IC, DEFAULT
0x369531de 222 8b75fc mov esi,[ebp-0x4]
0x369531e1 225 83c404 add esp,0x4
0x369531e4 228 8945f4 mov [ebp-0xc],eax
0x369531e7 231 8b5613 mov edx,[esi+0x13]
0x369531ea 234 b94943f120 mov ecx,0x20f14349 ;; object: 0x20f14349 <String[1]: i>
0x369531ef 239 e84ccbfdff call 0x3692fd40 ;; debug: position 79
;; code: contextual, LOAD_IC, UNINITIALIZED
0x369531f4 244 a801 test al,0x1
0x369531f6 246 730a jnc 258 (0x36953202)
0x369531f8 248 83c002 add eax,0x2
0x369531fb 251 7118 jno 277 (0x36953215)
0x369531fd 253 83e802 sub eax,0x2
0x36953200 256 eb05 jmp 263 (0x36953207)
0x36953202 258 e87965fcff call 0x36919780 ;; code: STUB, ToNumberStub, minor: 0
0x36953207 263 89c2 mov edx,eax
0x36953209 265 b802000000 mov eax,0x2
0x3695320e 270 e8cd5dfdff call 0x36928fe0 ;; debug: position 80
;; code: BINARY_OP_IC, UNINITIALIZED (id = 62)
0x36953213 275 a81d test al,0x1d
0x36953215 277 b94943f120 mov ecx,0x20f14349 ;; object: 0x20f14349 <String[1]: i>
0x3695321a 282 8b5613 mov edx,[esi+0x13]
0x3695321d 285 e8becafdff call 0x3692fce0 ;; code: STORE_IC, UNINITIALIZED
0x36953222 290 bb8185005f mov ebx,0x5f008581 ;; object: 0x5f008581 Cell for 6144
0x36953227 295 836b0302 sub [ebx+0x3],0x2
0x3695322b 299 7911 jns 318 (0x3695323e)
0x3695322d 301 e80efffdff call InterruptCheck (0x36933140) ;; debug: statement 59
;; code: BUILTIN
0x36953232 306 bb8185005f mov ebx,0x5f008581 ;; object: 0x5f008581 Cell for 6144
0x36953237 311 c7430300300000 mov [ebx+0x3],0x3000
0x3695323e 318 8b5613 mov edx,[esi+0x13]
0x36953241 321 b94943f120 mov ecx,0x20f14349 ;; object: 0x20f14349 <String[1]: i>
0x36953246 326 e8f5cafdff call 0x3692fd40 ;; debug: position 72
;; code: contextual, LOAD_IC, UNINITIALIZED
0x3695324b 331 50 push eax
0x3695324c 332 b8d0070000 mov eax,0x7d0
0x36953251 337 5a pop edx
0x36953252 338 89d1 mov ecx,edx
0x36953254 340 0bc8 or ecx,eax
0x36953256 342 f6c101 test_b cl,0x1
0x36953259 345 730d jnc 360 (0x36953268)
0x3695325b 347 3bd0 cmp edx,eax
0x3695325d 349 0f8c4affffff jl 173 (0x369531ad)
0x36953263 355 e921000000 jmp 393 (0x36953289)
0x36953268 360 e81396fcff call 0x3691c880 ;; debug: position 73
;; code: COMPARE_IC, UNINITIALIZED (id = 53)
0x3695326d 365 a814 test al,0x14
0x3695326f 367 eb10 jmp 385 (0x36953281)
0x36953271 369 3db1806049 cmp eax,0x496080b1 ;; object: 0x496080b1 <true>
0x36953276 374 0f8431ffffff jz 173 (0x369531ad)
0x3695327c 380 e908000000 jmp 393 (0x36953289)
0x36953281 385 85c0 test eax,eax
0x36953283 387 0f8c24ffffff jl 173 (0x369531ad)
0x36953289 393 8b45f4 mov eax,[ebp-0xc]
0x3695328c 396 bb8185005f mov ebx,0x5f008581 ;; object: 0x5f008581 Cell for 6144
0x36953291 401 836b0306 sub [ebx+0x3],0x6
0x36953295 405 7913 jns 426 (0x369532aa)
0x36953297 407 50 push eax
0x36953298 408 e8a3fefdff call InterruptCheck (0x36933140) ;; debug: statement 102
;; code: BUILTIN
0x3695329d 413 58 pop eax
0x3695329e 414 bb8185005f mov ebx,0x5f008581 ;; object: 0x5f008581 Cell for 6144
0x369532a3 419 c7430300300000 mov [ebx+0x3],0x3000
0x369532aa 426 89ec mov esp,ebp ;; debug: position 101
;; js return
0x369532ac 428 5d pop ebp
0x369532ad 429 c20400 ret 0x4
0x369532b0 432 b891806049 mov eax,0x49608091 ;; object: 0x49608091 <undefined>
0x369532b5 437 ebd5 jmp 396 (0x3695328c)
0x369532b7 439 90 nop
Deoptimization Output Data (deopt points = 0)
Back edges (size = 1)
ast_id pc_offset loop_depth
36 306 1
0x5092b591: [TypeFeedbackInfo]
- ic_total_count: 13, ic_with_type_info_count: 0, ic_generic_count: 0
RelocInfo (size = 80)
0x36953106 embedded object (0x49608091 <undefined>)
0x3695311c embedded object (0x49608091 <undefined>)
0x36953122 embedded object (0x5092b579 <FixedArray[4]>)
0x36953132 statement position (0)
0x36953133 code target (STUB) (0x3690acc0)
0x36953140 code target (BUILTIN) (0x36933220)
0x36953148 embedded object (0x20f25535 <String[5]: print>)
0x3695314c statement position (38)
0x3695314d code target (LOAD_IC) (0x3692fd40)
0x36953153 embedded object (0x49608091 <undefined>)
0x3695315b embedded object (0x20f12aad <String[3]: add>)
0x3695315f position (44)
0x36953160 code target (LOAD_IC) (0x3692fd40)
0x36953166 embedded object (0x49608091 <undefined>)
0x36953178 code target (CALL_IC) (0x36918100)
0x3695318c code target (CALL_IC) (0x369165a0)
0x3695319c embedded object (0x20f14349 <String[1]: i>)
0x369531a3 statement position (64)
0x369531a3 position (69)
0x369531a4 code target (STORE_IC) (0x3692fce0)
0x369531b1 embedded object (0x20f12aad <String[3]: add>)
0x369531b5 statement position (86)
0x369531b6 code target (LOAD_IC) (0x3692fd40)
0x369531bc embedded object (0x49608091 <undefined>)
0x369531c4 embedded object (0x20f14349 <String[1]: i>)
0x369531c8 position (90)
0x369531c9 code target (LOAD_IC) (0x3692fd40)
0x369531da code target (CALL_IC) (0x36918100)
0x369531eb embedded object (0x20f14349 <String[1]: i>)
0x369531ef position (79)
0x369531f0 code target (LOAD_IC) (0x3692fd40)
0x36953203 code target (STUB) (0x36919780)
0x3695320e position (80)
0x3695320f code target with id (BINARY_OP_IC) (0x36928fe0) (id=62)
0x36953216 embedded object (0x20f14349 <String[1]: i>)
0x3695321e code target (STORE_IC) (0x3692fce0)
0x36953223 embedded object (0x5f008581 Cell for 6144)
0x3695322d statement position (59)
0x3695322e code target (BUILTIN) (0x36933140)
0x36953233 embedded object (0x5f008581 Cell for 6144)
0x36953242 embedded object (0x20f14349 <String[1]: i>)
0x36953246 position (72)
0x36953247 code target (LOAD_IC) (0x3692fd40)
0x36953268 position (73)
0x36953269 code target with id (COMPARE_IC) (0x3691c880) (id=53)
0x36953272 embedded object (0x496080b1 <true>)
0x3695328d embedded object (0x5f008581 Cell for 6144)
0x36953298 statement position (102)
0x36953299 code target (BUILTIN) (0x36933140)
0x3695329f embedded object (0x5f008581 Cell for 6144)
0x369532aa position (101)
0x369532aa js return
0x369532b1 embedded object (0x49608091 <undefined>)
--- End code ---
--- Raw source ---
(a, b){
return a + b;
}
--- Code ---
source_position = 12
kind = FUNCTION
name = add
Instructions (size = 100)
0x36953320 0 8b4c240c mov ecx,[esp+0xc]
0x36953324 4 81f991806049 cmp ecx,0x49608091 ;; object: 0x49608091 <undefined>
0x3695332a 10 750a jnz 22 (0x36953336)
0x3695332c 12 8b4e13 mov ecx,[esi+0x13]
0x3695332f 15 8b4917 mov ecx,[ecx+0x17]
0x36953332 18 894c240c mov [esp+0xc],ecx
0x36953336 22 55 push ebp
0x36953337 23 89e5 mov ebp,esp
0x36953339 25 56 push esi
0x3695333a 26 57 push edi
0x3695333b 27 3b25ec418101 cmp esp,[0x18141ec]
0x36953341 33 7305 jnc 40 (0x36953348)
0x36953343 35 e8d8fefdff call StackCheck (0x36933220) ;; debug: statement 12
;; code: BUILTIN
0x36953348 40 ff750c push [ebp+0xc]
0x3695334b 43 8b4508 mov eax,[ebp+0x8]
0x3695334e 46 5a pop edx
0x3695334f 47 e88c5cfdff call 0x36928fe0 ;; debug: statement 21
;; debug: position 30
;; code: BINARY_OP_IC, UNINITIALIZED (id = 7)
0x36953354 52 90 nop
0x36953355 53 bb8985005f mov ebx,0x5f008589 ;; object: 0x5f008589 Cell for 6144
0x3695335a 58 836b035e sub [ebx+0x3],0x5e
0x3695335e 62 7913 jns 83 (0x36953373)
0x36953360 64 50 push eax
0x36953361 65 e8dafdfdff call InterruptCheck (0x36933140) ;; code: BUILTIN
0x36953366 70 58 pop eax
0x36953367 71 bb8985005f mov ebx,0x5f008589 ;; object: 0x5f008589 Cell for 6144
0x3695336c 76 c7430300300000 mov [ebx+0x3],0x3000
0x36953373 83 89ec mov esp,ebp ;; debug: position 35
;; js return
0x36953375 85 5d pop ebp
0x36953376 86 c20c00 ret 0xc
0x36953379 89 b891806049 mov eax,0x49608091 ;; object: 0x49608091 <undefined>
0x3695337e 94 ebd5 jmp 53 (0x36953355)
Deoptimization Output Data (deopt points = 0)
Back edges (size = 0)
ast_id pc_offset loop_depth
0x5092b665: [TypeFeedbackInfo]
- ic_total_count: 1, ic_with_type_info_count: 0, ic_generic_count: 0
RelocInfo (size = 18)
0x36953326 embedded object (0x49608091 <undefined>)
0x36953343 statement position (12)
0x36953344 code target (BUILTIN) (0x36933220)
0x3695334f statement position (21)
0x3695334f position (30)
0x36953350 code target with id (BINARY_OP_IC) (0x36928fe0) (id=7)
0x36953356 embedded object (0x5f008589 Cell for 6144)
0x36953362 code target (BUILTIN) (0x36933140)
0x36953368 embedded object (0x5f008589 Cell for 6144)
0x36953373 position (35)
0x36953373 js return
0x3695337a embedded object (0x49608091 <undefined>)
--- End code ---
34
--- Code ---
kind = HANDLER
major_key = <NoCache>Stub
name = StoreGlobalStub
Instructions (size = 68)
0x36953560 0 bb91eff02c mov ebx,0x2cf0ef91 ;; object: 0x2cf0ef91 PropertyCell for 0
0x36953565 5 8b7b03 mov edi,[ebx+0x3]
0x36953568 8 81ffa1806049 cmp edi,0x496080a1 ;; object: 0x496080a1 <the hole>
0x3695356e 14 0f8404000000 jz 24 (0x36953578)
0x36953574 20 894303 mov [ebx+0x3],eax
0x36953577 23 c3 ret
0x36953578 24 e900000000 jmp 29 (0x3695357d)
0x3695357d 29 6800a01050 push 0x5010a000
0x36953582 34 ff75fc push [ebp-0x4]
0x36953585 37 6a0c push 0xc
0x36953587 39 e800000000 call 44 (0x3695358c)
0x3695358c 44 ff74240c push [esp+0xc]
0x36953590 48 896c2410 mov [esp+0x10],ebp
0x36953594 52 8d6c2410 lea ebp,[esp+0x10]
0x36953598 56 c3 ret
0x36953599 57 0f1f00 nop
Safepoints (size = 8)
RelocInfo (size = 2)
0x36953561 embedded object (0x2cf0ef91 PropertyCell for 0)
0x3695356a embedded object (0x496080a1 <the hole>)
--- End code ---
--- Raw source ---
(a, b){
return a + b;
}
--- Code ---
source_position = 12
kind = FUNCTION
name = add
Instructions (size = 100)
0x36953700 0 8b4c240c mov ecx,[esp+0xc]
0x36953704 4 81f991806049 cmp ecx,0x49608091 ;; object: 0x49608091 <undefined>
0x3695370a 10 750a jnz 22 (0x36953716)
0x3695370c 12 8b4e13 mov ecx,[esi+0x13]
0x3695370f 15 8b4917 mov ecx,[ecx+0x17]
0x36953712 18 894c240c mov [esp+0xc],ecx
0x36953716 22 55 push ebp
0x36953717 23 89e5 mov ebp,esp
0x36953719 25 56 push esi
0x3695371a 26 57 push edi
0x3695371b 27 3b25ec418101 cmp esp,[0x18141ec]
0x36953721 33 7305 jnc 40 (0x36953728)
0x36953723 35 e8f8fafdff call StackCheck (0x36933220) ;; debug: statement 12
;; code: BUILTIN
0x36953728 40 ff750c push [ebp+0xc]
0x3695372b 43 8b4508 mov eax,[ebp+0x8]
0x3695372e 46 5a pop edx
0x3695372f 47 e8ac58fdff call 0x36928fe0 ;; debug: statement 21
;; debug: position 30
;; code: BINARY_OP_IC, UNINITIALIZED (id = 7)
0x36953734 52 90 nop
0x36953735 53 bb9185005f mov ebx,0x5f008591 ;; object: 0x5f008591 Cell for 6144
0x3695373a 58 836b035e sub [ebx+0x3],0x5e
0x3695373e 62 7913 jns 83 (0x36953753)
0x36953740 64 50 push eax
0x36953741 65 e8faf9fdff call InterruptCheck (0x36933140) ;; code: BUILTIN
0x36953746 70 58 pop eax
0x36953747 71 bb9185005f mov ebx,0x5f008591 ;; object: 0x5f008591 Cell for 6144
0x3695374c 76 c7430300300000 mov [ebx+0x3],0x3000
0x36953753 83 89ec mov esp,ebp ;; debug: position 35
;; js return
0x36953755 85 5d pop ebp
0x36953756 86 c20c00 ret 0xc
0x36953759 89 b891806049 mov eax,0x49608091 ;; object: 0x49608091 <undefined>
0x3695375e 94 ebd5 jmp 53 (0x36953735)
Deoptimization Output Data (deopt points = 5)
ast id pc state
2 27 NO_REGISTERS
3 27 NO_REGISTERS
8 43 NO_REGISTERS
10 46 TOS_REG
4 53 TOS_REG
Back edges (size = 0)
ast_id pc_offset loop_depth
0x5092b741: [TypeFeedbackInfo]
- ic_total_count: 1, ic_with_type_info_count: 0, ic_generic_count: 0
RelocInfo (size = 18)
0x36953706 embedded object (0x49608091 <undefined>)
0x36953723 statement position (12)
0x36953724 code target (BUILTIN) (0x36933220)
0x3695372f statement position (21)
0x3695372f position (30)
0x36953730 code target with id (BINARY_OP_IC) (0x36928fe0) (id=7)
0x36953736 embedded object (0x5f008591 Cell for 6144)
0x36953742 code target (BUILTIN) (0x36933140)
0x36953748 embedded object (0x5f008591 Cell for 6144)
0x36953753 position (35)
0x36953753 js return
0x3695375a embedded object (0x49608091 <undefined>)
--- End code ---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment