libv8 3.10.8.0 → 3.11.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (215) hide show
  1. data/Rakefile +10 -3
  2. data/ext/libv8/compiler.rb +46 -0
  3. data/ext/libv8/extconf.rb +5 -1
  4. data/ext/libv8/make.rb +13 -0
  5. data/lib/libv8/version.rb +1 -1
  6. data/patches/add-freebsd9-and-freebsd10-to-gyp-GetFlavor.patch +11 -0
  7. data/patches/src_platform-freebsd.cc.patch +10 -0
  8. data/vendor/v8/ChangeLog +124 -0
  9. data/vendor/v8/DEPS +27 -0
  10. data/vendor/v8/Makefile +7 -0
  11. data/vendor/v8/SConstruct +15 -2
  12. data/vendor/v8/build/common.gypi +129 -157
  13. data/vendor/v8/build/gyp_v8 +11 -25
  14. data/vendor/v8/build/standalone.gypi +9 -3
  15. data/vendor/v8/include/v8.h +5 -3
  16. data/vendor/v8/src/SConscript +1 -0
  17. data/vendor/v8/src/api.cc +4 -33
  18. data/vendor/v8/src/api.h +2 -2
  19. data/vendor/v8/src/arm/builtins-arm.cc +5 -4
  20. data/vendor/v8/src/arm/code-stubs-arm.cc +21 -14
  21. data/vendor/v8/src/arm/codegen-arm.cc +2 -2
  22. data/vendor/v8/src/arm/debug-arm.cc +3 -1
  23. data/vendor/v8/src/arm/full-codegen-arm.cc +3 -102
  24. data/vendor/v8/src/arm/ic-arm.cc +30 -33
  25. data/vendor/v8/src/arm/lithium-arm.cc +20 -7
  26. data/vendor/v8/src/arm/lithium-arm.h +10 -4
  27. data/vendor/v8/src/arm/lithium-codegen-arm.cc +106 -60
  28. data/vendor/v8/src/arm/macro-assembler-arm.cc +49 -39
  29. data/vendor/v8/src/arm/macro-assembler-arm.h +5 -4
  30. data/vendor/v8/src/arm/regexp-macro-assembler-arm.cc +115 -55
  31. data/vendor/v8/src/arm/regexp-macro-assembler-arm.h +7 -6
  32. data/vendor/v8/src/arm/simulator-arm.h +6 -6
  33. data/vendor/v8/src/arm/stub-cache-arm.cc +64 -19
  34. data/vendor/v8/src/array.js +7 -3
  35. data/vendor/v8/src/ast.cc +11 -6
  36. data/vendor/v8/src/bootstrapper.cc +9 -11
  37. data/vendor/v8/src/builtins.cc +61 -31
  38. data/vendor/v8/src/code-stubs.cc +23 -9
  39. data/vendor/v8/src/code-stubs.h +1 -0
  40. data/vendor/v8/src/codegen.h +3 -3
  41. data/vendor/v8/src/compiler.cc +1 -1
  42. data/vendor/v8/src/contexts.h +2 -18
  43. data/vendor/v8/src/d8.cc +94 -93
  44. data/vendor/v8/src/d8.h +1 -1
  45. data/vendor/v8/src/debug-agent.cc +3 -3
  46. data/vendor/v8/src/debug.cc +41 -1
  47. data/vendor/v8/src/debug.h +50 -0
  48. data/vendor/v8/src/elements-kind.cc +134 -0
  49. data/vendor/v8/src/elements-kind.h +210 -0
  50. data/vendor/v8/src/elements.cc +356 -190
  51. data/vendor/v8/src/elements.h +36 -28
  52. data/vendor/v8/src/factory.cc +44 -4
  53. data/vendor/v8/src/factory.h +11 -7
  54. data/vendor/v8/src/flag-definitions.h +3 -0
  55. data/vendor/v8/src/frames.h +3 -0
  56. data/vendor/v8/src/full-codegen.cc +2 -1
  57. data/vendor/v8/src/func-name-inferrer.h +2 -0
  58. data/vendor/v8/src/globals.h +3 -0
  59. data/vendor/v8/src/heap-inl.h +16 -4
  60. data/vendor/v8/src/heap.cc +38 -32
  61. data/vendor/v8/src/heap.h +3 -17
  62. data/vendor/v8/src/hydrogen-instructions.cc +28 -5
  63. data/vendor/v8/src/hydrogen-instructions.h +142 -44
  64. data/vendor/v8/src/hydrogen.cc +160 -55
  65. data/vendor/v8/src/hydrogen.h +2 -0
  66. data/vendor/v8/src/ia32/assembler-ia32.h +3 -0
  67. data/vendor/v8/src/ia32/builtins-ia32.cc +5 -4
  68. data/vendor/v8/src/ia32/code-stubs-ia32.cc +22 -16
  69. data/vendor/v8/src/ia32/codegen-ia32.cc +2 -2
  70. data/vendor/v8/src/ia32/debug-ia32.cc +29 -2
  71. data/vendor/v8/src/ia32/full-codegen-ia32.cc +8 -101
  72. data/vendor/v8/src/ia32/ic-ia32.cc +23 -19
  73. data/vendor/v8/src/ia32/lithium-codegen-ia32.cc +126 -80
  74. data/vendor/v8/src/ia32/lithium-codegen-ia32.h +2 -1
  75. data/vendor/v8/src/ia32/lithium-ia32.cc +15 -9
  76. data/vendor/v8/src/ia32/lithium-ia32.h +14 -6
  77. data/vendor/v8/src/ia32/macro-assembler-ia32.cc +50 -40
  78. data/vendor/v8/src/ia32/macro-assembler-ia32.h +5 -4
  79. data/vendor/v8/src/ia32/regexp-macro-assembler-ia32.cc +113 -43
  80. data/vendor/v8/src/ia32/regexp-macro-assembler-ia32.h +9 -4
  81. data/vendor/v8/src/ia32/simulator-ia32.h +4 -4
  82. data/vendor/v8/src/ia32/stub-cache-ia32.cc +52 -14
  83. data/vendor/v8/src/ic.cc +77 -20
  84. data/vendor/v8/src/ic.h +18 -2
  85. data/vendor/v8/src/incremental-marking-inl.h +21 -5
  86. data/vendor/v8/src/incremental-marking.cc +35 -8
  87. data/vendor/v8/src/incremental-marking.h +12 -3
  88. data/vendor/v8/src/isolate.cc +12 -2
  89. data/vendor/v8/src/isolate.h +1 -1
  90. data/vendor/v8/src/jsregexp.cc +66 -26
  91. data/vendor/v8/src/jsregexp.h +60 -31
  92. data/vendor/v8/src/list-inl.h +8 -0
  93. data/vendor/v8/src/list.h +3 -0
  94. data/vendor/v8/src/lithium.cc +5 -2
  95. data/vendor/v8/src/liveedit.cc +57 -5
  96. data/vendor/v8/src/mark-compact-inl.h +17 -11
  97. data/vendor/v8/src/mark-compact.cc +100 -143
  98. data/vendor/v8/src/mark-compact.h +44 -20
  99. data/vendor/v8/src/messages.js +131 -99
  100. data/vendor/v8/src/mips/builtins-mips.cc +5 -4
  101. data/vendor/v8/src/mips/code-stubs-mips.cc +23 -15
  102. data/vendor/v8/src/mips/codegen-mips.cc +2 -2
  103. data/vendor/v8/src/mips/debug-mips.cc +3 -1
  104. data/vendor/v8/src/mips/full-codegen-mips.cc +4 -102
  105. data/vendor/v8/src/mips/ic-mips.cc +34 -36
  106. data/vendor/v8/src/mips/lithium-codegen-mips.cc +116 -68
  107. data/vendor/v8/src/mips/lithium-mips.cc +20 -7
  108. data/vendor/v8/src/mips/lithium-mips.h +11 -4
  109. data/vendor/v8/src/mips/macro-assembler-mips.cc +50 -39
  110. data/vendor/v8/src/mips/macro-assembler-mips.h +5 -4
  111. data/vendor/v8/src/mips/regexp-macro-assembler-mips.cc +110 -50
  112. data/vendor/v8/src/mips/regexp-macro-assembler-mips.h +6 -5
  113. data/vendor/v8/src/mips/simulator-mips.h +5 -5
  114. data/vendor/v8/src/mips/stub-cache-mips.cc +66 -20
  115. data/vendor/v8/src/mksnapshot.cc +5 -1
  116. data/vendor/v8/src/objects-debug.cc +103 -6
  117. data/vendor/v8/src/objects-inl.h +215 -116
  118. data/vendor/v8/src/objects-printer.cc +13 -8
  119. data/vendor/v8/src/objects.cc +608 -331
  120. data/vendor/v8/src/objects.h +129 -94
  121. data/vendor/v8/src/parser.cc +16 -4
  122. data/vendor/v8/src/platform-freebsd.cc +1 -0
  123. data/vendor/v8/src/platform-linux.cc +9 -30
  124. data/vendor/v8/src/platform-posix.cc +28 -7
  125. data/vendor/v8/src/platform-win32.cc +15 -3
  126. data/vendor/v8/src/platform.h +2 -1
  127. data/vendor/v8/src/profile-generator-inl.h +25 -2
  128. data/vendor/v8/src/profile-generator.cc +300 -822
  129. data/vendor/v8/src/profile-generator.h +97 -214
  130. data/vendor/v8/src/regexp-macro-assembler-irregexp.cc +2 -1
  131. data/vendor/v8/src/regexp-macro-assembler-irregexp.h +2 -2
  132. data/vendor/v8/src/regexp-macro-assembler-tracer.cc +6 -5
  133. data/vendor/v8/src/regexp-macro-assembler-tracer.h +1 -1
  134. data/vendor/v8/src/regexp-macro-assembler.cc +7 -3
  135. data/vendor/v8/src/regexp-macro-assembler.h +10 -2
  136. data/vendor/v8/src/regexp.js +6 -0
  137. data/vendor/v8/src/runtime.cc +265 -212
  138. data/vendor/v8/src/runtime.h +6 -5
  139. data/vendor/v8/src/scopes.cc +20 -0
  140. data/vendor/v8/src/scopes.h +6 -3
  141. data/vendor/v8/src/spaces.cc +0 -2
  142. data/vendor/v8/src/string-stream.cc +2 -2
  143. data/vendor/v8/src/v8-counters.h +0 -2
  144. data/vendor/v8/src/v8natives.js +2 -2
  145. data/vendor/v8/src/v8utils.h +6 -3
  146. data/vendor/v8/src/version.cc +1 -1
  147. data/vendor/v8/src/x64/assembler-x64.h +2 -1
  148. data/vendor/v8/src/x64/builtins-x64.cc +5 -4
  149. data/vendor/v8/src/x64/code-stubs-x64.cc +25 -16
  150. data/vendor/v8/src/x64/codegen-x64.cc +2 -2
  151. data/vendor/v8/src/x64/debug-x64.cc +14 -1
  152. data/vendor/v8/src/x64/disasm-x64.cc +1 -1
  153. data/vendor/v8/src/x64/full-codegen-x64.cc +10 -106
  154. data/vendor/v8/src/x64/ic-x64.cc +20 -16
  155. data/vendor/v8/src/x64/lithium-codegen-x64.cc +156 -79
  156. data/vendor/v8/src/x64/lithium-codegen-x64.h +2 -1
  157. data/vendor/v8/src/x64/lithium-x64.cc +18 -8
  158. data/vendor/v8/src/x64/lithium-x64.h +7 -2
  159. data/vendor/v8/src/x64/macro-assembler-x64.cc +50 -40
  160. data/vendor/v8/src/x64/macro-assembler-x64.h +5 -4
  161. data/vendor/v8/src/x64/regexp-macro-assembler-x64.cc +122 -51
  162. data/vendor/v8/src/x64/regexp-macro-assembler-x64.h +17 -8
  163. data/vendor/v8/src/x64/simulator-x64.h +4 -4
  164. data/vendor/v8/src/x64/stub-cache-x64.cc +55 -17
  165. data/vendor/v8/test/cctest/cctest.status +1 -0
  166. data/vendor/v8/test/cctest/test-api.cc +24 -0
  167. data/vendor/v8/test/cctest/test-func-name-inference.cc +38 -0
  168. data/vendor/v8/test/cctest/test-heap-profiler.cc +21 -77
  169. data/vendor/v8/test/cctest/test-heap.cc +164 -3
  170. data/vendor/v8/test/cctest/test-list.cc +12 -0
  171. data/vendor/v8/test/cctest/test-mark-compact.cc +5 -5
  172. data/vendor/v8/test/cctest/test-regexp.cc +14 -8
  173. data/vendor/v8/test/cctest/testcfg.py +2 -0
  174. data/vendor/v8/test/mjsunit/accessor-map-sharing.js +176 -0
  175. data/vendor/v8/test/mjsunit/array-construct-transition.js +3 -3
  176. data/vendor/v8/test/mjsunit/array-literal-transitions.js +10 -10
  177. data/vendor/v8/test/mjsunit/big-array-literal.js +3 -0
  178. data/vendor/v8/test/mjsunit/compiler/inline-construct.js +4 -2
  179. data/vendor/v8/test/mjsunit/debug-liveedit-stack-padding.js +88 -0
  180. data/vendor/v8/test/mjsunit/elements-kind.js +4 -4
  181. data/vendor/v8/test/mjsunit/elements-transition-hoisting.js +2 -2
  182. data/vendor/v8/test/mjsunit/elements-transition.js +5 -5
  183. data/vendor/v8/test/mjsunit/error-constructors.js +68 -33
  184. data/vendor/v8/test/mjsunit/harmony/proxies.js +14 -6
  185. data/vendor/v8/test/mjsunit/mjsunit.status +1 -0
  186. data/vendor/v8/test/mjsunit/packed-elements.js +112 -0
  187. data/vendor/v8/test/mjsunit/regexp-capture-3.js +6 -0
  188. data/vendor/v8/test/mjsunit/regexp-global.js +132 -0
  189. data/vendor/v8/test/mjsunit/regexp.js +11 -0
  190. data/vendor/v8/test/mjsunit/regress/regress-117409.js +52 -0
  191. data/vendor/v8/test/mjsunit/regress/regress-126412.js +33 -0
  192. data/vendor/v8/test/mjsunit/regress/regress-128018.js +35 -0
  193. data/vendor/v8/test/mjsunit/regress/regress-128146.js +33 -0
  194. data/vendor/v8/test/mjsunit/regress/regress-1639-2.js +4 -1
  195. data/vendor/v8/test/mjsunit/regress/regress-1639.js +14 -8
  196. data/vendor/v8/test/mjsunit/regress/regress-1849.js +3 -3
  197. data/vendor/v8/test/mjsunit/regress/regress-1878.js +2 -2
  198. data/vendor/v8/test/mjsunit/regress/regress-2071.js +79 -0
  199. data/vendor/v8/test/mjsunit/regress/regress-2153.js +32 -0
  200. data/vendor/v8/test/mjsunit/regress/regress-crbug-122271.js +4 -4
  201. data/vendor/v8/test/mjsunit/regress/regress-crbug-126414.js +32 -0
  202. data/vendor/v8/test/mjsunit/regress/regress-smi-only-concat.js +2 -2
  203. data/vendor/v8/test/mjsunit/regress/regress-transcendental.js +49 -0
  204. data/vendor/v8/test/mjsunit/stack-traces.js +14 -0
  205. data/vendor/v8/test/mjsunit/unbox-double-arrays.js +4 -3
  206. data/vendor/v8/test/test262/testcfg.py +6 -1
  207. data/vendor/v8/tools/check-static-initializers.sh +11 -3
  208. data/vendor/v8/tools/fuzz-harness.sh +92 -0
  209. data/vendor/v8/tools/grokdump.py +658 -67
  210. data/vendor/v8/tools/gyp/v8.gyp +21 -39
  211. data/vendor/v8/tools/js2c.py +3 -3
  212. data/vendor/v8/tools/jsmin.py +2 -2
  213. data/vendor/v8/tools/presubmit.py +2 -1
  214. data/vendor/v8/tools/test-wrapper-gypbuild.py +25 -11
  215. metadata +624 -612
@@ -30,6 +30,7 @@
30
30
 
31
31
  #include "allocation.h"
32
32
  #include "builtins.h"
33
+ #include "elements-kind.h"
33
34
  #include "list.h"
34
35
  #include "property-details.h"
35
36
  #include "smart-array-pointer.h"
@@ -131,40 +132,6 @@
131
132
  namespace v8 {
132
133
  namespace internal {
133
134
 
134
- enum ElementsKind {
135
- // The "fast" kind for elements that only contain SMI values. Must be first
136
- // to make it possible to efficiently check maps for this kind.
137
- FAST_SMI_ONLY_ELEMENTS,
138
-
139
- // The "fast" kind for tagged values. Must be second to make it possible to
140
- // efficiently check maps for this and the FAST_SMI_ONLY_ELEMENTS kind
141
- // together at once.
142
- FAST_ELEMENTS,
143
-
144
- // The "fast" kind for unwrapped, non-tagged double values.
145
- FAST_DOUBLE_ELEMENTS,
146
-
147
- // The "slow" kind.
148
- DICTIONARY_ELEMENTS,
149
- NON_STRICT_ARGUMENTS_ELEMENTS,
150
- // The "fast" kind for external arrays
151
- EXTERNAL_BYTE_ELEMENTS,
152
- EXTERNAL_UNSIGNED_BYTE_ELEMENTS,
153
- EXTERNAL_SHORT_ELEMENTS,
154
- EXTERNAL_UNSIGNED_SHORT_ELEMENTS,
155
- EXTERNAL_INT_ELEMENTS,
156
- EXTERNAL_UNSIGNED_INT_ELEMENTS,
157
- EXTERNAL_FLOAT_ELEMENTS,
158
- EXTERNAL_DOUBLE_ELEMENTS,
159
- EXTERNAL_PIXEL_ELEMENTS,
160
-
161
- // Derived constants from ElementsKind
162
- FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND = EXTERNAL_BYTE_ELEMENTS,
163
- LAST_EXTERNAL_ARRAY_ELEMENTS_KIND = EXTERNAL_PIXEL_ELEMENTS,
164
- FIRST_ELEMENTS_KIND = FAST_SMI_ONLY_ELEMENTS,
165
- LAST_ELEMENTS_KIND = EXTERNAL_PIXEL_ELEMENTS
166
- };
167
-
168
135
  enum CompareMapMode {
169
136
  REQUIRE_EXACT_MAP,
170
137
  ALLOW_ELEMENT_TRANSITION_MAPS
@@ -175,13 +142,6 @@ enum KeyedAccessGrowMode {
175
142
  ALLOW_JSARRAY_GROWTH
176
143
  };
177
144
 
178
- const int kElementsKindCount = LAST_ELEMENTS_KIND - FIRST_ELEMENTS_KIND + 1;
179
-
180
- void PrintElementsKind(FILE* out, ElementsKind kind);
181
-
182
- inline bool IsMoreGeneralElementsKindTransition(ElementsKind from_kind,
183
- ElementsKind to_kind);
184
-
185
145
  // Setter that skips the write barrier if mode is SKIP_WRITE_BARRIER.
186
146
  enum WriteBarrierMode { SKIP_WRITE_BARRIER, UPDATE_WRITE_BARRIER };
187
147
 
@@ -704,12 +664,13 @@ enum CompareResult {
704
664
  WriteBarrierMode mode = UPDATE_WRITE_BARRIER); \
705
665
 
706
666
 
667
+ class AccessorPair;
707
668
  class DictionaryElementsAccessor;
708
669
  class ElementsAccessor;
670
+ class Failure;
709
671
  class FixedArrayBase;
710
672
  class ObjectVisitor;
711
673
  class StringStream;
712
- class Failure;
713
674
 
714
675
  struct ValueInfo : public Malloced {
715
676
  ValueInfo() : type(FIRST_TYPE), ptr(NULL), str(NULL), number(0) { }
@@ -1509,13 +1470,19 @@ class JSObject: public JSReceiver {
1509
1470
  MUST_USE_RESULT inline MaybeObject* ResetElements();
1510
1471
  inline ElementsKind GetElementsKind();
1511
1472
  inline ElementsAccessor* GetElementsAccessor();
1512
- inline bool HasFastSmiOnlyElements();
1513
- inline bool HasFastElements();
1514
- // Returns if an object has either FAST_ELEMENT or FAST_SMI_ONLY_ELEMENT
1515
- // elements. TODO(danno): Rename HasFastTypeElements to HasFastElements() and
1516
- // HasFastElements to HasFastObjectElements.
1517
- inline bool HasFastTypeElements();
1473
+ // Returns true if an object has elements of FAST_SMI_ELEMENTS ElementsKind.
1474
+ inline bool HasFastSmiElements();
1475
+ // Returns true if an object has elements of FAST_ELEMENTS ElementsKind.
1476
+ inline bool HasFastObjectElements();
1477
+ // Returns true if an object has elements of FAST_ELEMENTS or
1478
+ // FAST_SMI_ONLY_ELEMENTS.
1479
+ inline bool HasFastSmiOrObjectElements();
1480
+ // Returns true if an object has elements of FAST_DOUBLE_ELEMENTS
1481
+ // ElementsKind.
1518
1482
  inline bool HasFastDoubleElements();
1483
+ // Returns true if an object has elements of FAST_HOLEY_*_ELEMENTS
1484
+ // ElementsKind.
1485
+ inline bool HasFastHoleyElements();
1519
1486
  inline bool HasNonStrictArgumentsElements();
1520
1487
  inline bool HasDictionaryElements();
1521
1488
  inline bool HasExternalPixelElements();
@@ -1642,6 +1609,14 @@ class JSObject: public JSReceiver {
1642
1609
  Object* getter,
1643
1610
  Object* setter,
1644
1611
  PropertyAttributes attributes);
1612
+ // Try to define a single accessor paying attention to map transitions.
1613
+ // Returns a JavaScript null if this was not possible and we have to use the
1614
+ // slow case. Note that we can fail due to allocations, too.
1615
+ MUST_USE_RESULT MaybeObject* DefineFastAccessor(
1616
+ String* name,
1617
+ AccessorComponent component,
1618
+ Object* accessor,
1619
+ PropertyAttributes attributes);
1645
1620
  Object* LookupAccessor(String* name, AccessorComponent component);
1646
1621
 
1647
1622
  MUST_USE_RESULT MaybeObject* DefineAccessor(AccessorInfo* info);
@@ -1710,7 +1685,7 @@ class JSObject: public JSReceiver {
1710
1685
  static Handle<Object> DeleteElement(Handle<JSObject> obj, uint32_t index);
1711
1686
  MUST_USE_RESULT MaybeObject* DeleteElement(uint32_t index, DeleteMode mode);
1712
1687
 
1713
- inline void ValidateSmiOnlyElements();
1688
+ inline void ValidateElements();
1714
1689
 
1715
1690
  // Makes sure that this object can contain HeapObject as elements.
1716
1691
  MUST_USE_RESULT inline MaybeObject* EnsureCanContainHeapObjectElements();
@@ -1722,6 +1697,7 @@ class JSObject: public JSReceiver {
1722
1697
  EnsureElementsMode mode);
1723
1698
  MUST_USE_RESULT inline MaybeObject* EnsureCanContainElements(
1724
1699
  FixedArrayBase* elements,
1700
+ uint32_t length,
1725
1701
  EnsureElementsMode mode);
1726
1702
  MUST_USE_RESULT MaybeObject* EnsureCanContainElements(
1727
1703
  Arguments* arguments,
@@ -1820,10 +1796,10 @@ class JSObject: public JSReceiver {
1820
1796
  MUST_USE_RESULT MaybeObject* GetElementWithInterceptor(Object* receiver,
1821
1797
  uint32_t index);
1822
1798
 
1823
- enum SetFastElementsCapacityMode {
1824
- kAllowSmiOnlyElements,
1825
- kForceSmiOnlyElements,
1826
- kDontAllowSmiOnlyElements
1799
+ enum SetFastElementsCapacitySmiMode {
1800
+ kAllowSmiElements,
1801
+ kForceSmiElements,
1802
+ kDontAllowSmiElements
1827
1803
  };
1828
1804
 
1829
1805
  // Replace the elements' backing store with fast elements of the given
@@ -1832,7 +1808,7 @@ class JSObject: public JSReceiver {
1832
1808
  MUST_USE_RESULT MaybeObject* SetFastElementsCapacityAndLength(
1833
1809
  int capacity,
1834
1810
  int length,
1835
- SetFastElementsCapacityMode set_capacity_mode);
1811
+ SetFastElementsCapacitySmiMode smi_mode);
1836
1812
  MUST_USE_RESULT MaybeObject* SetFastDoubleElementsCapacityAndLength(
1837
1813
  int capacity,
1838
1814
  int length);
@@ -2474,6 +2450,7 @@ class DescriptorArray: public FixedArray {
2474
2450
  // Accessors for fetching instance descriptor at descriptor number.
2475
2451
  inline String* GetKey(int descriptor_number);
2476
2452
  inline Object* GetValue(int descriptor_number);
2453
+ inline Object** GetValueSlot(int descriptor_number);
2477
2454
  inline PropertyDetails GetDetails(int descriptor_number);
2478
2455
  inline PropertyType GetType(int descriptor_number);
2479
2456
  inline int GetFieldIndex(int descriptor_number);
@@ -2484,6 +2461,14 @@ class DescriptorArray: public FixedArray {
2484
2461
  inline bool IsTransitionOnly(int descriptor_number);
2485
2462
  inline bool IsNullDescriptor(int descriptor_number);
2486
2463
 
2464
+ // WhitenessWitness is used to prove that a specific descriptor array is white
2465
+ // (unmarked), so incremental write barriers can be skipped because the
2466
+ // marking invariant cannot be broken and slots pointing into evacuation
2467
+ // candidates will be discovered when the object is scanned. A witness is
2468
+ // always stack-allocated right after creating a descriptor array. By
2469
+ // allocating a witness, incremental marking is globally disabled. The witness
2470
+ // is then passed along wherever needed to statically prove that the
2471
+ // descriptor array is known to be white.
2487
2472
  class WhitenessWitness {
2488
2473
  public:
2489
2474
  inline explicit WhitenessWitness(DescriptorArray* array);
@@ -2600,6 +2585,9 @@ class DescriptorArray: public FixedArray {
2600
2585
  // Is the descriptor array sorted and without duplicates?
2601
2586
  bool IsSortedNoDuplicates();
2602
2587
 
2588
+ // Is the descriptor array consistent with the back pointers in targets?
2589
+ bool IsConsistentWithBackPointers(Map* current_map);
2590
+
2603
2591
  // Are two DescriptorArrays equal?
2604
2592
  bool IsEqualTo(DescriptorArray* other);
2605
2593
  #endif
@@ -2609,6 +2597,8 @@ class DescriptorArray: public FixedArray {
2609
2597
  static const int kMaxNumberOfDescriptors = 1024 + 512;
2610
2598
 
2611
2599
  private:
2600
+ friend class IntrusiveMapTransitionIterator;
2601
+
2612
2602
  // An entry in a DescriptorArray, represented as an (array, index) pair.
2613
2603
  class Entry {
2614
2604
  public:
@@ -2647,6 +2637,7 @@ class DescriptorArray: public FixedArray {
2647
2637
  FixedArray* GetContentArray() {
2648
2638
  return FixedArray::cast(get(kContentArrayIndex));
2649
2639
  }
2640
+
2650
2641
  DISALLOW_IMPLICIT_CONSTRUCTORS(DescriptorArray);
2651
2642
  };
2652
2643
 
@@ -4291,6 +4282,11 @@ class Code: public HeapObject {
4291
4282
  inline byte compare_state();
4292
4283
  inline void set_compare_state(byte value);
4293
4284
 
4285
+ // [compare_operation]: For kind COMPARE_IC tells what compare operation the
4286
+ // stub was generated for.
4287
+ inline byte compare_operation();
4288
+ inline void set_compare_operation(byte value);
4289
+
4294
4290
  // [to_boolean_foo]: For kind TO_BOOLEAN_IC tells what state the stub is in.
4295
4291
  inline byte to_boolean_state();
4296
4292
  inline void set_to_boolean_state(byte value);
@@ -4426,6 +4422,7 @@ class Code: public HeapObject {
4426
4422
  void CodeVerify();
4427
4423
  #endif
4428
4424
  void ClearInlineCaches();
4425
+ void ClearTypeFeedbackCells(Heap* heap);
4429
4426
 
4430
4427
  // Max loop nesting marker used to postpose OSR. We don't take loop
4431
4428
  // nesting that is deeper than 5 levels into account.
@@ -4474,6 +4471,8 @@ class Code: public HeapObject {
4474
4471
 
4475
4472
  static const int kBinaryOpReturnTypeOffset = kBinaryOpTypeOffset + 1;
4476
4473
 
4474
+ static const int kCompareOperationOffset = kCompareStateOffset + 1;
4475
+
4477
4476
  static const int kAllowOSRAtLoopNestingLevelOffset = kFullCodeFlags + 1;
4478
4477
  static const int kProfilerTicksOffset = kAllowOSRAtLoopNestingLevelOffset + 1;
4479
4478
 
@@ -4627,17 +4626,21 @@ class Map: public HeapObject {
4627
4626
  }
4628
4627
 
4629
4628
  // Tells whether the instance has fast elements that are only Smis.
4630
- inline bool has_fast_smi_only_elements() {
4631
- return elements_kind() == FAST_SMI_ONLY_ELEMENTS;
4629
+ inline bool has_fast_smi_elements() {
4630
+ return IsFastSmiElementsKind(elements_kind());
4632
4631
  }
4633
4632
 
4634
4633
  // Tells whether the instance has fast elements.
4635
- inline bool has_fast_elements() {
4636
- return elements_kind() == FAST_ELEMENTS;
4634
+ inline bool has_fast_object_elements() {
4635
+ return IsFastObjectElementsKind(elements_kind());
4636
+ }
4637
+
4638
+ inline bool has_fast_smi_or_object_elements() {
4639
+ return IsFastSmiOrObjectElementsKind(elements_kind());
4637
4640
  }
4638
4641
 
4639
4642
  inline bool has_fast_double_elements() {
4640
- return elements_kind() == FAST_DOUBLE_ELEMENTS;
4643
+ return IsFastDoubleElementsKind(elements_kind());
4641
4644
  }
4642
4645
 
4643
4646
  inline bool has_non_strict_arguments_elements() {
@@ -4702,19 +4705,30 @@ class Map: public HeapObject {
4702
4705
  // [stub cache]: contains stubs compiled for this map.
4703
4706
  DECL_ACCESSORS(code_cache, Object)
4704
4707
 
4708
+ // [back pointer]: points back to the parent map from which a transition
4709
+ // leads to this map. The field overlaps with prototype transitions and the
4710
+ // back pointer will be moved into the prototype transitions array if
4711
+ // required.
4712
+ inline Object* GetBackPointer();
4713
+ inline void SetBackPointer(Object* value,
4714
+ WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
4715
+
4705
4716
  // [prototype transitions]: cache of prototype transitions.
4706
4717
  // Prototype transition is a transition that happens
4707
4718
  // when we change object's prototype to a new one.
4708
4719
  // Cache format:
4709
4720
  // 0: finger - index of the first free cell in the cache
4710
- // 1 + 2 * i: prototype
4711
- // 2 + 2 * i: target map
4721
+ // 1: back pointer that overlaps with prototype transitions field.
4722
+ // 2 + 2 * i: prototype
4723
+ // 3 + 2 * i: target map
4712
4724
  DECL_ACCESSORS(prototype_transitions, FixedArray)
4713
4725
 
4714
- inline FixedArray* unchecked_prototype_transitions();
4726
+ inline void init_prototype_transitions(Object* undefined);
4727
+ inline HeapObject* unchecked_prototype_transitions();
4715
4728
 
4716
- static const int kProtoTransitionHeaderSize = 1;
4729
+ static const int kProtoTransitionHeaderSize = 2;
4717
4730
  static const int kProtoTransitionNumberOfEntriesOffset = 0;
4731
+ static const int kProtoTransitionBackPointerOffset = 1;
4718
4732
  static const int kProtoTransitionElementsPerEntry = 2;
4719
4733
  static const int kProtoTransitionPrototypeOffset = 0;
4720
4734
  static const int kProtoTransitionMapOffset = 1;
@@ -4786,25 +4800,10 @@ class Map: public HeapObject {
4786
4800
  // Removes a code object from the code cache at the given index.
4787
4801
  void RemoveFromCodeCache(String* name, Code* code, int index);
4788
4802
 
4789
- // For every transition in this map, makes the transition's
4790
- // target's prototype pointer point back to this map.
4791
- // This is undone in MarkCompactCollector::ClearNonLiveTransitions().
4792
- void CreateBackPointers();
4793
-
4794
- void CreateOneBackPointer(Object* transition_target);
4795
-
4796
- // Set all map transitions from this map to dead maps to null.
4797
- // Also, restore the original prototype on the targets of these
4798
- // transitions, so that we do not process this map again while
4799
- // following back pointers.
4800
- void ClearNonLiveTransitions(Heap* heap, Object* real_prototype);
4801
-
4802
- // Restore a possible back pointer in the prototype field of object.
4803
- // Return true in that case and false otherwise. Set *keep_entry to
4804
- // true when a live map transition has been found.
4805
- bool RestoreOneBackPointer(Object* object,
4806
- Object* real_prototype,
4807
- bool* keep_entry);
4803
+ // Set all map transitions from this map to dead maps to null. Also clear
4804
+ // back pointers in transition targets so that we do not process this map
4805
+ // again while following back pointers.
4806
+ void ClearNonLiveTransitions(Heap* heap);
4808
4807
 
4809
4808
  // Computes a hash value for this map, to be used in HashTables and such.
4810
4809
  int Hash();
@@ -4839,6 +4838,14 @@ class Map: public HeapObject {
4839
4838
  Handle<Map> FindTransitionedMap(MapHandleList* candidates);
4840
4839
  Map* FindTransitionedMap(MapList* candidates);
4841
4840
 
4841
+ // Zaps the contents of backing data structures in debug mode. Note that the
4842
+ // heap verifier (i.e. VerifyMarkingVisitor) relies on zapping of objects
4843
+ // holding weak references when incremental marking is used, because it also
4844
+ // iterates over objects that are otherwise unreachable.
4845
+ #ifdef DEBUG
4846
+ void ZapInstanceDescriptors();
4847
+ void ZapPrototypeTransitions();
4848
+ #endif
4842
4849
 
4843
4850
  // Dispatched behavior.
4844
4851
  #ifdef OBJECT_PRINT
@@ -4886,16 +4893,17 @@ class Map: public HeapObject {
4886
4893
  kConstructorOffset + kPointerSize;
4887
4894
  static const int kCodeCacheOffset =
4888
4895
  kInstanceDescriptorsOrBitField3Offset + kPointerSize;
4889
- static const int kPrototypeTransitionsOffset =
4896
+ static const int kPrototypeTransitionsOrBackPointerOffset =
4890
4897
  kCodeCacheOffset + kPointerSize;
4891
- static const int kPadStart = kPrototypeTransitionsOffset + kPointerSize;
4898
+ static const int kPadStart =
4899
+ kPrototypeTransitionsOrBackPointerOffset + kPointerSize;
4892
4900
  static const int kSize = MAP_POINTER_ALIGN(kPadStart);
4893
4901
 
4894
4902
  // Layout of pointer fields. Heap iteration code relies on them
4895
4903
  // being continuously allocated.
4896
4904
  static const int kPointerFieldsBeginOffset = Map::kPrototypeOffset;
4897
4905
  static const int kPointerFieldsEndOffset =
4898
- Map::kPrototypeTransitionsOffset + kPointerSize;
4906
+ kPrototypeTransitionsOrBackPointerOffset + kPointerSize;
4899
4907
 
4900
4908
  // Byte offsets within kInstanceSizesOffset.
4901
4909
  static const int kInstanceSizeOffset = kInstanceSizesOffset + 0;
@@ -4928,25 +4936,31 @@ class Map: public HeapObject {
4928
4936
 
4929
4937
  // Bit positions for bit field 2
4930
4938
  static const int kIsExtensible = 0;
4931
- static const int kFunctionWithPrototype = 1;
4932
- static const int kStringWrapperSafeForDefaultValueOf = 2;
4933
- static const int kAttachedToSharedFunctionInfo = 3;
4939
+ static const int kStringWrapperSafeForDefaultValueOf = 1;
4940
+ static const int kAttachedToSharedFunctionInfo = 2;
4934
4941
  // No bits can be used after kElementsKindFirstBit, they are all reserved for
4935
4942
  // storing ElementKind.
4936
- static const int kElementsKindShift = 4;
4937
- static const int kElementsKindBitCount = 4;
4943
+ static const int kElementsKindShift = 3;
4944
+ static const int kElementsKindBitCount = 5;
4938
4945
 
4939
4946
  // Derived values from bit field 2
4940
4947
  static const int kElementsKindMask = (-1 << kElementsKindShift) &
4941
4948
  ((1 << (kElementsKindShift + kElementsKindBitCount)) - 1);
4942
4949
  static const int8_t kMaximumBitField2FastElementValue = static_cast<int8_t>(
4943
4950
  (FAST_ELEMENTS + 1) << Map::kElementsKindShift) - 1;
4944
- static const int8_t kMaximumBitField2FastSmiOnlyElementValue =
4945
- static_cast<int8_t>((FAST_SMI_ONLY_ELEMENTS + 1) <<
4951
+ static const int8_t kMaximumBitField2FastSmiElementValue =
4952
+ static_cast<int8_t>((FAST_SMI_ELEMENTS + 1) <<
4953
+ Map::kElementsKindShift) - 1;
4954
+ static const int8_t kMaximumBitField2FastHoleyElementValue =
4955
+ static_cast<int8_t>((FAST_HOLEY_ELEMENTS + 1) <<
4956
+ Map::kElementsKindShift) - 1;
4957
+ static const int8_t kMaximumBitField2FastHoleySmiElementValue =
4958
+ static_cast<int8_t>((FAST_HOLEY_SMI_ELEMENTS + 1) <<
4946
4959
  Map::kElementsKindShift) - 1;
4947
4960
 
4948
4961
  // Bit positions for bit field 3
4949
4962
  static const int kIsShared = 0;
4963
+ static const int kFunctionWithPrototype = 1;
4950
4964
 
4951
4965
  // Layout of the default cache. It holds alternating name and code objects.
4952
4966
  static const int kCodeCacheEntrySize = 2;
@@ -5334,6 +5348,8 @@ class SharedFunctionInfo: public HeapObject {
5334
5348
  inline int deopt_counter();
5335
5349
  inline void set_deopt_counter(int counter);
5336
5350
 
5351
+ inline int profiler_ticks();
5352
+
5337
5353
  // Inline cache age is used to infer whether the function survived a context
5338
5354
  // disposal or not. In the former case we reset the opt_count.
5339
5355
  inline int ic_age();
@@ -6120,7 +6136,7 @@ class JSDate: public JSObject {
6120
6136
 
6121
6137
  // Returns the date field with the specified index.
6122
6138
  // See FieldIndex for the list of date fields.
6123
- static MaybeObject* GetField(Object* date, Smi* index);
6139
+ static Object* GetField(Object* date, Smi* index);
6124
6140
 
6125
6141
  void SetValue(Object* value, bool is_value_nan);
6126
6142
 
@@ -6869,7 +6885,7 @@ class String: public HeapObject {
6869
6885
  inline void Set(int index, uint16_t value);
6870
6886
  // Get individual two byte char in the string. Repeated calls
6871
6887
  // to this method are not efficient unless the string is flat.
6872
- inline uint16_t Get(int index);
6888
+ INLINE(uint16_t Get(int index));
6873
6889
 
6874
6890
  // Try to flatten the string. Checks first inline to see if it is
6875
6891
  // necessary. Does nothing if the string is not a cons string.
@@ -7224,6 +7240,10 @@ class SeqAsciiString: public SeqString {
7224
7240
  unsigned* offset,
7225
7241
  unsigned chars);
7226
7242
 
7243
+ #ifdef DEBUG
7244
+ void SeqAsciiStringVerify();
7245
+ #endif
7246
+
7227
7247
  private:
7228
7248
  DISALLOW_IMPLICIT_CONSTRUCTORS(SeqAsciiString);
7229
7249
  };
@@ -7700,11 +7720,13 @@ class JSProxy: public JSReceiver {
7700
7720
  uint32_t index);
7701
7721
 
7702
7722
  MUST_USE_RESULT MaybeObject* SetPropertyWithHandler(
7723
+ JSReceiver* receiver,
7703
7724
  String* name,
7704
7725
  Object* value,
7705
7726
  PropertyAttributes attributes,
7706
7727
  StrictModeFlag strict_mode);
7707
7728
  MUST_USE_RESULT MaybeObject* SetElementWithHandler(
7729
+ JSReceiver* receiver,
7708
7730
  uint32_t index,
7709
7731
  Object* value,
7710
7732
  StrictModeFlag strict_mode);
@@ -7712,6 +7734,7 @@ class JSProxy: public JSReceiver {
7712
7734
  // If the handler defines an accessor property, invoke its setter
7713
7735
  // (or throw if only a getter exists) and set *found to true. Otherwise false.
7714
7736
  MUST_USE_RESULT MaybeObject* SetPropertyWithHandlerIfDefiningSetter(
7737
+ JSReceiver* receiver,
7715
7738
  String* name,
7716
7739
  Object* value,
7717
7740
  PropertyAttributes attributes,
@@ -8101,6 +8124,18 @@ class AccessorPair: public Struct {
8101
8124
 
8102
8125
  MUST_USE_RESULT MaybeObject* CopyWithoutTransitions();
8103
8126
 
8127
+ Object* get(AccessorComponent component) {
8128
+ return component == ACCESSOR_GETTER ? getter() : setter();
8129
+ }
8130
+
8131
+ void set(AccessorComponent component, Object* value) {
8132
+ if (component == ACCESSOR_GETTER) {
8133
+ set_getter(value);
8134
+ } else {
8135
+ set_setter(value);
8136
+ }
8137
+ }
8138
+
8104
8139
  // Note: Returns undefined instead in case of a hole.
8105
8140
  Object* GetComponent(AccessorComponent component);
8106
8141