Skip to content

Instantly share code, notes, and snippets.

@P0lip
Created May 2, 2017 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save P0lip/039ffe3dc1ddf6a4321156141c3ccc31 to your computer and use it in GitHub Desktop.
Save P0lip/039ffe3dc1ddf6a4321156141c3ccc31 to your computer and use it in GitHub Desktop.
--- Raw source ---
(arr, index) {
return arr[secondIndex + index];
}
--- Optimized code ---
optimization_id = 0
source_position = 44
kind = OPTIMIZED_FUNCTION
name = elemAtComplex
stack_slots = 4
compiler = turbofan
Instructions (size = 314)
0xc145e604220 0 55 push rbp
0xc145e604221 1 4889e5 REX.W movq rbp,rsp
0xc145e604224 4 56 push rsi
0xc145e604225 5 57 push rdi
0xc145e604226 6 493ba5700c0000 REX.W cmpq rsp,[r13+0xc70]
0xc145e60422d 13 0f86c1000000 jna 212 (0xc145e6042f4)
0xc145e604233 19 48b8c11323e96e3f0000 REX.W movq rax,0x3f6ee92313c1 ;; object: 0x3f6ee92313c1 <FixedArray[5]>
0xc145e60423d 29 488b402f REX.W movq rax,[rax+0x2f]
0xc145e604241 33 493945a8 REX.W cmpq [r13-0x58],rax
0xc145e604245 37 0f8523000000 jnz 78 (0xc145e60426e)
0xc145e60424b 43 48b8690c23e96e3f0000 REX.W movq rax,0x3f6ee9230c69 ;; object: 0x3f6ee9230c69 <String[11]: secondIndex>
0xc145e604255 53 50 push rax
0xc145e604256 54 48bb50680d0501000000 REX.W movq rbx,0x1050d6850 ;; external reference (Runtime::ThrowReferenceError)
0xc145e604260 64 b801000000 movl rax,0x1
0xc145e604265 69 488b75f8 REX.W movq rsi,[rbp-0x8]
0xc145e604269 73 e832ffdfff call 0xc145e4041a0 ;; code: STUB, CEntryStub, minor: 8
0xc145e60426e 78 a801 test al,0x1
0xc145e604270 80 0f8598000000 jnz 238 (0xc145e60430e)
0xc145e604276 86 488b5d10 REX.W movq rbx,[rbp+0x10]
0xc145e60427a 90 f6c301 testb rbx,0x1
0xc145e60427d 93 0f8590000000 jnz 243 (0xc145e604313)
0xc145e604283 99 488bd3 REX.W movq rdx,rbx
0xc145e604286 102 48c1ea20 REX.W shrq rdx, 32
0xc145e60428a 106 488bc8 REX.W movq rcx,rax
0xc145e60428d 109 48c1e920 REX.W shrq rcx, 32
0xc145e604291 113 03d1 addl rdx,rcx
0xc145e604293 115 0f807f000000 jo 248 (0xc145e604318)
0xc145e604299 121 488b4d18 REX.W movq rcx,[rbp+0x18]
0xc145e60429d 125 f6c101 testb rcx,0x1
0xc145e6042a0 128 0f8477000000 jz 253 (0xc145e60431d)
0xc145e6042a6 134 48be713be83d350d0000 REX.W movq rsi,0xd353de83b71 ;; object: 0xd353de83b71 <Map(FAST_ELEMENTS)>
0xc145e6042b0 144 483971ff REX.W cmpq [rcx-0x1],rsi
0xc145e6042b4 148 0f8568000000 jnz 258 (0xc145e604322)
0xc145e6042ba 154 488b710f REX.W movq rsi,[rcx+0xf]
0xc145e6042be 158 8b791b movl rdi,[rcx+0x1b]
0xc145e6042c1 161 49ba0000000001000000 REX.W movq r10,0x100000000
0xc145e6042cb 171 4c3bd7 REX.W cmpq r10,rdi
0xc145e6042ce 174 7310 jnc 192 (0xc145e6042e0)
0xc145e6042d0 176 48ba0000000001000000 REX.W movq rdx,0x100000000
0xc145e6042da 186 e841fedfff call Abort (0xc145e404120) ;; code: BUILTIN
0xc145e6042df 191 cc int3l
0xc145e6042e0 192 3bd7 cmpl rdx,rdi
0xc145e6042e2 194 0f833f000000 jnc 263 (0xc145e604327)
0xc145e6042e8 200 488b44d60f REX.W movq rax,[rsi+rdx*8+0xf]
0xc145e6042ed 205 488be5 REX.W movq rsp,rbp
0xc145e6042f0 208 5d pop rbp
0xc145e6042f1 209 c21800 ret 0x18
0xc145e6042f4 212 48bb00b60d0501000000 REX.W movq rbx,0x1050db600 ;; external reference (Runtime::StackGuard)
0xc145e6042fe 222 33c0 xorl rax,rax
0xc145e604300 224 488b75f8 REX.W movq rsi,[rbp-0x8]
0xc145e604304 228 e897fedfff call 0xc145e4041a0 ;; code: STUB, CEntryStub, minor: 8
0xc145e604309 233 e925ffffff jmp 19 (0xc145e604233)
0xc145e60430e 238 e801fdc7ff call 0xc145e284014 ;; debug: deopt position, script offset '84'
;; debug: deopt position, inlining id '-1'
;; debug: deopt reason 'not a Smi'
;; debug: deopt index 2
;; deoptimization bailout 2
0xc145e604313 243 e806fdc7ff call 0xc145e28401e ;; debug: deopt position, script offset '84'
;; debug: deopt position, inlining id '-1'
;; debug: deopt reason 'not a Smi'
;; debug: deopt index 3
;; deoptimization bailout 3
0xc145e604318 248 e80bfdc7ff call 0xc145e284028 ;; debug: deopt position, script offset '84'
;; debug: deopt position, inlining id '-1'
;; debug: deopt reason 'overflow'
;; debug: deopt index 4
;; deoptimization bailout 4
0xc145e60431d 253 e810fdc7ff call 0xc145e284032 ;; debug: deopt position, script offset '84'
;; debug: deopt position, inlining id '-1'
;; debug: deopt reason 'Smi'
;; debug: deopt index 5
;; deoptimization bailout 5
0xc145e604322 258 e815fdc7ff call 0xc145e28403c ;; debug: deopt position, script offset '84'
;; debug: deopt position, inlining id '-1'
;; debug: deopt reason 'wrong map'
;; debug: deopt index 6
;; deoptimization bailout 6
0xc145e604327 263 e81afdc7ff call 0xc145e284046 ;; debug: deopt position, script offset '84'
;; debug: deopt position, inlining id '-1'
;; debug: deopt reason 'out of bounds'
;; debug: deopt index 7
;; deoptimization bailout 7
0xc145e60432c 268 90 nop
0xc145e60432d 269 90 nop
0xc145e60432e 270 90 nop
0xc145e60432f 271 90 nop
0xc145e604330 272 90 nop
0xc145e604331 273 90 nop
0xc145e604332 274 90 nop
0xc145e604333 275 90 nop
0xc145e604334 276 90 nop
0xc145e604335 277 90 nop
0xc145e604336 278 90 nop
0xc145e604337 279 90 nop
0xc145e604338 280 90 nop
0xc145e604339 281 0f1f00 nop
Source positions:
pc offset position
0 44
19 61
54 72
78 84
205 94
212 44
Inlined functions (count = 0)
Deoptimization Input Data (deopt points = 9)
index ast id argc pc
0 12 0 78
1 12 0 -1
2 21 0 -1
3 21 0 -1
4 21 0 -1
5 21 0 -1
6 21 0 -1
7 21 0 -1
8 0 0 233
Safepoints (size = 30)
0xc145e60426e 78 0000 (sp -> fp) 1
0xc145e604309 233 0000 (sp -> fp) 8
RelocInfo (size = 142)
0xc145e604235 embedded object (0x3f6ee92313c1 <FixedArray[5]>)
0xc145e60424d embedded object (0x3f6ee9230c69 <String[11]: secondIndex>)
0xc145e604258 external reference (Runtime::ThrowReferenceError) (0x1050d6850)
0xc145e60426a code target (STUB) (0xc145e4041a0)
0xc145e6042a8 embedded object (0xd353de83b71 <Map(FAST_ELEMENTS)>)
0xc145e6042db code target (BUILTIN) (0xc145e404120)
0xc145e6042f6 external reference (Runtime::StackGuard) (0x1050db600)
0xc145e604305 code target (STUB) (0xc145e4041a0)
0xc145e60430e deopt script offset (84)
0xc145e60430e deopt inlining id (-1)
0xc145e60430e deopt reason (not a Smi)
0xc145e60430e deopt index
0xc145e60430f runtime entry (deoptimization bailout 2)
0xc145e604313 deopt script offset (84)
0xc145e604313 deopt inlining id (-1)
0xc145e604313 deopt reason (not a Smi)
0xc145e604313 deopt index
0xc145e604314 runtime entry (deoptimization bailout 3)
0xc145e604318 deopt script offset (84)
0xc145e604318 deopt inlining id (-1)
0xc145e604318 deopt reason (overflow)
0xc145e604318 deopt index
0xc145e604319 runtime entry (deoptimization bailout 4)
0xc145e60431d deopt script offset (84)
0xc145e60431d deopt inlining id (-1)
0xc145e60431d deopt reason (Smi)
0xc145e60431d deopt index
0xc145e60431e runtime entry (deoptimization bailout 5)
0xc145e604322 deopt script offset (84)
0xc145e604322 deopt inlining id (-1)
0xc145e604322 deopt reason (wrong map)
0xc145e604322 deopt index
0xc145e604323 runtime entry (deoptimization bailout 6)
0xc145e604327 deopt script offset (84)
0xc145e604327 deopt inlining id (-1)
0xc145e604327 deopt reason (out of bounds)
0xc145e604327 deopt index
0xc145e604328 runtime entry (deoptimization bailout 7)
--- End code ---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment