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

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

Issue 913093002: Reland r26549 "Fix IsWeakObjectInOptimizedCode predicate to also include property cells." (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 | « no previous file | 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 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 5224 matching lines...) Expand 10 before | Expand all | Expand 10 after
5235 FromAddress(Memory::Address_at(location_of_address) - Code::kHeaderSize); 5235 FromAddress(Memory::Address_at(location_of_address) - Code::kHeaderSize);
5236 } 5236 }
5237 5237
5238 5238
5239 bool Code::IsWeakObjectInOptimizedCode(Object* object) { 5239 bool Code::IsWeakObjectInOptimizedCode(Object* object) {
5240 if (!FLAG_collect_maps) return false; 5240 if (!FLAG_collect_maps) return false;
5241 if (object->IsMap()) { 5241 if (object->IsMap()) {
5242 return Map::cast(object)->CanTransition() && 5242 return Map::cast(object)->CanTransition() &&
5243 FLAG_weak_embedded_maps_in_optimized_code; 5243 FLAG_weak_embedded_maps_in_optimized_code;
5244 } 5244 }
5245 if (object->IsCell()) object = Cell::cast(object)->value(); 5245 if (object->IsCell()) {
5246 object = Cell::cast(object)->value();
5247 } else if (object->IsPropertyCell()) {
5248 object = PropertyCell::cast(object)->value();
5249 }
5246 if (object->IsJSObject()) { 5250 if (object->IsJSObject()) {
5247 return FLAG_weak_embedded_objects_in_optimized_code; 5251 return FLAG_weak_embedded_objects_in_optimized_code;
5248 } 5252 }
5249 if (object->IsFixedArray()) { 5253 if (object->IsFixedArray()) {
5250 // Contexts of inlined functions are embedded in optimized code. 5254 // Contexts of inlined functions are embedded in optimized code.
5251 Map* map = HeapObject::cast(object)->map(); 5255 Map* map = HeapObject::cast(object)->map();
5252 Heap* heap = map->GetHeap(); 5256 Heap* heap = map->GetHeap();
5253 return FLAG_weak_embedded_objects_in_optimized_code && 5257 return FLAG_weak_embedded_objects_in_optimized_code &&
5254 map == heap->function_context_map(); 5258 map == heap->function_context_map();
5255 } 5259 }
(...skipping 2367 matching lines...) Expand 10 before | Expand all | Expand 10 after
7623 #undef READ_SHORT_FIELD 7627 #undef READ_SHORT_FIELD
7624 #undef WRITE_SHORT_FIELD 7628 #undef WRITE_SHORT_FIELD
7625 #undef READ_BYTE_FIELD 7629 #undef READ_BYTE_FIELD
7626 #undef WRITE_BYTE_FIELD 7630 #undef WRITE_BYTE_FIELD
7627 #undef NOBARRIER_READ_BYTE_FIELD 7631 #undef NOBARRIER_READ_BYTE_FIELD
7628 #undef NOBARRIER_WRITE_BYTE_FIELD 7632 #undef NOBARRIER_WRITE_BYTE_FIELD
7629 7633
7630 } } // namespace v8::internal 7634 } } // namespace v8::internal
7631 7635
7632 #endif // V8_OBJECTS_INL_H_ 7636 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698