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

Side by Side Diff: src/objects-inl.h

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 | « src/objects.cc ('k') | src/property.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 3118 matching lines...) Expand 10 before | Expand all | Expand 10 after
3129 3129
3130 3130
3131 int DescriptorArray::GetFieldIndex(int descriptor_number) { 3131 int DescriptorArray::GetFieldIndex(int descriptor_number) {
3132 DCHECK(GetDetails(descriptor_number).location() == kField); 3132 DCHECK(GetDetails(descriptor_number).location() == kField);
3133 return GetDetails(descriptor_number).field_index(); 3133 return GetDetails(descriptor_number).field_index();
3134 } 3134 }
3135 3135
3136 3136
3137 HeapType* DescriptorArray::GetFieldType(int descriptor_number) { 3137 HeapType* DescriptorArray::GetFieldType(int descriptor_number) {
3138 DCHECK(GetDetails(descriptor_number).location() == kField); 3138 DCHECK(GetDetails(descriptor_number).location() == kField);
3139 Object* value = GetValue(descriptor_number); 3139 return HeapType::cast(GetValue(descriptor_number));
3140 if (value->IsWeakCell()) {
3141 if (WeakCell::cast(value)->cleared()) return HeapType::Any();
3142 value = WeakCell::cast(value)->value();
3143 }
3144 return HeapType::cast(value);
3145 } 3140 }
3146 3141
3147 3142
3148 Object* DescriptorArray::GetConstant(int descriptor_number) { 3143 Object* DescriptorArray::GetConstant(int descriptor_number) {
3149 return GetValue(descriptor_number); 3144 return GetValue(descriptor_number);
3150 } 3145 }
3151 3146
3152 3147
3153 Object* DescriptorArray::GetCallbacksObject(int descriptor_number) { 3148 Object* DescriptorArray::GetCallbacksObject(int descriptor_number) {
3154 DCHECK(GetType(descriptor_number) == ACCESSOR_CONSTANT); 3149 DCHECK(GetType(descriptor_number) == ACCESSOR_CONSTANT);
(...skipping 4479 matching lines...) Expand 10 before | Expand all | Expand 10 after
7634 #undef READ_SHORT_FIELD 7629 #undef READ_SHORT_FIELD
7635 #undef WRITE_SHORT_FIELD 7630 #undef WRITE_SHORT_FIELD
7636 #undef READ_BYTE_FIELD 7631 #undef READ_BYTE_FIELD
7637 #undef WRITE_BYTE_FIELD 7632 #undef WRITE_BYTE_FIELD
7638 #undef NOBARRIER_READ_BYTE_FIELD 7633 #undef NOBARRIER_READ_BYTE_FIELD
7639 #undef NOBARRIER_WRITE_BYTE_FIELD 7634 #undef NOBARRIER_WRITE_BYTE_FIELD
7640 7635
7641 } } // namespace v8::internal 7636 } } // namespace v8::internal
7642 7637
7643 #endif // V8_OBJECTS_INL_H_ 7638 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/property.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698