| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdlib.h> | 5 #include <stdlib.h> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "test/cctest/test-api.h" | 8 #include "test/cctest/test-api.h" |
| 9 | 9 |
| 10 #include "src/v8.h" | 10 #include "src/v8.h" |
| (...skipping 1750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1761 CHECK(!new_map->is_deprecated()); | 1761 CHECK(!new_map->is_deprecated()); |
| 1762 CHECK(expectations.Check(*new_map)); | 1762 CHECK(expectations.Check(*new_map)); |
| 1763 | 1763 |
| 1764 // Update deprecated |map|, it should become |new_map|. | 1764 // Update deprecated |map|, it should become |new_map|. |
| 1765 Handle<Map> updated_map = Map::Update(map); | 1765 Handle<Map> updated_map = Map::Update(map); |
| 1766 CHECK_EQ(*new_map, *updated_map); | 1766 CHECK_EQ(*new_map, *updated_map); |
| 1767 | 1767 |
| 1768 // Ensure Map::FindElementsKindTransitionedMap() is able to find the | 1768 // Ensure Map::FindElementsKindTransitionedMap() is able to find the |
| 1769 // transitioned map. | 1769 // transitioned map. |
| 1770 { | 1770 { |
| 1771 MapHandleList map_list; | 1771 MapHandles map_list; |
| 1772 map_list.Add(updated_map); | 1772 map_list.push_back(updated_map); |
| 1773 Map* transitioned_map = map2->FindElementsKindTransitionedMap(&map_list); | 1773 Map* transitioned_map = map2->FindElementsKindTransitionedMap(map_list); |
| 1774 CHECK_EQ(*updated_map, transitioned_map); | 1774 CHECK_EQ(*updated_map, transitioned_map); |
| 1775 } | 1775 } |
| 1776 } | 1776 } |
| 1777 | 1777 |
| 1778 // This test ensures that trivial field generalization (from HeapObject to | 1778 // This test ensures that trivial field generalization (from HeapObject to |
| 1779 // HeapObject) is correctly propagated from one branch of transition tree | 1779 // HeapObject) is correctly propagated from one branch of transition tree |
| 1780 // (|map2|) to another (|map|). | 1780 // (|map2|) to another (|map|). |
| 1781 // | 1781 // |
| 1782 // + - p0 - p1 - p2A - p3 - p4: |map| | 1782 // + - p0 - p1 - p2A - p3 - p4: |map| |
| 1783 // | | 1783 // | |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1856 | 1856 |
| 1857 CHECK(!new_map->is_deprecated()); | 1857 CHECK(!new_map->is_deprecated()); |
| 1858 CHECK(expectations.Check(*new_map)); | 1858 CHECK(expectations.Check(*new_map)); |
| 1859 | 1859 |
| 1860 Handle<Map> updated_map = Map::Update(map); | 1860 Handle<Map> updated_map = Map::Update(map); |
| 1861 CHECK_EQ(*new_map, *updated_map); | 1861 CHECK_EQ(*new_map, *updated_map); |
| 1862 | 1862 |
| 1863 // Ensure Map::FindElementsKindTransitionedMap() is able to find the | 1863 // Ensure Map::FindElementsKindTransitionedMap() is able to find the |
| 1864 // transitioned map. | 1864 // transitioned map. |
| 1865 { | 1865 { |
| 1866 MapHandleList map_list; | 1866 MapHandles map_list; |
| 1867 map_list.Add(updated_map); | 1867 map_list.push_back(updated_map); |
| 1868 Map* transitioned_map = map2->FindElementsKindTransitionedMap(&map_list); | 1868 Map* transitioned_map = map2->FindElementsKindTransitionedMap(map_list); |
| 1869 CHECK_EQ(*updated_map, transitioned_map); | 1869 CHECK_EQ(*updated_map, transitioned_map); |
| 1870 } | 1870 } |
| 1871 } | 1871 } |
| 1872 | 1872 |
| 1873 TEST(ReconfigureElementsKind_GeneralizeSmiFieldToDouble) { | 1873 TEST(ReconfigureElementsKind_GeneralizeSmiFieldToDouble) { |
| 1874 CcTest::InitializeVM(); | 1874 CcTest::InitializeVM(); |
| 1875 v8::HandleScope scope(CcTest::isolate()); | 1875 v8::HandleScope scope(CcTest::isolate()); |
| 1876 Isolate* isolate = CcTest::i_isolate(); | 1876 Isolate* isolate = CcTest::i_isolate(); |
| 1877 Handle<FieldType> any_type = FieldType::Any(isolate); | 1877 Handle<FieldType> any_type = FieldType::Any(isolate); |
| 1878 | 1878 |
| (...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2734 Handle<Object> obj = | 2734 Handle<Object> obj = |
| 2735 Object::NewStorageFor(isolate, isolate->factory()->uninitialized_value(), | 2735 Object::NewStorageFor(isolate, isolate->factory()->uninitialized_value(), |
| 2736 Representation::Double()); | 2736 Representation::Double()); |
| 2737 CHECK(obj->IsMutableHeapNumber()); | 2737 CHECK(obj->IsMutableHeapNumber()); |
| 2738 CHECK_EQ(kHoleNanInt64, HeapNumber::cast(*obj)->value_as_bits()); | 2738 CHECK_EQ(kHoleNanInt64, HeapNumber::cast(*obj)->value_as_bits()); |
| 2739 | 2739 |
| 2740 obj = Object::NewStorageFor(isolate, mhn, Representation::Double()); | 2740 obj = Object::NewStorageFor(isolate, mhn, Representation::Double()); |
| 2741 CHECK(obj->IsMutableHeapNumber()); | 2741 CHECK(obj->IsMutableHeapNumber()); |
| 2742 CHECK_EQ(kHoleNanInt64, HeapNumber::cast(*obj)->value_as_bits()); | 2742 CHECK_EQ(kHoleNanInt64, HeapNumber::cast(*obj)->value_as_bits()); |
| 2743 } | 2743 } |
| OLD | NEW |