OLD | NEW |
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 Loading... |
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->IsPropertyCell()) { | 5245 if (object->IsCell()) object = Cell::cast(object)->value(); |
5246 object = Cell::cast(object)->value(); | |
5247 } | |
5248 if (object->IsJSObject()) { | 5246 if (object->IsJSObject()) { |
5249 return FLAG_weak_embedded_objects_in_optimized_code; | 5247 return FLAG_weak_embedded_objects_in_optimized_code; |
5250 } | 5248 } |
5251 if (object->IsFixedArray()) { | 5249 if (object->IsFixedArray()) { |
5252 // Contexts of inlined functions are embedded in optimized code. | 5250 // Contexts of inlined functions are embedded in optimized code. |
5253 Map* map = HeapObject::cast(object)->map(); | 5251 Map* map = HeapObject::cast(object)->map(); |
5254 Heap* heap = map->GetHeap(); | 5252 Heap* heap = map->GetHeap(); |
5255 return FLAG_weak_embedded_objects_in_optimized_code && | 5253 return FLAG_weak_embedded_objects_in_optimized_code && |
5256 map == heap->function_context_map(); | 5254 map == heap->function_context_map(); |
5257 } | 5255 } |
(...skipping 2367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7625 #undef READ_SHORT_FIELD | 7623 #undef READ_SHORT_FIELD |
7626 #undef WRITE_SHORT_FIELD | 7624 #undef WRITE_SHORT_FIELD |
7627 #undef READ_BYTE_FIELD | 7625 #undef READ_BYTE_FIELD |
7628 #undef WRITE_BYTE_FIELD | 7626 #undef WRITE_BYTE_FIELD |
7629 #undef NOBARRIER_READ_BYTE_FIELD | 7627 #undef NOBARRIER_READ_BYTE_FIELD |
7630 #undef NOBARRIER_WRITE_BYTE_FIELD | 7628 #undef NOBARRIER_WRITE_BYTE_FIELD |
7631 | 7629 |
7632 } } // namespace v8::internal | 7630 } } // namespace v8::internal |
7633 | 7631 |
7634 #endif // V8_OBJECTS_INL_H_ | 7632 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |