| 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 4717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4728 bool Code::IsWeakObjectInOptimizedCode(Object* object) { | 4728 bool Code::IsWeakObjectInOptimizedCode(Object* object) { |
| 4729 if (object->IsMap()) { | 4729 if (object->IsMap()) { |
| 4730 return Map::cast(object)->CanTransition() && | 4730 return Map::cast(object)->CanTransition() && |
| 4731 FLAG_weak_embedded_maps_in_optimized_code; | 4731 FLAG_weak_embedded_maps_in_optimized_code; |
| 4732 } | 4732 } |
| 4733 if (object->IsCell()) { | 4733 if (object->IsCell()) { |
| 4734 object = Cell::cast(object)->value(); | 4734 object = Cell::cast(object)->value(); |
| 4735 } else if (object->IsPropertyCell()) { | 4735 } else if (object->IsPropertyCell()) { |
| 4736 object = PropertyCell::cast(object)->value(); | 4736 object = PropertyCell::cast(object)->value(); |
| 4737 } | 4737 } |
| 4738 if (object->IsJSObject()) { | 4738 if (object->IsJSObject() || object->IsJSProxy()) { |
| 4739 // JSProxy is handled like JSObject because it can morph into one. |
| 4739 return FLAG_weak_embedded_objects_in_optimized_code; | 4740 return FLAG_weak_embedded_objects_in_optimized_code; |
| 4740 } | 4741 } |
| 4741 if (object->IsFixedArray()) { | 4742 if (object->IsFixedArray()) { |
| 4742 // Contexts of inlined functions are embedded in optimized code. | 4743 // Contexts of inlined functions are embedded in optimized code. |
| 4743 Map* map = HeapObject::cast(object)->map(); | 4744 Map* map = HeapObject::cast(object)->map(); |
| 4744 Heap* heap = map->GetHeap(); | 4745 Heap* heap = map->GetHeap(); |
| 4745 return FLAG_weak_embedded_objects_in_optimized_code && | 4746 return FLAG_weak_embedded_objects_in_optimized_code && |
| 4746 map == heap->function_context_map(); | 4747 map == heap->function_context_map(); |
| 4747 } | 4748 } |
| 4748 return false; | 4749 return false; |
| (...skipping 2472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7221 #undef READ_INT64_FIELD | 7222 #undef READ_INT64_FIELD |
| 7222 #undef WRITE_INT64_FIELD | 7223 #undef WRITE_INT64_FIELD |
| 7223 #undef READ_BYTE_FIELD | 7224 #undef READ_BYTE_FIELD |
| 7224 #undef WRITE_BYTE_FIELD | 7225 #undef WRITE_BYTE_FIELD |
| 7225 #undef NOBARRIER_READ_BYTE_FIELD | 7226 #undef NOBARRIER_READ_BYTE_FIELD |
| 7226 #undef NOBARRIER_WRITE_BYTE_FIELD | 7227 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7227 | 7228 |
| 7228 } } // namespace v8::internal | 7229 } } // namespace v8::internal |
| 7229 | 7230 |
| 7230 #endif // V8_OBJECTS_INL_H_ | 7231 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |