libv8 3.3.10.4 → 3.5.10.beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -395,12 +395,11 @@ struct AccessorDescriptor {
395
395
  };
396
396
 
397
397
 
398
- // Logging and profiling.
399
- // A StateTag represents a possible state of the VM. When compiled with
400
- // ENABLE_VMSTATE_TRACKING, the logger maintains a stack of these.
401
- // Creating a VMState object enters a state by pushing on the stack, and
402
- // destroying a VMState object leaves a state by popping the current state
403
- // from the stack.
398
+ // Logging and profiling. A StateTag represents a possible state of
399
+ // the VM. The logger maintains a stack of these. Creating a VMState
400
+ // object enters a state by pushing on the stack, and destroying a
401
+ // VMState object leaves a state by popping the current state from the
402
+ // stack.
404
403
 
405
404
  #define STATE_TAG_LIST(V) \
406
405
  V(JS) \
@@ -507,6 +506,16 @@ enum CallKind {
507
506
  CALL_AS_FUNCTION
508
507
  };
509
508
 
509
+
510
+ static const uint32_t kHoleNanUpper32 = 0x7FFFFFFF;
511
+ static const uint32_t kHoleNanLower32 = 0xFFFFFFFF;
512
+ static const uint32_t kNaNOrInfinityLowerBoundUpper32 = 0x7FF00000;
513
+
514
+ const uint64_t kHoleNanInt64 =
515
+ (static_cast<uint64_t>(kHoleNanUpper32) << 32) | kHoleNanLower32;
516
+ const uint64_t kLastNonNaNInt64 =
517
+ (static_cast<uint64_t>(kNaNOrInfinityLowerBoundUpper32) << 32);
518
+
510
519
  } } // namespace v8::internal
511
520
 
512
521
  #endif // V8_V8GLOBALS_H_
@@ -1,4 +1,4 @@
1
- // Copyright 2006-2008 the V8 project authors. All rights reserved.
1
+ // Copyright 2011 the V8 project authors. All rights reserved.
2
2
  // Redistribution and use in source and binary forms, with or without
3
3
  // modification, are permitted provided that the following conditions are
4
4
  // met:
@@ -56,7 +56,7 @@ function InstallFunctions(object, attributes, functions) {
56
56
  %FunctionSetName(f, key);
57
57
  %FunctionRemovePrototype(f);
58
58
  %SetProperty(object, key, f, attributes);
59
- %SetES5Flag(f);
59
+ %SetNativeFlag(f);
60
60
  }
61
61
  %ToFastProperties(object);
62
62
  }
@@ -106,7 +106,7 @@ function GlobalParseInt(string, radix) {
106
106
  // Truncate number.
107
107
  return string | 0;
108
108
  }
109
- if (IS_UNDEFINED(radix)) radix = 0;
109
+ radix = radix | 0;
110
110
  } else {
111
111
  radix = TO_INT32(radix);
112
112
  if (!(radix == 0 || (2 <= radix && radix <= 36)))
@@ -132,10 +132,19 @@ function GlobalParseFloat(string) {
132
132
  function GlobalEval(x) {
133
133
  if (!IS_STRING(x)) return x;
134
134
 
135
+ var receiver = this;
135
136
  var global_receiver = %GlobalReceiver(global);
136
- var this_is_global_receiver = (this === global_receiver);
137
+
138
+ if (receiver == null && !IS_UNDETECTABLE(receiver)) {
139
+ receiver = global_receiver;
140
+ }
141
+
142
+ var this_is_global_receiver = (receiver === global_receiver);
137
143
  var global_is_detached = (global === global_receiver);
138
144
 
145
+ // For consistency with JSC we require the global object passed to
146
+ // eval to be the global object from which 'eval' originated. This
147
+ // is not mandated by the spec.
139
148
  if (!this_is_global_receiver || global_is_detached) {
140
149
  throw new $EvalError('The "this" object passed to eval must ' +
141
150
  'be the global object from which eval originated');
@@ -144,7 +153,7 @@ function GlobalEval(x) {
144
153
  var f = %CompileString(x);
145
154
  if (!IS_FUNCTION(f)) return f;
146
155
 
147
- return %_CallFunction(this, f);
156
+ return %_CallFunction(receiver, f);
148
157
  }
149
158
 
150
159
 
@@ -200,7 +209,7 @@ function ObjectToString() {
200
209
  if (IS_UNDEFINED(this) && !IS_UNDETECTABLE(this)) {
201
210
  return '[object Undefined]';
202
211
  }
203
- if (IS_NULL(this)) return '[object Null]';
212
+ if (IS_NULL(this)) return '[object Null]';
204
213
  return "[object " + %_ClassOf(ToObject(this)) + "]";
205
214
  }
206
215
 
@@ -223,6 +232,10 @@ function ObjectValueOf() {
223
232
 
224
233
  // ECMA-262 - 15.2.4.5
225
234
  function ObjectHasOwnProperty(V) {
235
+ if (%IsJSProxy(this)) {
236
+ var handler = %GetHandler(this);
237
+ return CallTrap1(handler, "hasOwn", DerivedHasOwnTrap, TO_STRING_INLINE(V));
238
+ }
226
239
  return %HasLocalProperty(TO_OBJECT_INLINE(this), TO_STRING_INLINE(V));
227
240
  }
228
241
 
@@ -240,14 +253,20 @@ function ObjectIsPrototypeOf(V) {
240
253
 
241
254
  // ECMA-262 - 15.2.4.6
242
255
  function ObjectPropertyIsEnumerable(V) {
243
- return %IsPropertyEnumerable(ToObject(this), ToString(V));
256
+ var P = ToString(V);
257
+ if (%IsJSProxy(this)) {
258
+ var desc = GetOwnProperty(this, P);
259
+ return IS_UNDEFINED(desc) ? false : desc.isEnumerable();
260
+ }
261
+ return %IsPropertyEnumerable(ToObject(this), P);
244
262
  }
245
263
 
246
264
 
247
265
  // Extensions for providing property getters and setters.
248
266
  function ObjectDefineGetter(name, fun) {
249
- if (this == null && !IS_UNDETECTABLE(this)) {
250
- throw new $TypeError('Object.prototype.__defineGetter__: this is Null');
267
+ var receiver = this;
268
+ if (receiver == null && !IS_UNDETECTABLE(receiver)) {
269
+ receiver = %GlobalReceiver(global);
251
270
  }
252
271
  if (!IS_FUNCTION(fun)) {
253
272
  throw new $TypeError('Object.prototype.__defineGetter__: Expecting function');
@@ -256,21 +275,23 @@ function ObjectDefineGetter(name, fun) {
256
275
  desc.setGet(fun);
257
276
  desc.setEnumerable(true);
258
277
  desc.setConfigurable(true);
259
- DefineOwnProperty(ToObject(this), ToString(name), desc, false);
278
+ DefineOwnProperty(ToObject(receiver), ToString(name), desc, false);
260
279
  }
261
280
 
262
281
 
263
282
  function ObjectLookupGetter(name) {
264
- if (this == null && !IS_UNDETECTABLE(this)) {
265
- throw new $TypeError('Object.prototype.__lookupGetter__: this is Null');
283
+ var receiver = this;
284
+ if (receiver == null && !IS_UNDETECTABLE(receiver)) {
285
+ receiver = %GlobalReceiver(global);
266
286
  }
267
- return %LookupAccessor(ToObject(this), ToString(name), GETTER);
287
+ return %LookupAccessor(ToObject(receiver), ToString(name), GETTER);
268
288
  }
269
289
 
270
290
 
271
291
  function ObjectDefineSetter(name, fun) {
272
- if (this == null && !IS_UNDETECTABLE(this)) {
273
- throw new $TypeError('Object.prototype.__defineSetter__: this is Null');
292
+ var receiver = this;
293
+ if (receiver == null && !IS_UNDETECTABLE(receiver)) {
294
+ receiver = %GlobalReceiver(global);
274
295
  }
275
296
  if (!IS_FUNCTION(fun)) {
276
297
  throw new $TypeError(
@@ -280,21 +301,27 @@ function ObjectDefineSetter(name, fun) {
280
301
  desc.setSet(fun);
281
302
  desc.setEnumerable(true);
282
303
  desc.setConfigurable(true);
283
- DefineOwnProperty(ToObject(this), ToString(name), desc, false);
304
+ DefineOwnProperty(ToObject(receiver), ToString(name), desc, false);
284
305
  }
285
306
 
286
307
 
287
308
  function ObjectLookupSetter(name) {
288
- if (this == null && !IS_UNDETECTABLE(this)) {
289
- throw new $TypeError('Object.prototype.__lookupSetter__: this is Null');
309
+ var receiver = this;
310
+ if (receiver == null && !IS_UNDETECTABLE(receiver)) {
311
+ receiver = %GlobalReceiver(global);
290
312
  }
291
- return %LookupAccessor(ToObject(this), ToString(name), SETTER);
313
+ return %LookupAccessor(ToObject(receiver), ToString(name), SETTER);
292
314
  }
293
315
 
294
316
 
295
317
  function ObjectKeys(obj) {
296
318
  if (!IS_SPEC_OBJECT(obj))
297
319
  throw MakeTypeError("obj_ctor_property_non_object", ["keys"]);
320
+ if (%IsJSProxy(obj)) {
321
+ var handler = %GetHandler(obj);
322
+ var names = CallTrap0(handler, "keys", DerivedKeysTrap);
323
+ return ToStringArray(names);
324
+ }
298
325
  return %LocalKeys(obj);
299
326
  }
300
327
 
@@ -302,14 +329,14 @@ function ObjectKeys(obj) {
302
329
  // ES5 8.10.1.
303
330
  function IsAccessorDescriptor(desc) {
304
331
  if (IS_UNDEFINED(desc)) return false;
305
- return desc.hasGetter_ || desc.hasSetter_;
332
+ return desc.hasGetter() || desc.hasSetter();
306
333
  }
307
334
 
308
335
 
309
336
  // ES5 8.10.2.
310
337
  function IsDataDescriptor(desc) {
311
338
  if (IS_UNDEFINED(desc)) return false;
312
- return desc.hasValue_ || desc.hasWritable_;
339
+ return desc.hasValue() || desc.hasWritable();
313
340
  }
314
341
 
315
342
 
@@ -323,23 +350,54 @@ function IsInconsistentDescriptor(desc) {
323
350
  return IsAccessorDescriptor(desc) && IsDataDescriptor(desc);
324
351
  }
325
352
 
353
+
326
354
  // ES5 8.10.4
327
355
  function FromPropertyDescriptor(desc) {
328
356
  if (IS_UNDEFINED(desc)) return desc;
329
- var obj = new $Object();
357
+
330
358
  if (IsDataDescriptor(desc)) {
331
- obj.value = desc.getValue();
332
- obj.writable = desc.isWritable();
359
+ return { value: desc.getValue(),
360
+ writable: desc.isWritable(),
361
+ enumerable: desc.isEnumerable(),
362
+ configurable: desc.isConfigurable() };
363
+ }
364
+ // Must be an AccessorDescriptor then. We never return a generic descriptor.
365
+ return { get: desc.getGet(),
366
+ set: desc.getSet(),
367
+ enumerable: desc.isEnumerable(),
368
+ configurable: desc.isConfigurable() };
369
+ }
370
+
371
+
372
+ // Harmony Proxies
373
+ function FromGenericPropertyDescriptor(desc) {
374
+ if (IS_UNDEFINED(desc)) return desc;
375
+ var obj = new $Object();
376
+
377
+ if (desc.hasValue()) {
378
+ %IgnoreAttributesAndSetProperty(obj, "value", desc.getValue(), NONE);
379
+ }
380
+ if (desc.hasWritable()) {
381
+ %IgnoreAttributesAndSetProperty(obj, "writable", desc.isWritable(), NONE);
382
+ }
383
+ if (desc.hasGetter()) {
384
+ %IgnoreAttributesAndSetProperty(obj, "get", desc.getGet(), NONE);
333
385
  }
334
- if (IsAccessorDescriptor(desc)) {
335
- obj.get = desc.getGet();
336
- obj.set = desc.getSet();
386
+ if (desc.hasSetter()) {
387
+ %IgnoreAttributesAndSetProperty(obj, "set", desc.getSet(), NONE);
388
+ }
389
+ if (desc.hasEnumerable()) {
390
+ %IgnoreAttributesAndSetProperty(obj, "enumerable",
391
+ desc.isEnumerable(), NONE);
392
+ }
393
+ if (desc.hasConfigurable()) {
394
+ %IgnoreAttributesAndSetProperty(obj, "configurable",
395
+ desc.isConfigurable(), NONE);
337
396
  }
338
- obj.enumerable = desc.isEnumerable();
339
- obj.configurable = desc.isConfigurable();
340
397
  return obj;
341
398
  }
342
399
 
400
+
343
401
  // ES5 8.10.5.
344
402
  function ToPropertyDescriptor(obj) {
345
403
  if (!IS_SPEC_OBJECT(obj)) {
@@ -386,6 +444,23 @@ function ToPropertyDescriptor(obj) {
386
444
  }
387
445
 
388
446
 
447
+ // For Harmony proxies.
448
+ function ToCompletePropertyDescriptor(obj) {
449
+ var desc = ToPropertyDescriptor(obj)
450
+ if (IsGenericDescriptor(desc) || IsDataDescriptor(desc)) {
451
+ if (!desc.hasValue()) desc.setValue(void 0);
452
+ if (!desc.hasWritable()) desc.setWritable(false);
453
+ } else {
454
+ // Is accessor descriptor.
455
+ if (!desc.hasGetter()) desc.setGet(void 0);
456
+ if (!desc.hasSetter()) desc.setSet(void 0);
457
+ }
458
+ if (!desc.hasEnumerable()) desc.setEnumerable(false);
459
+ if (!desc.hasConfigurable()) desc.setConfigurable(false);
460
+ return desc;
461
+ }
462
+
463
+
389
464
  function PropertyDescriptor() {
390
465
  // Initialize here so they are all in-object and have the same map.
391
466
  // Default values from ES5 8.6.1.
@@ -404,6 +479,7 @@ function PropertyDescriptor() {
404
479
  }
405
480
 
406
481
  PropertyDescriptor.prototype.__proto__ = null;
482
+
407
483
  PropertyDescriptor.prototype.toString = function() {
408
484
  return "[object PropertyDescriptor]";
409
485
  };
@@ -532,29 +608,55 @@ function ConvertDescriptorArrayToDescriptor(desc_array) {
532
608
  }
533
609
 
534
610
 
535
- // ES5 section 8.12.2.
536
- function GetProperty(obj, p) {
537
- var prop = GetOwnProperty(obj);
538
- if (!IS_UNDEFINED(prop)) return prop;
539
- var proto = obj.__proto__;
540
- if (IS_NULL(proto)) return void 0;
541
- return GetProperty(proto, p);
611
+ // For Harmony proxies.
612
+ function GetTrap(handler, name, defaultTrap) {
613
+ var trap = handler[name];
614
+ if (IS_UNDEFINED(trap)) {
615
+ if (IS_UNDEFINED(defaultTrap)) {
616
+ throw MakeTypeError("handler_trap_missing", [handler, name]);
617
+ }
618
+ trap = defaultTrap;
619
+ } else if (!IS_FUNCTION(trap)) {
620
+ throw MakeTypeError("handler_trap_must_be_callable", [handler, name]);
621
+ }
622
+ return trap;
623
+ }
624
+
625
+
626
+ function CallTrap0(handler, name, defaultTrap) {
627
+ return %_CallFunction(handler, GetTrap(handler, name, defaultTrap));
628
+ }
629
+
630
+
631
+ function CallTrap1(handler, name, defaultTrap, x) {
632
+ return %_CallFunction(handler, x, GetTrap(handler, name, defaultTrap));
542
633
  }
543
634
 
544
635
 
545
- // ES5 section 8.12.6
546
- function HasProperty(obj, p) {
547
- var desc = GetProperty(obj, p);
548
- return IS_UNDEFINED(desc) ? false : true;
636
+ function CallTrap2(handler, name, defaultTrap, x, y) {
637
+ return %_CallFunction(handler, x, y, GetTrap(handler, name, defaultTrap));
549
638
  }
550
639
 
551
640
 
552
641
  // ES5 section 8.12.1.
553
- function GetOwnProperty(obj, p) {
642
+ function GetOwnProperty(obj, v) {
643
+ var p = ToString(v);
644
+ if (%IsJSProxy(obj)) {
645
+ var handler = %GetHandler(obj);
646
+ var descriptor = CallTrap1(handler, "getOwnPropertyDescriptor", void 0, p);
647
+ if (IS_UNDEFINED(descriptor)) return descriptor;
648
+ var desc = ToCompletePropertyDescriptor(descriptor);
649
+ if (!desc.isConfigurable()) {
650
+ throw MakeTypeError("proxy_prop_not_configurable",
651
+ [handler, "getOwnPropertyDescriptor", p, descriptor]);
652
+ }
653
+ return desc;
654
+ }
655
+
554
656
  // GetOwnProperty returns an array indexed by the constants
555
657
  // defined in macros.py.
556
658
  // If p is not a property on obj undefined is returned.
557
- var props = %GetOwnProperty(ToObject(obj), ToString(p));
659
+ var props = %GetOwnProperty(ToObject(obj), ToString(v));
558
660
 
559
661
  // A false value here means that access checks failed.
560
662
  if (props === false) return void 0;
@@ -563,8 +665,29 @@ function GetOwnProperty(obj, p) {
563
665
  }
564
666
 
565
667
 
668
+ // Harmony proxies.
669
+ function DefineProxyProperty(obj, p, attributes, should_throw) {
670
+ var handler = %GetHandler(obj);
671
+ var result = CallTrap2(handler, "defineProperty", void 0, p, attributes);
672
+ if (!ToBoolean(result)) {
673
+ if (should_throw) {
674
+ throw MakeTypeError("handler_returned_false",
675
+ [handler, "defineProperty"]);
676
+ } else {
677
+ return false;
678
+ }
679
+ }
680
+ return true;
681
+ }
682
+
683
+
566
684
  // ES5 8.12.9.
567
685
  function DefineOwnProperty(obj, p, desc, should_throw) {
686
+ if (%IsJSProxy(obj)) {
687
+ var attributes = FromGenericPropertyDescriptor(desc);
688
+ return DefineProxyProperty(obj, p, attributes, should_throw);
689
+ }
690
+
568
691
  var current_or_access = %GetOwnProperty(ToObject(obj), ToString(p));
569
692
  // A false value here means that access checks failed.
570
693
  if (current_or_access === false) return void 0;
@@ -576,7 +699,7 @@ function DefineOwnProperty(obj, p, desc, should_throw) {
576
699
  // Step 3
577
700
  if (IS_UNDEFINED(current) && !extensible) {
578
701
  if (should_throw) {
579
- throw MakeTypeError("define_disallowed", ["defineProperty"]);
702
+ throw MakeTypeError("define_disallowed", [p]);
580
703
  } else {
581
704
  return;
582
705
  }
@@ -606,7 +729,7 @@ function DefineOwnProperty(obj, p, desc, should_throw) {
606
729
  (desc.hasEnumerable() &&
607
730
  desc.isEnumerable() != current.isEnumerable())) {
608
731
  if (should_throw) {
609
- throw MakeTypeError("redefine_disallowed", ["defineProperty"]);
732
+ throw MakeTypeError("redefine_disallowed", [p]);
610
733
  } else {
611
734
  return;
612
735
  }
@@ -616,7 +739,7 @@ function DefineOwnProperty(obj, p, desc, should_throw) {
616
739
  // Step 9a
617
740
  if (IsDataDescriptor(current) != IsDataDescriptor(desc)) {
618
741
  if (should_throw) {
619
- throw MakeTypeError("redefine_disallowed", ["defineProperty"]);
742
+ throw MakeTypeError("redefine_disallowed", [p]);
620
743
  } else {
621
744
  return;
622
745
  }
@@ -625,7 +748,7 @@ function DefineOwnProperty(obj, p, desc, should_throw) {
625
748
  if (IsDataDescriptor(current) && IsDataDescriptor(desc)) {
626
749
  if (!current.isWritable() && desc.isWritable()) {
627
750
  if (should_throw) {
628
- throw MakeTypeError("redefine_disallowed", ["defineProperty"]);
751
+ throw MakeTypeError("redefine_disallowed", [p]);
629
752
  } else {
630
753
  return;
631
754
  }
@@ -633,7 +756,7 @@ function DefineOwnProperty(obj, p, desc, should_throw) {
633
756
  if (!current.isWritable() && desc.hasValue() &&
634
757
  !SameValue(desc.getValue(), current.getValue())) {
635
758
  if (should_throw) {
636
- throw MakeTypeError("redefine_disallowed", ["defineProperty"]);
759
+ throw MakeTypeError("redefine_disallowed", [p]);
637
760
  } else {
638
761
  return;
639
762
  }
@@ -643,14 +766,14 @@ function DefineOwnProperty(obj, p, desc, should_throw) {
643
766
  if (IsAccessorDescriptor(desc) && IsAccessorDescriptor(current)) {
644
767
  if (desc.hasSetter() && !SameValue(desc.getSet(), current.getSet())) {
645
768
  if (should_throw) {
646
- throw MakeTypeError("redefine_disallowed", ["defineProperty"]);
769
+ throw MakeTypeError("redefine_disallowed", [p]);
647
770
  } else {
648
771
  return;
649
772
  }
650
773
  }
651
774
  if (desc.hasGetter() && !SameValue(desc.getGet(),current.getGet())) {
652
775
  if (should_throw) {
653
- throw MakeTypeError("redefine_disallowed", ["defineProperty"]);
776
+ throw MakeTypeError("redefine_disallowed", [p]);
654
777
  } else {
655
778
  return;
656
779
  }
@@ -732,24 +855,52 @@ function DefineOwnProperty(obj, p, desc, should_throw) {
732
855
  function ObjectGetPrototypeOf(obj) {
733
856
  if (!IS_SPEC_OBJECT(obj))
734
857
  throw MakeTypeError("obj_ctor_property_non_object", ["getPrototypeOf"]);
735
- return obj.__proto__;
858
+ return %GetPrototype(obj);
736
859
  }
737
860
 
738
861
 
739
862
  // ES5 section 15.2.3.3
740
863
  function ObjectGetOwnPropertyDescriptor(obj, p) {
741
864
  if (!IS_SPEC_OBJECT(obj))
742
- throw MakeTypeError("obj_ctor_property_non_object", ["getOwnPropertyDescriptor"]);
865
+ throw MakeTypeError("obj_ctor_property_non_object",
866
+ ["getOwnPropertyDescriptor"]);
743
867
  var desc = GetOwnProperty(obj, p);
744
868
  return FromPropertyDescriptor(desc);
745
869
  }
746
870
 
747
871
 
872
+ // For Harmony proxies
873
+ function ToStringArray(obj, trap) {
874
+ if (!IS_SPEC_OBJECT(obj)) {
875
+ throw MakeTypeError("proxy_non_object_prop_names", [obj, trap]);
876
+ }
877
+ var n = ToUint32(obj.length);
878
+ var array = new $Array(n);
879
+ var names = {}
880
+ for (var index = 0; index < n; index++) {
881
+ var s = ToString(obj[index]);
882
+ if (s in names) {
883
+ throw MakeTypeError("proxy_repeated_prop_name", [obj, trap, s])
884
+ }
885
+ array[index] = s;
886
+ names.s = 0;
887
+ }
888
+ return array;
889
+ }
890
+
891
+
748
892
  // ES5 section 15.2.3.4.
749
893
  function ObjectGetOwnPropertyNames(obj) {
750
894
  if (!IS_SPEC_OBJECT(obj))
751
895
  throw MakeTypeError("obj_ctor_property_non_object", ["getOwnPropertyNames"]);
752
896
 
897
+ // Special handling for proxies.
898
+ if (%IsJSProxy(obj)) {
899
+ var handler = %GetHandler(obj);
900
+ var names = CallTrap0(handler, "getOwnPropertyNames", void 0);
901
+ return ToStringArray(names, "getOwnPropertyNames");
902
+ }
903
+
753
904
  // Find all the indexed properties.
754
905
 
755
906
  // Get the local element names.
@@ -815,48 +966,98 @@ function ObjectDefineProperty(obj, p, attributes) {
815
966
  throw MakeTypeError("obj_ctor_property_non_object", ["defineProperty"]);
816
967
  }
817
968
  var name = ToString(p);
818
- var desc = ToPropertyDescriptor(attributes);
819
- DefineOwnProperty(obj, name, desc, true);
969
+ if (%IsJSProxy(obj)) {
970
+ // Clone the attributes object for protection.
971
+ // TODO(rossberg): not spec'ed yet, so not sure if this should involve
972
+ // non-own properties as it does (or non-enumerable ones, as it doesn't?).
973
+ var attributesClone = {}
974
+ for (var a in attributes) {
975
+ attributesClone[a] = attributes[a];
976
+ }
977
+ DefineProxyProperty(obj, name, attributesClone, true);
978
+ // The following would implement the spec as in the current proposal,
979
+ // but after recent comments on es-discuss, is most likely obsolete.
980
+ /*
981
+ var defineObj = FromGenericPropertyDescriptor(desc);
982
+ var names = ObjectGetOwnPropertyNames(attributes);
983
+ var standardNames =
984
+ {value: 0, writable: 0, get: 0, set: 0, enumerable: 0, configurable: 0};
985
+ for (var i = 0; i < names.length; i++) {
986
+ var N = names[i];
987
+ if (!(%HasLocalProperty(standardNames, N))) {
988
+ var attr = GetOwnProperty(attributes, N);
989
+ DefineOwnProperty(descObj, N, attr, true);
990
+ }
991
+ }
992
+ // This is really confusing the types, but it is what the proxies spec
993
+ // currently requires:
994
+ desc = descObj;
995
+ */
996
+ } else {
997
+ var desc = ToPropertyDescriptor(attributes);
998
+ DefineOwnProperty(obj, name, desc, true);
999
+ }
820
1000
  return obj;
821
1001
  }
822
1002
 
823
1003
 
1004
+ function GetOwnEnumerablePropertyNames(properties) {
1005
+ var names = new InternalArray();
1006
+ for (var key in properties) {
1007
+ if (%HasLocalProperty(properties, key)) {
1008
+ names.push(key);
1009
+ }
1010
+ }
1011
+ return names;
1012
+ }
1013
+
1014
+
824
1015
  // ES5 section 15.2.3.7.
825
1016
  function ObjectDefineProperties(obj, properties) {
826
1017
  if (!IS_SPEC_OBJECT(obj))
827
1018
  throw MakeTypeError("obj_ctor_property_non_object", ["defineProperties"]);
828
1019
  var props = ToObject(properties);
829
- var key_values = [];
830
- for (var key in props) {
831
- if (%HasLocalProperty(props, key)) {
832
- key_values.push(key);
833
- var value = props[key];
834
- var desc = ToPropertyDescriptor(value);
835
- key_values.push(desc);
836
- }
837
- }
838
- for (var i = 0; i < key_values.length; i += 2) {
839
- var key = key_values[i];
840
- var desc = key_values[i + 1];
841
- DefineOwnProperty(obj, key, desc, true);
1020
+ var names = GetOwnEnumerablePropertyNames(props);
1021
+ for (var i = 0; i < names.length; i++) {
1022
+ var name = names[i];
1023
+ var desc = ToPropertyDescriptor(props[name]);
1024
+ DefineOwnProperty(obj, name, desc, true);
842
1025
  }
843
1026
  return obj;
844
1027
  }
845
1028
 
846
1029
 
1030
+ // Harmony proxies.
1031
+ function ProxyFix(obj) {
1032
+ var handler = %GetHandler(obj);
1033
+ var props = CallTrap0(handler, "fix", void 0);
1034
+ if (IS_UNDEFINED(props)) {
1035
+ throw MakeTypeError("handler_returned_undefined", [handler, "fix"]);
1036
+ }
1037
+ %Fix(obj);
1038
+ ObjectDefineProperties(obj, props);
1039
+ }
1040
+
1041
+
847
1042
  // ES5 section 15.2.3.8.
848
1043
  function ObjectSeal(obj) {
849
1044
  if (!IS_SPEC_OBJECT(obj)) {
850
1045
  throw MakeTypeError("obj_ctor_property_non_object", ["seal"]);
851
1046
  }
1047
+ if (%IsJSProxy(obj)) {
1048
+ ProxyFix(obj);
1049
+ }
852
1050
  var names = ObjectGetOwnPropertyNames(obj);
853
1051
  for (var i = 0; i < names.length; i++) {
854
1052
  var name = names[i];
855
1053
  var desc = GetOwnProperty(obj, name);
856
- if (desc.isConfigurable()) desc.setConfigurable(false);
857
- DefineOwnProperty(obj, name, desc, true);
1054
+ if (desc.isConfigurable()) {
1055
+ desc.setConfigurable(false);
1056
+ DefineOwnProperty(obj, name, desc, true);
1057
+ }
858
1058
  }
859
- return ObjectPreventExtension(obj);
1059
+ %PreventExtensions(obj);
1060
+ return obj;
860
1061
  }
861
1062
 
862
1063
 
@@ -865,15 +1066,21 @@ function ObjectFreeze(obj) {
865
1066
  if (!IS_SPEC_OBJECT(obj)) {
866
1067
  throw MakeTypeError("obj_ctor_property_non_object", ["freeze"]);
867
1068
  }
1069
+ if (%IsJSProxy(obj)) {
1070
+ ProxyFix(obj);
1071
+ }
868
1072
  var names = ObjectGetOwnPropertyNames(obj);
869
1073
  for (var i = 0; i < names.length; i++) {
870
1074
  var name = names[i];
871
1075
  var desc = GetOwnProperty(obj, name);
872
- if (IsDataDescriptor(desc)) desc.setWritable(false);
873
- if (desc.isConfigurable()) desc.setConfigurable(false);
874
- DefineOwnProperty(obj, name, desc, true);
1076
+ if (desc.isWritable() || desc.isConfigurable()) {
1077
+ if (IsDataDescriptor(desc)) desc.setWritable(false);
1078
+ desc.setConfigurable(false);
1079
+ DefineOwnProperty(obj, name, desc, true);
1080
+ }
875
1081
  }
876
- return ObjectPreventExtension(obj);
1082
+ %PreventExtensions(obj);
1083
+ return obj;
877
1084
  }
878
1085
 
879
1086
 
@@ -882,6 +1089,9 @@ function ObjectPreventExtension(obj) {
882
1089
  if (!IS_SPEC_OBJECT(obj)) {
883
1090
  throw MakeTypeError("obj_ctor_property_non_object", ["preventExtension"]);
884
1091
  }
1092
+ if (%IsJSProxy(obj)) {
1093
+ ProxyFix(obj);
1094
+ }
885
1095
  %PreventExtensions(obj);
886
1096
  return obj;
887
1097
  }
@@ -892,6 +1102,9 @@ function ObjectIsSealed(obj) {
892
1102
  if (!IS_SPEC_OBJECT(obj)) {
893
1103
  throw MakeTypeError("obj_ctor_property_non_object", ["isSealed"]);
894
1104
  }
1105
+ if (%IsJSProxy(obj)) {
1106
+ return false;
1107
+ }
895
1108
  var names = ObjectGetOwnPropertyNames(obj);
896
1109
  for (var i = 0; i < names.length; i++) {
897
1110
  var name = names[i];
@@ -910,6 +1123,9 @@ function ObjectIsFrozen(obj) {
910
1123
  if (!IS_SPEC_OBJECT(obj)) {
911
1124
  throw MakeTypeError("obj_ctor_property_non_object", ["isFrozen"]);
912
1125
  }
1126
+ if (%IsJSProxy(obj)) {
1127
+ return false;
1128
+ }
913
1129
  var names = ObjectGetOwnPropertyNames(obj);
914
1130
  for (var i = 0; i < names.length; i++) {
915
1131
  var name = names[i];
@@ -927,7 +1143,10 @@ function ObjectIsFrozen(obj) {
927
1143
  // ES5 section 15.2.3.13
928
1144
  function ObjectIsExtensible(obj) {
929
1145
  if (!IS_SPEC_OBJECT(obj)) {
930
- throw MakeTypeError("obj_ctor_property_non_object", ["preventExtension"]);
1146
+ throw MakeTypeError("obj_ctor_property_non_object", ["isExtensible"]);
1147
+ }
1148
+ if (%IsJSProxy(obj)) {
1149
+ return true;
931
1150
  }
932
1151
  return %IsExtensible(obj);
933
1152
  }
@@ -1198,7 +1417,9 @@ function FunctionSourceString(func) {
1198
1417
  }
1199
1418
  }
1200
1419
 
1201
- var name = %FunctionGetName(func);
1420
+ var name = %FunctionNameShouldPrintAsAnonymous(func)
1421
+ ? 'anonymous'
1422
+ : %FunctionGetName(func);
1202
1423
  return 'function ' + name + source;
1203
1424
  }
1204
1425
 
@@ -1268,8 +1489,9 @@ function FunctionBind(this_arg) { // Length is 1.
1268
1489
 
1269
1490
  // Set the correct length.
1270
1491
  var length = (this.length - argc_bound) > 0 ? this.length - argc_bound : 0;
1271
- %FunctionSetLength(result, length);
1272
-
1492
+ %FunctionRemovePrototype(result);
1493
+ %FunctionSetBound(result);
1494
+ %BoundFunctionSetLength(result, length);
1273
1495
  return result;
1274
1496
  }
1275
1497
 
@@ -1292,7 +1514,7 @@ function NewFunction(arg1) { // length == 1
1292
1514
  // The call to SetNewFunctionAttributes will ensure the prototype
1293
1515
  // property of the resulting function is enumerable (ECMA262, 15.3.5.2).
1294
1516
  var f = %CompileString(source)();
1295
- %FunctionSetName(f, "anonymous");
1517
+ %FunctionMarkNameShouldPrintAsAnonymous(f);
1296
1518
  return %SetNewFunctionAttributes(f);
1297
1519
  }
1298
1520