Advertisement
Guest User

Untitled

a guest
Oct 14th, 2013
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Assembly listings for the 3 javascript functions when optimized by V8:
  2.  
  3.     function undef(a) {
  4.         return a === undefined;
  5.     }
  6.     function void0(a) {
  7.         return a === void 0;
  8.     }
  9.  
  10.     var b;
  11.     function minified(a) {
  12.         return a === b;
  13.     }
  14.  
  15. --- Raw source ---
  16. (a) {
  17.  
  18.         return a === undefined;
  19.  
  20.     }
  21.  
  22.  
  23. --- Optimized code ---
  24. kind = OPTIMIZED_FUNCTION
  25. name = undef
  26. stack_slots = 1
  27. Instructions (size = 82)
  28. 0ED33320     0  55             push ebp
  29. 0ED33321     1  89e5           mov ebp,esp
  30. 0ED33323     3  56             push esi
  31. 0ED33324     4  57             push edi
  32. 0ED33325     5  6a00           push 0x0
  33.                   ;;; <@0,#0> -------------------- B0 --------------------
  34.                   ;;; <@2,#1> context
  35. 0ED33327     7  8b75fc         mov esi,[ebp-4]
  36.                   ;;; <@10,#8> -------------------- B1 --------------------
  37.                   ;;; <@12,#10> stack-check
  38. 0ED3332A    10  3b2518497300   cmp esp,[0x00734918]
  39. 0ED33330    16  7305           jnc 23  (0ED33337)
  40. 0ED33332    18  e82985feff     call StackCheck  (0ED1B860)    ;; code: BUILTIN
  41.                   ;;; <@14,#12> gap
  42. 0ED33337    23  8b4508         mov eax,[ebp+8]
  43.                   ;;; <@15,#12> cmp-object-eq-and-branch
  44. 0ED3333A    26  3d9180e004     cmp eax, 0x04e08091           ;; object: 04E08091 <undefined>
  45. 0ED3333F    31  0f840a000000   jz 47  (0ED3334F)
  46.                   ;;; <@16,#18> -------------------- B2 --------------------
  47.                   ;;; <@18,#20> gap
  48. 0ED33345    37  b8c180e004     mov eax,0x04e080c1            ;; object: 04E080C1 <false>
  49.                   ;;; <@19,#20> goto
  50. 0ED3334A    42  e905000000     jmp 52  (0ED33354)
  51.                   ;;; <@20,#15> -------------------- B3 --------------------
  52.                   ;;; <@22,#17> gap
  53. 0ED3334F    47  b8b180e004     mov eax,0x04e080b1            ;; object: 04E080B1 <true>
  54.                   ;;; <@24,#22> -------------------- B4 --------------------
  55.                   ;;; <@26,#24> return
  56. 0ED33354    52  89ec           mov esp,ebp
  57. 0ED33356    54  5d             pop ebp
  58. 0ED33357    55  c20800         ret 0x8
  59. 0ED3335A    58  90             nop
  60. 0ED3335B    59  90             nop
  61. 0ED3335C    60  90             nop
  62. 0ED3335D    61  90             nop
  63. 0ED3335E    62  90             nop
  64. 0ED3335F    63  90             nop
  65.  
  66. --- Raw source ---
  67. (a) {
  68.  
  69.         return a === b;
  70.  
  71.     }
  72.  
  73.  
  74. --- Optimized code ---
  75. kind = OPTIMIZED_FUNCTION
  76. name = minified
  77. stack_slots = 2
  78. Instructions (size = 108)
  79. 0ED33260     0  55             push ebp
  80. 0ED33261     1  89e5           mov ebp,esp
  81. 0ED33263     3  56             push esi
  82. 0ED33264     4  57             push edi
  83. 0ED33265     5  83ec08         sub esp,0x8
  84.                   ;;; Store dynamic frame alignment tag for spilled doubles
  85. 0ED33268     8  c745f400000000 mov [ebp-12],0x0
  86.                   ;;; <@0,#0> -------------------- B0 --------------------
  87.                   ;;; <@2,#1> context
  88. 0ED3326F    15  8b45fc         mov eax,[ebp-4]
  89.                   ;;; <@3,#1> gap
  90. 0ED33272    18  8945f0         mov [ebp-16],eax
  91.                   ;;; <@10,#8> -------------------- B1 --------------------
  92.                   ;;; <@11,#8> gap
  93. 0ED33275    21  89c6           mov esi,eax
  94.                   ;;; <@12,#10> stack-check
  95. 0ED33277    23  3b2518497300   cmp esp,[0x00734918]
  96. 0ED3327D    29  7305           jnc 36  (0ED33284)
  97. 0ED3327F    31  e8dc85feff     call StackCheck  (0ED1B860)    ;; code: BUILTIN
  98.                   ;;; <@13,#10> gap
  99. 0ED33284    36  8b75f0         mov esi,[ebp-16]
  100.                   ;;; <@14,#12> load-context-slot
  101. 0ED33287    39  8b4617         mov eax,[esi+23]
  102.                   ;;; <@15,#12> gap
  103. 0ED3328A    42  8b5508         mov edx,[ebp+8]
  104.                   ;;; <@16,#13> cmp-t
  105. 0ED3328D    45  e80edefdff     call 0x0ed110a0               ;; debug: position 202
  106.                                                              ;; code: COMPARE_IC, UNINITIALIZED
  107. 0ED33292    50  90             nop
  108. 0ED33293    51  85c0           test eax,eax
  109. 0ED33295    53  7407           jz 62  (0ED3329E)
  110. 0ED33297    55  b8c180e004     mov eax,0x04e080c1            ;; object: 04E080C1 <false>
  111. 0ED3329C    60  eb05           jmp 67  (0ED332A3)
  112. 0ED3329E    62  b8b180e004     mov eax,0x04e080b1            ;; object: 04E080B1 <true>
  113.                   ;;; <@18,#14> lazy-bailout
  114.                   ;;; <@20,#16> return
  115. 0ED332A3    67  89ec           mov esp,ebp
  116. 0ED332A5    69  5d             pop ebp
  117. 0ED332A6    70  c20800         ret 0x8
  118. 0ED332A9    73  90             nop
  119. 0ED332AA    74  90             nop
  120. 0ED332AB    75  90             nop
  121. 0ED332AC    76  90             nop
  122. 0ED332AD    77  90             nop
  123. 0ED332AE    78  66             nop
  124. 0ED332AF    79  90             nop
  125.  
  126. --- Raw source ---
  127. (a) {
  128.  
  129.         return a === void 0;
  130.  
  131.     }
  132.  
  133.  
  134. --- Optimized code ---
  135. kind = OPTIMIZED_FUNCTION
  136. name = void0
  137. stack_slots = 1
  138. Instructions (size = 82)
  139. 0ED331C0     0  55             push ebp
  140. 0ED331C1     1  89e5           mov ebp,esp
  141. 0ED331C3     3  56             push esi
  142. 0ED331C4     4  57             push edi
  143. 0ED331C5     5  6a00           push 0x0
  144.                   ;;; <@0,#0> -------------------- B0 --------------------
  145.                   ;;; <@2,#1> context
  146. 0ED331C7     7  8b75fc         mov esi,[ebp-4]
  147.                   ;;; <@10,#8> -------------------- B1 --------------------
  148.                   ;;; <@12,#10> stack-check
  149. 0ED331CA    10  3b2518497300   cmp esp,[0x00734918]
  150. 0ED331D0    16  7305           jnc 23  (0ED331D7)
  151. 0ED331D2    18  e88986feff     call StackCheck  (0ED1B860)    ;; code: BUILTIN
  152.                   ;;; <@14,#12> gap
  153. 0ED331D7    23  8b4508         mov eax,[ebp+8]
  154.                   ;;; <@15,#12> cmp-object-eq-and-branch
  155. 0ED331DA    26  3d9180e004     cmp eax, 0x04e08091           ;; object: 04E08091 <undefined>
  156. 0ED331DF    31  0f840a000000   jz 47  (0ED331EF)
  157.                   ;;; <@16,#18> -------------------- B2 --------------------
  158.                   ;;; <@18,#20> gap
  159. 0ED331E5    37  b8c180e004     mov eax,0x04e080c1            ;; object: 04E080C1 <false>
  160.                   ;;; <@19,#20> goto
  161. 0ED331EA    42  e905000000     jmp 52  (0ED331F4)
  162.                   ;;; <@20,#15> -------------------- B3 --------------------
  163.                   ;;; <@22,#17> gap
  164. 0ED331EF    47  b8b180e004     mov eax,0x04e080b1            ;; object: 04E080B1 <true>
  165.                   ;;; <@24,#22> -------------------- B4 --------------------
  166.                   ;;; <@26,#24> return
  167. 0ED331F4    52  89ec           mov esp,ebp
  168. 0ED331F6    54  5d             pop ebp
  169. 0ED331F7    55  c20800         ret 0x8
  170. 0ED331FA    58  90             nop
  171. 0ED331FB    59  90             nop
  172. 0ED331FC    60  90             nop
  173. 0ED331FD    61  90             nop
  174. 0ED331FE    62  90             nop
  175. 0ED331FF    63  90             nop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement