Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: test/cctest/test-unboxed-doubles.cc

Issue 1546933002: Ensure that all non-stable maps created by Map::AddMissingTransitions() are marked as such. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressing comments Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/test-field-type-tracking.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/compilation-cache.h" 10 #include "src/compilation-cache.h"
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 // This method calls LayoutDescriptor::AppendIfFastOrUseFull() internally 752 // This method calls LayoutDescriptor::AppendIfFastOrUseFull() internally
753 // and does all the required map-descriptors related book keeping. 753 // and does all the required map-descriptors related book keeping.
754 Handle<Map> last_map = Map::AddMissingTransitionsForTesting( 754 Handle<Map> last_map = Map::AddMissingTransitionsForTesting(
755 initial_map, descriptors, full_layout_descriptor); 755 initial_map, descriptors, full_layout_descriptor);
756 756
757 // Follow back pointers to construct a sequence of maps from |map| 757 // Follow back pointers to construct a sequence of maps from |map|
758 // to |last_map|. 758 // to |last_map|.
759 int descriptors_length = descriptors->number_of_descriptors(); 759 int descriptors_length = descriptors->number_of_descriptors();
760 std::vector<Handle<Map>> maps(descriptors_length); 760 std::vector<Handle<Map>> maps(descriptors_length);
761 { 761 {
762 CHECK(last_map->is_stable());
762 Map* map = *last_map; 763 Map* map = *last_map;
763 for (int i = 0; i < descriptors_length; i++) { 764 for (int i = 0; i < descriptors_length; i++) {
764 maps[descriptors_length - 1 - i] = handle(map, isolate); 765 maps[descriptors_length - 1 - i] = handle(map, isolate);
765 Object* maybe_map = map->GetBackPointer(); 766 Object* maybe_map = map->GetBackPointer();
766 CHECK(maybe_map->IsMap()); 767 CHECK(maybe_map->IsMap());
767 map = Map::cast(maybe_map); 768 map = Map::cast(maybe_map);
769 CHECK(!map->is_stable());
768 } 770 }
769 CHECK_EQ(1, maps[0]->NumberOfOwnDescriptors()); 771 CHECK_EQ(1, maps[0]->NumberOfOwnDescriptors());
770 } 772 }
771 773
772 Handle<Map> map; 774 Handle<Map> map;
773 // Now check layout descriptors of all intermediate maps. 775 // Now check layout descriptors of all intermediate maps.
774 for (int i = 0; i < number_of_descriptors; i++) { 776 for (int i = 0; i < number_of_descriptors; i++) {
775 PropertyDetails details = descriptors->GetDetails(i); 777 PropertyDetails details = descriptors->GetDetails(i);
776 map = maps[i]; 778 map = maps[i];
777 LayoutDescriptor* layout_desc = map->layout_descriptor(); 779 LayoutDescriptor* layout_desc = map->layout_descriptor();
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
1620 1622
1621 // TODO(ishell): add respective tests for property kind reconfiguring from 1623 // TODO(ishell): add respective tests for property kind reconfiguring from
1622 // accessor field to double, once accessor fields are supported by 1624 // accessor field to double, once accessor fields are supported by
1623 // Map::ReconfigureProperty(). 1625 // Map::ReconfigureProperty().
1624 1626
1625 1627
1626 // TODO(ishell): add respective tests for fast property removal case once 1628 // TODO(ishell): add respective tests for fast property removal case once
1627 // Map::ReconfigureProperty() supports that. 1629 // Map::ReconfigureProperty() supports that.
1628 1630
1629 #endif 1631 #endif
OLDNEW
« no previous file with comments | « test/cctest/test-field-type-tracking.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698