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

Side by Side Diff: test/cctest/test-migrations.cc

Issue 930983003: Reduce field type tracking to a single stable map per field. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 | « src/types.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 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 "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 Representation::Tagged(), any_type); 687 Representation::Tagged(), any_type);
688 } 688 }
689 689
690 690
691 TEST(GeneralizeRepresentationHeapObjectToHeapObject) { 691 TEST(GeneralizeRepresentationHeapObjectToHeapObject) {
692 CcTest::InitializeVM(); 692 CcTest::InitializeVM();
693 v8::HandleScope scope(CcTest::isolate()); 693 v8::HandleScope scope(CcTest::isolate());
694 Isolate* isolate = CcTest::i_isolate(); 694 Isolate* isolate = CcTest::i_isolate();
695 Handle<HeapType> any_type = HeapType::Any(isolate); 695 Handle<HeapType> any_type = HeapType::Any(isolate);
696 696
697 const int kMaxClassesPerFieldType = 5; 697 const int kMaxClassesPerFieldType = 1;
698 Handle<HeapType> current_type = 698 Handle<HeapType> current_type =
699 HeapType::Class(Map::Create(isolate, 0), isolate); 699 HeapType::Class(Map::Create(isolate, 0), isolate);
700 700
701 for (int i = 0; i < kMaxClassesPerFieldType; i++) { 701 for (int i = 0; i < kMaxClassesPerFieldType; i++) {
702 Handle<HeapType> new_type = 702 Handle<HeapType> new_type =
703 HeapType::Class(Map::Create(isolate, 0), isolate); 703 HeapType::Class(Map::Create(isolate, 0), isolate);
704 704
705 Handle<HeapType> expected_type = 705 Handle<HeapType> expected_type =
706 (i < kMaxClassesPerFieldType - 1) 706 (i < kMaxClassesPerFieldType - 1)
707 ? HeapType::Union(current_type, new_type, isolate) 707 ? HeapType::Union(current_type, new_type, isolate)
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
1063 value_type, Representation::Tagged(), any_type); 1063 value_type, Representation::Tagged(), any_type);
1064 } 1064 }
1065 1065
1066 1066
1067 TEST(ReconfigureDataFieldAttribute_GeneralizeRepresentationHeapObjToHeapObj) { 1067 TEST(ReconfigureDataFieldAttribute_GeneralizeRepresentationHeapObjToHeapObj) {
1068 CcTest::InitializeVM(); 1068 CcTest::InitializeVM();
1069 v8::HandleScope scope(CcTest::isolate()); 1069 v8::HandleScope scope(CcTest::isolate());
1070 Isolate* isolate = CcTest::i_isolate(); 1070 Isolate* isolate = CcTest::i_isolate();
1071 Handle<HeapType> any_type = HeapType::Any(isolate); 1071 Handle<HeapType> any_type = HeapType::Any(isolate);
1072 1072
1073 const int kMaxClassesPerFieldType = 5; 1073 const int kMaxClassesPerFieldType = 1;
1074 Handle<HeapType> current_type = 1074 Handle<HeapType> current_type =
1075 HeapType::Class(Map::Create(isolate, 0), isolate); 1075 HeapType::Class(Map::Create(isolate, 0), isolate);
1076 1076
1077 for (int i = 0; i < kMaxClassesPerFieldType; i++) { 1077 for (int i = 0; i < kMaxClassesPerFieldType; i++) {
1078 Handle<HeapType> new_type = 1078 Handle<HeapType> new_type =
1079 HeapType::Class(Map::Create(isolate, 0), isolate); 1079 HeapType::Class(Map::Create(isolate, 0), isolate);
1080 1080
1081 Handle<HeapType> expected_type = 1081 Handle<HeapType> expected_type =
1082 (i < kMaxClassesPerFieldType - 1) 1082 (i < kMaxClassesPerFieldType - 1)
1083 ? HeapType::Union(current_type, new_type, isolate) 1083 ? HeapType::Union(current_type, new_type, isolate)
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
2023 Handle<AccessorPair> pair = CreateAccessorPair(true, true); 2023 Handle<AccessorPair> pair = CreateAccessorPair(true, true);
2024 TransitionToAccessorConstantOperator transition_op(pair); 2024 TransitionToAccessorConstantOperator transition_op(pair);
2025 2025
2026 SameMapChecker checker; 2026 SameMapChecker checker;
2027 TestTransitionTo(transition_op, transition_op, checker); 2027 TestTransitionTo(transition_op, transition_op, checker);
2028 } 2028 }
2029 2029
2030 2030
2031 // TODO(ishell): add this test once IS_ACCESSOR_FIELD_SUPPORTED is supported. 2031 // TODO(ishell): add this test once IS_ACCESSOR_FIELD_SUPPORTED is supported.
2032 // TEST(TransitionAccessorConstantToAnotherAccessorConstant) 2032 // TEST(TransitionAccessorConstantToAnotherAccessorConstant)
OLDNEW
« no previous file with comments | « src/types.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698