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

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

Issue 960103003: 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: 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') | 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 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* expected_value = *values_[descriptor];
236 Object* value = descriptors->GetValue(descriptor); 237 Object* value = descriptors->GetValue(descriptor);
237 Object* expected_value = *values_[descriptor];
238 switch (type) { 238 switch (type) {
239 case DATA: 239 case DATA:
240 case ACCESSOR: { 240 case ACCESSOR:
241 HeapType* type = descriptors->GetFieldType(descriptor); 241 return HeapType::cast(expected_value)->Equals(HeapType::cast(value));
242 return HeapType::cast(expected_value)->Equals(type);
243 }
244 242
245 case DATA_CONSTANT: 243 case DATA_CONSTANT:
246 return value == expected_value; 244 return value == expected_value;
247 245
248 case ACCESSOR_CONSTANT: { 246 case ACCESSOR_CONSTANT: {
249 if (value == expected_value) return true; 247 if (value == expected_value) return true;
250 if (!value->IsAccessorPair()) return false; 248 if (!value->IsAccessorPair()) return false;
251 AccessorPair* pair = AccessorPair::cast(value); 249 AccessorPair* pair = AccessorPair::cast(value);
252 return pair->Equals(expected_value, *setter_values_[descriptor]); 250 return pair->Equals(expected_value, *setter_values_[descriptor]);
253 } 251 }
(...skipping 1823 matching lines...) Expand 10 before | Expand all | Expand 10 after
2077 Handle<AccessorPair> pair = CreateAccessorPair(true, true); 2075 Handle<AccessorPair> pair = CreateAccessorPair(true, true);
2078 TransitionToAccessorConstantOperator transition_op(pair); 2076 TransitionToAccessorConstantOperator transition_op(pair);
2079 2077
2080 SameMapChecker checker; 2078 SameMapChecker checker;
2081 TestTransitionTo(transition_op, transition_op, checker); 2079 TestTransitionTo(transition_op, transition_op, checker);
2082 } 2080 }
2083 2081
2084 2082
2085 // TODO(ishell): add this test once IS_ACCESSOR_FIELD_SUPPORTED is supported. 2083 // TODO(ishell): add this test once IS_ACCESSOR_FIELD_SUPPORTED is supported.
2086 // TEST(TransitionAccessorConstantToAnotherAccessorConstant) 2084 // TEST(TransitionAccessorConstantToAnotherAccessorConstant)
OLDNEW
« no previous file with comments | « test/cctest/test-heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698