libv8 3.3.10.4 → 3.5.10.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (538) hide show
  1. data/lib/libv8/scons/CHANGES.txt +24 -231
  2. data/lib/libv8/scons/LICENSE.txt +1 -1
  3. data/lib/libv8/scons/MANIFEST +0 -1
  4. data/lib/libv8/scons/PKG-INFO +1 -1
  5. data/lib/libv8/scons/README.txt +9 -9
  6. data/lib/libv8/scons/RELEASE.txt +75 -77
  7. data/lib/libv8/scons/engine/SCons/Action.py +6 -22
  8. data/lib/libv8/scons/engine/SCons/Builder.py +2 -2
  9. data/lib/libv8/scons/engine/SCons/CacheDir.py +2 -2
  10. data/lib/libv8/scons/engine/SCons/Debug.py +2 -2
  11. data/lib/libv8/scons/engine/SCons/Defaults.py +10 -24
  12. data/lib/libv8/scons/engine/SCons/Environment.py +19 -118
  13. data/lib/libv8/scons/engine/SCons/Errors.py +2 -2
  14. data/lib/libv8/scons/engine/SCons/Executor.py +2 -2
  15. data/lib/libv8/scons/engine/SCons/Job.py +2 -2
  16. data/lib/libv8/scons/engine/SCons/Memoize.py +2 -2
  17. data/lib/libv8/scons/engine/SCons/Node/Alias.py +2 -2
  18. data/lib/libv8/scons/engine/SCons/Node/FS.py +121 -281
  19. data/lib/libv8/scons/engine/SCons/Node/Python.py +2 -2
  20. data/lib/libv8/scons/engine/SCons/Node/__init__.py +5 -6
  21. data/lib/libv8/scons/engine/SCons/Options/BoolOption.py +2 -2
  22. data/lib/libv8/scons/engine/SCons/Options/EnumOption.py +2 -2
  23. data/lib/libv8/scons/engine/SCons/Options/ListOption.py +2 -2
  24. data/lib/libv8/scons/engine/SCons/Options/PackageOption.py +2 -2
  25. data/lib/libv8/scons/engine/SCons/Options/PathOption.py +2 -2
  26. data/lib/libv8/scons/engine/SCons/Options/__init__.py +2 -2
  27. data/lib/libv8/scons/engine/SCons/PathList.py +2 -2
  28. data/lib/libv8/scons/engine/SCons/Platform/__init__.py +2 -2
  29. data/lib/libv8/scons/engine/SCons/Platform/aix.py +2 -2
  30. data/lib/libv8/scons/engine/SCons/Platform/cygwin.py +2 -2
  31. data/lib/libv8/scons/engine/SCons/Platform/darwin.py +3 -27
  32. data/lib/libv8/scons/engine/SCons/Platform/hpux.py +2 -2
  33. data/lib/libv8/scons/engine/SCons/Platform/irix.py +2 -2
  34. data/lib/libv8/scons/engine/SCons/Platform/os2.py +2 -2
  35. data/lib/libv8/scons/engine/SCons/Platform/posix.py +2 -2
  36. data/lib/libv8/scons/engine/SCons/Platform/sunos.py +2 -2
  37. data/lib/libv8/scons/engine/SCons/Platform/win32.py +2 -2
  38. data/lib/libv8/scons/engine/SCons/SConf.py +2 -2
  39. data/lib/libv8/scons/engine/SCons/SConsign.py +3 -9
  40. data/lib/libv8/scons/engine/SCons/Scanner/C.py +2 -2
  41. data/lib/libv8/scons/engine/SCons/Scanner/D.py +2 -2
  42. data/lib/libv8/scons/engine/SCons/Scanner/Dir.py +2 -2
  43. data/lib/libv8/scons/engine/SCons/Scanner/Fortran.py +2 -2
  44. data/lib/libv8/scons/engine/SCons/Scanner/IDL.py +2 -2
  45. data/lib/libv8/scons/engine/SCons/Scanner/LaTeX.py +2 -5
  46. data/lib/libv8/scons/engine/SCons/Scanner/Prog.py +2 -2
  47. data/lib/libv8/scons/engine/SCons/Scanner/RC.py +3 -3
  48. data/lib/libv8/scons/engine/SCons/Scanner/__init__.py +2 -2
  49. data/lib/libv8/scons/engine/SCons/Script/Interactive.py +2 -2
  50. data/lib/libv8/scons/engine/SCons/Script/Main.py +11 -82
  51. data/lib/libv8/scons/engine/SCons/Script/SConsOptions.py +5 -5
  52. data/lib/libv8/scons/engine/SCons/Script/SConscript.py +2 -2
  53. data/lib/libv8/scons/engine/SCons/Script/__init__.py +2 -2
  54. data/lib/libv8/scons/engine/SCons/Sig.py +2 -2
  55. data/lib/libv8/scons/engine/SCons/Subst.py +2 -2
  56. data/lib/libv8/scons/engine/SCons/Taskmaster.py +2 -10
  57. data/lib/libv8/scons/engine/SCons/Tool/386asm.py +2 -2
  58. data/lib/libv8/scons/engine/SCons/Tool/BitKeeper.py +2 -2
  59. data/lib/libv8/scons/engine/SCons/Tool/CVS.py +2 -2
  60. data/lib/libv8/scons/engine/SCons/Tool/FortranCommon.py +2 -19
  61. data/lib/libv8/scons/engine/SCons/Tool/JavaCommon.py +2 -2
  62. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/__init__.py +2 -2
  63. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/arch.py +2 -2
  64. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/common.py +2 -2
  65. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/netframework.py +2 -2
  66. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/sdk.py +2 -2
  67. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/vc.py +6 -9
  68. data/lib/libv8/scons/engine/SCons/Tool/MSCommon/vs.py +2 -29
  69. data/lib/libv8/scons/engine/SCons/Tool/Perforce.py +2 -2
  70. data/lib/libv8/scons/engine/SCons/Tool/PharLapCommon.py +2 -2
  71. data/lib/libv8/scons/engine/SCons/Tool/RCS.py +2 -2
  72. data/lib/libv8/scons/engine/SCons/Tool/SCCS.py +2 -2
  73. data/lib/libv8/scons/engine/SCons/Tool/Subversion.py +2 -2
  74. data/lib/libv8/scons/engine/SCons/Tool/__init__.py +3 -3
  75. data/lib/libv8/scons/engine/SCons/Tool/aixc++.py +2 -2
  76. data/lib/libv8/scons/engine/SCons/Tool/aixcc.py +2 -2
  77. data/lib/libv8/scons/engine/SCons/Tool/aixf77.py +2 -2
  78. data/lib/libv8/scons/engine/SCons/Tool/aixlink.py +2 -2
  79. data/lib/libv8/scons/engine/SCons/Tool/applelink.py +2 -2
  80. data/lib/libv8/scons/engine/SCons/Tool/ar.py +2 -2
  81. data/lib/libv8/scons/engine/SCons/Tool/as.py +2 -2
  82. data/lib/libv8/scons/engine/SCons/Tool/bcc32.py +2 -2
  83. data/lib/libv8/scons/engine/SCons/Tool/c++.py +2 -2
  84. data/lib/libv8/scons/engine/SCons/Tool/cc.py +2 -2
  85. data/lib/libv8/scons/engine/SCons/Tool/cvf.py +2 -2
  86. data/lib/libv8/scons/engine/SCons/Tool/default.py +2 -2
  87. data/lib/libv8/scons/engine/SCons/Tool/dmd.py +7 -24
  88. data/lib/libv8/scons/engine/SCons/Tool/dvi.py +2 -2
  89. data/lib/libv8/scons/engine/SCons/Tool/dvipdf.py +2 -3
  90. data/lib/libv8/scons/engine/SCons/Tool/dvips.py +2 -3
  91. data/lib/libv8/scons/engine/SCons/Tool/f77.py +2 -2
  92. data/lib/libv8/scons/engine/SCons/Tool/f90.py +2 -2
  93. data/lib/libv8/scons/engine/SCons/Tool/f95.py +2 -2
  94. data/lib/libv8/scons/engine/SCons/Tool/filesystem.py +2 -2
  95. data/lib/libv8/scons/engine/SCons/Tool/fortran.py +2 -2
  96. data/lib/libv8/scons/engine/SCons/Tool/g++.py +2 -2
  97. data/lib/libv8/scons/engine/SCons/Tool/g77.py +2 -2
  98. data/lib/libv8/scons/engine/SCons/Tool/gas.py +2 -2
  99. data/lib/libv8/scons/engine/SCons/Tool/gcc.py +2 -2
  100. data/lib/libv8/scons/engine/SCons/Tool/gfortran.py +3 -3
  101. data/lib/libv8/scons/engine/SCons/Tool/gnulink.py +3 -2
  102. data/lib/libv8/scons/engine/SCons/Tool/gs.py +2 -2
  103. data/lib/libv8/scons/engine/SCons/Tool/hpc++.py +2 -2
  104. data/lib/libv8/scons/engine/SCons/Tool/hpcc.py +2 -2
  105. data/lib/libv8/scons/engine/SCons/Tool/hplink.py +2 -2
  106. data/lib/libv8/scons/engine/SCons/Tool/icc.py +2 -2
  107. data/lib/libv8/scons/engine/SCons/Tool/icl.py +2 -2
  108. data/lib/libv8/scons/engine/SCons/Tool/ifl.py +2 -2
  109. data/lib/libv8/scons/engine/SCons/Tool/ifort.py +2 -2
  110. data/lib/libv8/scons/engine/SCons/Tool/ilink.py +2 -2
  111. data/lib/libv8/scons/engine/SCons/Tool/ilink32.py +2 -2
  112. data/lib/libv8/scons/engine/SCons/Tool/install.py +3 -57
  113. data/lib/libv8/scons/engine/SCons/Tool/intelc.py +25 -65
  114. data/lib/libv8/scons/engine/SCons/Tool/ipkg.py +2 -2
  115. data/lib/libv8/scons/engine/SCons/Tool/jar.py +3 -9
  116. data/lib/libv8/scons/engine/SCons/Tool/javac.py +2 -2
  117. data/lib/libv8/scons/engine/SCons/Tool/javah.py +2 -2
  118. data/lib/libv8/scons/engine/SCons/Tool/latex.py +2 -3
  119. data/lib/libv8/scons/engine/SCons/Tool/lex.py +2 -2
  120. data/lib/libv8/scons/engine/SCons/Tool/link.py +5 -6
  121. data/lib/libv8/scons/engine/SCons/Tool/linkloc.py +2 -2
  122. data/lib/libv8/scons/engine/SCons/Tool/m4.py +2 -2
  123. data/lib/libv8/scons/engine/SCons/Tool/masm.py +2 -2
  124. data/lib/libv8/scons/engine/SCons/Tool/midl.py +2 -2
  125. data/lib/libv8/scons/engine/SCons/Tool/mingw.py +10 -31
  126. data/lib/libv8/scons/engine/SCons/Tool/mslib.py +2 -2
  127. data/lib/libv8/scons/engine/SCons/Tool/mslink.py +9 -61
  128. data/lib/libv8/scons/engine/SCons/Tool/mssdk.py +2 -2
  129. data/lib/libv8/scons/engine/SCons/Tool/msvc.py +11 -21
  130. data/lib/libv8/scons/engine/SCons/Tool/msvs.py +59 -477
  131. data/lib/libv8/scons/engine/SCons/Tool/mwcc.py +2 -2
  132. data/lib/libv8/scons/engine/SCons/Tool/mwld.py +2 -2
  133. data/lib/libv8/scons/engine/SCons/Tool/nasm.py +2 -2
  134. data/lib/libv8/scons/engine/SCons/Tool/packaging/__init__.py +2 -2
  135. data/lib/libv8/scons/engine/SCons/Tool/packaging/ipk.py +2 -2
  136. data/lib/libv8/scons/engine/SCons/Tool/packaging/msi.py +2 -2
  137. data/lib/libv8/scons/engine/SCons/Tool/packaging/rpm.py +2 -2
  138. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_tarbz2.py +2 -2
  139. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_targz.py +2 -2
  140. data/lib/libv8/scons/engine/SCons/Tool/packaging/src_zip.py +2 -2
  141. data/lib/libv8/scons/engine/SCons/Tool/packaging/tarbz2.py +2 -2
  142. data/lib/libv8/scons/engine/SCons/Tool/packaging/targz.py +2 -2
  143. data/lib/libv8/scons/engine/SCons/Tool/packaging/zip.py +2 -2
  144. data/lib/libv8/scons/engine/SCons/Tool/pdf.py +2 -2
  145. data/lib/libv8/scons/engine/SCons/Tool/pdflatex.py +2 -3
  146. data/lib/libv8/scons/engine/SCons/Tool/pdftex.py +2 -3
  147. data/lib/libv8/scons/engine/SCons/Tool/qt.py +2 -2
  148. data/lib/libv8/scons/engine/SCons/Tool/rmic.py +3 -9
  149. data/lib/libv8/scons/engine/SCons/Tool/rpcgen.py +2 -2
  150. data/lib/libv8/scons/engine/SCons/Tool/rpm.py +2 -2
  151. data/lib/libv8/scons/engine/SCons/Tool/sgiar.py +2 -2
  152. data/lib/libv8/scons/engine/SCons/Tool/sgic++.py +2 -2
  153. data/lib/libv8/scons/engine/SCons/Tool/sgicc.py +2 -2
  154. data/lib/libv8/scons/engine/SCons/Tool/sgilink.py +3 -2
  155. data/lib/libv8/scons/engine/SCons/Tool/sunar.py +2 -2
  156. data/lib/libv8/scons/engine/SCons/Tool/sunc++.py +2 -2
  157. data/lib/libv8/scons/engine/SCons/Tool/suncc.py +2 -2
  158. data/lib/libv8/scons/engine/SCons/Tool/sunf77.py +2 -2
  159. data/lib/libv8/scons/engine/SCons/Tool/sunf90.py +2 -2
  160. data/lib/libv8/scons/engine/SCons/Tool/sunf95.py +2 -2
  161. data/lib/libv8/scons/engine/SCons/Tool/sunlink.py +3 -2
  162. data/lib/libv8/scons/engine/SCons/Tool/swig.py +5 -6
  163. data/lib/libv8/scons/engine/SCons/Tool/tar.py +2 -2
  164. data/lib/libv8/scons/engine/SCons/Tool/tex.py +43 -96
  165. data/lib/libv8/scons/engine/SCons/Tool/textfile.py +2 -2
  166. data/lib/libv8/scons/engine/SCons/Tool/tlib.py +2 -2
  167. data/lib/libv8/scons/engine/SCons/Tool/wix.py +2 -2
  168. data/lib/libv8/scons/engine/SCons/Tool/yacc.py +2 -12
  169. data/lib/libv8/scons/engine/SCons/Tool/zip.py +2 -2
  170. data/lib/libv8/scons/engine/SCons/Util.py +3 -3
  171. data/lib/libv8/scons/engine/SCons/Variables/BoolVariable.py +2 -2
  172. data/lib/libv8/scons/engine/SCons/Variables/EnumVariable.py +3 -3
  173. data/lib/libv8/scons/engine/SCons/Variables/ListVariable.py +2 -2
  174. data/lib/libv8/scons/engine/SCons/Variables/PackageVariable.py +2 -2
  175. data/lib/libv8/scons/engine/SCons/Variables/PathVariable.py +2 -2
  176. data/lib/libv8/scons/engine/SCons/Variables/__init__.py +2 -2
  177. data/lib/libv8/scons/engine/SCons/Warnings.py +2 -2
  178. data/lib/libv8/scons/engine/SCons/__init__.py +6 -6
  179. data/lib/libv8/scons/engine/SCons/compat/__init__.py +2 -2
  180. data/lib/libv8/scons/engine/SCons/compat/_scons_builtins.py +2 -2
  181. data/lib/libv8/scons/engine/SCons/compat/_scons_collections.py +2 -2
  182. data/lib/libv8/scons/engine/SCons/compat/_scons_dbm.py +2 -2
  183. data/lib/libv8/scons/engine/SCons/compat/_scons_hashlib.py +2 -2
  184. data/lib/libv8/scons/engine/SCons/compat/_scons_io.py +2 -2
  185. data/lib/libv8/scons/engine/SCons/cpp.py +2 -2
  186. data/lib/libv8/scons/engine/SCons/dblite.py +1 -4
  187. data/lib/libv8/scons/engine/SCons/exitfuncs.py +2 -2
  188. data/lib/libv8/scons/scons-time.1 +3 -3
  189. data/lib/libv8/scons/scons.1 +1164 -1170
  190. data/lib/libv8/scons/sconsign.1 +3 -3
  191. data/lib/libv8/scons/script/scons +22 -22
  192. data/lib/libv8/scons/script/scons-time +2 -2
  193. data/lib/libv8/scons/script/scons.bat +4 -7
  194. data/lib/libv8/scons/script/sconsign +20 -21
  195. data/lib/libv8/scons/setup.cfg +1 -0
  196. data/lib/libv8/scons/setup.py +40 -38
  197. data/lib/libv8/v8/.gitignore +1 -1
  198. data/lib/libv8/v8/AUTHORS +2 -0
  199. data/lib/libv8/v8/ChangeLog +387 -0
  200. data/lib/libv8/v8/Makefile +171 -0
  201. data/lib/libv8/v8/SConstruct +124 -51
  202. data/lib/libv8/v8/build/README.txt +31 -14
  203. data/lib/libv8/v8/build/all.gyp +11 -4
  204. data/lib/libv8/v8/build/armu.gypi +6 -2
  205. data/lib/libv8/v8/build/common.gypi +240 -94
  206. data/lib/libv8/v8/build/gyp_v8 +32 -4
  207. data/lib/libv8/v8/build/standalone.gypi +200 -0
  208. data/lib/libv8/v8/include/v8-debug.h +0 -0
  209. data/lib/libv8/v8/include/v8-profiler.h +8 -11
  210. data/lib/libv8/v8/include/v8.h +191 -108
  211. data/lib/libv8/v8/preparser/SConscript +2 -2
  212. data/lib/libv8/v8/preparser/preparser-process.cc +3 -3
  213. data/lib/libv8/v8/preparser/preparser.gyp +42 -0
  214. data/lib/libv8/v8/src/SConscript +33 -8
  215. data/lib/libv8/v8/src/accessors.cc +77 -43
  216. data/lib/libv8/v8/src/api.cc +393 -191
  217. data/lib/libv8/v8/src/api.h +4 -8
  218. data/lib/libv8/v8/src/apinatives.js +15 -3
  219. data/lib/libv8/v8/src/arguments.h +8 -0
  220. data/lib/libv8/v8/src/arm/assembler-arm.cc +120 -120
  221. data/lib/libv8/v8/src/arm/assembler-arm.h +92 -43
  222. data/lib/libv8/v8/src/arm/builtins-arm.cc +32 -39
  223. data/lib/libv8/v8/src/arm/code-stubs-arm.cc +572 -351
  224. data/lib/libv8/v8/src/arm/code-stubs-arm.h +8 -77
  225. data/lib/libv8/v8/src/arm/codegen-arm.h +0 -2
  226. data/lib/libv8/v8/src/arm/deoptimizer-arm.cc +50 -30
  227. data/lib/libv8/v8/src/arm/disasm-arm.cc +1 -1
  228. data/lib/libv8/v8/src/arm/frames-arm.h +9 -5
  229. data/lib/libv8/v8/src/arm/full-codegen-arm.cc +331 -432
  230. data/lib/libv8/v8/src/arm/ic-arm.cc +192 -124
  231. data/lib/libv8/v8/src/arm/lithium-arm.cc +216 -232
  232. data/lib/libv8/v8/src/arm/lithium-arm.h +106 -259
  233. data/lib/libv8/v8/src/arm/lithium-codegen-arm.cc +633 -642
  234. data/lib/libv8/v8/src/arm/lithium-codegen-arm.h +4 -4
  235. data/lib/libv8/v8/src/arm/lithium-gap-resolver-arm.cc +1 -3
  236. data/lib/libv8/v8/src/arm/macro-assembler-arm.cc +260 -185
  237. data/lib/libv8/v8/src/arm/macro-assembler-arm.h +45 -25
  238. data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.cc +25 -13
  239. data/lib/libv8/v8/src/arm/regexp-macro-assembler-arm.h +3 -0
  240. data/lib/libv8/v8/src/arm/stub-cache-arm.cc +413 -226
  241. data/lib/libv8/v8/src/array.js +38 -18
  242. data/lib/libv8/v8/src/assembler.cc +12 -5
  243. data/lib/libv8/v8/src/assembler.h +15 -9
  244. data/lib/libv8/v8/src/ast-inl.h +34 -25
  245. data/lib/libv8/v8/src/ast.cc +141 -72
  246. data/lib/libv8/v8/src/ast.h +255 -181
  247. data/lib/libv8/v8/src/bignum.cc +3 -4
  248. data/lib/libv8/v8/src/bootstrapper.cc +55 -11
  249. data/lib/libv8/v8/src/bootstrapper.h +3 -2
  250. data/lib/libv8/v8/src/builtins.cc +8 -2
  251. data/lib/libv8/v8/src/builtins.h +4 -0
  252. data/lib/libv8/v8/src/cached-powers.cc +8 -4
  253. data/lib/libv8/v8/src/checks.h +3 -3
  254. data/lib/libv8/v8/src/code-stubs.cc +173 -28
  255. data/lib/libv8/v8/src/code-stubs.h +104 -148
  256. data/lib/libv8/v8/src/codegen.cc +8 -8
  257. data/lib/libv8/v8/src/compilation-cache.cc +2 -47
  258. data/lib/libv8/v8/src/compilation-cache.h +0 -10
  259. data/lib/libv8/v8/src/compiler.cc +27 -16
  260. data/lib/libv8/v8/src/compiler.h +13 -18
  261. data/lib/libv8/v8/src/contexts.cc +107 -72
  262. data/lib/libv8/v8/src/contexts.h +70 -34
  263. data/lib/libv8/v8/src/conversions-inl.h +572 -14
  264. data/lib/libv8/v8/src/conversions.cc +9 -707
  265. data/lib/libv8/v8/src/conversions.h +23 -12
  266. data/lib/libv8/v8/src/cpu-profiler-inl.h +2 -19
  267. data/lib/libv8/v8/src/cpu-profiler.cc +4 -21
  268. data/lib/libv8/v8/src/cpu-profiler.h +8 -17
  269. data/lib/libv8/v8/src/d8-debug.cc +5 -3
  270. data/lib/libv8/v8/src/d8-debug.h +6 -7
  271. data/lib/libv8/v8/src/d8-posix.cc +1 -10
  272. data/lib/libv8/v8/src/d8.cc +721 -219
  273. data/lib/libv8/v8/src/d8.gyp +37 -12
  274. data/lib/libv8/v8/src/d8.h +141 -19
  275. data/lib/libv8/v8/src/d8.js +17 -8
  276. data/lib/libv8/v8/src/date.js +16 -5
  277. data/lib/libv8/v8/src/dateparser-inl.h +242 -39
  278. data/lib/libv8/v8/src/dateparser.cc +38 -4
  279. data/lib/libv8/v8/src/dateparser.h +170 -28
  280. data/lib/libv8/v8/src/debug-agent.cc +5 -3
  281. data/lib/libv8/v8/src/debug-agent.h +11 -7
  282. data/lib/libv8/v8/src/debug-debugger.js +65 -34
  283. data/lib/libv8/v8/src/debug.cc +30 -60
  284. data/lib/libv8/v8/src/debug.h +5 -3
  285. data/lib/libv8/v8/src/deoptimizer.cc +227 -10
  286. data/lib/libv8/v8/src/deoptimizer.h +133 -9
  287. data/lib/libv8/v8/src/disassembler.cc +22 -14
  288. data/lib/libv8/v8/src/diy-fp.cc +4 -3
  289. data/lib/libv8/v8/src/diy-fp.h +3 -3
  290. data/lib/libv8/v8/src/elements.cc +634 -0
  291. data/lib/libv8/v8/src/elements.h +95 -0
  292. data/lib/libv8/v8/src/execution.cc +5 -21
  293. data/lib/libv8/v8/src/extensions/experimental/break-iterator.cc +3 -1
  294. data/lib/libv8/v8/src/extensions/experimental/break-iterator.h +1 -1
  295. data/lib/libv8/v8/src/extensions/experimental/collator.cc +6 -2
  296. data/lib/libv8/v8/src/extensions/experimental/collator.h +1 -2
  297. data/lib/libv8/v8/src/extensions/experimental/datetime-format.cc +384 -0
  298. data/lib/libv8/v8/src/extensions/experimental/datetime-format.h +83 -0
  299. data/lib/libv8/v8/src/extensions/experimental/experimental.gyp +18 -7
  300. data/lib/libv8/v8/src/extensions/experimental/i18n-extension.cc +12 -16
  301. data/lib/libv8/v8/src/extensions/experimental/i18n-extension.h +1 -1
  302. data/lib/libv8/v8/src/extensions/experimental/i18n-js2c.py +126 -0
  303. data/lib/libv8/v8/src/extensions/experimental/i18n-locale.cc +3 -4
  304. data/lib/libv8/v8/src/extensions/experimental/i18n-locale.h +1 -1
  305. data/lib/libv8/v8/src/{shell.h → extensions/experimental/i18n-natives.h} +8 -20
  306. data/lib/libv8/v8/src/extensions/experimental/i18n-utils.cc +45 -1
  307. data/lib/libv8/v8/src/extensions/experimental/i18n-utils.h +21 -1
  308. data/lib/libv8/v8/src/extensions/experimental/i18n.js +211 -11
  309. data/lib/libv8/v8/src/extensions/experimental/language-matcher.cc +4 -3
  310. data/lib/libv8/v8/src/extensions/experimental/language-matcher.h +1 -1
  311. data/lib/libv8/v8/src/extensions/experimental/number-format.cc +374 -0
  312. data/lib/libv8/v8/src/extensions/experimental/number-format.h +71 -0
  313. data/lib/libv8/v8/src/factory.cc +89 -18
  314. data/lib/libv8/v8/src/factory.h +36 -8
  315. data/lib/libv8/v8/src/flag-definitions.h +11 -44
  316. data/lib/libv8/v8/src/frames-inl.h +8 -1
  317. data/lib/libv8/v8/src/frames.cc +39 -3
  318. data/lib/libv8/v8/src/frames.h +10 -3
  319. data/lib/libv8/v8/src/full-codegen.cc +311 -293
  320. data/lib/libv8/v8/src/full-codegen.h +183 -143
  321. data/lib/libv8/v8/src/func-name-inferrer.cc +29 -15
  322. data/lib/libv8/v8/src/func-name-inferrer.h +19 -9
  323. data/lib/libv8/v8/src/gdb-jit.cc +658 -55
  324. data/lib/libv8/v8/src/gdb-jit.h +6 -2
  325. data/lib/libv8/v8/src/global-handles.cc +368 -312
  326. data/lib/libv8/v8/src/global-handles.h +29 -36
  327. data/lib/libv8/v8/src/globals.h +3 -1
  328. data/lib/libv8/v8/src/handles.cc +43 -69
  329. data/lib/libv8/v8/src/handles.h +21 -16
  330. data/lib/libv8/v8/src/heap-inl.h +11 -13
  331. data/lib/libv8/v8/src/heap-profiler.cc +0 -999
  332. data/lib/libv8/v8/src/heap-profiler.h +0 -303
  333. data/lib/libv8/v8/src/heap.cc +366 -141
  334. data/lib/libv8/v8/src/heap.h +87 -26
  335. data/lib/libv8/v8/src/hydrogen-instructions.cc +192 -81
  336. data/lib/libv8/v8/src/hydrogen-instructions.h +711 -482
  337. data/lib/libv8/v8/src/hydrogen.cc +1146 -629
  338. data/lib/libv8/v8/src/hydrogen.h +100 -64
  339. data/lib/libv8/v8/src/ia32/assembler-ia32.cc +19 -0
  340. data/lib/libv8/v8/src/ia32/assembler-ia32.h +15 -2
  341. data/lib/libv8/v8/src/ia32/builtins-ia32.cc +34 -39
  342. data/lib/libv8/v8/src/ia32/code-stubs-ia32.cc +675 -377
  343. data/lib/libv8/v8/src/ia32/code-stubs-ia32.h +8 -69
  344. data/lib/libv8/v8/src/ia32/codegen-ia32.cc +1 -0
  345. data/lib/libv8/v8/src/ia32/codegen-ia32.h +0 -2
  346. data/lib/libv8/v8/src/ia32/cpu-ia32.cc +3 -2
  347. data/lib/libv8/v8/src/ia32/deoptimizer-ia32.cc +28 -3
  348. data/lib/libv8/v8/src/ia32/disasm-ia32.cc +21 -10
  349. data/lib/libv8/v8/src/ia32/frames-ia32.h +6 -5
  350. data/lib/libv8/v8/src/ia32/full-codegen-ia32.cc +459 -465
  351. data/lib/libv8/v8/src/ia32/ic-ia32.cc +196 -147
  352. data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.cc +575 -650
  353. data/lib/libv8/v8/src/ia32/lithium-codegen-ia32.h +19 -21
  354. data/lib/libv8/v8/src/ia32/lithium-gap-resolver-ia32.cc +7 -2
  355. data/lib/libv8/v8/src/ia32/lithium-ia32.cc +261 -256
  356. data/lib/libv8/v8/src/ia32/lithium-ia32.h +234 -335
  357. data/lib/libv8/v8/src/ia32/macro-assembler-ia32.cc +224 -67
  358. data/lib/libv8/v8/src/ia32/macro-assembler-ia32.h +63 -19
  359. data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.cc +22 -8
  360. data/lib/libv8/v8/src/ia32/regexp-macro-assembler-ia32.h +3 -0
  361. data/lib/libv8/v8/src/ia32/stub-cache-ia32.cc +380 -239
  362. data/lib/libv8/v8/src/ic.cc +198 -234
  363. data/lib/libv8/v8/src/ic.h +32 -30
  364. data/lib/libv8/v8/src/interpreter-irregexp.cc +6 -4
  365. data/lib/libv8/v8/src/isolate.cc +112 -95
  366. data/lib/libv8/v8/src/isolate.h +55 -71
  367. data/lib/libv8/v8/src/json-parser.h +486 -48
  368. data/lib/libv8/v8/src/json.js +28 -23
  369. data/lib/libv8/v8/src/jsregexp.cc +163 -208
  370. data/lib/libv8/v8/src/jsregexp.h +0 -1
  371. data/lib/libv8/v8/src/lithium-allocator-inl.h +29 -27
  372. data/lib/libv8/v8/src/lithium-allocator.cc +22 -17
  373. data/lib/libv8/v8/src/lithium-allocator.h +8 -8
  374. data/lib/libv8/v8/src/lithium.cc +16 -11
  375. data/lib/libv8/v8/src/lithium.h +31 -34
  376. data/lib/libv8/v8/src/liveedit.cc +111 -15
  377. data/lib/libv8/v8/src/liveedit.h +3 -4
  378. data/lib/libv8/v8/src/liveobjectlist.cc +116 -80
  379. data/lib/libv8/v8/src/liveobjectlist.h +2 -2
  380. data/lib/libv8/v8/src/log-inl.h +0 -4
  381. data/lib/libv8/v8/src/log-utils.cc +25 -143
  382. data/lib/libv8/v8/src/log-utils.h +13 -92
  383. data/lib/libv8/v8/src/log.cc +26 -249
  384. data/lib/libv8/v8/src/log.h +6 -17
  385. data/lib/libv8/v8/src/macros.py +9 -6
  386. data/lib/libv8/v8/src/mark-compact.cc +276 -56
  387. data/lib/libv8/v8/src/mark-compact.h +20 -0
  388. data/lib/libv8/v8/src/messages.js +93 -39
  389. data/lib/libv8/v8/src/mips/assembler-mips-inl.h +9 -3
  390. data/lib/libv8/v8/src/mips/assembler-mips.cc +297 -189
  391. data/lib/libv8/v8/src/mips/assembler-mips.h +121 -54
  392. data/lib/libv8/v8/src/mips/builtins-mips.cc +23 -24
  393. data/lib/libv8/v8/src/mips/code-stubs-mips.cc +484 -263
  394. data/lib/libv8/v8/src/mips/code-stubs-mips.h +8 -83
  395. data/lib/libv8/v8/src/mips/codegen-mips.h +0 -2
  396. data/lib/libv8/v8/src/mips/constants-mips.h +37 -11
  397. data/lib/libv8/v8/src/mips/deoptimizer-mips.cc +6 -1
  398. data/lib/libv8/v8/src/mips/frames-mips.h +8 -7
  399. data/lib/libv8/v8/src/mips/full-codegen-mips.cc +258 -419
  400. data/lib/libv8/v8/src/mips/ic-mips.cc +181 -121
  401. data/lib/libv8/v8/src/mips/macro-assembler-mips.cc +640 -382
  402. data/lib/libv8/v8/src/mips/macro-assembler-mips.h +94 -89
  403. data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.cc +23 -10
  404. data/lib/libv8/v8/src/mips/regexp-macro-assembler-mips.h +6 -1
  405. data/lib/libv8/v8/src/mips/simulator-mips.cc +249 -49
  406. data/lib/libv8/v8/src/mips/simulator-mips.h +25 -1
  407. data/lib/libv8/v8/src/mips/stub-cache-mips.cc +373 -161
  408. data/lib/libv8/v8/src/mirror-debugger.js +55 -8
  409. data/lib/libv8/v8/src/misc-intrinsics.h +89 -0
  410. data/lib/libv8/v8/src/mksnapshot.cc +36 -4
  411. data/lib/libv8/v8/src/natives.h +5 -2
  412. data/lib/libv8/v8/src/objects-debug.cc +73 -6
  413. data/lib/libv8/v8/src/objects-inl.h +529 -164
  414. data/lib/libv8/v8/src/objects-printer.cc +67 -12
  415. data/lib/libv8/v8/src/objects-visiting.cc +13 -2
  416. data/lib/libv8/v8/src/objects-visiting.h +41 -1
  417. data/lib/libv8/v8/src/objects.cc +2200 -1177
  418. data/lib/libv8/v8/src/objects.h +912 -283
  419. data/lib/libv8/v8/src/parser.cc +566 -371
  420. data/lib/libv8/v8/src/parser.h +35 -33
  421. data/lib/libv8/v8/src/platform-cygwin.cc +10 -25
  422. data/lib/libv8/v8/src/platform-freebsd.cc +4 -29
  423. data/lib/libv8/v8/src/platform-linux.cc +60 -57
  424. data/lib/libv8/v8/src/platform-macos.cc +4 -27
  425. data/lib/libv8/v8/src/platform-nullos.cc +3 -16
  426. data/lib/libv8/v8/src/platform-openbsd.cc +247 -85
  427. data/lib/libv8/v8/src/platform-posix.cc +43 -1
  428. data/lib/libv8/v8/src/platform-solaris.cc +151 -112
  429. data/lib/libv8/v8/src/platform-tls.h +1 -1
  430. data/lib/libv8/v8/src/platform-win32.cc +65 -39
  431. data/lib/libv8/v8/src/platform.h +17 -14
  432. data/lib/libv8/v8/src/preparse-data-format.h +2 -2
  433. data/lib/libv8/v8/src/preparse-data.h +8 -2
  434. data/lib/libv8/v8/src/preparser-api.cc +2 -18
  435. data/lib/libv8/v8/src/preparser.cc +106 -65
  436. data/lib/libv8/v8/src/preparser.h +26 -5
  437. data/lib/libv8/v8/src/prettyprinter.cc +25 -43
  438. data/lib/libv8/v8/src/profile-generator-inl.h +0 -4
  439. data/lib/libv8/v8/src/profile-generator.cc +213 -34
  440. data/lib/libv8/v8/src/profile-generator.h +9 -9
  441. data/lib/libv8/v8/src/property.h +1 -0
  442. data/lib/libv8/v8/src/proxy.js +74 -4
  443. data/lib/libv8/v8/src/regexp-macro-assembler.cc +10 -6
  444. data/lib/libv8/v8/src/regexp.js +16 -11
  445. data/lib/libv8/v8/src/rewriter.cc +24 -133
  446. data/lib/libv8/v8/src/runtime-profiler.cc +27 -151
  447. data/lib/libv8/v8/src/runtime-profiler.h +5 -31
  448. data/lib/libv8/v8/src/runtime.cc +1450 -681
  449. data/lib/libv8/v8/src/runtime.h +47 -31
  450. data/lib/libv8/v8/src/runtime.js +2 -1
  451. data/lib/libv8/v8/src/scanner-base.cc +358 -220
  452. data/lib/libv8/v8/src/scanner-base.h +30 -138
  453. data/lib/libv8/v8/src/scanner.cc +0 -18
  454. data/lib/libv8/v8/src/scanner.h +0 -15
  455. data/lib/libv8/v8/src/scopeinfo.cc +3 -1
  456. data/lib/libv8/v8/src/scopeinfo.h +1 -6
  457. data/lib/libv8/v8/src/scopes.cc +243 -253
  458. data/lib/libv8/v8/src/scopes.h +58 -109
  459. data/lib/libv8/v8/src/serialize.cc +12 -54
  460. data/lib/libv8/v8/src/serialize.h +47 -0
  461. data/lib/libv8/v8/src/small-pointer-list.h +25 -0
  462. data/lib/libv8/v8/src/spaces-inl.h +4 -50
  463. data/lib/libv8/v8/src/spaces.cc +64 -131
  464. data/lib/libv8/v8/src/spaces.h +19 -70
  465. data/lib/libv8/v8/src/string-stream.cc +3 -1
  466. data/lib/libv8/v8/src/string.js +10 -6
  467. data/lib/libv8/v8/src/strtod.cc +7 -3
  468. data/lib/libv8/v8/src/stub-cache.cc +59 -129
  469. data/lib/libv8/v8/src/stub-cache.h +42 -54
  470. data/lib/libv8/v8/src/third_party/valgrind/valgrind.h +1447 -1339
  471. data/lib/libv8/v8/src/token.cc +4 -4
  472. data/lib/libv8/v8/src/token.h +6 -5
  473. data/lib/libv8/v8/src/type-info.cc +173 -129
  474. data/lib/libv8/v8/src/type-info.h +40 -22
  475. data/lib/libv8/v8/src/utils.cc +25 -304
  476. data/lib/libv8/v8/src/utils.h +118 -3
  477. data/lib/libv8/v8/src/v8-counters.h +3 -6
  478. data/lib/libv8/v8/src/v8.cc +34 -27
  479. data/lib/libv8/v8/src/v8.h +7 -7
  480. data/lib/libv8/v8/src/v8conversions.cc +129 -0
  481. data/lib/libv8/v8/src/v8conversions.h +60 -0
  482. data/lib/libv8/v8/src/v8globals.h +15 -6
  483. data/lib/libv8/v8/src/v8natives.js +300 -78
  484. data/lib/libv8/v8/src/v8threads.cc +14 -6
  485. data/lib/libv8/v8/src/v8threads.h +4 -1
  486. data/lib/libv8/v8/src/v8utils.cc +360 -0
  487. data/lib/libv8/v8/src/v8utils.h +17 -66
  488. data/lib/libv8/v8/src/variables.cc +7 -12
  489. data/lib/libv8/v8/src/variables.h +12 -10
  490. data/lib/libv8/v8/src/version.cc +2 -2
  491. data/lib/libv8/v8/src/vm-state-inl.h +0 -41
  492. data/lib/libv8/v8/src/vm-state.h +0 -11
  493. data/lib/libv8/v8/src/weakmap.js +103 -0
  494. data/lib/libv8/v8/src/x64/assembler-x64.h +6 -3
  495. data/lib/libv8/v8/src/x64/builtins-x64.cc +25 -22
  496. data/lib/libv8/v8/src/x64/code-stubs-x64.cc +523 -250
  497. data/lib/libv8/v8/src/x64/code-stubs-x64.h +8 -71
  498. data/lib/libv8/v8/src/x64/codegen-x64.cc +1 -0
  499. data/lib/libv8/v8/src/x64/codegen-x64.h +0 -2
  500. data/lib/libv8/v8/src/x64/cpu-x64.cc +2 -1
  501. data/lib/libv8/v8/src/x64/deoptimizer-x64.cc +40 -8
  502. data/lib/libv8/v8/src/x64/disasm-x64.cc +12 -10
  503. data/lib/libv8/v8/src/x64/frames-x64.h +7 -6
  504. data/lib/libv8/v8/src/x64/full-codegen-x64.cc +310 -415
  505. data/lib/libv8/v8/src/x64/ic-x64.cc +180 -117
  506. data/lib/libv8/v8/src/x64/lithium-codegen-x64.cc +411 -523
  507. data/lib/libv8/v8/src/x64/lithium-codegen-x64.h +11 -6
  508. data/lib/libv8/v8/src/x64/lithium-x64.cc +191 -216
  509. data/lib/libv8/v8/src/x64/lithium-x64.h +112 -263
  510. data/lib/libv8/v8/src/x64/macro-assembler-x64.cc +177 -61
  511. data/lib/libv8/v8/src/x64/macro-assembler-x64.h +23 -7
  512. data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.cc +21 -9
  513. data/lib/libv8/v8/src/x64/regexp-macro-assembler-x64.h +6 -0
  514. data/lib/libv8/v8/src/x64/stub-cache-x64.cc +273 -107
  515. data/lib/libv8/v8/src/zone.cc +31 -22
  516. data/lib/libv8/v8/src/zone.h +12 -6
  517. data/lib/libv8/v8/tools/codemap.js +8 -0
  518. data/lib/libv8/v8/tools/gcmole/Makefile +43 -0
  519. data/lib/libv8/v8/tools/gcmole/gcmole.lua +0 -2
  520. data/lib/libv8/v8/tools/gdb-v8-support.py +154 -0
  521. data/lib/libv8/v8/tools/grokdump.py +44 -35
  522. data/lib/libv8/v8/tools/gyp/v8.gyp +94 -248
  523. data/lib/libv8/v8/tools/js2c.py +83 -52
  524. data/lib/libv8/v8/tools/linux-tick-processor +4 -6
  525. data/lib/libv8/v8/tools/ll_prof.py +3 -3
  526. data/lib/libv8/v8/tools/oom_dump/README +3 -1
  527. data/lib/libv8/v8/tools/presubmit.py +11 -4
  528. data/lib/libv8/v8/tools/profile.js +46 -2
  529. data/lib/libv8/v8/tools/splaytree.js +11 -0
  530. data/lib/libv8/v8/tools/stats-viewer.py +15 -11
  531. data/lib/libv8/v8/tools/test-wrapper-gypbuild.py +227 -0
  532. data/lib/libv8/v8/tools/test.py +28 -8
  533. data/lib/libv8/v8/tools/tickprocessor.js +0 -16
  534. data/lib/libv8/version.rb +1 -1
  535. data/libv8.gemspec +2 -2
  536. metadata +31 -19
  537. data/lib/libv8/scons/engine/SCons/Tool/f03.py +0 -63
  538. data/lib/libv8/v8/src/json-parser.cc +0 -504
@@ -398,16 +398,18 @@ class StringTracker {
398
398
  // data.
399
399
  class HandleScopeImplementer {
400
400
  public:
401
-
402
401
  explicit HandleScopeImplementer(Isolate* isolate)
403
402
  : isolate_(isolate),
404
403
  blocks_(0),
405
404
  entered_contexts_(0),
406
405
  saved_contexts_(0),
407
406
  spare_(NULL),
408
- ignore_out_of_memory_(false),
409
407
  call_depth_(0) { }
410
408
 
409
+ ~HandleScopeImplementer() {
410
+ DeleteArray(spare_);
411
+ }
412
+
411
413
  // Threading support for handle data.
412
414
  static int ArchiveSpacePerThread();
413
415
  char* RestoreThread(char* from);
@@ -438,10 +440,6 @@ class HandleScopeImplementer {
438
440
  inline bool HasSavedContexts();
439
441
 
440
442
  inline List<internal::Object**>* blocks() { return &blocks_; }
441
- inline bool ignore_out_of_memory() { return ignore_out_of_memory_; }
442
- inline void set_ignore_out_of_memory(bool value) {
443
- ignore_out_of_memory_ = value;
444
- }
445
443
 
446
444
  private:
447
445
  void ResetAfterArchive() {
@@ -449,7 +447,6 @@ class HandleScopeImplementer {
449
447
  entered_contexts_.Initialize(0);
450
448
  saved_contexts_.Initialize(0);
451
449
  spare_ = NULL;
452
- ignore_out_of_memory_ = false;
453
450
  call_depth_ = 0;
454
451
  }
455
452
 
@@ -474,7 +471,6 @@ class HandleScopeImplementer {
474
471
  // Used as a stack to keep track of saved contexts.
475
472
  List<Context*> saved_contexts_;
476
473
  Object** spare_;
477
- bool ignore_out_of_memory_;
478
474
  int call_depth_;
479
475
  // This is only used for threading support.
480
476
  v8::ImplementationUtilities::HandleScopeData handle_scope_data_;
@@ -49,7 +49,10 @@ function Instantiate(data, name) {
49
49
  return InstantiateFunction(data, name);
50
50
  case kNewObjectTag:
51
51
  var Constructor = %GetTemplateField(data, kApiConstructorOffset);
52
- var result = Constructor ? new (Instantiate(Constructor))() : {};
52
+ // Note: Do not directly use a function template as a condition, our
53
+ // internal ToBoolean doesn't handle that!
54
+ var result = typeof Constructor === 'undefined' ?
55
+ {} : new (Instantiate(Constructor))();
53
56
  ConfigureTemplateInstance(result, data);
54
57
  result = %ToFastProperties(result);
55
58
  return result;
@@ -73,10 +76,19 @@ function InstantiateFunction(data, name) {
73
76
  if (name) %FunctionSetName(fun, name);
74
77
  cache[serialNumber] = fun;
75
78
  var prototype = %GetTemplateField(data, kApiPrototypeTemplateOffset);
76
- fun.prototype = prototype ? Instantiate(prototype) : {};
79
+ var flags = %GetTemplateField(data, kApiFlagOffset);
80
+ // Note: Do not directly use an object template as a condition, our
81
+ // internal ToBoolean doesn't handle that!
82
+ fun.prototype = typeof prototype === 'undefined' ?
83
+ {} : Instantiate(prototype);
84
+ if (flags & (1 << kReadOnlyPrototypeBit)) {
85
+ %FunctionSetReadOnlyPrototype(fun);
86
+ }
77
87
  %SetProperty(fun.prototype, "constructor", fun, DONT_ENUM);
78
88
  var parent = %GetTemplateField(data, kApiParentTemplateOffset);
79
- if (parent) {
89
+ // Note: Do not directly use a function template as a condition, our
90
+ // internal ToBoolean doesn't handle that!
91
+ if (!(typeof parent === 'undefined')) {
80
92
  var parent_fun = Instantiate(parent);
81
93
  fun.prototype.__proto__ = parent_fun.prototype;
82
94
  }
@@ -63,6 +63,14 @@ class Arguments BASE_EMBEDDED {
63
63
  return Handle<S>(reinterpret_cast<S**>(value));
64
64
  }
65
65
 
66
+ int smi_at(int index) {
67
+ return Smi::cast((*this)[index])->value();
68
+ }
69
+
70
+ double number_at(int index) {
71
+ return (*this)[index]->Number();
72
+ }
73
+
66
74
  // Get the total number of arguments including the receiver.
67
75
  int length() const { return length_; }
68
76
 
@@ -320,13 +320,13 @@ Assembler::Assembler(Isolate* arg_isolate, void* buffer, int buffer_size)
320
320
  ASSERT(buffer_ != NULL);
321
321
  pc_ = buffer_;
322
322
  reloc_info_writer.Reposition(buffer_ + buffer_size, pc_);
323
- num_prinfo_ = 0;
323
+ num_pending_reloc_info_ = 0;
324
324
  next_buffer_check_ = 0;
325
325
  const_pool_blocked_nesting_ = 0;
326
326
  no_const_pool_before_ = 0;
327
- last_const_pool_end_ = 0;
327
+ first_const_pool_use_ = -1;
328
328
  last_bound_pos_ = 0;
329
- ast_id_for_reloc_info_ = kNoASTId;
329
+ ClearRecordedAstId();
330
330
  }
331
331
 
332
332
 
@@ -346,7 +346,7 @@ Assembler::~Assembler() {
346
346
  void Assembler::GetCode(CodeDesc* desc) {
347
347
  // Emit constant pool if necessary.
348
348
  CheckConstPool(true, false);
349
- ASSERT(num_prinfo_ == 0);
349
+ ASSERT(num_pending_reloc_info_ == 0);
350
350
 
351
351
  // Setup code descriptor.
352
352
  desc->buffer = buffer_;
@@ -692,11 +692,11 @@ void Assembler::bind(Label* L) {
692
692
  void Assembler::next(Label* L) {
693
693
  ASSERT(L->is_linked());
694
694
  int link = target_at(L->pos());
695
- if (link > 0) {
696
- L->link_to(link);
697
- } else {
698
- ASSERT(link == kEndOfChain);
695
+ if (link == kEndOfChain) {
699
696
  L->Unuse();
697
+ } else {
698
+ ASSERT(link >= 0);
699
+ L->link_to(link);
700
700
  }
701
701
  }
702
702
 
@@ -873,7 +873,7 @@ void Assembler::addrmod1(Instr instr,
873
873
  emit(instr | rn.code()*B16 | rd.code()*B12);
874
874
  if (rn.is(pc) || x.rm_.is(pc)) {
875
875
  // Block constant pool emission for one instruction after reading pc.
876
- BlockConstPoolBefore(pc_offset() + kInstrSize);
876
+ BlockConstPoolFor(1);
877
877
  }
878
878
  }
879
879
 
@@ -997,7 +997,7 @@ int Assembler::branch_offset(Label* L, bool jump_elimination_allowed) {
997
997
 
998
998
  // Block the emission of the constant pool, since the branch instruction must
999
999
  // be emitted at the pc offset recorded by the label.
1000
- BlockConstPoolBefore(pc_offset() + kInstrSize);
1000
+ BlockConstPoolFor(1);
1001
1001
  return target_pos - (pc_offset() + kPcLoadDelta);
1002
1002
  }
1003
1003
 
@@ -1493,15 +1493,17 @@ void Assembler::stm(BlockAddrMode am,
1493
1493
  void Assembler::stop(const char* msg, Condition cond, int32_t code) {
1494
1494
  #ifndef __arm__
1495
1495
  ASSERT(code >= kDefaultStopCode);
1496
- // The Simulator will handle the stop instruction and get the message address.
1497
- // It expects to find the address just after the svc instruction.
1498
- BlockConstPoolFor(2);
1499
- if (code >= 0) {
1500
- svc(kStopCode + code, cond);
1501
- } else {
1502
- svc(kStopCode + kMaxStopCode, cond);
1496
+ {
1497
+ // The Simulator will handle the stop instruction and get the message
1498
+ // address. It expects to find the address just after the svc instruction.
1499
+ BlockConstPoolScope block_const_pool(this);
1500
+ if (code >= 0) {
1501
+ svc(kStopCode + code, cond);
1502
+ } else {
1503
+ svc(kStopCode + kMaxStopCode, cond);
1504
+ }
1505
+ emit(reinterpret_cast<Instr>(msg));
1503
1506
  }
1504
- emit(reinterpret_cast<Instr>(msg));
1505
1507
  #else // def __arm__
1506
1508
  #ifdef CAN_USE_ARMV5_INSTRUCTIONS
1507
1509
  if (cond != al) {
@@ -2406,11 +2408,6 @@ bool Assembler::ImmediateFitsAddrMode1Instruction(int32_t imm32) {
2406
2408
  }
2407
2409
 
2408
2410
 
2409
- void Assembler::BlockConstPoolFor(int instructions) {
2410
- BlockConstPoolBefore(pc_offset() + instructions * kInstrSize);
2411
- }
2412
-
2413
-
2414
2411
  // Debugging.
2415
2412
  void Assembler::RecordJSReturn() {
2416
2413
  positions_recorder()->WriteRecordedPositions();
@@ -2474,8 +2471,8 @@ void Assembler::GrowBuffer() {
2474
2471
  // to relocate any emitted relocation entries.
2475
2472
 
2476
2473
  // Relocate pending relocation entries.
2477
- for (int i = 0; i < num_prinfo_; i++) {
2478
- RelocInfo& rinfo = prinfo_[i];
2474
+ for (int i = 0; i < num_pending_reloc_info_; i++) {
2475
+ RelocInfo& rinfo = pending_reloc_info_[i];
2479
2476
  ASSERT(rinfo.rmode() != RelocInfo::COMMENT &&
2480
2477
  rinfo.rmode() != RelocInfo::POSITION);
2481
2478
  if (rinfo.rmode() != RelocInfo::JS_RETURN) {
@@ -2489,7 +2486,7 @@ void Assembler::db(uint8_t data) {
2489
2486
  // No relocation info should be pending while using db. db is used
2490
2487
  // to write pure data with no pointers and the constant pool should
2491
2488
  // be emitted before using db.
2492
- ASSERT(num_prinfo_ == 0);
2489
+ ASSERT(num_pending_reloc_info_ == 0);
2493
2490
  CheckBuffer();
2494
2491
  *reinterpret_cast<uint8_t*>(pc_) = data;
2495
2492
  pc_ += sizeof(uint8_t);
@@ -2500,7 +2497,7 @@ void Assembler::dd(uint32_t data) {
2500
2497
  // No relocation info should be pending while using dd. dd is used
2501
2498
  // to write pure data with no pointers and the constant pool should
2502
2499
  // be emitted before using dd.
2503
- ASSERT(num_prinfo_ == 0);
2500
+ ASSERT(num_pending_reloc_info_ == 0);
2504
2501
  CheckBuffer();
2505
2502
  *reinterpret_cast<uint32_t*>(pc_) = data;
2506
2503
  pc_ += sizeof(uint32_t);
@@ -2517,11 +2514,14 @@ void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
2517
2514
  || RelocInfo::IsPosition(rmode));
2518
2515
  // These modes do not need an entry in the constant pool.
2519
2516
  } else {
2520
- ASSERT(num_prinfo_ < kMaxNumPRInfo);
2521
- prinfo_[num_prinfo_++] = rinfo;
2517
+ ASSERT(num_pending_reloc_info_ < kMaxNumPendingRelocInfo);
2518
+ if (num_pending_reloc_info_ == 0) {
2519
+ first_const_pool_use_ = pc_offset();
2520
+ }
2521
+ pending_reloc_info_[num_pending_reloc_info_++] = rinfo;
2522
2522
  // Make sure the constant pool is not emitted in place of the next
2523
2523
  // instruction for which we just recorded relocation info.
2524
- BlockConstPoolBefore(pc_offset() + kInstrSize);
2524
+ BlockConstPoolFor(1);
2525
2525
  }
2526
2526
  if (rinfo.rmode() != RelocInfo::NONE) {
2527
2527
  // Don't record external references unless the heap will be serialized.
@@ -2537,9 +2537,8 @@ void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
2537
2537
  }
2538
2538
  ASSERT(buffer_space() >= kMaxRelocSize); // too late to grow buffer here
2539
2539
  if (rmode == RelocInfo::CODE_TARGET_WITH_ID) {
2540
- ASSERT(ast_id_for_reloc_info_ != kNoASTId);
2541
- RelocInfo reloc_info_with_ast_id(pc_, rmode, ast_id_for_reloc_info_);
2542
- ast_id_for_reloc_info_ = kNoASTId;
2540
+ RelocInfo reloc_info_with_ast_id(pc_, rmode, RecordedAstId());
2541
+ ClearRecordedAstId();
2543
2542
  reloc_info_writer.Write(&reloc_info_with_ast_id);
2544
2543
  } else {
2545
2544
  reloc_info_writer.Write(&rinfo);
@@ -2548,111 +2547,112 @@ void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
2548
2547
  }
2549
2548
 
2550
2549
 
2551
- void Assembler::CheckConstPool(bool force_emit, bool require_jump) {
2552
- // Calculate the offset of the next check. It will be overwritten
2553
- // when a const pool is generated or when const pools are being
2554
- // blocked for a specific range.
2555
- next_buffer_check_ = pc_offset() + kCheckConstInterval;
2556
-
2557
- // There is nothing to do if there are no pending relocation info entries.
2558
- if (num_prinfo_ == 0) return;
2559
-
2560
- // We emit a constant pool at regular intervals of about kDistBetweenPools
2561
- // or when requested by parameter force_emit (e.g. after each function).
2562
- // We prefer not to emit a jump unless the max distance is reached or if we
2563
- // are running low on slots, which can happen if a lot of constants are being
2564
- // emitted (e.g. --debug-code and many static references).
2565
- int dist = pc_offset() - last_const_pool_end_;
2566
- if (!force_emit && dist < kMaxDistBetweenPools &&
2567
- (require_jump || dist < kDistBetweenPools) &&
2568
- // TODO(1236125): Cleanup the "magic" number below. We know that
2569
- // the code generation will test every kCheckConstIntervalInst.
2570
- // Thus we are safe as long as we generate less than 7 constant
2571
- // entries per instruction.
2572
- (num_prinfo_ < (kMaxNumPRInfo - (7 * kCheckConstIntervalInst)))) {
2573
- return;
2550
+ void Assembler::BlockConstPoolFor(int instructions) {
2551
+ int pc_limit = pc_offset() + instructions * kInstrSize;
2552
+ if (no_const_pool_before_ < pc_limit) {
2553
+ // If there are some pending entries, the constant pool cannot be blocked
2554
+ // further than first_const_pool_use_ + kMaxDistToPool
2555
+ ASSERT((num_pending_reloc_info_ == 0) ||
2556
+ (pc_limit < (first_const_pool_use_ + kMaxDistToPool)));
2557
+ no_const_pool_before_ = pc_limit;
2574
2558
  }
2575
2559
 
2576
- // If we did not return by now, we need to emit the constant pool soon.
2560
+ if (next_buffer_check_ < no_const_pool_before_) {
2561
+ next_buffer_check_ = no_const_pool_before_;
2562
+ }
2563
+ }
2577
2564
 
2578
- // However, some small sequences of instructions must not be broken up by the
2579
- // insertion of a constant pool; such sequences are protected by setting
2580
- // either const_pool_blocked_nesting_ or no_const_pool_before_, which are
2581
- // both checked here. Also, recursive calls to CheckConstPool are blocked by
2582
- // no_const_pool_before_.
2583
- if (const_pool_blocked_nesting_ > 0 || pc_offset() < no_const_pool_before_) {
2584
- // Emission is currently blocked; make sure we try again as soon as
2585
- // possible.
2586
- if (const_pool_blocked_nesting_ > 0) {
2587
- next_buffer_check_ = pc_offset() + kInstrSize;
2588
- } else {
2589
- next_buffer_check_ = no_const_pool_before_;
2590
- }
2591
2565
 
2566
+ void Assembler::CheckConstPool(bool force_emit, bool require_jump) {
2567
+ // Some short sequence of instruction mustn't be broken up by constant pool
2568
+ // emission, such sequences are protected by calls to BlockConstPoolFor and
2569
+ // BlockConstPoolScope.
2570
+ if (is_const_pool_blocked()) {
2592
2571
  // Something is wrong if emission is forced and blocked at the same time.
2593
2572
  ASSERT(!force_emit);
2594
2573
  return;
2595
2574
  }
2596
2575
 
2597
- int jump_instr = require_jump ? kInstrSize : 0;
2576
+ // There is nothing to do if there are no pending constant pool entries.
2577
+ if (num_pending_reloc_info_ == 0) {
2578
+ // Calculate the offset of the next check.
2579
+ next_buffer_check_ = pc_offset() + kCheckPoolInterval;
2580
+ return;
2581
+ }
2582
+
2583
+ // We emit a constant pool when:
2584
+ // * requested to do so by parameter force_emit (e.g. after each function).
2585
+ // * the distance to the first instruction accessing the constant pool is
2586
+ // kAvgDistToPool or more.
2587
+ // * no jump is required and the distance to the first instruction accessing
2588
+ // the constant pool is at least kMaxDistToPool / 2.
2589
+ ASSERT(first_const_pool_use_ >= 0);
2590
+ int dist = pc_offset() - first_const_pool_use_;
2591
+ if (!force_emit && dist < kAvgDistToPool &&
2592
+ (require_jump || (dist < (kMaxDistToPool / 2)))) {
2593
+ return;
2594
+ }
2598
2595
 
2599
2596
  // Check that the code buffer is large enough before emitting the constant
2600
- // pool and relocation information (include the jump over the pool and the
2601
- // constant pool marker).
2602
- int max_needed_space =
2603
- jump_instr + kInstrSize + num_prinfo_*(kInstrSize + kMaxRelocSize);
2604
- while (buffer_space() <= (max_needed_space + kGap)) GrowBuffer();
2605
-
2606
- // Block recursive calls to CheckConstPool.
2607
- BlockConstPoolBefore(pc_offset() + jump_instr + kInstrSize +
2608
- num_prinfo_*kInstrSize);
2609
- // Don't bother to check for the emit calls below.
2610
- next_buffer_check_ = no_const_pool_before_;
2611
-
2612
- // Emit jump over constant pool if necessary.
2613
- Label after_pool;
2614
- if (require_jump) b(&after_pool);
2615
-
2616
- RecordComment("[ Constant Pool");
2617
-
2618
- // Put down constant pool marker "Undefined instruction" as specified by
2619
- // A5.6 (ARMv7) Instruction set encoding.
2620
- emit(kConstantPoolMarker | num_prinfo_);
2621
-
2622
- // Emit constant pool entries.
2623
- for (int i = 0; i < num_prinfo_; i++) {
2624
- RelocInfo& rinfo = prinfo_[i];
2625
- ASSERT(rinfo.rmode() != RelocInfo::COMMENT &&
2626
- rinfo.rmode() != RelocInfo::POSITION &&
2627
- rinfo.rmode() != RelocInfo::STATEMENT_POSITION);
2628
- Instr instr = instr_at(rinfo.pc());
2629
-
2630
- // Instruction to patch must be a ldr/str [pc, #offset].
2631
- // P and U set, B and W clear, Rn == pc, offset12 still 0.
2632
- ASSERT((instr & (7*B25 | P | U | B | W | 15*B16 | kOff12Mask)) ==
2633
- (2*B25 | P | U | pc.code()*B16));
2634
- int delta = pc_ - rinfo.pc() - 8;
2635
- ASSERT(delta >= -4); // instr could be ldr pc, [pc, #-4] followed by targ32
2636
- if (delta < 0) {
2637
- instr &= ~U;
2638
- delta = -delta;
2597
+ // pool (include the jump over the pool and the constant pool marker and
2598
+ // the gap to the relocation information).
2599
+ int jump_instr = require_jump ? kInstrSize : 0;
2600
+ int needed_space = jump_instr + kInstrSize +
2601
+ num_pending_reloc_info_ * kInstrSize + kGap;
2602
+ while (buffer_space() <= needed_space) GrowBuffer();
2603
+
2604
+ {
2605
+ // Block recursive calls to CheckConstPool.
2606
+ BlockConstPoolScope block_const_pool(this);
2607
+
2608
+ // Emit jump over constant pool if necessary.
2609
+ Label after_pool;
2610
+ if (require_jump) {
2611
+ b(&after_pool);
2639
2612
  }
2640
- ASSERT(is_uint12(delta));
2641
- instr_at_put(rinfo.pc(), instr + delta);
2642
- emit(rinfo.data());
2643
- }
2644
- num_prinfo_ = 0;
2645
- last_const_pool_end_ = pc_offset();
2646
2613
 
2647
- RecordComment("]");
2614
+ RecordComment("[ Constant Pool");
2615
+
2616
+ // Put down constant pool marker "Undefined instruction" as specified by
2617
+ // A5.6 (ARMv7) Instruction set encoding.
2618
+ emit(kConstantPoolMarker | num_pending_reloc_info_);
2619
+
2620
+ // Emit constant pool entries.
2621
+ for (int i = 0; i < num_pending_reloc_info_; i++) {
2622
+ RelocInfo& rinfo = pending_reloc_info_[i];
2623
+ ASSERT(rinfo.rmode() != RelocInfo::COMMENT &&
2624
+ rinfo.rmode() != RelocInfo::POSITION &&
2625
+ rinfo.rmode() != RelocInfo::STATEMENT_POSITION);
2626
+
2627
+ Instr instr = instr_at(rinfo.pc());
2628
+ // Instruction to patch must be 'ldr rd, [pc, #offset]' with offset == 0.
2629
+ ASSERT(IsLdrPcImmediateOffset(instr) &&
2630
+ GetLdrRegisterImmediateOffset(instr) == 0);
2631
+
2632
+ int delta = pc_ - rinfo.pc() - kPcLoadDelta;
2633
+ // 0 is the smallest delta:
2634
+ // ldr rd, [pc, #0]
2635
+ // constant pool marker
2636
+ // data
2637
+ ASSERT(is_uint12(delta));
2638
+
2639
+ instr_at_put(rinfo.pc(), SetLdrRegisterImmediateOffset(instr, delta));
2640
+ emit(rinfo.data());
2641
+ }
2642
+
2643
+ num_pending_reloc_info_ = 0;
2644
+ first_const_pool_use_ = -1;
2648
2645
 
2649
- if (after_pool.is_linked()) {
2650
- bind(&after_pool);
2646
+ RecordComment("]");
2647
+
2648
+ if (after_pool.is_linked()) {
2649
+ bind(&after_pool);
2650
+ }
2651
2651
  }
2652
2652
 
2653
2653
  // Since a constant pool was just emitted, move the check offset forward by
2654
2654
  // the standard interval.
2655
- next_buffer_check_ = pc_offset() + kCheckConstInterval;
2655
+ next_buffer_check_ = pc_offset() + kCheckPoolInterval;
2656
2656
  }
2657
2657
 
2658
2658
 
@@ -167,13 +167,14 @@ struct SwVfpRegister {
167
167
 
168
168
  // Double word VFP register.
169
169
  struct DwVfpRegister {
170
- // d0 has been excluded from allocation. This is following ia32
171
- // where xmm0 is excluded. This should be revisited.
172
- // Currently d0 is used as a scratch register.
173
- // d1 has also been excluded from allocation to be used as a scratch
174
- // register as well.
175
170
  static const int kNumRegisters = 16;
176
- static const int kNumAllocatableRegisters = 15;
171
+ // A few double registers are reserved: one as a scratch register and one to
172
+ // hold 0.0, that does not fit in the immediate field of vmov instructions.
173
+ // d14: 0.0
174
+ // d15: scratch register.
175
+ static const int kNumReservedRegisters = 2;
176
+ static const int kNumAllocatableRegisters = kNumRegisters -
177
+ kNumReservedRegisters;
177
178
 
178
179
  static int ToAllocationIndex(DwVfpRegister reg) {
179
180
  ASSERT(reg.code() != 0);
@@ -188,6 +189,7 @@ struct DwVfpRegister {
188
189
  static const char* AllocationIndexToString(int index) {
189
190
  ASSERT(index >= 0 && index < kNumAllocatableRegisters);
190
191
  const char* const names[] = {
192
+ "d0",
191
193
  "d1",
192
194
  "d2",
193
195
  "d3",
@@ -200,9 +202,7 @@ struct DwVfpRegister {
200
202
  "d10",
201
203
  "d11",
202
204
  "d12",
203
- "d13",
204
- "d14",
205
- "d15"
205
+ "d13"
206
206
  };
207
207
  return names[index];
208
208
  }
@@ -303,6 +303,11 @@ const DwVfpRegister d13 = { 13 };
303
303
  const DwVfpRegister d14 = { 14 };
304
304
  const DwVfpRegister d15 = { 15 };
305
305
 
306
+ // Aliases for double registers.
307
+ const DwVfpRegister kFirstCalleeSavedDoubleReg = d8;
308
+ const DwVfpRegister kLastCalleeSavedDoubleReg = d15;
309
+ const DwVfpRegister kDoubleRegZero = d14;
310
+
306
311
 
307
312
  // Coprocessor register
308
313
  struct CRegister {
@@ -372,8 +377,10 @@ class Operand BASE_EMBEDDED {
372
377
  // immediate
373
378
  INLINE(explicit Operand(int32_t immediate,
374
379
  RelocInfo::Mode rmode = RelocInfo::NONE));
380
+ INLINE(static Operand Zero()) {
381
+ return Operand(static_cast<int32_t>(0));
382
+ }
375
383
  INLINE(explicit Operand(const ExternalReference& f));
376
- INLINE(explicit Operand(const char* s));
377
384
  explicit Operand(Handle<Object> handle);
378
385
  INLINE(explicit Operand(Smi* value));
379
386
 
@@ -451,6 +458,7 @@ class MemOperand BASE_EMBEDDED {
451
458
 
452
459
  Register rn() const { return rn_; }
453
460
  Register rm() const { return rm_; }
461
+ AddrMode am() const { return am_; }
454
462
 
455
463
  bool OffsetIsUint12Encodable() const {
456
464
  return offset_ >= 0 ? is_uint12(offset_) : is_uint12(-offset_);
@@ -500,6 +508,7 @@ class CpuFeatures : public AllStatic {
500
508
  // Enable a specified feature within a scope.
501
509
  class Scope BASE_EMBEDDED {
502
510
  #ifdef DEBUG
511
+
503
512
  public:
504
513
  explicit Scope(CpuFeature f) {
505
514
  unsigned mask = 1u << f;
@@ -519,10 +528,12 @@ class CpuFeatures : public AllStatic {
519
528
  isolate_->set_enabled_cpu_features(old_enabled_);
520
529
  }
521
530
  }
531
+
522
532
  private:
523
533
  Isolate* isolate_;
524
534
  unsigned old_enabled_;
525
535
  #else
536
+
526
537
  public:
527
538
  explicit Scope(CpuFeature f) {}
528
539
  #endif
@@ -1132,8 +1143,13 @@ class Assembler : public AssemblerBase {
1132
1143
  void jmp(Label* L) { b(L, al); }
1133
1144
 
1134
1145
  // Check the code size generated from label to here.
1135
- int InstructionsGeneratedSince(Label* l) {
1136
- return (pc_offset() - l->pos()) / kInstrSize;
1146
+ int SizeOfCodeGeneratedSince(Label* label) {
1147
+ return pc_offset() - label->pos();
1148
+ }
1149
+
1150
+ // Check the number of instructions generated from label to here.
1151
+ int InstructionsGeneratedSince(Label* label) {
1152
+ return SizeOfCodeGeneratedSince(label) / kInstrSize;
1137
1153
  }
1138
1154
 
1139
1155
  // Check whether an immediate fits an addressing mode 1 instruction.
@@ -1155,10 +1171,6 @@ class Assembler : public AssemblerBase {
1155
1171
  DISALLOW_IMPLICIT_CONSTRUCTORS(BlockConstPoolScope);
1156
1172
  };
1157
1173
 
1158
- // Postpone the generation of the constant pool for the specified number of
1159
- // instructions.
1160
- void BlockConstPoolFor(int instructions);
1161
-
1162
1174
  // Debugging
1163
1175
 
1164
1176
  // Mark address of the ExitJSFrame code.
@@ -1169,7 +1181,17 @@ class Assembler : public AssemblerBase {
1169
1181
 
1170
1182
  // Record the AST id of the CallIC being compiled, so that it can be placed
1171
1183
  // in the relocation information.
1172
- void RecordAstId(unsigned ast_id) { ast_id_for_reloc_info_ = ast_id; }
1184
+ void SetRecordedAstId(unsigned ast_id) {
1185
+ ASSERT(recorded_ast_id_ == kNoASTId);
1186
+ recorded_ast_id_ = ast_id;
1187
+ }
1188
+
1189
+ unsigned RecordedAstId() {
1190
+ ASSERT(recorded_ast_id_ != kNoASTId);
1191
+ return recorded_ast_id_;
1192
+ }
1193
+
1194
+ void ClearRecordedAstId() { recorded_ast_id_ = kNoASTId; }
1173
1195
 
1174
1196
  // Record a comment relocation entry that can be used by a disassembler.
1175
1197
  // Use --code-comments to enable.
@@ -1218,24 +1240,24 @@ class Assembler : public AssemblerBase {
1218
1240
  static int GetCmpImmediateRawImmediate(Instr instr);
1219
1241
  static bool IsNop(Instr instr, int type = NON_MARKING_NOP);
1220
1242
 
1221
- // Buffer size and constant pool distance are checked together at regular
1222
- // intervals of kBufferCheckInterval emitted bytes
1223
- static const int kBufferCheckInterval = 1*KB/2;
1224
1243
  // Constants in pools are accessed via pc relative addressing, which can
1225
1244
  // reach +/-4KB thereby defining a maximum distance between the instruction
1226
- // and the accessed constant. We satisfy this constraint by limiting the
1227
- // distance between pools.
1228
- static const int kMaxDistBetweenPools = 4*KB - 2*kBufferCheckInterval;
1229
- static const int kMaxNumPRInfo = kMaxDistBetweenPools/kInstrSize;
1245
+ // and the accessed constant.
1246
+ static const int kMaxDistToPool = 4*KB;
1247
+ static const int kMaxNumPendingRelocInfo = kMaxDistToPool/kInstrSize;
1230
1248
 
1231
- // Check if is time to emit a constant pool for pending reloc info entries
1249
+ // Postpone the generation of the constant pool for the specified number of
1250
+ // instructions.
1251
+ void BlockConstPoolFor(int instructions);
1252
+
1253
+ // Check if is time to emit a constant pool.
1232
1254
  void CheckConstPool(bool force_emit, bool require_jump);
1233
1255
 
1234
1256
  protected:
1235
1257
  // Relocation for a type-recording IC has the AST id added to it. This
1236
1258
  // member variable is a way to pass the information from the call site to
1237
1259
  // the relocation info.
1238
- unsigned ast_id_for_reloc_info_;
1260
+ unsigned recorded_ast_id_;
1239
1261
 
1240
1262
  bool emit_debug_code() const { return emit_debug_code_; }
1241
1263
 
@@ -1253,18 +1275,37 @@ class Assembler : public AssemblerBase {
1253
1275
  // Patch branch instruction at pos to branch to given branch target pos
1254
1276
  void target_at_put(int pos, int target_pos);
1255
1277
 
1256
- // Block the emission of the constant pool before pc_offset
1257
- void BlockConstPoolBefore(int pc_offset) {
1258
- if (no_const_pool_before_ < pc_offset) no_const_pool_before_ = pc_offset;
1259
- }
1260
-
1278
+ // Prevent contant pool emission until EndBlockConstPool is called.
1279
+ // Call to this function can be nested but must be followed by an equal
1280
+ // number of call to EndBlockConstpool.
1261
1281
  void StartBlockConstPool() {
1262
- const_pool_blocked_nesting_++;
1282
+ if (const_pool_blocked_nesting_++ == 0) {
1283
+ // Prevent constant pool checks happening by setting the next check to
1284
+ // the biggest possible offset.
1285
+ next_buffer_check_ = kMaxInt;
1286
+ }
1263
1287
  }
1288
+
1289
+ // Resume constant pool emission. Need to be called as many time as
1290
+ // StartBlockConstPool to have an effect.
1264
1291
  void EndBlockConstPool() {
1265
- const_pool_blocked_nesting_--;
1292
+ if (--const_pool_blocked_nesting_ == 0) {
1293
+ // Check the constant pool hasn't been blocked for too long.
1294
+ ASSERT((num_pending_reloc_info_ == 0) ||
1295
+ (pc_offset() < (first_const_pool_use_ + kMaxDistToPool)));
1296
+ // Two cases:
1297
+ // * no_const_pool_before_ >= next_buffer_check_ and the emission is
1298
+ // still blocked
1299
+ // * no_const_pool_before_ < next_buffer_check_ and the next emit will
1300
+ // trigger a check.
1301
+ next_buffer_check_ = no_const_pool_before_;
1302
+ }
1303
+ }
1304
+
1305
+ bool is_const_pool_blocked() const {
1306
+ return (const_pool_blocked_nesting_ > 0) ||
1307
+ (pc_offset() < no_const_pool_before_);
1266
1308
  }
1267
- bool is_const_pool_blocked() const { return const_pool_blocked_nesting_ > 0; }
1268
1309
 
1269
1310
  private:
1270
1311
  // Code buffer:
@@ -1298,33 +1339,41 @@ class Assembler : public AssemblerBase {
1298
1339
  // expensive. By default we only check again once a number of instructions
1299
1340
  // has been generated. That also means that the sizing of the buffers is not
1300
1341
  // an exact science, and that we rely on some slop to not overrun buffers.
1301
- static const int kCheckConstIntervalInst = 32;
1302
- static const int kCheckConstInterval = kCheckConstIntervalInst * kInstrSize;
1342
+ static const int kCheckPoolIntervalInst = 32;
1343
+ static const int kCheckPoolInterval = kCheckPoolIntervalInst * kInstrSize;
1303
1344
 
1304
1345
 
1305
- // Pools are emitted after function return and in dead code at (more or less)
1306
- // regular intervals of kDistBetweenPools bytes
1307
- static const int kDistBetweenPools = 1*KB;
1346
+ // Average distance beetween a constant pool and the first instruction
1347
+ // accessing the constant pool. Longer distance should result in less I-cache
1348
+ // pollution.
1349
+ // In practice the distance will be smaller since constant pool emission is
1350
+ // forced after function return and sometimes after unconditional branches.
1351
+ static const int kAvgDistToPool = kMaxDistToPool - kCheckPoolInterval;
1308
1352
 
1309
1353
  // Emission of the constant pool may be blocked in some code sequences.
1310
1354
  int const_pool_blocked_nesting_; // Block emission if this is not zero.
1311
1355
  int no_const_pool_before_; // Block emission before this pc offset.
1312
1356
 
1313
- // Keep track of the last emitted pool to guarantee a maximal distance
1314
- int last_const_pool_end_; // pc offset following the last constant pool
1357
+ // Keep track of the first instruction requiring a constant pool entry
1358
+ // since the previous constant pool was emitted.
1359
+ int first_const_pool_use_;
1315
1360
 
1316
1361
  // Relocation info generation
1317
1362
  // Each relocation is encoded as a variable size value
1318
1363
  static const int kMaxRelocSize = RelocInfoWriter::kMaxSize;
1319
1364
  RelocInfoWriter reloc_info_writer;
1365
+
1320
1366
  // Relocation info records are also used during code generation as temporary
1321
1367
  // containers for constants and code target addresses until they are emitted
1322
1368
  // to the constant pool. These pending relocation info records are temporarily
1323
1369
  // stored in a separate buffer until a constant pool is emitted.
1324
1370
  // If every instruction in a long sequence is accessing the pool, we need one
1325
1371
  // pending relocation entry per instruction.
1326
- RelocInfo prinfo_[kMaxNumPRInfo]; // the buffer of pending relocation info
1327
- int num_prinfo_; // number of pending reloc info entries in the buffer
1372
+
1373
+ // the buffer of pending relocation info
1374
+ RelocInfo pending_reloc_info_[kMaxNumPendingRelocInfo];
1375
+ // number of pending reloc info entries in the buffer
1376
+ int num_pending_reloc_info_;
1328
1377
 
1329
1378
  // The bound position, before this we cannot do instruction elimination.
1330
1379
  int last_bound_pos_;