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

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

Issue 957373002: Revert "Revert of Fix memory leak caused by field type in descriptor array." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: typo Created 5 years, 9 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-heap.cc ('k') | test/mjsunit/mjsunit.status » ('j') | 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 } 226 }
227 } 227 }
228 228
229 229
230 bool Check(DescriptorArray* descriptors, int descriptor) const { 230 bool Check(DescriptorArray* descriptors, int descriptor) const {
231 PropertyType type = types_[descriptor]; 231 PropertyType type = types_[descriptor];
232 if (!EqualDetails(descriptors, descriptor, type, attributes_[descriptor], 232 if (!EqualDetails(descriptors, descriptor, type, attributes_[descriptor],
233 representations_[descriptor])) { 233 representations_[descriptor])) {
234 return false; 234 return false;
235 } 235 }
236 Object* value = descriptors->GetValue(descriptor);
236 Object* expected_value = *values_[descriptor]; 237 Object* expected_value = *values_[descriptor];
237 Object* value = descriptors->GetValue(descriptor);
238 switch (type) { 238 switch (type) {
239 case DATA: 239 case DATA:
240 case ACCESSOR: 240 case ACCESSOR: {
241 return HeapType::cast(expected_value)->Equals(HeapType::cast(value)); 241 HeapType* type = descriptors->GetFieldType(descriptor);
242 return HeapType::cast(expected_value)->Equals(type);
243 }
242 244
243 case DATA_CONSTANT: 245 case DATA_CONSTANT:
244 return value == expected_value; 246 return value == expected_value;
245 247
246 case ACCESSOR_CONSTANT: { 248 case ACCESSOR_CONSTANT: {
247 if (value == expected_value) return true; 249 if (value == expected_value) return true;
248 if (!value->IsAccessorPair()) return false; 250 if (!value->IsAccessorPair()) return false;
249 AccessorPair* pair = AccessorPair::cast(value); 251 AccessorPair* pair = AccessorPair::cast(value);
250 return pair->Equals(expected_value, *setter_values_[descriptor]); 252 return pair->Equals(expected_value, *setter_values_[descriptor]);
251 } 253 }
(...skipping 1823 matching lines...) Expand 10 before | Expand all | Expand 10 after
2075 Handle<AccessorPair> pair = CreateAccessorPair(true, true); 2077 Handle<AccessorPair> pair = CreateAccessorPair(true, true);
2076 TransitionToAccessorConstantOperator transition_op(pair); 2078 TransitionToAccessorConstantOperator transition_op(pair);
2077 2079
2078 SameMapChecker checker; 2080 SameMapChecker checker;
2079 TestTransitionTo(transition_op, transition_op, checker); 2081 TestTransitionTo(transition_op, transition_op, checker);
2080 } 2082 }
2081 2083
2082 2084
2083 // TODO(ishell): add this test once IS_ACCESSOR_FIELD_SUPPORTED is supported. 2085 // TODO(ishell): add this test once IS_ACCESSOR_FIELD_SUPPORTED is supported.
2084 // TEST(TransitionAccessorConstantToAnotherAccessorConstant) 2086 // TEST(TransitionAccessorConstantToAnotherAccessorConstant)
OLDNEW
« no previous file with comments | « test/cctest/test-heap.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698