| 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 = 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 Loading... |
| 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_ |
| OLD | NEW |