libv8 3.11.8.17 → 3.16.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (754) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -2
  3. data/Gemfile +1 -1
  4. data/Rakefile +6 -7
  5. data/lib/libv8/version.rb +1 -1
  6. data/vendor/v8/.gitignore +24 -3
  7. data/vendor/v8/AUTHORS +7 -0
  8. data/vendor/v8/ChangeLog +839 -0
  9. data/vendor/v8/DEPS +1 -1
  10. data/vendor/v8/Makefile.android +92 -0
  11. data/vendor/v8/OWNERS +11 -0
  12. data/vendor/v8/PRESUBMIT.py +71 -0
  13. data/vendor/v8/SConstruct +34 -39
  14. data/vendor/v8/build/android.gypi +56 -37
  15. data/vendor/v8/build/common.gypi +112 -30
  16. data/vendor/v8/build/gyp_v8 +1 -1
  17. data/vendor/v8/build/standalone.gypi +15 -11
  18. data/vendor/v8/include/v8-debug.h +9 -1
  19. data/vendor/v8/include/v8-preparser.h +4 -3
  20. data/vendor/v8/include/v8-profiler.h +25 -25
  21. data/vendor/v8/include/v8-testing.h +4 -3
  22. data/vendor/v8/include/v8.h +994 -540
  23. data/vendor/v8/preparser/preparser-process.cc +3 -3
  24. data/vendor/v8/samples/lineprocessor.cc +20 -27
  25. data/vendor/v8/samples/process.cc +18 -14
  26. data/vendor/v8/samples/shell.cc +16 -15
  27. data/vendor/v8/src/SConscript +15 -14
  28. data/vendor/v8/src/accessors.cc +169 -77
  29. data/vendor/v8/src/accessors.h +4 -0
  30. data/vendor/v8/src/allocation-inl.h +2 -2
  31. data/vendor/v8/src/allocation.h +7 -7
  32. data/vendor/v8/src/api.cc +810 -497
  33. data/vendor/v8/src/api.h +85 -60
  34. data/vendor/v8/src/arm/assembler-arm-inl.h +179 -22
  35. data/vendor/v8/src/arm/assembler-arm.cc +633 -264
  36. data/vendor/v8/src/arm/assembler-arm.h +264 -197
  37. data/vendor/v8/src/arm/builtins-arm.cc +117 -27
  38. data/vendor/v8/src/arm/code-stubs-arm.cc +1241 -700
  39. data/vendor/v8/src/arm/code-stubs-arm.h +35 -138
  40. data/vendor/v8/src/arm/codegen-arm.cc +285 -16
  41. data/vendor/v8/src/arm/codegen-arm.h +22 -0
  42. data/vendor/v8/src/arm/constants-arm.cc +5 -3
  43. data/vendor/v8/src/arm/constants-arm.h +24 -11
  44. data/vendor/v8/src/arm/debug-arm.cc +3 -3
  45. data/vendor/v8/src/arm/deoptimizer-arm.cc +382 -92
  46. data/vendor/v8/src/arm/disasm-arm.cc +61 -12
  47. data/vendor/v8/src/arm/frames-arm.h +0 -14
  48. data/vendor/v8/src/arm/full-codegen-arm.cc +332 -304
  49. data/vendor/v8/src/arm/ic-arm.cc +180 -259
  50. data/vendor/v8/src/arm/lithium-arm.cc +364 -316
  51. data/vendor/v8/src/arm/lithium-arm.h +512 -275
  52. data/vendor/v8/src/arm/lithium-codegen-arm.cc +1768 -809
  53. data/vendor/v8/src/arm/lithium-codegen-arm.h +97 -35
  54. data/vendor/v8/src/arm/lithium-gap-resolver-arm.cc +12 -5
  55. data/vendor/v8/src/arm/macro-assembler-arm.cc +439 -228
  56. data/vendor/v8/src/arm/macro-assembler-arm.h +116 -70
  57. data/vendor/v8/src/arm/regexp-macro-assembler-arm.cc +54 -44
  58. data/vendor/v8/src/arm/regexp-macro-assembler-arm.h +3 -10
  59. data/vendor/v8/src/arm/simulator-arm.cc +272 -238
  60. data/vendor/v8/src/arm/simulator-arm.h +38 -8
  61. data/vendor/v8/src/arm/stub-cache-arm.cc +522 -895
  62. data/vendor/v8/src/array.js +101 -70
  63. data/vendor/v8/src/assembler.cc +270 -19
  64. data/vendor/v8/src/assembler.h +110 -15
  65. data/vendor/v8/src/ast.cc +79 -69
  66. data/vendor/v8/src/ast.h +255 -301
  67. data/vendor/v8/src/atomicops.h +7 -1
  68. data/vendor/v8/src/atomicops_internals_tsan.h +335 -0
  69. data/vendor/v8/src/bootstrapper.cc +481 -418
  70. data/vendor/v8/src/bootstrapper.h +4 -4
  71. data/vendor/v8/src/builtins.cc +498 -311
  72. data/vendor/v8/src/builtins.h +75 -47
  73. data/vendor/v8/src/checks.cc +2 -1
  74. data/vendor/v8/src/checks.h +8 -0
  75. data/vendor/v8/src/code-stubs-hydrogen.cc +253 -0
  76. data/vendor/v8/src/code-stubs.cc +249 -84
  77. data/vendor/v8/src/code-stubs.h +501 -169
  78. data/vendor/v8/src/codegen.cc +36 -18
  79. data/vendor/v8/src/codegen.h +25 -3
  80. data/vendor/v8/src/collection.js +54 -17
  81. data/vendor/v8/src/compilation-cache.cc +24 -16
  82. data/vendor/v8/src/compilation-cache.h +15 -6
  83. data/vendor/v8/src/compiler.cc +497 -195
  84. data/vendor/v8/src/compiler.h +246 -38
  85. data/vendor/v8/src/contexts.cc +64 -24
  86. data/vendor/v8/src/contexts.h +60 -29
  87. data/vendor/v8/src/conversions-inl.h +24 -14
  88. data/vendor/v8/src/conversions.h +7 -4
  89. data/vendor/v8/src/counters.cc +21 -12
  90. data/vendor/v8/src/counters.h +44 -16
  91. data/vendor/v8/src/cpu-profiler.h +1 -1
  92. data/vendor/v8/src/d8-debug.cc +2 -2
  93. data/vendor/v8/src/d8-readline.cc +13 -2
  94. data/vendor/v8/src/d8.cc +681 -273
  95. data/vendor/v8/src/d8.gyp +4 -4
  96. data/vendor/v8/src/d8.h +38 -18
  97. data/vendor/v8/src/d8.js +0 -617
  98. data/vendor/v8/src/data-flow.h +55 -0
  99. data/vendor/v8/src/date.js +1 -42
  100. data/vendor/v8/src/dateparser-inl.h +5 -1
  101. data/vendor/v8/src/debug-agent.cc +10 -15
  102. data/vendor/v8/src/debug-debugger.js +147 -149
  103. data/vendor/v8/src/debug.cc +323 -164
  104. data/vendor/v8/src/debug.h +26 -14
  105. data/vendor/v8/src/deoptimizer.cc +765 -290
  106. data/vendor/v8/src/deoptimizer.h +130 -28
  107. data/vendor/v8/src/disassembler.cc +10 -4
  108. data/vendor/v8/src/elements-kind.cc +7 -2
  109. data/vendor/v8/src/elements-kind.h +19 -0
  110. data/vendor/v8/src/elements.cc +607 -285
  111. data/vendor/v8/src/elements.h +36 -13
  112. data/vendor/v8/src/execution.cc +52 -31
  113. data/vendor/v8/src/execution.h +4 -4
  114. data/vendor/v8/src/extensions/externalize-string-extension.cc +5 -4
  115. data/vendor/v8/src/extensions/gc-extension.cc +5 -1
  116. data/vendor/v8/src/extensions/statistics-extension.cc +153 -0
  117. data/vendor/v8/src/{inspector.h → extensions/statistics-extension.h} +12 -23
  118. data/vendor/v8/src/factory.cc +101 -134
  119. data/vendor/v8/src/factory.h +36 -31
  120. data/vendor/v8/src/flag-definitions.h +102 -25
  121. data/vendor/v8/src/flags.cc +9 -5
  122. data/vendor/v8/src/frames-inl.h +10 -0
  123. data/vendor/v8/src/frames.cc +116 -26
  124. data/vendor/v8/src/frames.h +96 -12
  125. data/vendor/v8/src/full-codegen.cc +219 -74
  126. data/vendor/v8/src/full-codegen.h +63 -21
  127. data/vendor/v8/src/func-name-inferrer.cc +8 -7
  128. data/vendor/v8/src/func-name-inferrer.h +5 -3
  129. data/vendor/v8/src/gdb-jit.cc +71 -57
  130. data/vendor/v8/src/global-handles.cc +230 -101
  131. data/vendor/v8/src/global-handles.h +26 -27
  132. data/vendor/v8/src/globals.h +17 -19
  133. data/vendor/v8/src/handles-inl.h +59 -12
  134. data/vendor/v8/src/handles.cc +180 -200
  135. data/vendor/v8/src/handles.h +80 -11
  136. data/vendor/v8/src/hashmap.h +60 -40
  137. data/vendor/v8/src/heap-inl.h +107 -45
  138. data/vendor/v8/src/heap-profiler.cc +38 -19
  139. data/vendor/v8/src/heap-profiler.h +24 -14
  140. data/vendor/v8/src/heap.cc +1123 -738
  141. data/vendor/v8/src/heap.h +385 -146
  142. data/vendor/v8/src/hydrogen-instructions.cc +700 -217
  143. data/vendor/v8/src/hydrogen-instructions.h +1158 -472
  144. data/vendor/v8/src/hydrogen.cc +3319 -1662
  145. data/vendor/v8/src/hydrogen.h +411 -170
  146. data/vendor/v8/src/ia32/assembler-ia32-inl.h +46 -16
  147. data/vendor/v8/src/ia32/assembler-ia32.cc +131 -61
  148. data/vendor/v8/src/ia32/assembler-ia32.h +115 -57
  149. data/vendor/v8/src/ia32/builtins-ia32.cc +99 -5
  150. data/vendor/v8/src/ia32/code-stubs-ia32.cc +787 -495
  151. data/vendor/v8/src/ia32/code-stubs-ia32.h +10 -100
  152. data/vendor/v8/src/ia32/codegen-ia32.cc +227 -23
  153. data/vendor/v8/src/ia32/codegen-ia32.h +14 -0
  154. data/vendor/v8/src/ia32/deoptimizer-ia32.cc +428 -87
  155. data/vendor/v8/src/ia32/disasm-ia32.cc +28 -1
  156. data/vendor/v8/src/ia32/frames-ia32.h +6 -16
  157. data/vendor/v8/src/ia32/full-codegen-ia32.cc +280 -272
  158. data/vendor/v8/src/ia32/ic-ia32.cc +150 -250
  159. data/vendor/v8/src/ia32/lithium-codegen-ia32.cc +1600 -517
  160. data/vendor/v8/src/ia32/lithium-codegen-ia32.h +90 -24
  161. data/vendor/v8/src/ia32/lithium-gap-resolver-ia32.cc +10 -6
  162. data/vendor/v8/src/ia32/lithium-gap-resolver-ia32.h +2 -2
  163. data/vendor/v8/src/ia32/lithium-ia32.cc +405 -302
  164. data/vendor/v8/src/ia32/lithium-ia32.h +526 -271
  165. data/vendor/v8/src/ia32/macro-assembler-ia32.cc +378 -119
  166. data/vendor/v8/src/ia32/macro-assembler-ia32.h +62 -28
  167. data/vendor/v8/src/ia32/regexp-macro-assembler-ia32.cc +43 -30
  168. data/vendor/v8/src/ia32/regexp-macro-assembler-ia32.h +2 -10
  169. data/vendor/v8/src/ia32/stub-cache-ia32.cc +492 -678
  170. data/vendor/v8/src/ic-inl.h +9 -4
  171. data/vendor/v8/src/ic.cc +836 -923
  172. data/vendor/v8/src/ic.h +228 -247
  173. data/vendor/v8/src/incremental-marking-inl.h +26 -30
  174. data/vendor/v8/src/incremental-marking.cc +276 -248
  175. data/vendor/v8/src/incremental-marking.h +29 -37
  176. data/vendor/v8/src/interface.cc +34 -25
  177. data/vendor/v8/src/interface.h +69 -25
  178. data/vendor/v8/src/interpreter-irregexp.cc +2 -2
  179. data/vendor/v8/src/isolate.cc +382 -76
  180. data/vendor/v8/src/isolate.h +109 -56
  181. data/vendor/v8/src/json-parser.h +217 -104
  182. data/vendor/v8/src/json-stringifier.h +745 -0
  183. data/vendor/v8/src/json.js +10 -132
  184. data/vendor/v8/src/jsregexp-inl.h +106 -0
  185. data/vendor/v8/src/jsregexp.cc +517 -285
  186. data/vendor/v8/src/jsregexp.h +145 -117
  187. data/vendor/v8/src/list-inl.h +35 -22
  188. data/vendor/v8/src/list.h +46 -19
  189. data/vendor/v8/src/lithium-allocator-inl.h +22 -2
  190. data/vendor/v8/src/lithium-allocator.cc +85 -70
  191. data/vendor/v8/src/lithium-allocator.h +21 -39
  192. data/vendor/v8/src/lithium.cc +259 -5
  193. data/vendor/v8/src/lithium.h +131 -32
  194. data/vendor/v8/src/liveedit-debugger.js +52 -3
  195. data/vendor/v8/src/liveedit.cc +393 -113
  196. data/vendor/v8/src/liveedit.h +7 -3
  197. data/vendor/v8/src/log-utils.cc +4 -2
  198. data/vendor/v8/src/log.cc +170 -140
  199. data/vendor/v8/src/log.h +62 -11
  200. data/vendor/v8/src/macro-assembler.h +17 -0
  201. data/vendor/v8/src/macros.py +2 -0
  202. data/vendor/v8/src/mark-compact-inl.h +3 -23
  203. data/vendor/v8/src/mark-compact.cc +801 -830
  204. data/vendor/v8/src/mark-compact.h +154 -47
  205. data/vendor/v8/src/marking-thread.cc +85 -0
  206. data/vendor/v8/src/{inspector.cc → marking-thread.h} +32 -24
  207. data/vendor/v8/src/math.js +12 -18
  208. data/vendor/v8/src/messages.cc +18 -8
  209. data/vendor/v8/src/messages.js +314 -261
  210. data/vendor/v8/src/mips/assembler-mips-inl.h +58 -6
  211. data/vendor/v8/src/mips/assembler-mips.cc +92 -75
  212. data/vendor/v8/src/mips/assembler-mips.h +54 -60
  213. data/vendor/v8/src/mips/builtins-mips.cc +116 -17
  214. data/vendor/v8/src/mips/code-stubs-mips.cc +919 -556
  215. data/vendor/v8/src/mips/code-stubs-mips.h +22 -131
  216. data/vendor/v8/src/mips/codegen-mips.cc +281 -6
  217. data/vendor/v8/src/mips/codegen-mips.h +22 -0
  218. data/vendor/v8/src/mips/constants-mips.cc +2 -0
  219. data/vendor/v8/src/mips/constants-mips.h +12 -2
  220. data/vendor/v8/src/mips/deoptimizer-mips.cc +286 -50
  221. data/vendor/v8/src/mips/disasm-mips.cc +13 -0
  222. data/vendor/v8/src/mips/full-codegen-mips.cc +297 -284
  223. data/vendor/v8/src/mips/ic-mips.cc +182 -263
  224. data/vendor/v8/src/mips/lithium-codegen-mips.cc +1208 -556
  225. data/vendor/v8/src/mips/lithium-codegen-mips.h +72 -19
  226. data/vendor/v8/src/mips/lithium-gap-resolver-mips.cc +9 -2
  227. data/vendor/v8/src/mips/lithium-mips.cc +290 -302
  228. data/vendor/v8/src/mips/lithium-mips.h +463 -266
  229. data/vendor/v8/src/mips/macro-assembler-mips.cc +208 -115
  230. data/vendor/v8/src/mips/macro-assembler-mips.h +67 -24
  231. data/vendor/v8/src/mips/regexp-macro-assembler-mips.cc +40 -25
  232. data/vendor/v8/src/mips/regexp-macro-assembler-mips.h +3 -9
  233. data/vendor/v8/src/mips/simulator-mips.cc +112 -40
  234. data/vendor/v8/src/mips/simulator-mips.h +5 -0
  235. data/vendor/v8/src/mips/stub-cache-mips.cc +502 -884
  236. data/vendor/v8/src/mirror-debugger.js +157 -30
  237. data/vendor/v8/src/mksnapshot.cc +88 -14
  238. data/vendor/v8/src/object-observe.js +235 -0
  239. data/vendor/v8/src/objects-debug.cc +178 -176
  240. data/vendor/v8/src/objects-inl.h +1333 -486
  241. data/vendor/v8/src/objects-printer.cc +125 -43
  242. data/vendor/v8/src/objects-visiting-inl.h +578 -6
  243. data/vendor/v8/src/objects-visiting.cc +2 -2
  244. data/vendor/v8/src/objects-visiting.h +172 -79
  245. data/vendor/v8/src/objects.cc +3533 -2885
  246. data/vendor/v8/src/objects.h +1352 -1131
  247. data/vendor/v8/src/optimizing-compiler-thread.cc +152 -0
  248. data/vendor/v8/src/optimizing-compiler-thread.h +111 -0
  249. data/vendor/v8/src/parser.cc +390 -500
  250. data/vendor/v8/src/parser.h +45 -33
  251. data/vendor/v8/src/platform-cygwin.cc +10 -21
  252. data/vendor/v8/src/platform-freebsd.cc +36 -41
  253. data/vendor/v8/src/platform-linux.cc +160 -124
  254. data/vendor/v8/src/platform-macos.cc +30 -27
  255. data/vendor/v8/src/platform-nullos.cc +17 -1
  256. data/vendor/v8/src/platform-openbsd.cc +19 -50
  257. data/vendor/v8/src/platform-posix.cc +14 -0
  258. data/vendor/v8/src/platform-solaris.cc +20 -53
  259. data/vendor/v8/src/platform-win32.cc +49 -26
  260. data/vendor/v8/src/platform.h +40 -1
  261. data/vendor/v8/src/preparser.cc +8 -5
  262. data/vendor/v8/src/preparser.h +2 -2
  263. data/vendor/v8/src/prettyprinter.cc +16 -0
  264. data/vendor/v8/src/prettyprinter.h +2 -0
  265. data/vendor/v8/src/profile-generator-inl.h +1 -0
  266. data/vendor/v8/src/profile-generator.cc +209 -147
  267. data/vendor/v8/src/profile-generator.h +15 -12
  268. data/vendor/v8/src/property-details.h +46 -31
  269. data/vendor/v8/src/property.cc +27 -46
  270. data/vendor/v8/src/property.h +163 -83
  271. data/vendor/v8/src/proxy.js +7 -2
  272. data/vendor/v8/src/regexp-macro-assembler-irregexp.cc +4 -13
  273. data/vendor/v8/src/regexp-macro-assembler-irregexp.h +1 -2
  274. data/vendor/v8/src/regexp-macro-assembler-tracer.cc +1 -11
  275. data/vendor/v8/src/regexp-macro-assembler-tracer.h +0 -1
  276. data/vendor/v8/src/regexp-macro-assembler.cc +31 -14
  277. data/vendor/v8/src/regexp-macro-assembler.h +14 -11
  278. data/vendor/v8/src/regexp-stack.cc +1 -0
  279. data/vendor/v8/src/regexp.js +9 -8
  280. data/vendor/v8/src/rewriter.cc +18 -7
  281. data/vendor/v8/src/runtime-profiler.cc +52 -43
  282. data/vendor/v8/src/runtime-profiler.h +0 -25
  283. data/vendor/v8/src/runtime.cc +2006 -2023
  284. data/vendor/v8/src/runtime.h +56 -49
  285. data/vendor/v8/src/safepoint-table.cc +12 -18
  286. data/vendor/v8/src/safepoint-table.h +11 -8
  287. data/vendor/v8/src/scanner.cc +1 -0
  288. data/vendor/v8/src/scanner.h +4 -10
  289. data/vendor/v8/src/scopeinfo.cc +35 -9
  290. data/vendor/v8/src/scopeinfo.h +64 -3
  291. data/vendor/v8/src/scopes.cc +251 -156
  292. data/vendor/v8/src/scopes.h +61 -27
  293. data/vendor/v8/src/serialize.cc +348 -396
  294. data/vendor/v8/src/serialize.h +125 -114
  295. data/vendor/v8/src/small-pointer-list.h +11 -11
  296. data/vendor/v8/src/{smart-array-pointer.h → smart-pointers.h} +64 -15
  297. data/vendor/v8/src/snapshot-common.cc +64 -15
  298. data/vendor/v8/src/snapshot-empty.cc +7 -1
  299. data/vendor/v8/src/snapshot.h +9 -2
  300. data/vendor/v8/src/spaces-inl.h +17 -0
  301. data/vendor/v8/src/spaces.cc +477 -183
  302. data/vendor/v8/src/spaces.h +238 -58
  303. data/vendor/v8/src/splay-tree-inl.h +8 -7
  304. data/vendor/v8/src/splay-tree.h +24 -10
  305. data/vendor/v8/src/store-buffer.cc +12 -5
  306. data/vendor/v8/src/store-buffer.h +2 -4
  307. data/vendor/v8/src/string-search.h +22 -6
  308. data/vendor/v8/src/string-stream.cc +11 -8
  309. data/vendor/v8/src/string.js +47 -15
  310. data/vendor/v8/src/stub-cache.cc +461 -224
  311. data/vendor/v8/src/stub-cache.h +164 -102
  312. data/vendor/v8/src/sweeper-thread.cc +105 -0
  313. data/vendor/v8/src/sweeper-thread.h +81 -0
  314. data/vendor/v8/src/token.h +1 -0
  315. data/vendor/v8/src/transitions-inl.h +220 -0
  316. data/vendor/v8/src/transitions.cc +160 -0
  317. data/vendor/v8/src/transitions.h +207 -0
  318. data/vendor/v8/src/type-info.cc +182 -181
  319. data/vendor/v8/src/type-info.h +31 -19
  320. data/vendor/v8/src/unicode-inl.h +62 -106
  321. data/vendor/v8/src/unicode.cc +57 -67
  322. data/vendor/v8/src/unicode.h +45 -91
  323. data/vendor/v8/src/uri.js +57 -29
  324. data/vendor/v8/src/utils.h +105 -5
  325. data/vendor/v8/src/v8-counters.cc +54 -11
  326. data/vendor/v8/src/v8-counters.h +134 -19
  327. data/vendor/v8/src/v8.cc +29 -29
  328. data/vendor/v8/src/v8.h +1 -0
  329. data/vendor/v8/src/v8conversions.cc +26 -22
  330. data/vendor/v8/src/v8globals.h +56 -43
  331. data/vendor/v8/src/v8natives.js +83 -30
  332. data/vendor/v8/src/v8threads.cc +42 -21
  333. data/vendor/v8/src/v8threads.h +4 -1
  334. data/vendor/v8/src/v8utils.cc +9 -93
  335. data/vendor/v8/src/v8utils.h +37 -33
  336. data/vendor/v8/src/variables.cc +6 -3
  337. data/vendor/v8/src/variables.h +6 -13
  338. data/vendor/v8/src/version.cc +2 -2
  339. data/vendor/v8/src/vm-state-inl.h +11 -0
  340. data/vendor/v8/src/x64/assembler-x64-inl.h +39 -8
  341. data/vendor/v8/src/x64/assembler-x64.cc +78 -64
  342. data/vendor/v8/src/x64/assembler-x64.h +38 -33
  343. data/vendor/v8/src/x64/builtins-x64.cc +105 -7
  344. data/vendor/v8/src/x64/code-stubs-x64.cc +790 -413
  345. data/vendor/v8/src/x64/code-stubs-x64.h +10 -106
  346. data/vendor/v8/src/x64/codegen-x64.cc +210 -8
  347. data/vendor/v8/src/x64/codegen-x64.h +20 -1
  348. data/vendor/v8/src/x64/deoptimizer-x64.cc +336 -75
  349. data/vendor/v8/src/x64/disasm-x64.cc +15 -0
  350. data/vendor/v8/src/x64/frames-x64.h +0 -14
  351. data/vendor/v8/src/x64/full-codegen-x64.cc +293 -270
  352. data/vendor/v8/src/x64/ic-x64.cc +153 -251
  353. data/vendor/v8/src/x64/lithium-codegen-x64.cc +1379 -531
  354. data/vendor/v8/src/x64/lithium-codegen-x64.h +67 -23
  355. data/vendor/v8/src/x64/lithium-gap-resolver-x64.cc +2 -2
  356. data/vendor/v8/src/x64/lithium-x64.cc +349 -289
  357. data/vendor/v8/src/x64/lithium-x64.h +460 -250
  358. data/vendor/v8/src/x64/macro-assembler-x64.cc +350 -177
  359. data/vendor/v8/src/x64/macro-assembler-x64.h +67 -49
  360. data/vendor/v8/src/x64/regexp-macro-assembler-x64.cc +46 -33
  361. data/vendor/v8/src/x64/regexp-macro-assembler-x64.h +2 -3
  362. data/vendor/v8/src/x64/stub-cache-x64.cc +484 -653
  363. data/vendor/v8/src/zone-inl.h +9 -27
  364. data/vendor/v8/src/zone.cc +5 -5
  365. data/vendor/v8/src/zone.h +53 -27
  366. data/vendor/v8/test/benchmarks/testcfg.py +5 -0
  367. data/vendor/v8/test/cctest/cctest.cc +4 -0
  368. data/vendor/v8/test/cctest/cctest.gyp +3 -1
  369. data/vendor/v8/test/cctest/cctest.h +57 -9
  370. data/vendor/v8/test/cctest/cctest.status +15 -15
  371. data/vendor/v8/test/cctest/test-accessors.cc +26 -0
  372. data/vendor/v8/test/cctest/test-alloc.cc +22 -30
  373. data/vendor/v8/test/cctest/test-api.cc +1943 -314
  374. data/vendor/v8/test/cctest/test-assembler-arm.cc +133 -13
  375. data/vendor/v8/test/cctest/test-assembler-ia32.cc +1 -1
  376. data/vendor/v8/test/cctest/test-assembler-mips.cc +12 -0
  377. data/vendor/v8/test/cctest/test-ast.cc +4 -2
  378. data/vendor/v8/test/cctest/test-compiler.cc +61 -29
  379. data/vendor/v8/test/cctest/test-dataflow.cc +2 -2
  380. data/vendor/v8/test/cctest/test-debug.cc +212 -33
  381. data/vendor/v8/test/cctest/test-decls.cc +257 -11
  382. data/vendor/v8/test/cctest/test-dictionary.cc +24 -10
  383. data/vendor/v8/test/cctest/test-disasm-arm.cc +118 -1
  384. data/vendor/v8/test/cctest/test-disasm-ia32.cc +3 -2
  385. data/vendor/v8/test/cctest/test-flags.cc +14 -1
  386. data/vendor/v8/test/cctest/test-func-name-inference.cc +7 -4
  387. data/vendor/v8/test/cctest/test-global-object.cc +51 -0
  388. data/vendor/v8/test/cctest/test-hashing.cc +32 -23
  389. data/vendor/v8/test/cctest/test-heap-profiler.cc +131 -77
  390. data/vendor/v8/test/cctest/test-heap.cc +1084 -143
  391. data/vendor/v8/test/cctest/test-list.cc +1 -1
  392. data/vendor/v8/test/cctest/test-liveedit.cc +3 -2
  393. data/vendor/v8/test/cctest/test-lockers.cc +12 -13
  394. data/vendor/v8/test/cctest/test-log.cc +10 -8
  395. data/vendor/v8/test/cctest/test-macro-assembler-x64.cc +2 -2
  396. data/vendor/v8/test/cctest/test-mark-compact.cc +44 -22
  397. data/vendor/v8/test/cctest/test-object-observe.cc +434 -0
  398. data/vendor/v8/test/cctest/test-parsing.cc +86 -39
  399. data/vendor/v8/test/cctest/test-platform-linux.cc +6 -0
  400. data/vendor/v8/test/cctest/test-platform-win32.cc +7 -0
  401. data/vendor/v8/test/cctest/test-random.cc +5 -4
  402. data/vendor/v8/test/cctest/test-regexp.cc +137 -101
  403. data/vendor/v8/test/cctest/test-serialize.cc +150 -230
  404. data/vendor/v8/test/cctest/test-sockets.cc +1 -1
  405. data/vendor/v8/test/cctest/test-spaces.cc +139 -0
  406. data/vendor/v8/test/cctest/test-strings.cc +736 -74
  407. data/vendor/v8/test/cctest/test-thread-termination.cc +10 -11
  408. data/vendor/v8/test/cctest/test-threads.cc +4 -4
  409. data/vendor/v8/test/cctest/test-utils.cc +16 -0
  410. data/vendor/v8/test/cctest/test-weakmaps.cc +7 -3
  411. data/vendor/v8/test/cctest/testcfg.py +64 -5
  412. data/vendor/v8/test/es5conform/testcfg.py +5 -0
  413. data/vendor/v8/test/message/message.status +1 -1
  414. data/vendor/v8/test/message/overwritten-builtins.out +3 -0
  415. data/vendor/v8/test/message/testcfg.py +89 -8
  416. data/vendor/v8/test/message/try-catch-finally-no-message.out +26 -26
  417. data/vendor/v8/test/mjsunit/accessor-map-sharing.js +18 -2
  418. data/vendor/v8/test/mjsunit/allocation-site-info.js +126 -0
  419. data/vendor/v8/test/mjsunit/array-bounds-check-removal.js +62 -1
  420. data/vendor/v8/test/mjsunit/array-iteration.js +1 -1
  421. data/vendor/v8/test/mjsunit/array-literal-transitions.js +2 -0
  422. data/vendor/v8/test/mjsunit/array-natives-elements.js +317 -0
  423. data/vendor/v8/test/mjsunit/array-reduce.js +8 -8
  424. data/vendor/v8/test/mjsunit/array-slice.js +12 -0
  425. data/vendor/v8/test/mjsunit/array-store-and-grow.js +4 -1
  426. data/vendor/v8/test/mjsunit/assert-opt-and-deopt.js +1 -1
  427. data/vendor/v8/test/mjsunit/bugs/bug-2337.js +53 -0
  428. data/vendor/v8/test/mjsunit/compare-known-objects-slow.js +69 -0
  429. data/vendor/v8/test/mjsunit/compiler/alloc-object-huge.js +3 -1
  430. data/vendor/v8/test/mjsunit/compiler/inline-accessors.js +368 -0
  431. data/vendor/v8/test/mjsunit/compiler/inline-arguments.js +87 -1
  432. data/vendor/v8/test/mjsunit/compiler/inline-closures.js +49 -0
  433. data/vendor/v8/test/mjsunit/compiler/inline-construct.js +55 -43
  434. data/vendor/v8/test/mjsunit/compiler/inline-literals.js +39 -0
  435. data/vendor/v8/test/mjsunit/compiler/multiply-add.js +69 -0
  436. data/vendor/v8/test/mjsunit/compiler/optimized-closures.js +57 -0
  437. data/vendor/v8/test/mjsunit/compiler/parallel-proto-change.js +44 -0
  438. data/vendor/v8/test/mjsunit/compiler/property-static.js +69 -0
  439. data/vendor/v8/test/mjsunit/compiler/proto-chain-constant.js +55 -0
  440. data/vendor/v8/test/mjsunit/compiler/proto-chain-load.js +44 -0
  441. data/vendor/v8/test/mjsunit/compiler/regress-gvn.js +3 -2
  442. data/vendor/v8/test/mjsunit/compiler/regress-or.js +6 -2
  443. data/vendor/v8/test/mjsunit/compiler/rotate.js +224 -0
  444. data/vendor/v8/test/mjsunit/compiler/uint32.js +173 -0
  445. data/vendor/v8/test/mjsunit/count-based-osr.js +2 -1
  446. data/vendor/v8/test/mjsunit/d8-os.js +3 -3
  447. data/vendor/v8/test/mjsunit/date-parse.js +3 -0
  448. data/vendor/v8/test/mjsunit/date.js +22 -0
  449. data/vendor/v8/test/mjsunit/debug-break-inline.js +1 -0
  450. data/vendor/v8/test/mjsunit/debug-evaluate-locals-optimized-double.js +22 -12
  451. data/vendor/v8/test/mjsunit/debug-evaluate-locals-optimized.js +21 -10
  452. data/vendor/v8/test/mjsunit/debug-liveedit-compile-error.js +60 -0
  453. data/vendor/v8/test/mjsunit/debug-liveedit-double-call.js +142 -0
  454. data/vendor/v8/test/mjsunit/debug-liveedit-literals.js +94 -0
  455. data/vendor/v8/test/mjsunit/debug-liveedit-restart-frame.js +153 -0
  456. data/vendor/v8/test/mjsunit/debug-multiple-breakpoints.js +1 -1
  457. data/vendor/v8/test/mjsunit/debug-script-breakpoints-closure.js +67 -0
  458. data/vendor/v8/test/mjsunit/debug-script-breakpoints-nested.js +82 -0
  459. data/vendor/v8/test/mjsunit/debug-script.js +4 -2
  460. data/vendor/v8/test/mjsunit/debug-set-variable-value.js +308 -0
  461. data/vendor/v8/test/mjsunit/debug-stepout-scope-part1.js +190 -0
  462. data/vendor/v8/test/mjsunit/debug-stepout-scope-part2.js +83 -0
  463. data/vendor/v8/test/mjsunit/debug-stepout-scope-part3.js +80 -0
  464. data/vendor/v8/test/mjsunit/debug-stepout-scope-part4.js +80 -0
  465. data/vendor/v8/test/mjsunit/debug-stepout-scope-part5.js +77 -0
  466. data/vendor/v8/test/mjsunit/debug-stepout-scope-part6.js +79 -0
  467. data/vendor/v8/test/mjsunit/debug-stepout-scope-part7.js +79 -0
  468. data/vendor/v8/test/mjsunit/{debug-stepout-scope.js → debug-stepout-scope-part8.js} +0 -189
  469. data/vendor/v8/test/mjsunit/delete-non-configurable.js +74 -0
  470. data/vendor/v8/test/mjsunit/deopt-minus-zero.js +56 -0
  471. data/vendor/v8/test/mjsunit/elements-kind.js +6 -4
  472. data/vendor/v8/test/mjsunit/elements-length-no-holey.js +33 -0
  473. data/vendor/v8/test/mjsunit/elements-transition-hoisting.js +46 -19
  474. data/vendor/v8/test/mjsunit/error-accessors.js +54 -0
  475. data/vendor/v8/test/mjsunit/error-constructors.js +1 -14
  476. data/vendor/v8/test/mjsunit/error-tostring.js +8 -0
  477. data/vendor/v8/test/mjsunit/eval-stack-trace.js +204 -0
  478. data/vendor/v8/test/mjsunit/external-array.js +364 -1
  479. data/vendor/v8/test/mjsunit/fast-array-length.js +37 -0
  480. data/vendor/v8/test/mjsunit/fast-non-keyed.js +113 -0
  481. data/vendor/v8/test/mjsunit/fast-prototype.js +117 -0
  482. data/vendor/v8/test/mjsunit/function-call.js +14 -18
  483. data/vendor/v8/test/mjsunit/fuzz-natives-part1.js +230 -0
  484. data/vendor/v8/test/mjsunit/fuzz-natives-part2.js +229 -0
  485. data/vendor/v8/test/mjsunit/fuzz-natives-part3.js +229 -0
  486. data/vendor/v8/test/mjsunit/{fuzz-natives.js → fuzz-natives-part4.js} +12 -2
  487. data/vendor/v8/test/mjsunit/generated-transition-stub.js +218 -0
  488. data/vendor/v8/test/mjsunit/greedy.js +1 -1
  489. data/vendor/v8/test/mjsunit/harmony/block-conflicts.js +2 -1
  490. data/vendor/v8/test/mjsunit/harmony/block-let-crankshaft.js +1 -1
  491. data/vendor/v8/test/mjsunit/harmony/collections.js +69 -11
  492. data/vendor/v8/test/mjsunit/harmony/debug-blockscopes.js +2 -2
  493. data/vendor/v8/test/mjsunit/harmony/module-linking.js +180 -3
  494. data/vendor/v8/test/mjsunit/harmony/module-parsing.js +31 -0
  495. data/vendor/v8/test/mjsunit/harmony/module-recompile.js +87 -0
  496. data/vendor/v8/test/mjsunit/harmony/module-resolution.js +15 -2
  497. data/vendor/v8/test/mjsunit/harmony/object-observe.js +1056 -0
  498. data/vendor/v8/test/mjsunit/harmony/proxies-json.js +178 -0
  499. data/vendor/v8/test/mjsunit/harmony/proxies.js +25 -10
  500. data/vendor/v8/test/mjsunit/json-parser-recursive.js +33 -0
  501. data/vendor/v8/test/mjsunit/json-stringify-recursive.js +52 -0
  502. data/vendor/v8/test/mjsunit/json.js +38 -2
  503. data/vendor/v8/test/mjsunit/json2.js +153 -0
  504. data/vendor/v8/test/mjsunit/limit-locals.js +5 -4
  505. data/vendor/v8/test/mjsunit/manual-parallel-recompile.js +79 -0
  506. data/vendor/v8/test/mjsunit/math-exp-precision.js +64 -0
  507. data/vendor/v8/test/mjsunit/math-floor-negative.js +59 -0
  508. data/vendor/v8/test/mjsunit/math-floor-of-div-minus-zero.js +41 -0
  509. data/vendor/v8/test/mjsunit/math-floor-of-div-nosudiv.js +288 -0
  510. data/vendor/v8/test/mjsunit/math-floor-of-div.js +81 -9
  511. data/vendor/v8/test/mjsunit/{math-floor.js → math-floor-part1.js} +1 -72
  512. data/vendor/v8/test/mjsunit/math-floor-part2.js +76 -0
  513. data/vendor/v8/test/mjsunit/math-floor-part3.js +78 -0
  514. data/vendor/v8/test/mjsunit/math-floor-part4.js +76 -0
  515. data/vendor/v8/test/mjsunit/mirror-object.js +43 -9
  516. data/vendor/v8/test/mjsunit/mjsunit.js +1 -1
  517. data/vendor/v8/test/mjsunit/mjsunit.status +52 -27
  518. data/vendor/v8/test/mjsunit/mul-exhaustive-part1.js +491 -0
  519. data/vendor/v8/test/mjsunit/mul-exhaustive-part10.js +470 -0
  520. data/vendor/v8/test/mjsunit/mul-exhaustive-part2.js +525 -0
  521. data/vendor/v8/test/mjsunit/mul-exhaustive-part3.js +532 -0
  522. data/vendor/v8/test/mjsunit/mul-exhaustive-part4.js +509 -0
  523. data/vendor/v8/test/mjsunit/mul-exhaustive-part5.js +505 -0
  524. data/vendor/v8/test/mjsunit/mul-exhaustive-part6.js +554 -0
  525. data/vendor/v8/test/mjsunit/mul-exhaustive-part7.js +497 -0
  526. data/vendor/v8/test/mjsunit/mul-exhaustive-part8.js +526 -0
  527. data/vendor/v8/test/mjsunit/mul-exhaustive-part9.js +533 -0
  528. data/vendor/v8/test/mjsunit/new-function.js +34 -0
  529. data/vendor/v8/test/mjsunit/numops-fuzz-part1.js +1172 -0
  530. data/vendor/v8/test/mjsunit/numops-fuzz-part2.js +1178 -0
  531. data/vendor/v8/test/mjsunit/numops-fuzz-part3.js +1178 -0
  532. data/vendor/v8/test/mjsunit/numops-fuzz-part4.js +1177 -0
  533. data/vendor/v8/test/mjsunit/object-define-property.js +107 -2
  534. data/vendor/v8/test/mjsunit/override-read-only-property.js +6 -4
  535. data/vendor/v8/test/mjsunit/packed-elements.js +2 -2
  536. data/vendor/v8/test/mjsunit/parse-int-float.js +4 -4
  537. data/vendor/v8/test/mjsunit/pixel-array-rounding.js +1 -1
  538. data/vendor/v8/test/mjsunit/readonly.js +228 -0
  539. data/vendor/v8/test/mjsunit/regexp-capture-3.js +16 -18
  540. data/vendor/v8/test/mjsunit/regexp-capture.js +2 -0
  541. data/vendor/v8/test/mjsunit/regexp-global.js +122 -0
  542. data/vendor/v8/test/mjsunit/regexp-results-cache.js +78 -0
  543. data/vendor/v8/test/mjsunit/regress/regress-1117.js +12 -3
  544. data/vendor/v8/test/mjsunit/regress/regress-1118.js +1 -1
  545. data/vendor/v8/test/mjsunit/regress/regress-115100.js +36 -0
  546. data/vendor/v8/test/mjsunit/regress/regress-1199637.js +1 -3
  547. data/vendor/v8/test/mjsunit/regress/regress-121407.js +1 -1
  548. data/vendor/v8/test/mjsunit/regress/regress-131923.js +30 -0
  549. data/vendor/v8/test/mjsunit/regress/regress-131994.js +70 -0
  550. data/vendor/v8/test/mjsunit/regress/regress-133211.js +35 -0
  551. data/vendor/v8/test/mjsunit/regress/regress-133211b.js +39 -0
  552. data/vendor/v8/test/mjsunit/regress/regress-136048.js +34 -0
  553. data/vendor/v8/test/mjsunit/regress/regress-137768.js +73 -0
  554. data/vendor/v8/test/mjsunit/regress/regress-143967.js +34 -0
  555. data/vendor/v8/test/mjsunit/regress/regress-145201.js +107 -0
  556. data/vendor/v8/test/mjsunit/regress/regress-147497.js +45 -0
  557. data/vendor/v8/test/mjsunit/regress/regress-148378.js +38 -0
  558. data/vendor/v8/test/mjsunit/regress/regress-1563.js +1 -1
  559. data/vendor/v8/test/mjsunit/regress/regress-1591.js +48 -0
  560. data/vendor/v8/test/mjsunit/regress/regress-164442.js +45 -0
  561. data/vendor/v8/test/mjsunit/regress/regress-165637.js +61 -0
  562. data/vendor/v8/test/mjsunit/regress/regress-166379.js +39 -0
  563. data/vendor/v8/test/mjsunit/regress/regress-166553.js +33 -0
  564. data/vendor/v8/test/mjsunit/regress/regress-1692.js +1 -1
  565. data/vendor/v8/test/mjsunit/regress/regress-171641.js +40 -0
  566. data/vendor/v8/test/mjsunit/regress/regress-1980.js +1 -1
  567. data/vendor/v8/test/mjsunit/regress/regress-2073.js +99 -0
  568. data/vendor/v8/test/mjsunit/regress/regress-2119.js +36 -0
  569. data/vendor/v8/test/mjsunit/regress/regress-2156.js +39 -0
  570. data/vendor/v8/test/mjsunit/regress/regress-2163.js +70 -0
  571. data/vendor/v8/test/mjsunit/regress/regress-2170.js +58 -0
  572. data/vendor/v8/test/mjsunit/regress/regress-2172.js +35 -0
  573. data/vendor/v8/test/mjsunit/regress/regress-2185-2.js +145 -0
  574. data/vendor/v8/test/mjsunit/regress/regress-2185.js +38 -0
  575. data/vendor/v8/test/mjsunit/regress/regress-2186.js +49 -0
  576. data/vendor/v8/test/mjsunit/regress/regress-2193.js +58 -0
  577. data/vendor/v8/test/mjsunit/regress/regress-2219.js +32 -0
  578. data/vendor/v8/test/mjsunit/regress/regress-2225.js +65 -0
  579. data/vendor/v8/test/mjsunit/regress/regress-2226.js +36 -0
  580. data/vendor/v8/test/mjsunit/regress/regress-2234.js +41 -0
  581. data/vendor/v8/test/mjsunit/regress/regress-2243.js +31 -0
  582. data/vendor/v8/test/mjsunit/regress/regress-2249.js +33 -0
  583. data/vendor/v8/test/mjsunit/regress/regress-2250.js +68 -0
  584. data/vendor/v8/test/mjsunit/regress/regress-2261.js +113 -0
  585. data/vendor/v8/test/mjsunit/regress/regress-2263.js +30 -0
  586. data/vendor/v8/test/mjsunit/regress/regress-2284.js +32 -0
  587. data/vendor/v8/test/mjsunit/regress/regress-2285.js +32 -0
  588. data/vendor/v8/test/mjsunit/regress/regress-2286.js +32 -0
  589. data/vendor/v8/test/mjsunit/regress/regress-2289.js +34 -0
  590. data/vendor/v8/test/mjsunit/regress/regress-2291.js +36 -0
  591. data/vendor/v8/test/mjsunit/regress/regress-2294.js +70 -0
  592. data/vendor/v8/test/mjsunit/regress/regress-2296.js +40 -0
  593. data/vendor/v8/test/mjsunit/regress/regress-2315.js +40 -0
  594. data/vendor/v8/test/mjsunit/regress/regress-2318.js +66 -0
  595. data/vendor/v8/test/mjsunit/regress/regress-2322.js +36 -0
  596. data/vendor/v8/test/mjsunit/regress/regress-2326.js +54 -0
  597. data/vendor/v8/test/mjsunit/regress/regress-2336.js +53 -0
  598. data/vendor/v8/test/mjsunit/regress/regress-2339.js +59 -0
  599. data/vendor/v8/test/mjsunit/regress/regress-2346.js +123 -0
  600. data/vendor/v8/test/mjsunit/regress/regress-2373.js +29 -0
  601. data/vendor/v8/test/mjsunit/regress/regress-2374.js +33 -0
  602. data/vendor/v8/test/mjsunit/regress/regress-2398.js +41 -0
  603. data/vendor/v8/test/mjsunit/regress/regress-2410.js +36 -0
  604. data/vendor/v8/test/mjsunit/regress/regress-2416.js +75 -0
  605. data/vendor/v8/test/mjsunit/regress/regress-2419.js +37 -0
  606. data/vendor/v8/test/mjsunit/regress/regress-2433.js +36 -0
  607. data/vendor/v8/test/mjsunit/regress/regress-2437.js +156 -0
  608. data/vendor/v8/test/mjsunit/regress/regress-2438.js +52 -0
  609. data/vendor/v8/test/mjsunit/regress/regress-2443.js +129 -0
  610. data/vendor/v8/test/mjsunit/regress/regress-2444.js +120 -0
  611. data/vendor/v8/test/mjsunit/regress/regress-2489.js +50 -0
  612. data/vendor/v8/test/mjsunit/regress/regress-2499.js +40 -0
  613. data/vendor/v8/test/mjsunit/regress/regress-334.js +1 -1
  614. data/vendor/v8/test/mjsunit/regress/regress-492.js +39 -1
  615. data/vendor/v8/test/mjsunit/regress/regress-builtin-array-op.js +38 -0
  616. data/vendor/v8/test/mjsunit/regress/regress-cnlt-elements.js +43 -0
  617. data/vendor/v8/test/mjsunit/regress/regress-cnlt-enum-indices.js +45 -0
  618. data/vendor/v8/test/mjsunit/regress/regress-cntl-descriptors-enum.js +46 -0
  619. data/vendor/v8/test/mjsunit/regress/regress-convert-enum.js +60 -0
  620. data/vendor/v8/test/mjsunit/regress/regress-convert-enum2.js +46 -0
  621. data/vendor/v8/test/mjsunit/regress/regress-convert-transition.js +40 -0
  622. data/vendor/v8/test/mjsunit/regress/regress-crbug-119926.js +3 -1
  623. data/vendor/v8/test/mjsunit/regress/regress-crbug-125148.js +90 -0
  624. data/vendor/v8/test/mjsunit/regress/regress-crbug-134055.js +63 -0
  625. data/vendor/v8/test/mjsunit/regress/regress-crbug-134609.js +59 -0
  626. data/vendor/v8/test/mjsunit/regress/regress-crbug-135008.js +45 -0
  627. data/vendor/v8/test/mjsunit/regress/regress-crbug-135066.js +55 -0
  628. data/vendor/v8/test/mjsunit/regress/regress-crbug-137689.js +47 -0
  629. data/vendor/v8/test/mjsunit/regress/regress-crbug-138887.js +48 -0
  630. data/vendor/v8/test/mjsunit/regress/regress-crbug-140083.js +44 -0
  631. data/vendor/v8/test/mjsunit/regress/regress-crbug-142087.js +38 -0
  632. data/vendor/v8/test/mjsunit/regress/regress-crbug-142218.js +44 -0
  633. data/vendor/v8/test/mjsunit/regress/regress-crbug-145961.js +39 -0
  634. data/vendor/v8/test/mjsunit/regress/regress-crbug-146910.js +33 -0
  635. data/vendor/v8/test/mjsunit/regress/regress-crbug-147475.js +48 -0
  636. data/vendor/v8/test/mjsunit/regress/regress-crbug-148376.js +35 -0
  637. data/vendor/v8/test/mjsunit/regress/regress-crbug-150545.js +53 -0
  638. data/vendor/v8/test/mjsunit/regress/regress-crbug-150729.js +39 -0
  639. data/vendor/v8/test/mjsunit/regress/regress-crbug-157019.js +54 -0
  640. data/vendor/v8/test/mjsunit/regress/regress-crbug-157520.js +38 -0
  641. data/vendor/v8/test/mjsunit/regress/regress-crbug-158185.js +39 -0
  642. data/vendor/v8/test/mjsunit/regress/regress-crbug-160010.js +35 -0
  643. data/vendor/v8/test/mjsunit/regress/regress-crbug-162085.js +71 -0
  644. data/vendor/v8/test/mjsunit/regress/regress-crbug-168545.js +34 -0
  645. data/vendor/v8/test/mjsunit/regress/regress-crbug-170856.js +33 -0
  646. data/vendor/v8/test/mjsunit/regress/regress-crbug-172345.js +34 -0
  647. data/vendor/v8/test/mjsunit/regress/regress-crbug-173974.js +36 -0
  648. data/vendor/v8/test/mjsunit/regress/regress-crbug-18639.js +9 -5
  649. data/vendor/v8/test/mjsunit/regress/regress-debug-code-recompilation.js +2 -1
  650. data/vendor/v8/test/mjsunit/regress/regress-deep-proto.js +45 -0
  651. data/vendor/v8/test/mjsunit/regress/regress-delete-empty-double.js +40 -0
  652. data/vendor/v8/test/mjsunit/regress/regress-iteration-order.js +42 -0
  653. data/vendor/v8/test/mjsunit/regress/regress-json-stringify-gc.js +41 -0
  654. data/vendor/v8/test/mjsunit/regress/regress-latin-1.js +78 -0
  655. data/vendor/v8/test/mjsunit/regress/regress-load-elements.js +49 -0
  656. data/vendor/v8/test/mjsunit/regress/regress-observe-empty-double-array.js +38 -0
  657. data/vendor/v8/test/mjsunit/regress/regress-undefined-store-keyed-fast-element.js +37 -0
  658. data/vendor/v8/test/mjsunit/shift-for-integer-div.js +59 -0
  659. data/vendor/v8/test/mjsunit/stack-traces-gc.js +119 -0
  660. data/vendor/v8/test/mjsunit/stack-traces-overflow.js +122 -0
  661. data/vendor/v8/test/mjsunit/stack-traces.js +39 -1
  662. data/vendor/v8/test/mjsunit/str-to-num.js +7 -2
  663. data/vendor/v8/test/mjsunit/strict-mode.js +36 -11
  664. data/vendor/v8/test/mjsunit/string-charcodeat.js +3 -0
  665. data/vendor/v8/test/mjsunit/string-natives.js +72 -0
  666. data/vendor/v8/test/mjsunit/string-split.js +17 -0
  667. data/vendor/v8/test/mjsunit/testcfg.py +76 -6
  668. data/vendor/v8/test/mjsunit/tools/tickprocessor.js +4 -1
  669. data/vendor/v8/test/mjsunit/try-finally-continue.js +72 -0
  670. data/vendor/v8/test/mjsunit/typed-array-slice.js +61 -0
  671. data/vendor/v8/test/mjsunit/unbox-double-arrays.js +2 -0
  672. data/vendor/v8/test/mjsunit/uri.js +12 -0
  673. data/vendor/v8/test/mjsunit/with-readonly.js +4 -2
  674. data/vendor/v8/test/mozilla/mozilla.status +19 -113
  675. data/vendor/v8/test/mozilla/testcfg.py +122 -3
  676. data/vendor/v8/test/preparser/preparser.status +5 -0
  677. data/vendor/v8/test/preparser/strict-identifiers.pyt +1 -1
  678. data/vendor/v8/test/preparser/testcfg.py +101 -5
  679. data/vendor/v8/test/sputnik/sputnik.status +1 -1
  680. data/vendor/v8/test/sputnik/testcfg.py +5 -0
  681. data/vendor/v8/test/test262/README +2 -2
  682. data/vendor/v8/test/test262/test262.status +13 -36
  683. data/vendor/v8/test/test262/testcfg.py +102 -8
  684. data/vendor/v8/tools/android-build.sh +0 -0
  685. data/vendor/v8/tools/android-ll-prof.sh +69 -0
  686. data/vendor/v8/tools/android-run.py +109 -0
  687. data/vendor/v8/tools/android-sync.sh +105 -0
  688. data/vendor/v8/tools/bash-completion.sh +0 -0
  689. data/vendor/v8/tools/check-static-initializers.sh +0 -0
  690. data/vendor/v8/tools/common-includes.sh +15 -22
  691. data/vendor/v8/tools/disasm.py +4 -4
  692. data/vendor/v8/tools/fuzz-harness.sh +0 -0
  693. data/vendor/v8/tools/gen-postmortem-metadata.py +6 -8
  694. data/vendor/v8/tools/grokdump.py +404 -129
  695. data/vendor/v8/tools/gyp/v8.gyp +105 -43
  696. data/vendor/v8/tools/linux-tick-processor +5 -5
  697. data/vendor/v8/tools/ll_prof.py +75 -15
  698. data/vendor/v8/tools/merge-to-branch.sh +2 -2
  699. data/vendor/v8/tools/plot-timer-events +70 -0
  700. data/vendor/v8/tools/plot-timer-events.js +510 -0
  701. data/vendor/v8/tools/presubmit.py +1 -0
  702. data/vendor/v8/tools/push-to-trunk.sh +14 -4
  703. data/vendor/v8/tools/run-llprof.sh +69 -0
  704. data/vendor/v8/tools/run-tests.py +372 -0
  705. data/vendor/v8/tools/run-valgrind.py +1 -1
  706. data/vendor/v8/tools/status-file-converter.py +39 -0
  707. data/vendor/v8/tools/test-server.py +224 -0
  708. data/vendor/v8/tools/test-wrapper-gypbuild.py +13 -16
  709. data/vendor/v8/tools/test.py +10 -19
  710. data/vendor/v8/tools/testrunner/README +174 -0
  711. data/vendor/v8/tools/testrunner/__init__.py +26 -0
  712. data/vendor/v8/tools/testrunner/local/__init__.py +26 -0
  713. data/vendor/v8/tools/testrunner/local/commands.py +153 -0
  714. data/vendor/v8/tools/testrunner/local/execution.py +182 -0
  715. data/vendor/v8/tools/testrunner/local/old_statusfile.py +460 -0
  716. data/vendor/v8/tools/testrunner/local/progress.py +238 -0
  717. data/vendor/v8/tools/testrunner/local/statusfile.py +145 -0
  718. data/vendor/v8/tools/testrunner/local/testsuite.py +187 -0
  719. data/vendor/v8/tools/testrunner/local/utils.py +108 -0
  720. data/vendor/v8/tools/testrunner/local/verbose.py +99 -0
  721. data/vendor/v8/tools/testrunner/network/__init__.py +26 -0
  722. data/vendor/v8/tools/testrunner/network/distro.py +90 -0
  723. data/vendor/v8/tools/testrunner/network/endpoint.py +124 -0
  724. data/vendor/v8/tools/testrunner/network/network_execution.py +253 -0
  725. data/vendor/v8/tools/testrunner/network/perfdata.py +120 -0
  726. data/vendor/v8/tools/testrunner/objects/__init__.py +26 -0
  727. data/vendor/v8/tools/testrunner/objects/context.py +50 -0
  728. data/vendor/v8/tools/testrunner/objects/output.py +60 -0
  729. data/vendor/v8/tools/testrunner/objects/peer.py +80 -0
  730. data/vendor/v8/tools/testrunner/objects/testcase.py +83 -0
  731. data/vendor/v8/tools/testrunner/objects/workpacket.py +90 -0
  732. data/vendor/v8/tools/testrunner/server/__init__.py +26 -0
  733. data/vendor/v8/tools/testrunner/server/compression.py +111 -0
  734. data/vendor/v8/tools/testrunner/server/constants.py +51 -0
  735. data/vendor/v8/tools/testrunner/server/daemon.py +147 -0
  736. data/vendor/v8/tools/testrunner/server/local_handler.py +119 -0
  737. data/vendor/v8/tools/testrunner/server/main.py +245 -0
  738. data/vendor/v8/tools/testrunner/server/presence_handler.py +120 -0
  739. data/vendor/v8/tools/testrunner/server/signatures.py +63 -0
  740. data/vendor/v8/tools/testrunner/server/status_handler.py +112 -0
  741. data/vendor/v8/tools/testrunner/server/work_handler.py +150 -0
  742. data/vendor/v8/tools/tick-processor.html +168 -0
  743. data/vendor/v8/tools/tickprocessor-driver.js +5 -3
  744. data/vendor/v8/tools/tickprocessor.js +58 -15
  745. metadata +534 -30
  746. data/patches/add-freebsd9-and-freebsd10-to-gyp-GetFlavor.patch +0 -11
  747. data/patches/do-not-imply-vfp3-and-armv7.patch +0 -44
  748. data/patches/fPIC-on-x64.patch +0 -14
  749. data/vendor/v8/src/liveobjectlist-inl.h +0 -126
  750. data/vendor/v8/src/liveobjectlist.cc +0 -2631
  751. data/vendor/v8/src/liveobjectlist.h +0 -319
  752. data/vendor/v8/test/mjsunit/mul-exhaustive.js +0 -4629
  753. data/vendor/v8/test/mjsunit/numops-fuzz.js +0 -4609
  754. data/vendor/v8/test/mjsunit/regress/regress-1969.js +0 -5045
@@ -69,7 +69,11 @@ typedef intptr_t Atomic64;
69
69
 
70
70
  // Use AtomicWord for a machine-sized pointer. It will use the Atomic32 or
71
71
  // Atomic64 routines below, depending on your architecture.
72
+ #if defined(__OpenBSD__) && defined(__i386__)
73
+ typedef Atomic32 AtomicWord;
74
+ #else
72
75
  typedef intptr_t AtomicWord;
76
+ #endif
73
77
 
74
78
  // Atomically execute:
75
79
  // result = *ptr;
@@ -147,7 +151,9 @@ Atomic64 Release_Load(volatile const Atomic64* ptr);
147
151
  } } // namespace v8::internal
148
152
 
149
153
  // Include our platform specific implementation.
150
- #if defined(_MSC_VER) && \
154
+ #if defined(THREAD_SANITIZER)
155
+ #include "atomicops_internals_tsan.h"
156
+ #elif defined(_MSC_VER) && \
151
157
  (defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_X64))
152
158
  #include "atomicops_internals_x86_msvc.h"
153
159
  #elif defined(__APPLE__) && \
@@ -0,0 +1,335 @@
1
+ // Copyright 2012 the V8 project authors. All rights reserved.
2
+ // Redistribution and use in source and binary forms, with or without
3
+ // modification, are permitted provided that the following conditions are
4
+ // met:
5
+ //
6
+ // * Redistributions of source code must retain the above copyright
7
+ // notice, this list of conditions and the following disclaimer.
8
+ // * Redistributions in binary form must reproduce the above
9
+ // copyright notice, this list of conditions and the following
10
+ // disclaimer in the documentation and/or other materials provided
11
+ // with the distribution.
12
+ // * Neither the name of Google Inc. nor the names of its
13
+ // contributors may be used to endorse or promote products derived
14
+ // from this software without specific prior written permission.
15
+ //
16
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+
28
+
29
+ // This file is an internal atomic implementation for compiler-based
30
+ // ThreadSanitizer. Use base/atomicops.h instead.
31
+
32
+ #ifndef V8_ATOMICOPS_INTERNALS_TSAN_H_
33
+ #define V8_ATOMICOPS_INTERNALS_TSAN_H_
34
+
35
+ // This struct is not part of the public API of this module; clients may not
36
+ // use it. (However, it's exported via BASE_EXPORT because clients implicitly
37
+ // do use it at link time by inlining these functions.)
38
+ // Features of this x86. Values may not be correct before main() is run,
39
+ // but are set conservatively.
40
+ struct AtomicOps_x86CPUFeatureStruct {
41
+ bool has_amd_lock_mb_bug; // Processor has AMD memory-barrier bug; do lfence
42
+ // after acquire compare-and-swap.
43
+ bool has_sse2; // Processor has SSE2.
44
+ };
45
+ extern struct AtomicOps_x86CPUFeatureStruct
46
+ AtomicOps_Internalx86CPUFeatures;
47
+
48
+ #define ATOMICOPS_COMPILER_BARRIER() __asm__ __volatile__("" : : : "memory")
49
+
50
+ namespace v8 {
51
+ namespace internal {
52
+
53
+ #ifndef TSAN_INTERFACE_ATOMIC_H
54
+ #define TSAN_INTERFACE_ATOMIC_H
55
+
56
+ #ifdef __cplusplus
57
+ extern "C" {
58
+ #endif
59
+
60
+ typedef char __tsan_atomic8;
61
+ typedef short __tsan_atomic16; // NOLINT
62
+ typedef int __tsan_atomic32;
63
+ typedef long __tsan_atomic64; // NOLINT
64
+
65
+ typedef enum {
66
+ __tsan_memory_order_relaxed = (1 << 0) + 100500,
67
+ __tsan_memory_order_consume = (1 << 1) + 100500,
68
+ __tsan_memory_order_acquire = (1 << 2) + 100500,
69
+ __tsan_memory_order_release = (1 << 3) + 100500,
70
+ __tsan_memory_order_acq_rel = (1 << 4) + 100500,
71
+ __tsan_memory_order_seq_cst = (1 << 5) + 100500,
72
+ } __tsan_memory_order;
73
+
74
+ __tsan_atomic8 __tsan_atomic8_load(const volatile __tsan_atomic8* a,
75
+ __tsan_memory_order mo);
76
+ __tsan_atomic16 __tsan_atomic16_load(const volatile __tsan_atomic16* a,
77
+ __tsan_memory_order mo);
78
+ __tsan_atomic32 __tsan_atomic32_load(const volatile __tsan_atomic32* a,
79
+ __tsan_memory_order mo);
80
+ __tsan_atomic64 __tsan_atomic64_load(const volatile __tsan_atomic64* a,
81
+ __tsan_memory_order mo);
82
+
83
+ void __tsan_atomic8_store(volatile __tsan_atomic8* a, __tsan_atomic8 v,
84
+ __tsan_memory_order mo);
85
+ void __tsan_atomic16_store(volatile __tsan_atomic16* a, __tsan_atomic16 v,
86
+ __tsan_memory_order mo);
87
+ void __tsan_atomic32_store(volatile __tsan_atomic32* a, __tsan_atomic32 v,
88
+ __tsan_memory_order mo);
89
+ void __tsan_atomic64_store(volatile __tsan_atomic64* a, __tsan_atomic64 v,
90
+ __tsan_memory_order mo);
91
+
92
+ __tsan_atomic8 __tsan_atomic8_exchange(volatile __tsan_atomic8* a,
93
+ __tsan_atomic8 v, __tsan_memory_order mo);
94
+ __tsan_atomic16 __tsan_atomic16_exchange(volatile __tsan_atomic16* a,
95
+ __tsan_atomic16 v, __tsan_memory_order mo);
96
+ __tsan_atomic32 __tsan_atomic32_exchange(volatile __tsan_atomic32* a,
97
+ __tsan_atomic32 v, __tsan_memory_order mo);
98
+ __tsan_atomic64 __tsan_atomic64_exchange(volatile __tsan_atomic64* a,
99
+ __tsan_atomic64 v, __tsan_memory_order mo);
100
+
101
+ __tsan_atomic8 __tsan_atomic8_fetch_add(volatile __tsan_atomic8* a,
102
+ __tsan_atomic8 v, __tsan_memory_order mo);
103
+ __tsan_atomic16 __tsan_atomic16_fetch_add(volatile __tsan_atomic16* a,
104
+ __tsan_atomic16 v, __tsan_memory_order mo);
105
+ __tsan_atomic32 __tsan_atomic32_fetch_add(volatile __tsan_atomic32* a,
106
+ __tsan_atomic32 v, __tsan_memory_order mo);
107
+ __tsan_atomic64 __tsan_atomic64_fetch_add(volatile __tsan_atomic64* a,
108
+ __tsan_atomic64 v, __tsan_memory_order mo);
109
+
110
+ __tsan_atomic8 __tsan_atomic8_fetch_and(volatile __tsan_atomic8* a,
111
+ __tsan_atomic8 v, __tsan_memory_order mo);
112
+ __tsan_atomic16 __tsan_atomic16_fetch_and(volatile __tsan_atomic16* a,
113
+ __tsan_atomic16 v, __tsan_memory_order mo);
114
+ __tsan_atomic32 __tsan_atomic32_fetch_and(volatile __tsan_atomic32* a,
115
+ __tsan_atomic32 v, __tsan_memory_order mo);
116
+ __tsan_atomic64 __tsan_atomic64_fetch_and(volatile __tsan_atomic64* a,
117
+ __tsan_atomic64 v, __tsan_memory_order mo);
118
+
119
+ __tsan_atomic8 __tsan_atomic8_fetch_or(volatile __tsan_atomic8* a,
120
+ __tsan_atomic8 v, __tsan_memory_order mo);
121
+ __tsan_atomic16 __tsan_atomic16_fetch_or(volatile __tsan_atomic16* a,
122
+ __tsan_atomic16 v, __tsan_memory_order mo);
123
+ __tsan_atomic32 __tsan_atomic32_fetch_or(volatile __tsan_atomic32* a,
124
+ __tsan_atomic32 v, __tsan_memory_order mo);
125
+ __tsan_atomic64 __tsan_atomic64_fetch_or(volatile __tsan_atomic64* a,
126
+ __tsan_atomic64 v, __tsan_memory_order mo);
127
+
128
+ __tsan_atomic8 __tsan_atomic8_fetch_xor(volatile __tsan_atomic8* a,
129
+ __tsan_atomic8 v, __tsan_memory_order mo);
130
+ __tsan_atomic16 __tsan_atomic16_fetch_xor(volatile __tsan_atomic16* a,
131
+ __tsan_atomic16 v, __tsan_memory_order mo);
132
+ __tsan_atomic32 __tsan_atomic32_fetch_xor(volatile __tsan_atomic32* a,
133
+ __tsan_atomic32 v, __tsan_memory_order mo);
134
+ __tsan_atomic64 __tsan_atomic64_fetch_xor(volatile __tsan_atomic64* a,
135
+ __tsan_atomic64 v, __tsan_memory_order mo);
136
+
137
+ int __tsan_atomic8_compare_exchange_weak(volatile __tsan_atomic8* a,
138
+ __tsan_atomic8* c, __tsan_atomic8 v, __tsan_memory_order mo);
139
+ int __tsan_atomic16_compare_exchange_weak(volatile __tsan_atomic16* a,
140
+ __tsan_atomic16* c, __tsan_atomic16 v, __tsan_memory_order mo);
141
+ int __tsan_atomic32_compare_exchange_weak(volatile __tsan_atomic32* a,
142
+ __tsan_atomic32* c, __tsan_atomic32 v, __tsan_memory_order mo);
143
+ int __tsan_atomic64_compare_exchange_weak(volatile __tsan_atomic64* a,
144
+ __tsan_atomic64* c, __tsan_atomic64 v, __tsan_memory_order mo);
145
+
146
+ int __tsan_atomic8_compare_exchange_strong(volatile __tsan_atomic8* a,
147
+ __tsan_atomic8* c, __tsan_atomic8 v, __tsan_memory_order mo);
148
+ int __tsan_atomic16_compare_exchange_strong(volatile __tsan_atomic16* a,
149
+ __tsan_atomic16* c, __tsan_atomic16 v, __tsan_memory_order mo);
150
+ int __tsan_atomic32_compare_exchange_strong(volatile __tsan_atomic32* a,
151
+ __tsan_atomic32* c, __tsan_atomic32 v, __tsan_memory_order mo);
152
+ int __tsan_atomic64_compare_exchange_strong(volatile __tsan_atomic64* a,
153
+ __tsan_atomic64* c, __tsan_atomic64 v, __tsan_memory_order mo);
154
+
155
+ void __tsan_atomic_thread_fence(__tsan_memory_order mo);
156
+
157
+ #ifdef __cplusplus
158
+ } // extern "C"
159
+ #endif
160
+
161
+ #endif // #ifndef TSAN_INTERFACE_ATOMIC_H
162
+
163
+ inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
164
+ Atomic32 old_value,
165
+ Atomic32 new_value) {
166
+ Atomic32 cmp = old_value;
167
+ __tsan_atomic32_compare_exchange_strong(ptr, &cmp, new_value,
168
+ __tsan_memory_order_relaxed);
169
+ return cmp;
170
+ }
171
+
172
+ inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr,
173
+ Atomic32 new_value) {
174
+ return __tsan_atomic32_exchange(ptr, new_value,
175
+ __tsan_memory_order_relaxed);
176
+ }
177
+
178
+ inline Atomic32 Acquire_AtomicExchange(volatile Atomic32* ptr,
179
+ Atomic32 new_value) {
180
+ return __tsan_atomic32_exchange(ptr, new_value,
181
+ __tsan_memory_order_acquire);
182
+ }
183
+
184
+ inline Atomic32 Release_AtomicExchange(volatile Atomic32* ptr,
185
+ Atomic32 new_value) {
186
+ return __tsan_atomic32_exchange(ptr, new_value,
187
+ __tsan_memory_order_release);
188
+ }
189
+
190
+ inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
191
+ Atomic32 increment) {
192
+ return increment + __tsan_atomic32_fetch_add(ptr, increment,
193
+ __tsan_memory_order_relaxed);
194
+ }
195
+
196
+ inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
197
+ Atomic32 increment) {
198
+ return increment + __tsan_atomic32_fetch_add(ptr, increment,
199
+ __tsan_memory_order_acq_rel);
200
+ }
201
+
202
+ inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
203
+ Atomic32 old_value,
204
+ Atomic32 new_value) {
205
+ Atomic32 cmp = old_value;
206
+ __tsan_atomic32_compare_exchange_strong(ptr, &cmp, new_value,
207
+ __tsan_memory_order_acquire);
208
+ return cmp;
209
+ }
210
+
211
+ inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
212
+ Atomic32 old_value,
213
+ Atomic32 new_value) {
214
+ Atomic32 cmp = old_value;
215
+ __tsan_atomic32_compare_exchange_strong(ptr, &cmp, new_value,
216
+ __tsan_memory_order_release);
217
+ return cmp;
218
+ }
219
+
220
+ inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
221
+ __tsan_atomic32_store(ptr, value, __tsan_memory_order_relaxed);
222
+ }
223
+
224
+ inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) {
225
+ __tsan_atomic32_store(ptr, value, __tsan_memory_order_relaxed);
226
+ __tsan_atomic_thread_fence(__tsan_memory_order_seq_cst);
227
+ }
228
+
229
+ inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) {
230
+ __tsan_atomic32_store(ptr, value, __tsan_memory_order_release);
231
+ }
232
+
233
+ inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) {
234
+ return __tsan_atomic32_load(ptr, __tsan_memory_order_relaxed);
235
+ }
236
+
237
+ inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) {
238
+ return __tsan_atomic32_load(ptr, __tsan_memory_order_acquire);
239
+ }
240
+
241
+ inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
242
+ __tsan_atomic_thread_fence(__tsan_memory_order_seq_cst);
243
+ return __tsan_atomic32_load(ptr, __tsan_memory_order_relaxed);
244
+ }
245
+
246
+ inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr,
247
+ Atomic64 old_value,
248
+ Atomic64 new_value) {
249
+ Atomic64 cmp = old_value;
250
+ __tsan_atomic64_compare_exchange_strong(ptr, &cmp, new_value,
251
+ __tsan_memory_order_relaxed);
252
+ return cmp;
253
+ }
254
+
255
+ inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr,
256
+ Atomic64 new_value) {
257
+ return __tsan_atomic64_exchange(ptr, new_value, __tsan_memory_order_relaxed);
258
+ }
259
+
260
+ inline Atomic64 Acquire_AtomicExchange(volatile Atomic64* ptr,
261
+ Atomic64 new_value) {
262
+ return __tsan_atomic64_exchange(ptr, new_value, __tsan_memory_order_acquire);
263
+ }
264
+
265
+ inline Atomic64 Release_AtomicExchange(volatile Atomic64* ptr,
266
+ Atomic64 new_value) {
267
+ return __tsan_atomic64_exchange(ptr, new_value, __tsan_memory_order_release);
268
+ }
269
+
270
+ inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
271
+ Atomic64 increment) {
272
+ return increment + __tsan_atomic64_fetch_add(ptr, increment,
273
+ __tsan_memory_order_relaxed);
274
+ }
275
+
276
+ inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
277
+ Atomic64 increment) {
278
+ return increment + __tsan_atomic64_fetch_add(ptr, increment,
279
+ __tsan_memory_order_acq_rel);
280
+ }
281
+
282
+ inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) {
283
+ __tsan_atomic64_store(ptr, value, __tsan_memory_order_relaxed);
284
+ }
285
+
286
+ inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) {
287
+ __tsan_atomic64_store(ptr, value, __tsan_memory_order_relaxed);
288
+ __tsan_atomic_thread_fence(__tsan_memory_order_seq_cst);
289
+ }
290
+
291
+ inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) {
292
+ __tsan_atomic64_store(ptr, value, __tsan_memory_order_release);
293
+ }
294
+
295
+ inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) {
296
+ return __tsan_atomic64_load(ptr, __tsan_memory_order_relaxed);
297
+ }
298
+
299
+ inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
300
+ return __tsan_atomic64_load(ptr, __tsan_memory_order_acquire);
301
+ }
302
+
303
+ inline Atomic64 Release_Load(volatile const Atomic64* ptr) {
304
+ __tsan_atomic_thread_fence(__tsan_memory_order_seq_cst);
305
+ return __tsan_atomic64_load(ptr, __tsan_memory_order_relaxed);
306
+ }
307
+
308
+ inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
309
+ Atomic64 old_value,
310
+ Atomic64 new_value) {
311
+ Atomic64 cmp = old_value;
312
+ __tsan_atomic64_compare_exchange_strong(ptr, &cmp, new_value,
313
+ __tsan_memory_order_acquire);
314
+ return cmp;
315
+ }
316
+
317
+ inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
318
+ Atomic64 old_value,
319
+ Atomic64 new_value) {
320
+ Atomic64 cmp = old_value;
321
+ __tsan_atomic64_compare_exchange_strong(ptr, &cmp, new_value,
322
+ __tsan_memory_order_release);
323
+ return cmp;
324
+ }
325
+
326
+ inline void MemoryBarrier() {
327
+ __tsan_atomic_thread_fence(__tsan_memory_order_seq_cst);
328
+ }
329
+
330
+ } // namespace internal
331
+ } // namespace v8
332
+
333
+ #undef ATOMICOPS_COMPILER_BARRIER
334
+
335
+ #endif // V8_ATOMICOPS_INTERNALS_TSAN_H_
@@ -42,6 +42,7 @@
42
42
  #include "snapshot.h"
43
43
  #include "extensions/externalize-string-extension.h"
44
44
  #include "extensions/gc-extension.h"
45
+ #include "extensions/statistics-extension.h"
45
46
 
46
47
  namespace v8 {
47
48
  namespace internal {
@@ -95,6 +96,7 @@ void Bootstrapper::Initialize(bool create_heap_objects) {
95
96
  extensions_cache_.Initialize(create_heap_objects);
96
97
  GCExtension::Register();
97
98
  ExternalizeStringExtension::Register();
99
+ StatisticsExtension::Register();
98
100
  }
99
101
 
100
102
 
@@ -154,7 +156,7 @@ class Genesis BASE_EMBEDDED {
154
156
  Heap* heap() const { return isolate_->heap(); }
155
157
 
156
158
  private:
157
- Handle<Context> global_context_;
159
+ Handle<Context> native_context_;
158
160
  Isolate* isolate_;
159
161
 
160
162
  // There may be more than one active genesis object: When GC is
@@ -162,7 +164,7 @@ class Genesis BASE_EMBEDDED {
162
164
  // processing callbacks which may create new environments.
163
165
  Genesis* previous_;
164
166
 
165
- Handle<Context> global_context() { return global_context_; }
167
+ Handle<Context> native_context() { return native_context_; }
166
168
 
167
169
  // Creates some basic objects. Used for creating a context from scratch.
168
170
  void CreateRoots();
@@ -226,13 +228,13 @@ class Genesis BASE_EMBEDDED {
226
228
 
227
229
  // Used both for deserialized and from-scratch contexts to add the extensions
228
230
  // provided.
229
- static bool InstallExtensions(Handle<Context> global_context,
231
+ static bool InstallExtensions(Handle<Context> native_context,
230
232
  v8::ExtensionConfiguration* extensions);
231
233
  static bool InstallExtension(const char* name,
232
234
  ExtensionStates* extension_states);
233
235
  static bool InstallExtension(v8::RegisteredExtension* current,
234
236
  ExtensionStates* extension_states);
235
- static void InstallSpecialObjects(Handle<Context> global_context);
237
+ static void InstallSpecialObjects(Handle<Context> native_context);
236
238
  bool InstallJSBuiltins(Handle<JSBuiltinsObject> builtins);
237
239
  bool ConfigureApiObject(Handle<JSObject> object,
238
240
  Handle<ObjectTemplateInfo> object_template);
@@ -253,16 +255,16 @@ class Genesis BASE_EMBEDDED {
253
255
 
254
256
  Handle<Map> CreateFunctionMap(PrototypePropertyMode prototype_mode);
255
257
 
256
- Handle<DescriptorArray> ComputeFunctionInstanceDescriptor(
257
- PrototypePropertyMode prototypeMode);
258
+ void SetFunctionInstanceDescriptor(Handle<Map> map,
259
+ PrototypePropertyMode prototypeMode);
258
260
  void MakeFunctionInstancePrototypeWritable();
259
261
 
260
262
  Handle<Map> CreateStrictModeFunctionMap(
261
263
  PrototypePropertyMode prototype_mode,
262
264
  Handle<JSFunction> empty_function);
263
265
 
264
- Handle<DescriptorArray> ComputeStrictFunctionInstanceDescriptor(
265
- PrototypePropertyMode propertyMode);
266
+ void SetStrictFunctionInstanceDescriptor(Handle<Map> map,
267
+ PrototypePropertyMode propertyMode);
266
268
 
267
269
  static bool CompileBuiltin(Isolate* isolate, int index);
268
270
  static bool CompileExperimentalBuiltin(Isolate* isolate, int index);
@@ -317,7 +319,7 @@ static void SetObjectPrototype(Handle<JSObject> object, Handle<Object> proto) {
317
319
  // object.__proto__ = proto;
318
320
  Factory* factory = object->GetIsolate()->factory();
319
321
  Handle<Map> old_to_map = Handle<Map>(object->map());
320
- Handle<Map> new_to_map = factory->CopyMapDropTransitions(old_to_map);
322
+ Handle<Map> new_to_map = factory->CopyMap(old_to_map);
321
323
  new_to_map->set_prototype(*proto);
322
324
  object->set_map(*new_to_map);
323
325
  }
@@ -325,22 +327,20 @@ static void SetObjectPrototype(Handle<JSObject> object, Handle<Object> proto) {
325
327
 
326
328
  void Bootstrapper::DetachGlobal(Handle<Context> env) {
327
329
  Factory* factory = env->GetIsolate()->factory();
328
- JSGlobalProxy::cast(env->global_proxy())->set_context(*factory->null_value());
329
- SetObjectPrototype(Handle<JSObject>(env->global_proxy()),
330
- factory->null_value());
331
- env->set_global_proxy(env->global());
332
- env->global()->set_global_receiver(env->global());
330
+ Handle<JSGlobalProxy> global_proxy(JSGlobalProxy::cast(env->global_proxy()));
331
+ global_proxy->set_native_context(*factory->null_value());
332
+ SetObjectPrototype(global_proxy, factory->null_value());
333
+ env->set_global_proxy(env->global_object());
334
+ env->global_object()->set_global_receiver(env->global_object());
333
335
  }
334
336
 
335
337
 
336
338
  void Bootstrapper::ReattachGlobal(Handle<Context> env,
337
- Handle<Object> global_object) {
338
- ASSERT(global_object->IsJSGlobalProxy());
339
- Handle<JSGlobalProxy> global = Handle<JSGlobalProxy>::cast(global_object);
340
- env->global()->set_global_receiver(*global);
341
- env->set_global_proxy(*global);
342
- SetObjectPrototype(global, Handle<JSObject>(env->global()));
343
- global->set_context(*env);
339
+ Handle<JSGlobalProxy> global_proxy) {
340
+ env->global_object()->set_global_receiver(*global_proxy);
341
+ env->set_global_proxy(*global_proxy);
342
+ SetObjectPrototype(global_proxy, Handle<JSObject>(env->global_object()));
343
+ global_proxy->set_native_context(*env);
344
344
  }
345
345
 
346
346
 
@@ -353,7 +353,7 @@ static Handle<JSFunction> InstallFunction(Handle<JSObject> target,
353
353
  bool is_ecma_native) {
354
354
  Isolate* isolate = target->GetIsolate();
355
355
  Factory* factory = isolate->factory();
356
- Handle<String> symbol = factory->LookupAsciiSymbol(name);
356
+ Handle<String> symbol = factory->LookupUtf8Symbol(name);
357
357
  Handle<Code> call_code = Handle<Code>(isolate->builtins()->builtin(call));
358
358
  Handle<JSFunction> function = prototype.is_null() ?
359
359
  factory->NewFunctionWithoutPrototype(symbol, call_code) :
@@ -381,54 +381,54 @@ static Handle<JSFunction> InstallFunction(Handle<JSObject> target,
381
381
  }
382
382
 
383
383
 
384
- Handle<DescriptorArray> Genesis::ComputeFunctionInstanceDescriptor(
385
- PrototypePropertyMode prototypeMode) {
384
+ void Genesis::SetFunctionInstanceDescriptor(
385
+ Handle<Map> map, PrototypePropertyMode prototypeMode) {
386
386
  int size = (prototypeMode == DONT_ADD_PROTOTYPE) ? 4 : 5;
387
- Handle<DescriptorArray> descriptors(factory()->NewDescriptorArray(size));
387
+ Handle<DescriptorArray> descriptors(factory()->NewDescriptorArray(0, size));
388
+ DescriptorArray::WhitenessWitness witness(*descriptors);
389
+
390
+ Handle<Foreign> length(factory()->NewForeign(&Accessors::FunctionLength));
391
+ Handle<Foreign> name(factory()->NewForeign(&Accessors::FunctionName));
392
+ Handle<Foreign> args(factory()->NewForeign(&Accessors::FunctionArguments));
393
+ Handle<Foreign> caller(factory()->NewForeign(&Accessors::FunctionCaller));
394
+ Handle<Foreign> prototype;
395
+ if (prototypeMode != DONT_ADD_PROTOTYPE) {
396
+ prototype = factory()->NewForeign(&Accessors::FunctionPrototype);
397
+ }
388
398
  PropertyAttributes attribs = static_cast<PropertyAttributes>(
389
399
  DONT_ENUM | DONT_DELETE | READ_ONLY);
390
-
391
- DescriptorArray::WhitenessWitness witness(*descriptors);
400
+ map->set_instance_descriptors(*descriptors);
392
401
 
393
402
  { // Add length.
394
- Handle<Foreign> f(factory()->NewForeign(&Accessors::FunctionLength));
395
- CallbacksDescriptor d(*factory()->length_symbol(), *f, attribs);
396
- descriptors->Set(0, &d, witness);
403
+ CallbacksDescriptor d(*factory()->length_symbol(), *length, attribs);
404
+ map->AppendDescriptor(&d, witness);
397
405
  }
398
406
  { // Add name.
399
- Handle<Foreign> f(factory()->NewForeign(&Accessors::FunctionName));
400
- CallbacksDescriptor d(*factory()->name_symbol(), *f, attribs);
401
- descriptors->Set(1, &d, witness);
407
+ CallbacksDescriptor d(*factory()->name_symbol(), *name, attribs);
408
+ map->AppendDescriptor(&d, witness);
402
409
  }
403
410
  { // Add arguments.
404
- Handle<Foreign> f(factory()->NewForeign(&Accessors::FunctionArguments));
405
- CallbacksDescriptor d(*factory()->arguments_symbol(), *f, attribs);
406
- descriptors->Set(2, &d, witness);
411
+ CallbacksDescriptor d(*factory()->arguments_symbol(), *args, attribs);
412
+ map->AppendDescriptor(&d, witness);
407
413
  }
408
414
  { // Add caller.
409
- Handle<Foreign> f(factory()->NewForeign(&Accessors::FunctionCaller));
410
- CallbacksDescriptor d(*factory()->caller_symbol(), *f, attribs);
411
- descriptors->Set(3, &d, witness);
415
+ CallbacksDescriptor d(*factory()->caller_symbol(), *caller, attribs);
416
+ map->AppendDescriptor(&d, witness);
412
417
  }
413
418
  if (prototypeMode != DONT_ADD_PROTOTYPE) {
414
419
  // Add prototype.
415
420
  if (prototypeMode == ADD_WRITEABLE_PROTOTYPE) {
416
421
  attribs = static_cast<PropertyAttributes>(attribs & ~READ_ONLY);
417
422
  }
418
- Handle<Foreign> f(factory()->NewForeign(&Accessors::FunctionPrototype));
419
- CallbacksDescriptor d(*factory()->prototype_symbol(), *f, attribs);
420
- descriptors->Set(4, &d, witness);
423
+ CallbacksDescriptor d(*factory()->prototype_symbol(), *prototype, attribs);
424
+ map->AppendDescriptor(&d, witness);
421
425
  }
422
- descriptors->Sort(witness);
423
- return descriptors;
424
426
  }
425
427
 
426
428
 
427
429
  Handle<Map> Genesis::CreateFunctionMap(PrototypePropertyMode prototype_mode) {
428
430
  Handle<Map> map = factory()->NewMap(JS_FUNCTION_TYPE, JSFunction::kSize);
429
- Handle<DescriptorArray> descriptors =
430
- ComputeFunctionInstanceDescriptor(prototype_mode);
431
- map->set_instance_descriptors(*descriptors);
431
+ SetFunctionInstanceDescriptor(map, prototype_mode);
432
432
  map->set_function_with_prototype(prototype_mode != DONT_ADD_PROTOTYPE);
433
433
  return map;
434
434
  }
@@ -442,20 +442,20 @@ Handle<JSFunction> Genesis::CreateEmptyFunction(Isolate* isolate) {
442
442
  // writable.
443
443
  Handle<Map> function_instance_map =
444
444
  CreateFunctionMap(ADD_WRITEABLE_PROTOTYPE);
445
- global_context()->set_function_instance_map(*function_instance_map);
445
+ native_context()->set_function_instance_map(*function_instance_map);
446
446
 
447
447
  // Functions with this map will not have a 'prototype' property, and
448
448
  // can not be used as constructors.
449
449
  Handle<Map> function_without_prototype_map =
450
450
  CreateFunctionMap(DONT_ADD_PROTOTYPE);
451
- global_context()->set_function_without_prototype_map(
451
+ native_context()->set_function_without_prototype_map(
452
452
  *function_without_prototype_map);
453
453
 
454
454
  // Allocate the function map. This map is temporary, used only for processing
455
455
  // of builtins.
456
456
  // Later the map is replaced with writable prototype map, allocated below.
457
457
  Handle<Map> function_map = CreateFunctionMap(ADD_READONLY_PROTOTYPE);
458
- global_context()->set_function_map(*function_map);
458
+ native_context()->set_function_map(*function_map);
459
459
 
460
460
  // The final map for functions. Writeable prototype.
461
461
  // This map is installed in MakeFunctionInstancePrototypeWritable.
@@ -475,22 +475,21 @@ Handle<JSFunction> Genesis::CreateEmptyFunction(Isolate* isolate) {
475
475
  object_fun->set_initial_map(*object_function_map);
476
476
  object_function_map->set_constructor(*object_fun);
477
477
 
478
- global_context()->set_object_function(*object_fun);
478
+ native_context()->set_object_function(*object_fun);
479
479
 
480
480
  // Allocate a new prototype for the object function.
481
481
  Handle<JSObject> prototype = factory->NewJSObject(
482
482
  isolate->object_function(),
483
483
  TENURED);
484
484
 
485
- global_context()->set_initial_object_prototype(*prototype);
485
+ native_context()->set_initial_object_prototype(*prototype);
486
486
  SetPrototype(object_fun, prototype);
487
- object_function_map->set_instance_descriptors(
488
- heap->empty_descriptor_array());
489
487
  }
490
488
 
491
489
  // Allocate the empty function as the prototype for function ECMAScript
492
490
  // 262 15.3.4.
493
- Handle<String> symbol = factory->LookupAsciiSymbol("Empty");
491
+ Handle<String> symbol =
492
+ factory->LookupOneByteSymbol(STATIC_ASCII_VECTOR("Empty"));
494
493
  Handle<JSFunction> empty_function =
495
494
  factory->NewFunctionWithoutPrototype(symbol, CLASSIC_MODE);
496
495
 
@@ -500,7 +499,8 @@ Handle<JSFunction> Genesis::CreateEmptyFunction(Isolate* isolate) {
500
499
  Builtins::kEmptyFunction));
501
500
  empty_function->set_code(*code);
502
501
  empty_function->shared()->set_code(*code);
503
- Handle<String> source = factory->NewStringFromAscii(CStrVector("() {}"));
502
+ Handle<String> source =
503
+ factory->NewStringFromOneByte(STATIC_ASCII_VECTOR("() {}"));
504
504
  Handle<Script> script = factory->NewScript(source);
505
505
  script->set_type(Smi::FromInt(Script::TYPE_NATIVE));
506
506
  empty_function->shared()->set_script(*script);
@@ -509,76 +509,77 @@ Handle<JSFunction> Genesis::CreateEmptyFunction(Isolate* isolate) {
509
509
  empty_function->shared()->DontAdaptArguments();
510
510
 
511
511
  // Set prototypes for the function maps.
512
- global_context()->function_map()->set_prototype(*empty_function);
513
- global_context()->function_instance_map()->set_prototype(*empty_function);
514
- global_context()->function_without_prototype_map()->
512
+ native_context()->function_map()->set_prototype(*empty_function);
513
+ native_context()->function_instance_map()->set_prototype(*empty_function);
514
+ native_context()->function_without_prototype_map()->
515
515
  set_prototype(*empty_function);
516
516
  function_instance_map_writable_prototype_->set_prototype(*empty_function);
517
517
 
518
518
  // Allocate the function map first and then patch the prototype later
519
519
  Handle<Map> empty_function_map = CreateFunctionMap(DONT_ADD_PROTOTYPE);
520
520
  empty_function_map->set_prototype(
521
- global_context()->object_function()->prototype());
521
+ native_context()->object_function()->prototype());
522
522
  empty_function->set_map(*empty_function_map);
523
523
  return empty_function;
524
524
  }
525
525
 
526
526
 
527
- Handle<DescriptorArray> Genesis::ComputeStrictFunctionInstanceDescriptor(
528
- PrototypePropertyMode prototypeMode) {
527
+ void Genesis::SetStrictFunctionInstanceDescriptor(
528
+ Handle<Map> map, PrototypePropertyMode prototypeMode) {
529
529
  int size = (prototypeMode == DONT_ADD_PROTOTYPE) ? 4 : 5;
530
- Handle<DescriptorArray> descriptors(factory()->NewDescriptorArray(size));
530
+ Handle<DescriptorArray> descriptors(factory()->NewDescriptorArray(0, size));
531
+ DescriptorArray::WhitenessWitness witness(*descriptors);
532
+
533
+ Handle<Foreign> length(factory()->NewForeign(&Accessors::FunctionLength));
534
+ Handle<Foreign> name(factory()->NewForeign(&Accessors::FunctionName));
535
+ Handle<AccessorPair> arguments(factory()->NewAccessorPair());
536
+ Handle<AccessorPair> caller(factory()->NewAccessorPair());
537
+ Handle<Foreign> prototype;
538
+ if (prototypeMode != DONT_ADD_PROTOTYPE) {
539
+ prototype = factory()->NewForeign(&Accessors::FunctionPrototype);
540
+ }
531
541
  PropertyAttributes attribs = static_cast<PropertyAttributes>(
532
542
  DONT_ENUM | DONT_DELETE);
533
-
534
- DescriptorArray::WhitenessWitness witness(*descriptors);
543
+ map->set_instance_descriptors(*descriptors);
535
544
 
536
545
  { // Add length.
537
- Handle<Foreign> f(factory()->NewForeign(&Accessors::FunctionLength));
538
- CallbacksDescriptor d(*factory()->length_symbol(), *f, attribs);
539
- descriptors->Set(0, &d, witness);
546
+ CallbacksDescriptor d(*factory()->length_symbol(), *length, attribs);
547
+ map->AppendDescriptor(&d, witness);
540
548
  }
541
549
  { // Add name.
542
- Handle<Foreign> f(factory()->NewForeign(&Accessors::FunctionName));
543
- CallbacksDescriptor d(*factory()->name_symbol(), *f, attribs);
544
- descriptors->Set(1, &d, witness);
550
+ CallbacksDescriptor d(*factory()->name_symbol(), *name, attribs);
551
+ map->AppendDescriptor(&d, witness);
545
552
  }
546
553
  { // Add arguments.
547
- Handle<AccessorPair> arguments(factory()->NewAccessorPair());
548
554
  CallbacksDescriptor d(*factory()->arguments_symbol(), *arguments, attribs);
549
- descriptors->Set(2, &d, witness);
555
+ map->AppendDescriptor(&d, witness);
550
556
  }
551
557
  { // Add caller.
552
- Handle<AccessorPair> caller(factory()->NewAccessorPair());
553
558
  CallbacksDescriptor d(*factory()->caller_symbol(), *caller, attribs);
554
- descriptors->Set(3, &d, witness);
559
+ map->AppendDescriptor(&d, witness);
555
560
  }
556
-
557
561
  if (prototypeMode != DONT_ADD_PROTOTYPE) {
558
562
  // Add prototype.
559
563
  if (prototypeMode != ADD_WRITEABLE_PROTOTYPE) {
560
564
  attribs = static_cast<PropertyAttributes>(attribs | READ_ONLY);
561
565
  }
562
- Handle<Foreign> f(factory()->NewForeign(&Accessors::FunctionPrototype));
563
- CallbacksDescriptor d(*factory()->prototype_symbol(), *f, attribs);
564
- descriptors->Set(4, &d, witness);
566
+ CallbacksDescriptor d(*factory()->prototype_symbol(), *prototype, attribs);
567
+ map->AppendDescriptor(&d, witness);
565
568
  }
566
-
567
- descriptors->Sort(witness);
568
- return descriptors;
569
569
  }
570
570
 
571
571
 
572
572
  // ECMAScript 5th Edition, 13.2.3
573
573
  Handle<JSFunction> Genesis::GetThrowTypeErrorFunction() {
574
574
  if (throw_type_error_function.is_null()) {
575
- Handle<String> name = factory()->LookupAsciiSymbol("ThrowTypeError");
575
+ Handle<String> name = factory()->LookupOneByteSymbol(
576
+ STATIC_ASCII_VECTOR("ThrowTypeError"));
576
577
  throw_type_error_function =
577
578
  factory()->NewFunctionWithoutPrototype(name, CLASSIC_MODE);
578
579
  Handle<Code> code(isolate()->builtins()->builtin(
579
580
  Builtins::kStrictModePoisonPill));
580
581
  throw_type_error_function->set_map(
581
- global_context()->function_map());
582
+ native_context()->function_map());
582
583
  throw_type_error_function->set_code(*code);
583
584
  throw_type_error_function->shared()->set_code(*code);
584
585
  throw_type_error_function->shared()->DontAdaptArguments();
@@ -593,9 +594,7 @@ Handle<Map> Genesis::CreateStrictModeFunctionMap(
593
594
  PrototypePropertyMode prototype_mode,
594
595
  Handle<JSFunction> empty_function) {
595
596
  Handle<Map> map = factory()->NewMap(JS_FUNCTION_TYPE, JSFunction::kSize);
596
- Handle<DescriptorArray> descriptors =
597
- ComputeStrictFunctionInstanceDescriptor(prototype_mode);
598
- map->set_instance_descriptors(*descriptors);
597
+ SetStrictFunctionInstanceDescriptor(map, prototype_mode);
599
598
  map->set_function_with_prototype(prototype_mode != DONT_ADD_PROTOTYPE);
600
599
  map->set_prototype(*empty_function);
601
600
  return map;
@@ -606,13 +605,13 @@ void Genesis::CreateStrictModeFunctionMaps(Handle<JSFunction> empty) {
606
605
  // Allocate map for the strict mode function instances.
607
606
  Handle<Map> strict_mode_function_instance_map =
608
607
  CreateStrictModeFunctionMap(ADD_WRITEABLE_PROTOTYPE, empty);
609
- global_context()->set_strict_mode_function_instance_map(
608
+ native_context()->set_strict_mode_function_instance_map(
610
609
  *strict_mode_function_instance_map);
611
610
 
612
611
  // Allocate map for the prototype-less strict mode instances.
613
612
  Handle<Map> strict_mode_function_without_prototype_map =
614
613
  CreateStrictModeFunctionMap(DONT_ADD_PROTOTYPE, empty);
615
- global_context()->set_strict_mode_function_without_prototype_map(
614
+ native_context()->set_strict_mode_function_without_prototype_map(
616
615
  *strict_mode_function_without_prototype_map);
617
616
 
618
617
  // Allocate map for the strict mode functions. This map is temporary, used
@@ -620,7 +619,7 @@ void Genesis::CreateStrictModeFunctionMaps(Handle<JSFunction> empty) {
620
619
  // Later the map is replaced with writable prototype map, allocated below.
621
620
  Handle<Map> strict_mode_function_map =
622
621
  CreateStrictModeFunctionMap(ADD_READONLY_PROTOTYPE, empty);
623
- global_context()->set_strict_mode_function_map(
622
+ native_context()->set_strict_mode_function_map(
624
623
  *strict_mode_function_map);
625
624
 
626
625
  // The final map for the strict mode functions. Writeable prototype.
@@ -641,7 +640,7 @@ static void SetAccessors(Handle<Map> map,
641
640
  Handle<String> name,
642
641
  Handle<JSFunction> func) {
643
642
  DescriptorArray* descs = map->instance_descriptors();
644
- int number = descs->Search(*name);
643
+ int number = descs->SearchWithCache(*name, *map);
645
644
  AccessorPair* accessors = AccessorPair::cast(descs->GetValue(number));
646
645
  accessors->set_getter(*func);
647
646
  accessors->set_setter(*func);
@@ -654,39 +653,39 @@ void Genesis::PoisonArgumentsAndCaller(Handle<Map> map) {
654
653
  }
655
654
 
656
655
 
657
- static void AddToWeakGlobalContextList(Context* context) {
658
- ASSERT(context->IsGlobalContext());
656
+ static void AddToWeakNativeContextList(Context* context) {
657
+ ASSERT(context->IsNativeContext());
659
658
  Heap* heap = context->GetIsolate()->heap();
660
659
  #ifdef DEBUG
661
660
  { // NOLINT
662
661
  ASSERT(context->get(Context::NEXT_CONTEXT_LINK)->IsUndefined());
663
662
  // Check that context is not in the list yet.
664
- for (Object* current = heap->global_contexts_list();
663
+ for (Object* current = heap->native_contexts_list();
665
664
  !current->IsUndefined();
666
665
  current = Context::cast(current)->get(Context::NEXT_CONTEXT_LINK)) {
667
666
  ASSERT(current != context);
668
667
  }
669
668
  }
670
669
  #endif
671
- context->set(Context::NEXT_CONTEXT_LINK, heap->global_contexts_list());
672
- heap->set_global_contexts_list(context);
670
+ context->set(Context::NEXT_CONTEXT_LINK, heap->native_contexts_list());
671
+ heap->set_native_contexts_list(context);
673
672
  }
674
673
 
675
674
 
676
675
  void Genesis::CreateRoots() {
677
- // Allocate the global context FixedArray first and then patch the
676
+ // Allocate the native context FixedArray first and then patch the
678
677
  // closure and extension object later (we need the empty function
679
678
  // and the global object, but in order to create those, we need the
680
- // global context).
681
- global_context_ = Handle<Context>::cast(isolate()->global_handles()->Create(
682
- *factory()->NewGlobalContext()));
683
- AddToWeakGlobalContextList(*global_context_);
684
- isolate()->set_context(*global_context());
679
+ // native context).
680
+ native_context_ = Handle<Context>::cast(isolate()->global_handles()->Create(
681
+ *factory()->NewNativeContext()));
682
+ AddToWeakNativeContextList(*native_context_);
683
+ isolate()->set_context(*native_context());
685
684
 
686
685
  // Allocate the message listeners object.
687
686
  {
688
687
  v8::NeanderArray listeners;
689
- global_context()->set_message_listeners(*listeners.value());
688
+ native_context()->set_message_listeners(*listeners.value());
690
689
  }
691
690
  }
692
691
 
@@ -749,6 +748,7 @@ Handle<JSGlobalProxy> Genesis::CreateNewGlobals(
749
748
  }
750
749
 
751
750
  js_global_function->initial_map()->set_is_hidden_prototype();
751
+ js_global_function->initial_map()->set_dictionary_map(true);
752
752
  Handle<GlobalObject> inner_global =
753
753
  factory()->NewGlobalObject(js_global_function);
754
754
  if (inner_global_out != NULL) {
@@ -774,7 +774,8 @@ Handle<JSGlobalProxy> Genesis::CreateNewGlobals(
774
774
  factory()->OuterGlobalObject);
775
775
  }
776
776
 
777
- Handle<String> global_name = factory()->LookupAsciiSymbol("global");
777
+ Handle<String> global_name = factory()->LookupOneByteSymbol(
778
+ STATIC_ASCII_VECTOR("global"));
778
779
  global_proxy_function->shared()->set_instance_class_name(*global_name);
779
780
  global_proxy_function->initial_map()->set_is_access_check_needed(true);
780
781
 
@@ -795,25 +796,27 @@ Handle<JSGlobalProxy> Genesis::CreateNewGlobals(
795
796
 
796
797
  void Genesis::HookUpGlobalProxy(Handle<GlobalObject> inner_global,
797
798
  Handle<JSGlobalProxy> global_proxy) {
798
- // Set the global context for the global object.
799
- inner_global->set_global_context(*global_context());
799
+ // Set the native context for the global object.
800
+ inner_global->set_native_context(*native_context());
801
+ inner_global->set_global_context(*native_context());
800
802
  inner_global->set_global_receiver(*global_proxy);
801
- global_proxy->set_context(*global_context());
802
- global_context()->set_global_proxy(*global_proxy);
803
+ global_proxy->set_native_context(*native_context());
804
+ native_context()->set_global_proxy(*global_proxy);
803
805
  }
804
806
 
805
807
 
806
808
  void Genesis::HookUpInnerGlobal(Handle<GlobalObject> inner_global) {
807
809
  Handle<GlobalObject> inner_global_from_snapshot(
808
- GlobalObject::cast(global_context_->extension()));
809
- Handle<JSBuiltinsObject> builtins_global(global_context_->builtins());
810
- global_context_->set_extension(*inner_global);
811
- global_context_->set_global(*inner_global);
812
- global_context_->set_security_token(*inner_global);
810
+ GlobalObject::cast(native_context_->extension()));
811
+ Handle<JSBuiltinsObject> builtins_global(native_context_->builtins());
812
+ native_context_->set_extension(*inner_global);
813
+ native_context_->set_global_object(*inner_global);
814
+ native_context_->set_security_token(*inner_global);
813
815
  static const PropertyAttributes attributes =
814
816
  static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE);
815
817
  ForceSetProperty(builtins_global,
816
- factory()->LookupAsciiSymbol("global"),
818
+ factory()->LookupOneByteSymbol(
819
+ STATIC_ASCII_VECTOR("global")),
817
820
  inner_global,
818
821
  attributes);
819
822
  // Set up the reference from the global object to the builtins object.
@@ -829,16 +832,16 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
829
832
  Handle<JSFunction> empty_function) {
830
833
  // --- G l o b a l C o n t e x t ---
831
834
  // Use the empty function as closure (no scope info).
832
- global_context()->set_closure(*empty_function);
833
- global_context()->set_previous(NULL);
835
+ native_context()->set_closure(*empty_function);
836
+ native_context()->set_previous(NULL);
834
837
  // Set extension and global object.
835
- global_context()->set_extension(*inner_global);
836
- global_context()->set_global(*inner_global);
838
+ native_context()->set_extension(*inner_global);
839
+ native_context()->set_global_object(*inner_global);
837
840
  // Security setup: Set the security token of the global object to
838
841
  // its the inner global. This makes the security check between two
839
842
  // different contexts fail by default even in case of global
840
843
  // object reinitialization.
841
- global_context()->set_security_token(*inner_global);
844
+ native_context()->set_security_token(*inner_global);
842
845
 
843
846
  Isolate* isolate = inner_global->GetIsolate();
844
847
  Factory* factory = isolate->factory();
@@ -850,7 +853,7 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
850
853
  inner_global, object_name,
851
854
  isolate->object_function(), DONT_ENUM));
852
855
 
853
- Handle<JSObject> global = Handle<JSObject>(global_context()->global());
856
+ Handle<JSObject> global = Handle<JSObject>(native_context()->global_object());
854
857
 
855
858
  // Install global Function object
856
859
  InstallFunction(global, "Function", JS_FUNCTION_TYPE, JSFunction::kSize,
@@ -868,19 +871,27 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
868
871
  // This seems a bit hackish, but we need to make sure Array.length
869
872
  // is 1.
870
873
  array_function->shared()->set_length(1);
871
- Handle<DescriptorArray> array_descriptors =
872
- factory->CopyAppendForeignDescriptor(
873
- factory->empty_descriptor_array(),
874
- factory->length_symbol(),
875
- factory->NewForeign(&Accessors::ArrayLength),
876
- static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE));
874
+
875
+ Handle<Map> initial_map(array_function->initial_map());
876
+ Handle<DescriptorArray> array_descriptors(
877
+ factory->NewDescriptorArray(0, 1));
878
+ DescriptorArray::WhitenessWitness witness(*array_descriptors);
879
+
880
+ Handle<Foreign> array_length(factory->NewForeign(&Accessors::ArrayLength));
881
+ PropertyAttributes attribs = static_cast<PropertyAttributes>(
882
+ DONT_ENUM | DONT_DELETE);
883
+ initial_map->set_instance_descriptors(*array_descriptors);
884
+
885
+ { // Add length.
886
+ CallbacksDescriptor d(*factory->length_symbol(), *array_length, attribs);
887
+ array_function->initial_map()->AppendDescriptor(&d, witness);
888
+ }
877
889
 
878
890
  // array_function is used internally. JS code creating array object should
879
891
  // search for the 'Array' property on the global object and use that one
880
892
  // as the constructor. 'Array' property on a global object can be
881
893
  // overwritten by JS code.
882
- global_context()->set_array_function(*array_function);
883
- array_function->initial_map()->set_instance_descriptors(*array_descriptors);
894
+ native_context()->set_array_function(*array_function);
884
895
  }
885
896
 
886
897
  { // --- N u m b e r ---
@@ -888,7 +899,7 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
888
899
  InstallFunction(global, "Number", JS_VALUE_TYPE, JSValue::kSize,
889
900
  isolate->initial_object_prototype(),
890
901
  Builtins::kIllegal, true);
891
- global_context()->set_number_function(*number_fun);
902
+ native_context()->set_number_function(*number_fun);
892
903
  }
893
904
 
894
905
  { // --- B o o l e a n ---
@@ -896,7 +907,7 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
896
907
  InstallFunction(global, "Boolean", JS_VALUE_TYPE, JSValue::kSize,
897
908
  isolate->initial_object_prototype(),
898
909
  Builtins::kIllegal, true);
899
- global_context()->set_boolean_function(*boolean_fun);
910
+ native_context()->set_boolean_function(*boolean_fun);
900
911
  }
901
912
 
902
913
  { // --- S t r i n g ---
@@ -906,20 +917,24 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
906
917
  Builtins::kIllegal, true);
907
918
  string_fun->shared()->set_construct_stub(
908
919
  isolate->builtins()->builtin(Builtins::kStringConstructCode));
909
- global_context()->set_string_function(*string_fun);
910
- // Add 'length' property to strings.
911
- Handle<DescriptorArray> string_descriptors =
912
- factory->CopyAppendForeignDescriptor(
913
- factory->empty_descriptor_array(),
914
- factory->length_symbol(),
915
- factory->NewForeign(&Accessors::StringLength),
916
- static_cast<PropertyAttributes>(DONT_ENUM |
917
- DONT_DELETE |
918
- READ_ONLY));
920
+ native_context()->set_string_function(*string_fun);
919
921
 
920
922
  Handle<Map> string_map =
921
- Handle<Map>(global_context()->string_function()->initial_map());
923
+ Handle<Map>(native_context()->string_function()->initial_map());
924
+ Handle<DescriptorArray> string_descriptors(
925
+ factory->NewDescriptorArray(0, 1));
926
+ DescriptorArray::WhitenessWitness witness(*string_descriptors);
927
+
928
+ Handle<Foreign> string_length(
929
+ factory->NewForeign(&Accessors::StringLength));
930
+ PropertyAttributes attribs = static_cast<PropertyAttributes>(
931
+ DONT_ENUM | DONT_DELETE | READ_ONLY);
922
932
  string_map->set_instance_descriptors(*string_descriptors);
933
+
934
+ { // Add length.
935
+ CallbacksDescriptor d(*factory->length_symbol(), *string_length, attribs);
936
+ string_map->AppendDescriptor(&d, witness);
937
+ }
923
938
  }
924
939
 
925
940
  { // --- D a t e ---
@@ -929,7 +944,7 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
929
944
  isolate->initial_object_prototype(),
930
945
  Builtins::kIllegal, true);
931
946
 
932
- global_context()->set_date_function(*date_fun);
947
+ native_context()->set_date_function(*date_fun);
933
948
  }
934
949
 
935
950
 
@@ -939,49 +954,46 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
939
954
  InstallFunction(global, "RegExp", JS_REGEXP_TYPE, JSRegExp::kSize,
940
955
  isolate->initial_object_prototype(),
941
956
  Builtins::kIllegal, true);
942
- global_context()->set_regexp_function(*regexp_fun);
957
+ native_context()->set_regexp_function(*regexp_fun);
943
958
 
944
959
  ASSERT(regexp_fun->has_initial_map());
945
960
  Handle<Map> initial_map(regexp_fun->initial_map());
946
961
 
947
962
  ASSERT_EQ(0, initial_map->inobject_properties());
948
963
 
949
- Handle<DescriptorArray> descriptors = factory->NewDescriptorArray(5);
950
- DescriptorArray::WhitenessWitness witness(*descriptors);
951
964
  PropertyAttributes final =
952
965
  static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
953
- int enum_index = 0;
966
+ Handle<DescriptorArray> descriptors = factory->NewDescriptorArray(0, 5);
967
+ DescriptorArray::WhitenessWitness witness(*descriptors);
968
+ initial_map->set_instance_descriptors(*descriptors);
969
+
954
970
  {
955
971
  // ECMA-262, section 15.10.7.1.
956
972
  FieldDescriptor field(heap->source_symbol(),
957
973
  JSRegExp::kSourceFieldIndex,
958
- final,
959
- enum_index++);
960
- descriptors->Set(0, &field, witness);
974
+ final);
975
+ initial_map->AppendDescriptor(&field, witness);
961
976
  }
962
977
  {
963
978
  // ECMA-262, section 15.10.7.2.
964
979
  FieldDescriptor field(heap->global_symbol(),
965
980
  JSRegExp::kGlobalFieldIndex,
966
- final,
967
- enum_index++);
968
- descriptors->Set(1, &field, witness);
981
+ final);
982
+ initial_map->AppendDescriptor(&field, witness);
969
983
  }
970
984
  {
971
985
  // ECMA-262, section 15.10.7.3.
972
986
  FieldDescriptor field(heap->ignore_case_symbol(),
973
987
  JSRegExp::kIgnoreCaseFieldIndex,
974
- final,
975
- enum_index++);
976
- descriptors->Set(2, &field, witness);
988
+ final);
989
+ initial_map->AppendDescriptor(&field, witness);
977
990
  }
978
991
  {
979
992
  // ECMA-262, section 15.10.7.4.
980
993
  FieldDescriptor field(heap->multiline_symbol(),
981
994
  JSRegExp::kMultilineFieldIndex,
982
- final,
983
- enum_index++);
984
- descriptors->Set(3, &field, witness);
995
+ final);
996
+ initial_map->AppendDescriptor(&field, witness);
985
997
  }
986
998
  {
987
999
  // ECMA-262, section 15.10.7.5.
@@ -989,24 +1001,20 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
989
1001
  static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE);
990
1002
  FieldDescriptor field(heap->last_index_symbol(),
991
1003
  JSRegExp::kLastIndexFieldIndex,
992
- writable,
993
- enum_index++);
994
- descriptors->Set(4, &field, witness);
1004
+ writable);
1005
+ initial_map->AppendDescriptor(&field, witness);
995
1006
  }
996
- descriptors->SetNextEnumerationIndex(enum_index);
997
- descriptors->Sort(witness);
998
1007
 
999
1008
  initial_map->set_inobject_properties(5);
1000
1009
  initial_map->set_pre_allocated_property_fields(5);
1001
1010
  initial_map->set_unused_property_fields(0);
1002
1011
  initial_map->set_instance_size(
1003
1012
  initial_map->instance_size() + 5 * kPointerSize);
1004
- initial_map->set_instance_descriptors(*descriptors);
1005
1013
  initial_map->set_visitor_id(StaticVisitorBase::GetVisitorId(*initial_map));
1006
1014
 
1007
1015
  // RegExp prototype object is itself a RegExp.
1008
- Handle<Map> proto_map = factory->CopyMapDropTransitions(initial_map);
1009
- proto_map->set_prototype(global_context()->initial_object_prototype());
1016
+ Handle<Map> proto_map = factory->CopyMap(initial_map);
1017
+ proto_map->set_prototype(native_context()->initial_object_prototype());
1010
1018
  Handle<JSObject> proto = factory->NewJSObjectFromMap(proto_map);
1011
1019
  proto->InObjectPropertyAtPut(JSRegExp::kSourceFieldIndex,
1012
1020
  heap->query_colon_symbol());
@@ -1030,7 +1038,7 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
1030
1038
  Handle<JSFunction> cons = factory->NewFunction(name,
1031
1039
  factory->the_hole_value());
1032
1040
  { MaybeObject* result = cons->SetInstancePrototype(
1033
- global_context()->initial_object_prototype());
1041
+ native_context()->initial_object_prototype());
1034
1042
  if (result->IsFailure()) return false;
1035
1043
  }
1036
1044
  cons->SetInstanceClassName(*name);
@@ -1039,19 +1047,20 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
1039
1047
  CHECK_NOT_EMPTY_HANDLE(isolate,
1040
1048
  JSObject::SetLocalPropertyIgnoreAttributes(
1041
1049
  global, name, json_object, DONT_ENUM));
1042
- global_context()->set_json_object(*json_object);
1050
+ native_context()->set_json_object(*json_object);
1043
1051
  }
1044
1052
 
1045
1053
  { // --- arguments_boilerplate_
1046
1054
  // Make sure we can recognize argument objects at runtime.
1047
1055
  // This is done by introducing an anonymous function with
1048
1056
  // class_name equals 'Arguments'.
1049
- Handle<String> symbol = factory->LookupAsciiSymbol("Arguments");
1057
+ Handle<String> symbol = factory->LookupOneByteSymbol(
1058
+ STATIC_ASCII_VECTOR("Arguments"));
1050
1059
  Handle<Code> code = Handle<Code>(
1051
1060
  isolate->builtins()->builtin(Builtins::kIllegal));
1052
1061
  Handle<JSObject> prototype =
1053
1062
  Handle<JSObject>(
1054
- JSObject::cast(global_context()->object_function()->prototype()));
1063
+ JSObject::cast(native_context()->object_function()->prototype()));
1055
1064
 
1056
1065
  Handle<JSFunction> function =
1057
1066
  factory->NewFunctionWithPrototype(symbol,
@@ -1065,7 +1074,7 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
1065
1074
  function->shared()->set_expected_nof_properties(2);
1066
1075
  Handle<JSObject> result = factory->NewJSObject(function);
1067
1076
 
1068
- global_context()->set_arguments_boilerplate(*result);
1077
+ native_context()->set_arguments_boilerplate(*result);
1069
1078
  // Note: length must be added as the first property and
1070
1079
  // callee must be added as the second property.
1071
1080
  CHECK_NOT_EMPTY_HANDLE(isolate,
@@ -1080,12 +1089,12 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
1080
1089
  #ifdef DEBUG
1081
1090
  LookupResult lookup(isolate);
1082
1091
  result->LocalLookup(heap->callee_symbol(), &lookup);
1083
- ASSERT(lookup.IsFound() && (lookup.type() == FIELD));
1084
- ASSERT(lookup.GetFieldIndex() == Heap::kArgumentsCalleeIndex);
1092
+ ASSERT(lookup.IsField());
1093
+ ASSERT(lookup.GetFieldIndex().field_index() == Heap::kArgumentsCalleeIndex);
1085
1094
 
1086
1095
  result->LocalLookup(heap->length_symbol(), &lookup);
1087
- ASSERT(lookup.IsFound() && (lookup.type() == FIELD));
1088
- ASSERT(lookup.GetFieldIndex() == Heap::kArgumentsLengthIndex);
1096
+ ASSERT(lookup.IsField());
1097
+ ASSERT(lookup.GetFieldIndex().field_index() == Heap::kArgumentsLengthIndex);
1089
1098
 
1090
1099
  ASSERT(result->map()->inobject_properties() > Heap::kArgumentsCalleeIndex);
1091
1100
  ASSERT(result->map()->inobject_properties() > Heap::kArgumentsLengthIndex);
@@ -1106,8 +1115,8 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
1106
1115
  array = factory->NewFixedArray(0);
1107
1116
  elements->set(1, *array);
1108
1117
 
1109
- Handle<Map> old_map(global_context()->arguments_boilerplate()->map());
1110
- Handle<Map> new_map = factory->CopyMapDropTransitions(old_map);
1118
+ Handle<Map> old_map(native_context()->arguments_boilerplate()->map());
1119
+ Handle<Map> new_map = factory->CopyMap(old_map);
1111
1120
  new_map->set_pre_allocated_property_fields(2);
1112
1121
  Handle<JSObject> result = factory->NewJSObjectFromMap(new_map);
1113
1122
  // Set elements kind after allocating the object because
@@ -1115,7 +1124,7 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
1115
1124
  new_map->set_elements_kind(NON_STRICT_ARGUMENTS_ELEMENTS);
1116
1125
  result->set_elements(*elements);
1117
1126
  ASSERT(result->HasNonStrictArgumentsElements());
1118
- global_context()->set_aliased_arguments_boilerplate(*result);
1127
+ native_context()->set_aliased_arguments_boilerplate(*result);
1119
1128
  }
1120
1129
 
1121
1130
  { // --- strict mode arguments boilerplate
@@ -1135,39 +1144,43 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
1135
1144
  caller->set_getter(*throw_function);
1136
1145
  caller->set_setter(*throw_function);
1137
1146
 
1147
+ // Create the map. Allocate one in-object field for length.
1148
+ Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE,
1149
+ Heap::kArgumentsObjectSizeStrict);
1138
1150
  // Create the descriptor array for the arguments object.
1139
- Handle<DescriptorArray> descriptors = factory->NewDescriptorArray(3);
1151
+ Handle<DescriptorArray> descriptors = factory->NewDescriptorArray(0, 3);
1140
1152
  DescriptorArray::WhitenessWitness witness(*descriptors);
1153
+ map->set_instance_descriptors(*descriptors);
1154
+
1141
1155
  { // length
1142
1156
  FieldDescriptor d(*factory->length_symbol(), 0, DONT_ENUM);
1143
- descriptors->Set(0, &d, witness);
1157
+ map->AppendDescriptor(&d, witness);
1144
1158
  }
1145
1159
  { // callee
1146
- CallbacksDescriptor d(*factory->callee_symbol(), *callee, attributes);
1147
- descriptors->Set(1, &d, witness);
1160
+ CallbacksDescriptor d(*factory->callee_symbol(),
1161
+ *callee,
1162
+ attributes);
1163
+ map->AppendDescriptor(&d, witness);
1148
1164
  }
1149
1165
  { // caller
1150
- CallbacksDescriptor d(*factory->caller_symbol(), *caller, attributes);
1151
- descriptors->Set(2, &d, witness);
1166
+ CallbacksDescriptor d(*factory->caller_symbol(),
1167
+ *caller,
1168
+ attributes);
1169
+ map->AppendDescriptor(&d, witness);
1152
1170
  }
1153
- descriptors->Sort(witness);
1154
1171
 
1155
- // Create the map. Allocate one in-object field for length.
1156
- Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE,
1157
- Heap::kArgumentsObjectSizeStrict);
1158
- map->set_instance_descriptors(*descriptors);
1159
1172
  map->set_function_with_prototype(true);
1160
- map->set_prototype(global_context()->object_function()->prototype());
1173
+ map->set_prototype(native_context()->object_function()->prototype());
1161
1174
  map->set_pre_allocated_property_fields(1);
1162
1175
  map->set_inobject_properties(1);
1163
1176
 
1164
1177
  // Copy constructor from the non-strict arguments boilerplate.
1165
1178
  map->set_constructor(
1166
- global_context()->arguments_boilerplate()->map()->constructor());
1179
+ native_context()->arguments_boilerplate()->map()->constructor());
1167
1180
 
1168
1181
  // Allocate the arguments boilerplate object.
1169
1182
  Handle<JSObject> result = factory->NewJSObjectFromMap(map);
1170
- global_context()->set_strict_mode_arguments_boilerplate(*result);
1183
+ native_context()->set_strict_mode_arguments_boilerplate(*result);
1171
1184
 
1172
1185
  // Add length property only for strict mode boilerplate.
1173
1186
  CHECK_NOT_EMPTY_HANDLE(isolate,
@@ -1178,8 +1191,8 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
1178
1191
  #ifdef DEBUG
1179
1192
  LookupResult lookup(isolate);
1180
1193
  result->LocalLookup(heap->length_symbol(), &lookup);
1181
- ASSERT(lookup.IsFound() && (lookup.type() == FIELD));
1182
- ASSERT(lookup.GetFieldIndex() == Heap::kArgumentsLengthIndex);
1194
+ ASSERT(lookup.IsField());
1195
+ ASSERT(lookup.GetFieldIndex().field_index() == Heap::kArgumentsLengthIndex);
1183
1196
 
1184
1197
  ASSERT(result->map()->inobject_properties() > Heap::kArgumentsLengthIndex);
1185
1198
 
@@ -1200,9 +1213,10 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
1200
1213
  code,
1201
1214
  true);
1202
1215
 
1203
- Handle<String> name = factory->LookupAsciiSymbol("context_extension");
1216
+ Handle<String> name =
1217
+ factory->LookupOneByteSymbol(STATIC_ASCII_VECTOR("context_extension"));
1204
1218
  context_extension_fun->shared()->set_instance_class_name(*name);
1205
- global_context()->set_context_extension_function(*context_extension_fun);
1219
+ native_context()->set_context_extension_function(*context_extension_fun);
1206
1220
  }
1207
1221
 
1208
1222
 
@@ -1214,7 +1228,7 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
1214
1228
  Handle<JSFunction> delegate =
1215
1229
  factory->NewFunction(factory->empty_symbol(), JS_OBJECT_TYPE,
1216
1230
  JSObject::kHeaderSize, code, true);
1217
- global_context()->set_call_as_function_delegate(*delegate);
1231
+ native_context()->set_call_as_function_delegate(*delegate);
1218
1232
  delegate->shared()->DontAdaptArguments();
1219
1233
  }
1220
1234
 
@@ -1226,21 +1240,22 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
1226
1240
  Handle<JSFunction> delegate =
1227
1241
  factory->NewFunction(factory->empty_symbol(), JS_OBJECT_TYPE,
1228
1242
  JSObject::kHeaderSize, code, true);
1229
- global_context()->set_call_as_constructor_delegate(*delegate);
1243
+ native_context()->set_call_as_constructor_delegate(*delegate);
1230
1244
  delegate->shared()->DontAdaptArguments();
1231
1245
  }
1232
1246
 
1233
1247
  // Initialize the out of memory slot.
1234
- global_context()->set_out_of_memory(heap->false_value());
1248
+ native_context()->set_out_of_memory(heap->false_value());
1235
1249
 
1236
- // Initialize the data slot.
1237
- global_context()->set_data(heap->undefined_value());
1250
+ // Initialize the embedder data slot.
1251
+ Handle<FixedArray> embedder_data = factory->NewFixedArray(2);
1252
+ native_context()->set_embedder_data(*embedder_data);
1238
1253
 
1239
1254
  {
1240
1255
  // Initialize the random seed slot.
1241
1256
  Handle<ByteArray> zeroed_byte_array(
1242
1257
  factory->NewByteArray(kRandomStateSize));
1243
- global_context()->set_random_seed(*zeroed_byte_array);
1258
+ native_context()->set_random_seed(*zeroed_byte_array);
1244
1259
  memset(zeroed_byte_array->GetDataStartAddress(), 0, kRandomStateSize);
1245
1260
  }
1246
1261
  return true;
@@ -1248,7 +1263,7 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
1248
1263
 
1249
1264
 
1250
1265
  void Genesis::InitializeExperimentalGlobal() {
1251
- Handle<JSObject> global = Handle<JSObject>(global_context()->global());
1266
+ Handle<JSObject> global = Handle<JSObject>(native_context()->global_object());
1252
1267
 
1253
1268
  // TODO(mstarzinger): Move this into Genesis::InitializeGlobal once we no
1254
1269
  // longer need to live behind a flag, so functions get added to the snapshot.
@@ -1333,13 +1348,14 @@ bool Genesis::CompileScriptCached(Vector<const char> name,
1333
1348
  // If we can't find the function in the cache, we compile a new
1334
1349
  // function and insert it into the cache.
1335
1350
  if (cache == NULL || !cache->Lookup(name, &function_info)) {
1336
- ASSERT(source->IsAsciiRepresentation());
1351
+ ASSERT(source->IsOneByteRepresentation());
1337
1352
  Handle<String> script_name = factory->NewStringFromUtf8(name);
1338
1353
  function_info = Compiler::Compile(
1339
1354
  source,
1340
1355
  script_name,
1341
1356
  0,
1342
1357
  0,
1358
+ top_context,
1343
1359
  extension,
1344
1360
  NULL,
1345
1361
  Handle<String>::null(),
@@ -1351,7 +1367,7 @@ bool Genesis::CompileScriptCached(Vector<const char> name,
1351
1367
  // Set up the function context. Conceptually, we should clone the
1352
1368
  // function before overwriting the context but since we're in a
1353
1369
  // single-threaded environment it is not strictly necessary.
1354
- ASSERT(top_context->IsGlobalContext());
1370
+ ASSERT(top_context->IsNativeContext());
1355
1371
  Handle<Context> context =
1356
1372
  Handle<Context>(use_runtime_context
1357
1373
  ? Handle<Context>(top_context->runtime_context())
@@ -1364,7 +1380,7 @@ bool Genesis::CompileScriptCached(Vector<const char> name,
1364
1380
  Handle<Object> receiver =
1365
1381
  Handle<Object>(use_runtime_context
1366
1382
  ? top_context->builtins()
1367
- : top_context->global());
1383
+ : top_context->global_object());
1368
1384
  bool has_pending_exception;
1369
1385
  Execution::Call(fun, receiver, 0, NULL, &has_pending_exception);
1370
1386
  if (has_pending_exception) return false;
@@ -1372,12 +1388,13 @@ bool Genesis::CompileScriptCached(Vector<const char> name,
1372
1388
  }
1373
1389
 
1374
1390
 
1375
- #define INSTALL_NATIVE(Type, name, var) \
1376
- Handle<String> var##_name = factory()->LookupAsciiSymbol(name); \
1377
- Object* var##_native = \
1378
- global_context()->builtins()->GetPropertyNoExceptionThrown( \
1379
- *var##_name); \
1380
- global_context()->set_##var(Type::cast(var##_native));
1391
+ #define INSTALL_NATIVE(Type, name, var) \
1392
+ Handle<String> var##_name = \
1393
+ factory()->LookupOneByteSymbol(STATIC_ASCII_VECTOR(name)); \
1394
+ Object* var##_native = \
1395
+ native_context()->builtins()->GetPropertyNoExceptionThrown( \
1396
+ *var##_name); \
1397
+ native_context()->set_##var(Type::cast(var##_native));
1381
1398
 
1382
1399
 
1383
1400
  void Genesis::InstallNativeFunctions() {
@@ -1407,6 +1424,11 @@ void Genesis::InstallExperimentalNativeFunctions() {
1407
1424
  INSTALL_NATIVE(JSFunction, "DerivedSetTrap", derived_set_trap);
1408
1425
  INSTALL_NATIVE(JSFunction, "ProxyEnumerate", proxy_enumerate);
1409
1426
  }
1427
+ if (FLAG_harmony_observation) {
1428
+ INSTALL_NATIVE(JSFunction, "NotifyChange", observers_notify_change);
1429
+ INSTALL_NATIVE(JSFunction, "DeliverChangeRecords",
1430
+ observers_deliver_changes);
1431
+ }
1410
1432
  }
1411
1433
 
1412
1434
  #undef INSTALL_NATIVE
@@ -1417,7 +1439,7 @@ bool Genesis::InstallNatives() {
1417
1439
 
1418
1440
  // Create a function for the builtins object. Allocate space for the
1419
1441
  // JavaScript builtins, a reference to the builtins object
1420
- // (itself) and a reference to the global_context directly in the object.
1442
+ // (itself) and a reference to the native_context directly in the object.
1421
1443
  Handle<Code> code = Handle<Code>(
1422
1444
  isolate()->builtins()->builtin(Builtins::kIllegal));
1423
1445
  Handle<JSFunction> builtins_fun =
@@ -1425,14 +1447,18 @@ bool Genesis::InstallNatives() {
1425
1447
  JS_BUILTINS_OBJECT_TYPE,
1426
1448
  JSBuiltinsObject::kSize, code, true);
1427
1449
 
1428
- Handle<String> name = factory()->LookupAsciiSymbol("builtins");
1450
+ Handle<String> name =
1451
+ factory()->LookupOneByteSymbol(STATIC_ASCII_VECTOR("builtins"));
1429
1452
  builtins_fun->shared()->set_instance_class_name(*name);
1453
+ builtins_fun->initial_map()->set_dictionary_map(true);
1454
+ builtins_fun->initial_map()->set_prototype(heap()->null_value());
1430
1455
 
1431
1456
  // Allocate the builtins object.
1432
1457
  Handle<JSBuiltinsObject> builtins =
1433
1458
  Handle<JSBuiltinsObject>::cast(factory()->NewGlobalObject(builtins_fun));
1434
1459
  builtins->set_builtins(*builtins);
1435
- builtins->set_global_context(*global_context());
1460
+ builtins->set_native_context(*native_context());
1461
+ builtins->set_global_context(*native_context());
1436
1462
  builtins->set_global_receiver(*builtins);
1437
1463
 
1438
1464
  // Set up the 'global' properties of the builtins object. The
@@ -1441,27 +1467,29 @@ bool Genesis::InstallNatives() {
1441
1467
  // global object.
1442
1468
  static const PropertyAttributes attributes =
1443
1469
  static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE);
1444
- Handle<String> global_symbol = factory()->LookupAsciiSymbol("global");
1445
- Handle<Object> global_obj(global_context()->global());
1470
+ Handle<String> global_symbol =
1471
+ factory()->LookupOneByteSymbol(STATIC_ASCII_VECTOR("global"));
1472
+ Handle<Object> global_obj(native_context()->global_object());
1446
1473
  CHECK_NOT_EMPTY_HANDLE(isolate(),
1447
1474
  JSObject::SetLocalPropertyIgnoreAttributes(
1448
1475
  builtins, global_symbol, global_obj, attributes));
1449
1476
 
1450
1477
  // Set up the reference from the global object to the builtins object.
1451
- JSGlobalObject::cast(global_context()->global())->set_builtins(*builtins);
1478
+ JSGlobalObject::cast(native_context()->global_object())->
1479
+ set_builtins(*builtins);
1452
1480
 
1453
- // Create a bridge function that has context in the global context.
1481
+ // Create a bridge function that has context in the native context.
1454
1482
  Handle<JSFunction> bridge =
1455
1483
  factory()->NewFunction(factory()->empty_symbol(),
1456
1484
  factory()->undefined_value());
1457
- ASSERT(bridge->context() == *isolate()->global_context());
1485
+ ASSERT(bridge->context() == *isolate()->native_context());
1458
1486
 
1459
1487
  // Allocate the builtins context.
1460
1488
  Handle<Context> context =
1461
1489
  factory()->NewFunctionContext(Context::MIN_CONTEXT_SLOTS, bridge);
1462
- context->set_global(*builtins); // override builtins global object
1490
+ context->set_global_object(*builtins); // override builtins global object
1463
1491
 
1464
- global_context()->set_runtime_context(*context);
1492
+ native_context()->set_runtime_context(*context);
1465
1493
 
1466
1494
  { // -- S c r i p t
1467
1495
  // Builtin functions for Script.
@@ -1472,118 +1500,142 @@ bool Genesis::InstallNatives() {
1472
1500
  Handle<JSObject> prototype =
1473
1501
  factory()->NewJSObject(isolate()->object_function(), TENURED);
1474
1502
  SetPrototype(script_fun, prototype);
1475
- global_context()->set_script_function(*script_fun);
1476
-
1477
- // Add 'source' and 'data' property to scripts.
1478
- PropertyAttributes common_attributes =
1479
- static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
1480
- Handle<Foreign> foreign_source =
1481
- factory()->NewForeign(&Accessors::ScriptSource);
1482
- Handle<DescriptorArray> script_descriptors =
1483
- factory()->CopyAppendForeignDescriptor(
1484
- factory()->empty_descriptor_array(),
1485
- factory()->LookupAsciiSymbol("source"),
1486
- foreign_source,
1487
- common_attributes);
1488
- Handle<Foreign> foreign_name =
1489
- factory()->NewForeign(&Accessors::ScriptName);
1490
- script_descriptors =
1491
- factory()->CopyAppendForeignDescriptor(
1492
- script_descriptors,
1493
- factory()->LookupAsciiSymbol("name"),
1494
- foreign_name,
1495
- common_attributes);
1496
- Handle<Foreign> foreign_id = factory()->NewForeign(&Accessors::ScriptId);
1497
- script_descriptors =
1498
- factory()->CopyAppendForeignDescriptor(
1499
- script_descriptors,
1500
- factory()->LookupAsciiSymbol("id"),
1501
- foreign_id,
1502
- common_attributes);
1503
- Handle<Foreign> foreign_line_offset =
1504
- factory()->NewForeign(&Accessors::ScriptLineOffset);
1505
- script_descriptors =
1506
- factory()->CopyAppendForeignDescriptor(
1507
- script_descriptors,
1508
- factory()->LookupAsciiSymbol("line_offset"),
1509
- foreign_line_offset,
1510
- common_attributes);
1511
- Handle<Foreign> foreign_column_offset =
1512
- factory()->NewForeign(&Accessors::ScriptColumnOffset);
1513
- script_descriptors =
1514
- factory()->CopyAppendForeignDescriptor(
1515
- script_descriptors,
1516
- factory()->LookupAsciiSymbol("column_offset"),
1517
- foreign_column_offset,
1518
- common_attributes);
1519
- Handle<Foreign> foreign_data =
1520
- factory()->NewForeign(&Accessors::ScriptData);
1521
- script_descriptors =
1522
- factory()->CopyAppendForeignDescriptor(
1523
- script_descriptors,
1524
- factory()->LookupAsciiSymbol("data"),
1525
- foreign_data,
1526
- common_attributes);
1527
- Handle<Foreign> foreign_type =
1528
- factory()->NewForeign(&Accessors::ScriptType);
1529
- script_descriptors =
1530
- factory()->CopyAppendForeignDescriptor(
1531
- script_descriptors,
1532
- factory()->LookupAsciiSymbol("type"),
1533
- foreign_type,
1534
- common_attributes);
1535
- Handle<Foreign> foreign_compilation_type =
1536
- factory()->NewForeign(&Accessors::ScriptCompilationType);
1537
- script_descriptors =
1538
- factory()->CopyAppendForeignDescriptor(
1539
- script_descriptors,
1540
- factory()->LookupAsciiSymbol("compilation_type"),
1541
- foreign_compilation_type,
1542
- common_attributes);
1543
- Handle<Foreign> foreign_line_ends =
1544
- factory()->NewForeign(&Accessors::ScriptLineEnds);
1545
- script_descriptors =
1546
- factory()->CopyAppendForeignDescriptor(
1547
- script_descriptors,
1548
- factory()->LookupAsciiSymbol("line_ends"),
1549
- foreign_line_ends,
1550
- common_attributes);
1551
- Handle<Foreign> foreign_context_data =
1552
- factory()->NewForeign(&Accessors::ScriptContextData);
1553
- script_descriptors =
1554
- factory()->CopyAppendForeignDescriptor(
1555
- script_descriptors,
1556
- factory()->LookupAsciiSymbol("context_data"),
1557
- foreign_context_data,
1558
- common_attributes);
1559
- Handle<Foreign> foreign_eval_from_script =
1560
- factory()->NewForeign(&Accessors::ScriptEvalFromScript);
1561
- script_descriptors =
1562
- factory()->CopyAppendForeignDescriptor(
1563
- script_descriptors,
1564
- factory()->LookupAsciiSymbol("eval_from_script"),
1565
- foreign_eval_from_script,
1566
- common_attributes);
1567
- Handle<Foreign> foreign_eval_from_script_position =
1568
- factory()->NewForeign(&Accessors::ScriptEvalFromScriptPosition);
1569
- script_descriptors =
1570
- factory()->CopyAppendForeignDescriptor(
1571
- script_descriptors,
1572
- factory()->LookupAsciiSymbol("eval_from_script_position"),
1573
- foreign_eval_from_script_position,
1574
- common_attributes);
1575
- Handle<Foreign> foreign_eval_from_function_name =
1576
- factory()->NewForeign(&Accessors::ScriptEvalFromFunctionName);
1577
- script_descriptors =
1578
- factory()->CopyAppendForeignDescriptor(
1579
- script_descriptors,
1580
- factory()->LookupAsciiSymbol("eval_from_function_name"),
1581
- foreign_eval_from_function_name,
1582
- common_attributes);
1503
+ native_context()->set_script_function(*script_fun);
1583
1504
 
1584
1505
  Handle<Map> script_map = Handle<Map>(script_fun->initial_map());
1506
+
1507
+ Handle<DescriptorArray> script_descriptors(
1508
+ factory()->NewDescriptorArray(0, 13));
1509
+ DescriptorArray::WhitenessWitness witness(*script_descriptors);
1510
+
1511
+ Handle<Foreign> script_source(
1512
+ factory()->NewForeign(&Accessors::ScriptSource));
1513
+ Handle<Foreign> script_name(factory()->NewForeign(&Accessors::ScriptName));
1514
+ Handle<String> id_symbol(factory()->LookupOneByteSymbol(
1515
+ STATIC_ASCII_VECTOR("id")));
1516
+ Handle<Foreign> script_id(factory()->NewForeign(&Accessors::ScriptId));
1517
+ Handle<String> line_offset_symbol(
1518
+ factory()->LookupOneByteSymbol(STATIC_ASCII_VECTOR("line_offset")));
1519
+ Handle<Foreign> script_line_offset(
1520
+ factory()->NewForeign(&Accessors::ScriptLineOffset));
1521
+ Handle<String> column_offset_symbol(
1522
+ factory()->LookupOneByteSymbol(STATIC_ASCII_VECTOR("column_offset")));
1523
+ Handle<Foreign> script_column_offset(
1524
+ factory()->NewForeign(&Accessors::ScriptColumnOffset));
1525
+ Handle<String> data_symbol(factory()->LookupOneByteSymbol(
1526
+ STATIC_ASCII_VECTOR("data")));
1527
+ Handle<Foreign> script_data(factory()->NewForeign(&Accessors::ScriptData));
1528
+ Handle<String> type_symbol(factory()->LookupOneByteSymbol(
1529
+ STATIC_ASCII_VECTOR("type")));
1530
+ Handle<Foreign> script_type(factory()->NewForeign(&Accessors::ScriptType));
1531
+ Handle<String> compilation_type_symbol(
1532
+ factory()->LookupOneByteSymbol(
1533
+ STATIC_ASCII_VECTOR("compilation_type")));
1534
+ Handle<Foreign> script_compilation_type(
1535
+ factory()->NewForeign(&Accessors::ScriptCompilationType));
1536
+ Handle<String> line_ends_symbol(factory()->LookupOneByteSymbol(
1537
+ STATIC_ASCII_VECTOR("line_ends")));
1538
+ Handle<Foreign> script_line_ends(
1539
+ factory()->NewForeign(&Accessors::ScriptLineEnds));
1540
+ Handle<String> context_data_symbol(
1541
+ factory()->LookupOneByteSymbol(STATIC_ASCII_VECTOR("context_data")));
1542
+ Handle<Foreign> script_context_data(
1543
+ factory()->NewForeign(&Accessors::ScriptContextData));
1544
+ Handle<String> eval_from_script_symbol(
1545
+ factory()->LookupOneByteSymbol(
1546
+ STATIC_ASCII_VECTOR("eval_from_script")));
1547
+ Handle<Foreign> script_eval_from_script(
1548
+ factory()->NewForeign(&Accessors::ScriptEvalFromScript));
1549
+ Handle<String> eval_from_script_position_symbol(
1550
+ factory()->LookupOneByteSymbol(
1551
+ STATIC_ASCII_VECTOR("eval_from_script_position")));
1552
+ Handle<Foreign> script_eval_from_script_position(
1553
+ factory()->NewForeign(&Accessors::ScriptEvalFromScriptPosition));
1554
+ Handle<String> eval_from_function_name_symbol(
1555
+ factory()->LookupOneByteSymbol(
1556
+ STATIC_ASCII_VECTOR("eval_from_function_name")));
1557
+ Handle<Foreign> script_eval_from_function_name(
1558
+ factory()->NewForeign(&Accessors::ScriptEvalFromFunctionName));
1559
+ PropertyAttributes attribs =
1560
+ static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
1585
1561
  script_map->set_instance_descriptors(*script_descriptors);
1586
1562
 
1563
+ {
1564
+ CallbacksDescriptor d(
1565
+ *factory()->source_symbol(), *script_source, attribs);
1566
+ script_map->AppendDescriptor(&d, witness);
1567
+ }
1568
+
1569
+ {
1570
+ CallbacksDescriptor d(*factory()->name_symbol(), *script_name, attribs);
1571
+ script_map->AppendDescriptor(&d, witness);
1572
+ }
1573
+
1574
+ {
1575
+ CallbacksDescriptor d(*id_symbol, *script_id, attribs);
1576
+ script_map->AppendDescriptor(&d, witness);
1577
+ }
1578
+
1579
+ {
1580
+ CallbacksDescriptor d(*line_offset_symbol, *script_line_offset, attribs);
1581
+ script_map->AppendDescriptor(&d, witness);
1582
+ }
1583
+
1584
+ {
1585
+ CallbacksDescriptor d(
1586
+ *column_offset_symbol, *script_column_offset, attribs);
1587
+ script_map->AppendDescriptor(&d, witness);
1588
+ }
1589
+
1590
+ {
1591
+ CallbacksDescriptor d(*data_symbol, *script_data, attribs);
1592
+ script_map->AppendDescriptor(&d, witness);
1593
+ }
1594
+
1595
+ {
1596
+ CallbacksDescriptor d(*type_symbol, *script_type, attribs);
1597
+ script_map->AppendDescriptor(&d, witness);
1598
+ }
1599
+
1600
+ {
1601
+ CallbacksDescriptor d(
1602
+ *compilation_type_symbol, *script_compilation_type, attribs);
1603
+ script_map->AppendDescriptor(&d, witness);
1604
+ }
1605
+
1606
+ {
1607
+ CallbacksDescriptor d(*line_ends_symbol, *script_line_ends, attribs);
1608
+ script_map->AppendDescriptor(&d, witness);
1609
+ }
1610
+
1611
+ {
1612
+ CallbacksDescriptor d(
1613
+ *context_data_symbol, *script_context_data, attribs);
1614
+ script_map->AppendDescriptor(&d, witness);
1615
+ }
1616
+
1617
+ {
1618
+ CallbacksDescriptor d(
1619
+ *eval_from_script_symbol, *script_eval_from_script, attribs);
1620
+ script_map->AppendDescriptor(&d, witness);
1621
+ }
1622
+
1623
+ {
1624
+ CallbacksDescriptor d(
1625
+ *eval_from_script_position_symbol,
1626
+ *script_eval_from_script_position,
1627
+ attribs);
1628
+ script_map->AppendDescriptor(&d, witness);
1629
+ }
1630
+
1631
+ {
1632
+ CallbacksDescriptor d(
1633
+ *eval_from_function_name_symbol,
1634
+ *script_eval_from_function_name,
1635
+ attribs);
1636
+ script_map->AppendDescriptor(&d, witness);
1637
+ }
1638
+
1587
1639
  // Allocate the empty script.
1588
1640
  Handle<Script> script = factory()->NewScript(factory()->empty_string());
1589
1641
  script->set_type(Smi::FromInt(Script::TYPE_NATIVE));
@@ -1601,7 +1653,7 @@ bool Genesis::InstallNatives() {
1601
1653
  Handle<JSObject> prototype =
1602
1654
  factory()->NewJSObject(isolate()->object_function(), TENURED);
1603
1655
  SetPrototype(opaque_reference_fun, prototype);
1604
- global_context()->set_opaque_reference_function(*opaque_reference_fun);
1656
+ native_context()->set_opaque_reference_function(*opaque_reference_fun);
1605
1657
  }
1606
1658
 
1607
1659
  { // --- I n t e r n a l A r r a y ---
@@ -1631,25 +1683,31 @@ bool Genesis::InstallNatives() {
1631
1683
  // elements in InternalArrays can be set to non-Smi values without going
1632
1684
  // through a common bottleneck that would make the SMI_ONLY -> FAST_ELEMENT
1633
1685
  // transition easy to trap. Moreover, they rarely are smi-only.
1634
- MaybeObject* maybe_map =
1635
- array_function->initial_map()->CopyDropTransitions();
1686
+ MaybeObject* maybe_map = array_function->initial_map()->Copy();
1636
1687
  Map* new_map;
1637
- if (!maybe_map->To<Map>(&new_map)) return false;
1688
+ if (!maybe_map->To(&new_map)) return false;
1638
1689
  new_map->set_elements_kind(FAST_HOLEY_ELEMENTS);
1639
1690
  array_function->set_initial_map(new_map);
1640
1691
 
1641
1692
  // Make "length" magic on instances.
1642
- Handle<DescriptorArray> array_descriptors =
1643
- factory()->CopyAppendForeignDescriptor(
1644
- factory()->empty_descriptor_array(),
1645
- factory()->length_symbol(),
1646
- factory()->NewForeign(&Accessors::ArrayLength),
1647
- static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE));
1648
-
1649
- array_function->initial_map()->set_instance_descriptors(
1650
- *array_descriptors);
1693
+ Handle<Map> initial_map(array_function->initial_map());
1694
+ Handle<DescriptorArray> array_descriptors(
1695
+ factory()->NewDescriptorArray(0, 1));
1696
+ DescriptorArray::WhitenessWitness witness(*array_descriptors);
1697
+
1698
+ Handle<Foreign> array_length(factory()->NewForeign(
1699
+ &Accessors::ArrayLength));
1700
+ PropertyAttributes attribs = static_cast<PropertyAttributes>(
1701
+ DONT_ENUM | DONT_DELETE);
1702
+ initial_map->set_instance_descriptors(*array_descriptors);
1703
+
1704
+ { // Add length.
1705
+ CallbacksDescriptor d(
1706
+ *factory()->length_symbol(), *array_length, attribs);
1707
+ array_function->initial_map()->AppendDescriptor(&d, witness);
1708
+ }
1651
1709
 
1652
- global_context()->set_internal_array_function(*array_function);
1710
+ native_context()->set_internal_array_function(*array_function);
1653
1711
  }
1654
1712
 
1655
1713
  if (FLAG_disable_native_files) {
@@ -1672,16 +1730,16 @@ bool Genesis::InstallNatives() {
1672
1730
 
1673
1731
  // Store the map for the string prototype after the natives has been compiled
1674
1732
  // and the String function has been set up.
1675
- Handle<JSFunction> string_function(global_context()->string_function());
1733
+ Handle<JSFunction> string_function(native_context()->string_function());
1676
1734
  ASSERT(JSObject::cast(
1677
1735
  string_function->initial_map()->prototype())->HasFastProperties());
1678
- global_context()->set_string_function_prototype_map(
1736
+ native_context()->set_string_function_prototype_map(
1679
1737
  HeapObject::cast(string_function->initial_map()->prototype())->map());
1680
1738
 
1681
1739
  // Install Function.prototype.call and apply.
1682
1740
  { Handle<String> key = factory()->function_class_symbol();
1683
1741
  Handle<JSFunction> function =
1684
- Handle<JSFunction>::cast(GetProperty(isolate()->global(), key));
1742
+ Handle<JSFunction>::cast(GetProperty(isolate()->global_object(), key));
1685
1743
  Handle<JSObject> proto =
1686
1744
  Handle<JSObject>(JSObject::cast(function->instance_prototype()));
1687
1745
 
@@ -1719,7 +1777,7 @@ bool Genesis::InstallNatives() {
1719
1777
  // RegExpResult initial map.
1720
1778
 
1721
1779
  // Find global.Array.prototype to inherit from.
1722
- Handle<JSFunction> array_constructor(global_context()->array_function());
1780
+ Handle<JSFunction> array_constructor(native_context()->array_function());
1723
1781
  Handle<JSObject> array_prototype(
1724
1782
  JSObject::cast(array_constructor->instance_prototype()));
1725
1783
 
@@ -1734,44 +1792,45 @@ bool Genesis::InstallNatives() {
1734
1792
 
1735
1793
  // Update map with length accessor from Array and add "index" and "input".
1736
1794
  Handle<DescriptorArray> reresult_descriptors =
1737
- factory()->NewDescriptorArray(3);
1795
+ factory()->NewDescriptorArray(0, 3);
1738
1796
  DescriptorArray::WhitenessWitness witness(*reresult_descriptors);
1797
+ initial_map->set_instance_descriptors(*reresult_descriptors);
1739
1798
 
1740
- JSFunction* array_function = global_context()->array_function();
1741
- Handle<DescriptorArray> array_descriptors(
1742
- array_function->initial_map()->instance_descriptors());
1743
- int index = array_descriptors->SearchWithCache(heap()->length_symbol());
1744
- MaybeObject* copy_result =
1745
- reresult_descriptors->CopyFrom(0, *array_descriptors, index, witness);
1746
- if (copy_result->IsFailure()) return false;
1747
-
1748
- int enum_index = 0;
1799
+ {
1800
+ JSFunction* array_function = native_context()->array_function();
1801
+ Handle<DescriptorArray> array_descriptors(
1802
+ array_function->initial_map()->instance_descriptors());
1803
+ String* length = heap()->length_symbol();
1804
+ int old = array_descriptors->SearchWithCache(
1805
+ length, array_function->initial_map());
1806
+ ASSERT(old != DescriptorArray::kNotFound);
1807
+ CallbacksDescriptor desc(length,
1808
+ array_descriptors->GetValue(old),
1809
+ array_descriptors->GetDetails(old).attributes());
1810
+ initial_map->AppendDescriptor(&desc, witness);
1811
+ }
1749
1812
  {
1750
1813
  FieldDescriptor index_field(heap()->index_symbol(),
1751
1814
  JSRegExpResult::kIndexIndex,
1752
- NONE,
1753
- enum_index++);
1754
- reresult_descriptors->Set(1, &index_field, witness);
1815
+ NONE);
1816
+ initial_map->AppendDescriptor(&index_field, witness);
1755
1817
  }
1756
1818
 
1757
1819
  {
1758
1820
  FieldDescriptor input_field(heap()->input_symbol(),
1759
1821
  JSRegExpResult::kInputIndex,
1760
- NONE,
1761
- enum_index++);
1762
- reresult_descriptors->Set(2, &input_field, witness);
1822
+ NONE);
1823
+ initial_map->AppendDescriptor(&input_field, witness);
1763
1824
  }
1764
- reresult_descriptors->Sort(witness);
1765
1825
 
1766
1826
  initial_map->set_inobject_properties(2);
1767
1827
  initial_map->set_pre_allocated_property_fields(2);
1768
1828
  initial_map->set_unused_property_fields(0);
1769
- initial_map->set_instance_descriptors(*reresult_descriptors);
1770
1829
 
1771
- global_context()->set_regexp_result_map(*initial_map);
1830
+ native_context()->set_regexp_result_map(*initial_map);
1772
1831
  }
1773
1832
 
1774
- #ifdef DEBUG
1833
+ #ifdef VERIFY_HEAP
1775
1834
  builtins->Verify();
1776
1835
  #endif
1777
1836
 
@@ -1793,6 +1852,11 @@ bool Genesis::InstallExperimentalNatives() {
1793
1852
  "native collection.js") == 0) {
1794
1853
  if (!CompileExperimentalBuiltin(isolate(), i)) return false;
1795
1854
  }
1855
+ if (FLAG_harmony_observation &&
1856
+ strcmp(ExperimentalNatives::GetScriptName(i).start(),
1857
+ "native object-observe.js") == 0) {
1858
+ if (!CompileExperimentalBuiltin(isolate(), i)) return false;
1859
+ }
1796
1860
  }
1797
1861
 
1798
1862
  InstallExperimentalNativeFunctions();
@@ -1802,20 +1866,20 @@ bool Genesis::InstallExperimentalNatives() {
1802
1866
 
1803
1867
 
1804
1868
  static Handle<JSObject> ResolveBuiltinIdHolder(
1805
- Handle<Context> global_context,
1869
+ Handle<Context> native_context,
1806
1870
  const char* holder_expr) {
1807
- Factory* factory = global_context->GetIsolate()->factory();
1808
- Handle<GlobalObject> global(global_context->global());
1871
+ Factory* factory = native_context->GetIsolate()->factory();
1872
+ Handle<GlobalObject> global(native_context->global_object());
1809
1873
  const char* period_pos = strchr(holder_expr, '.');
1810
1874
  if (period_pos == NULL) {
1811
1875
  return Handle<JSObject>::cast(
1812
- GetProperty(global, factory->LookupAsciiSymbol(holder_expr)));
1876
+ GetProperty(global, factory->LookupUtf8Symbol(holder_expr)));
1813
1877
  }
1814
1878
  ASSERT_EQ(".prototype", period_pos);
1815
1879
  Vector<const char> property(holder_expr,
1816
1880
  static_cast<int>(period_pos - holder_expr));
1817
1881
  Handle<JSFunction> function = Handle<JSFunction>::cast(
1818
- GetProperty(global, factory->LookupSymbol(property)));
1882
+ GetProperty(global, factory->LookupUtf8Symbol(property)));
1819
1883
  return Handle<JSObject>(JSObject::cast(function->prototype()));
1820
1884
  }
1821
1885
 
@@ -1824,7 +1888,7 @@ static void InstallBuiltinFunctionId(Handle<JSObject> holder,
1824
1888
  const char* function_name,
1825
1889
  BuiltinFunctionId id) {
1826
1890
  Factory* factory = holder->GetIsolate()->factory();
1827
- Handle<String> name = factory->LookupAsciiSymbol(function_name);
1891
+ Handle<String> name = factory->LookupUtf8Symbol(function_name);
1828
1892
  Object* function_object = holder->GetProperty(*name)->ToObjectUnchecked();
1829
1893
  Handle<JSFunction> function(JSFunction::cast(function_object));
1830
1894
  function->shared()->set_function_data(Smi::FromInt(id));
@@ -1836,7 +1900,7 @@ void Genesis::InstallBuiltinFunctionIds() {
1836
1900
  #define INSTALL_BUILTIN_ID(holder_expr, fun_name, name) \
1837
1901
  { \
1838
1902
  Handle<JSObject> holder = ResolveBuiltinIdHolder( \
1839
- global_context(), #holder_expr); \
1903
+ native_context(), #holder_expr); \
1840
1904
  BuiltinFunctionId id = k##name; \
1841
1905
  InstallBuiltinFunctionId(holder, #fun_name, id); \
1842
1906
  }
@@ -1848,7 +1912,7 @@ void Genesis::InstallBuiltinFunctionIds() {
1848
1912
  // Do not forget to update macros.py with named constant
1849
1913
  // of cache id.
1850
1914
  #define JSFUNCTION_RESULT_CACHE_LIST(F) \
1851
- F(16, global_context()->regexp_function())
1915
+ F(16, native_context()->regexp_function())
1852
1916
 
1853
1917
 
1854
1918
  static FixedArray* CreateCache(int size, Handle<JSFunction> factory_function) {
@@ -1884,37 +1948,38 @@ void Genesis::InstallJSFunctionResultCaches() {
1884
1948
 
1885
1949
  #undef F
1886
1950
 
1887
- global_context()->set_jsfunction_result_caches(*caches);
1951
+ native_context()->set_jsfunction_result_caches(*caches);
1888
1952
  }
1889
1953
 
1890
1954
 
1891
1955
  void Genesis::InitializeNormalizedMapCaches() {
1892
1956
  Handle<FixedArray> array(
1893
1957
  FACTORY->NewFixedArray(NormalizedMapCache::kEntries, TENURED));
1894
- global_context()->set_normalized_map_cache(NormalizedMapCache::cast(*array));
1958
+ native_context()->set_normalized_map_cache(NormalizedMapCache::cast(*array));
1895
1959
  }
1896
1960
 
1897
1961
 
1898
- bool Bootstrapper::InstallExtensions(Handle<Context> global_context,
1962
+ bool Bootstrapper::InstallExtensions(Handle<Context> native_context,
1899
1963
  v8::ExtensionConfiguration* extensions) {
1900
- Isolate* isolate = global_context->GetIsolate();
1964
+ Isolate* isolate = native_context->GetIsolate();
1901
1965
  BootstrapperActive active;
1902
1966
  SaveContext saved_context(isolate);
1903
- isolate->set_context(*global_context);
1904
- if (!Genesis::InstallExtensions(global_context, extensions)) return false;
1905
- Genesis::InstallSpecialObjects(global_context);
1967
+ isolate->set_context(*native_context);
1968
+ if (!Genesis::InstallExtensions(native_context, extensions)) return false;
1969
+ Genesis::InstallSpecialObjects(native_context);
1906
1970
  return true;
1907
1971
  }
1908
1972
 
1909
1973
 
1910
- void Genesis::InstallSpecialObjects(Handle<Context> global_context) {
1911
- Isolate* isolate = global_context->GetIsolate();
1974
+ void Genesis::InstallSpecialObjects(Handle<Context> native_context) {
1975
+ Isolate* isolate = native_context->GetIsolate();
1912
1976
  Factory* factory = isolate->factory();
1913
1977
  HandleScope scope;
1914
- Handle<JSGlobalObject> global(JSGlobalObject::cast(global_context->global()));
1978
+ Handle<JSGlobalObject> global(JSGlobalObject::cast(
1979
+ native_context->global_object()));
1915
1980
  // Expose the natives in global if a name for it is specified.
1916
1981
  if (FLAG_expose_natives_as != NULL && strlen(FLAG_expose_natives_as) != 0) {
1917
- Handle<String> natives = factory->LookupAsciiSymbol(FLAG_expose_natives_as);
1982
+ Handle<String> natives = factory->LookupUtf8Symbol(FLAG_expose_natives_as);
1918
1983
  CHECK_NOT_EMPTY_HANDLE(isolate,
1919
1984
  JSObject::SetLocalPropertyIgnoreAttributes(
1920
1985
  global, natives,
@@ -1924,7 +1989,8 @@ void Genesis::InstallSpecialObjects(Handle<Context> global_context) {
1924
1989
 
1925
1990
  Handle<Object> Error = GetProperty(global, "Error");
1926
1991
  if (Error->IsJSObject()) {
1927
- Handle<String> name = factory->LookupAsciiSymbol("stackTraceLimit");
1992
+ Handle<String> name =
1993
+ factory->LookupOneByteSymbol(STATIC_ASCII_VECTOR("stackTraceLimit"));
1928
1994
  Handle<Smi> stack_trace_limit(Smi::FromInt(FLAG_stack_trace_limit));
1929
1995
  CHECK_NOT_EMPTY_HANDLE(isolate,
1930
1996
  JSObject::SetLocalPropertyIgnoreAttributes(
@@ -1940,13 +2006,13 @@ void Genesis::InstallSpecialObjects(Handle<Context> global_context) {
1940
2006
  // debugger but without tanking the whole context.
1941
2007
  if (!debug->Load()) return;
1942
2008
  // Set the security token for the debugger context to the same as
1943
- // the shell global context to allow calling between these (otherwise
2009
+ // the shell native context to allow calling between these (otherwise
1944
2010
  // exposing debug global object doesn't make much sense).
1945
2011
  debug->debug_context()->set_security_token(
1946
- global_context->security_token());
2012
+ native_context->security_token());
1947
2013
 
1948
2014
  Handle<String> debug_string =
1949
- factory->LookupAsciiSymbol(FLAG_expose_debug_as);
2015
+ factory->LookupUtf8Symbol(FLAG_expose_debug_as);
1950
2016
  Handle<Object> global_proxy(debug->debug_context()->global_proxy());
1951
2017
  CHECK_NOT_EMPTY_HANDLE(isolate,
1952
2018
  JSObject::SetLocalPropertyIgnoreAttributes(
@@ -1982,7 +2048,7 @@ void Genesis::ExtensionStates::set_state(RegisteredExtension* extension,
1982
2048
  reinterpret_cast<void*>(static_cast<intptr_t>(state));
1983
2049
  }
1984
2050
 
1985
- bool Genesis::InstallExtensions(Handle<Context> global_context,
2051
+ bool Genesis::InstallExtensions(Handle<Context> native_context,
1986
2052
  v8::ExtensionConfiguration* extensions) {
1987
2053
  // TODO(isolates): Extensions on multiple isolates may take a little more
1988
2054
  // effort. (The external API reads 'ignore'-- does that mean
@@ -2002,6 +2068,9 @@ bool Genesis::InstallExtensions(Handle<Context> global_context,
2002
2068
  if (FLAG_expose_externalize_string) {
2003
2069
  InstallExtension("v8/externalize", &extension_states);
2004
2070
  }
2071
+ if (FLAG_track_gc_object_stats) {
2072
+ InstallExtension("v8/statistics", &extension_states);
2073
+ }
2005
2074
 
2006
2075
  if (extensions == NULL) return true;
2007
2076
  // Install required extensions
@@ -2087,19 +2156,15 @@ bool Genesis::InstallJSBuiltins(Handle<JSBuiltinsObject> builtins) {
2087
2156
  Factory* factory = builtins->GetIsolate()->factory();
2088
2157
  for (int i = 0; i < Builtins::NumberOfJavaScriptBuiltins(); i++) {
2089
2158
  Builtins::JavaScript id = static_cast<Builtins::JavaScript>(i);
2090
- Handle<String> name = factory->LookupAsciiSymbol(Builtins::GetName(id));
2159
+ Handle<String> name = factory->LookupUtf8Symbol(Builtins::GetName(id));
2091
2160
  Object* function_object = builtins->GetPropertyNoExceptionThrown(*name);
2092
2161
  Handle<JSFunction> function
2093
2162
  = Handle<JSFunction>(JSFunction::cast(function_object));
2094
2163
  builtins->set_javascript_builtin(id, *function);
2095
- Handle<SharedFunctionInfo> shared
2096
- = Handle<SharedFunctionInfo>(function->shared());
2097
- if (!SharedFunctionInfo::EnsureCompiled(shared, CLEAR_EXCEPTION)) {
2164
+ if (!JSFunction::CompileLazy(function, CLEAR_EXCEPTION)) {
2098
2165
  return false;
2099
2166
  }
2100
- // Set the code object on the function object.
2101
- function->ReplaceCode(function->shared()->code());
2102
- builtins->set_javascript_builtin_code(id, shared->code());
2167
+ builtins->set_javascript_builtin_code(id, function->shared()->code());
2103
2168
  }
2104
2169
  return true;
2105
2170
  }
@@ -2108,8 +2173,9 @@ bool Genesis::InstallJSBuiltins(Handle<JSBuiltinsObject> builtins) {
2108
2173
  bool Genesis::ConfigureGlobalObjects(
2109
2174
  v8::Handle<v8::ObjectTemplate> global_proxy_template) {
2110
2175
  Handle<JSObject> global_proxy(
2111
- JSObject::cast(global_context()->global_proxy()));
2112
- Handle<JSObject> inner_global(JSObject::cast(global_context()->global()));
2176
+ JSObject::cast(native_context()->global_proxy()));
2177
+ Handle<JSObject> inner_global(
2178
+ JSObject::cast(native_context()->global_object()));
2113
2179
 
2114
2180
  if (!global_proxy_template.IsEmpty()) {
2115
2181
  // Configure the global proxy object.
@@ -2183,27 +2249,24 @@ void Genesis::TransferNamedProperties(Handle<JSObject> from,
2183
2249
  LookupResult result(isolate());
2184
2250
  to->LocalLookup(descs->GetKey(i), &result);
2185
2251
  // If the property is already there we skip it
2186
- if (result.IsProperty()) continue;
2252
+ if (result.IsFound()) continue;
2187
2253
  HandleScope inner;
2188
2254
  ASSERT(!to->HasFastProperties());
2189
2255
  // Add to dictionary.
2190
2256
  Handle<String> key = Handle<String>(descs->GetKey(i));
2191
2257
  Handle<Object> callbacks(descs->GetCallbacksObject(i));
2192
- PropertyDetails d =
2193
- PropertyDetails(details.attributes(), CALLBACKS, details.index());
2258
+ PropertyDetails d = PropertyDetails(details.attributes(),
2259
+ CALLBACKS,
2260
+ details.descriptor_index());
2194
2261
  JSObject::SetNormalizedProperty(to, key, callbacks, d);
2195
2262
  break;
2196
2263
  }
2197
- case MAP_TRANSITION:
2198
- case ELEMENTS_TRANSITION:
2199
- case CONSTANT_TRANSITION:
2200
- case NULL_DESCRIPTOR:
2201
- // Ignore non-properties.
2202
- break;
2203
2264
  case NORMAL:
2204
2265
  // Do not occur since the from object has fast properties.
2205
2266
  case HANDLER:
2206
2267
  case INTERCEPTOR:
2268
+ case TRANSITION:
2269
+ case NONEXISTENT:
2207
2270
  // No element in instance descriptors have proxy or interceptor type.
2208
2271
  UNREACHABLE();
2209
2272
  break;
@@ -2220,7 +2283,7 @@ void Genesis::TransferNamedProperties(Handle<JSObject> from,
2220
2283
  // If the property is already there we skip it.
2221
2284
  LookupResult result(isolate());
2222
2285
  to->LocalLookup(String::cast(raw_key), &result);
2223
- if (result.IsProperty()) continue;
2286
+ if (result.IsFound()) continue;
2224
2287
  // Set the property.
2225
2288
  Handle<String> key = Handle<String>(String::cast(raw_key));
2226
2289
  Handle<Object> value = Handle<Object>(properties->ValueAt(i));
@@ -2259,7 +2322,7 @@ void Genesis::TransferObject(Handle<JSObject> from, Handle<JSObject> to) {
2259
2322
 
2260
2323
  // Transfer the prototype (new map is needed).
2261
2324
  Handle<Map> old_to_map = Handle<Map>(to->map());
2262
- Handle<Map> new_to_map = factory->CopyMapDropTransitions(old_to_map);
2325
+ Handle<Map> new_to_map = factory->CopyMap(old_to_map);
2263
2326
  new_to_map->set_prototype(from->map()->prototype());
2264
2327
  to->set_map(*new_to_map);
2265
2328
  }
@@ -2273,9 +2336,9 @@ void Genesis::MakeFunctionInstancePrototypeWritable() {
2273
2336
  ASSERT(!strict_mode_function_instance_map_writable_prototype_.is_null());
2274
2337
 
2275
2338
  // Replace function instance maps to make prototype writable.
2276
- global_context()->set_function_map(
2339
+ native_context()->set_function_map(
2277
2340
  *function_instance_map_writable_prototype_);
2278
- global_context()->set_strict_mode_function_map(
2341
+ native_context()->set_strict_mode_function_map(
2279
2342
  *strict_mode_function_instance_map_writable_prototype_);
2280
2343
  }
2281
2344
 
@@ -2301,10 +2364,10 @@ Genesis::Genesis(Isolate* isolate,
2301
2364
 
2302
2365
  Handle<Context> new_context = Snapshot::NewContextFromSnapshot();
2303
2366
  if (!new_context.is_null()) {
2304
- global_context_ =
2367
+ native_context_ =
2305
2368
  Handle<Context>::cast(isolate->global_handles()->Create(*new_context));
2306
- AddToWeakGlobalContextList(*global_context_);
2307
- isolate->set_context(*global_context_);
2369
+ AddToWeakNativeContextList(*native_context_);
2370
+ isolate->set_context(*native_context_);
2308
2371
  isolate->counters()->contexts_created_by_snapshot()->Increment();
2309
2372
  Handle<GlobalObject> inner_global;
2310
2373
  Handle<JSGlobalProxy> global_proxy =
@@ -2340,7 +2403,7 @@ Genesis::Genesis(Isolate* isolate,
2340
2403
  InitializeExperimentalGlobal();
2341
2404
  if (!InstallExperimentalNatives()) return;
2342
2405
 
2343
- result_ = global_context_;
2406
+ result_ = native_context_;
2344
2407
  }
2345
2408
 
2346
2409