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 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 CHECK(!info.dependencies()->HasAborted()); | 614 CHECK(!info.dependencies()->HasAborted()); |
615 | 615 |
616 } else { | 616 } else { |
617 CHECK(!field_owner->is_deprecated()); | 617 CHECK(!field_owner->is_deprecated()); |
618 CHECK(map->is_stable()); // Map did not change, must be left stable. | 618 CHECK(map->is_stable()); // Map did not change, must be left stable. |
619 CHECK_EQ(*map, *new_map); | 619 CHECK_EQ(*map, *new_map); |
620 | 620 |
621 CHECK_EQ(expected_field_type_dependency, info.dependencies()->HasAborted()); | 621 CHECK_EQ(expected_field_type_dependency, info.dependencies()->HasAborted()); |
622 } | 622 } |
623 | 623 |
| 624 { |
| 625 // Check that all previous maps are not stable. |
| 626 Map* tmp = *new_map; |
| 627 while (true) { |
| 628 Object* back = tmp->GetBackPointer(); |
| 629 if (back->IsUndefined()) break; |
| 630 tmp = Map::cast(back); |
| 631 CHECK(!tmp->is_stable()); |
| 632 } |
| 633 } |
| 634 |
624 info.dependencies()->Rollback(); // Properly cleanup compilation info. | 635 info.dependencies()->Rollback(); // Properly cleanup compilation info. |
625 | 636 |
626 // Update all deprecated maps and check that they are now the same. | 637 // Update all deprecated maps and check that they are now the same. |
627 Handle<Map> updated_map = Map::Update(map); | 638 Handle<Map> updated_map = Map::Update(map); |
628 CHECK_EQ(*new_map, *updated_map); | 639 CHECK_EQ(*new_map, *updated_map); |
629 } | 640 } |
630 | 641 |
631 | 642 |
632 static void TestGeneralizeRepresentation( | 643 static void TestGeneralizeRepresentation( |
633 Representation from_representation, Handle<HeapType> from_type, | 644 Representation from_representation, Handle<HeapType> from_type, |
(...skipping 1545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2179 Handle<AccessorPair> pair = CreateAccessorPair(true, true); | 2190 Handle<AccessorPair> pair = CreateAccessorPair(true, true); |
2180 TransitionToAccessorConstantOperator transition_op(pair); | 2191 TransitionToAccessorConstantOperator transition_op(pair); |
2181 | 2192 |
2182 SameMapChecker checker; | 2193 SameMapChecker checker; |
2183 TestTransitionTo(transition_op, transition_op, checker); | 2194 TestTransitionTo(transition_op, transition_op, checker); |
2184 } | 2195 } |
2185 | 2196 |
2186 | 2197 |
2187 // TODO(ishell): add this test once IS_ACCESSOR_FIELD_SUPPORTED is supported. | 2198 // TODO(ishell): add this test once IS_ACCESSOR_FIELD_SUPPORTED is supported. |
2188 // TEST(TransitionAccessorConstantToAnotherAccessorConstant) | 2199 // TEST(TransitionAccessorConstantToAnotherAccessorConstant) |
OLD | NEW |