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 4790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4801 } | 4801 } |
4802 | 4802 |
4803 | 4803 |
4804 Object* Code::GetObjectFromEntryAddress(Address location_of_address) { | 4804 Object* Code::GetObjectFromEntryAddress(Address location_of_address) { |
4805 return HeapObject:: | 4805 return HeapObject:: |
4806 FromAddress(Memory::Address_at(location_of_address) - Code::kHeaderSize); | 4806 FromAddress(Memory::Address_at(location_of_address) - Code::kHeaderSize); |
4807 } | 4807 } |
4808 | 4808 |
4809 | 4809 |
4810 bool Code::IsWeakObjectInOptimizedCode(Object* object) { | 4810 bool Code::IsWeakObjectInOptimizedCode(Object* object) { |
| 4811 if (!FLAG_collect_maps) return false; |
4811 if (object->IsMap()) { | 4812 if (object->IsMap()) { |
4812 return Map::cast(object)->CanTransition() && | 4813 return Map::cast(object)->CanTransition() && |
4813 FLAG_collect_maps && | |
4814 FLAG_weak_embedded_maps_in_optimized_code; | 4814 FLAG_weak_embedded_maps_in_optimized_code; |
4815 } | 4815 } |
4816 if (object->IsJSObject() || | 4816 if (object->IsJSObject() || |
4817 (object->IsCell() && Cell::cast(object)->value()->IsJSObject())) { | 4817 (object->IsCell() && Cell::cast(object)->value()->IsJSObject())) { |
4818 return FLAG_weak_embedded_objects_in_optimized_code; | 4818 return FLAG_weak_embedded_objects_in_optimized_code; |
4819 } | 4819 } |
4820 return false; | 4820 return false; |
4821 } | 4821 } |
4822 | 4822 |
4823 | 4823 |
(...skipping 2158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6982 #undef READ_SHORT_FIELD | 6982 #undef READ_SHORT_FIELD |
6983 #undef WRITE_SHORT_FIELD | 6983 #undef WRITE_SHORT_FIELD |
6984 #undef READ_BYTE_FIELD | 6984 #undef READ_BYTE_FIELD |
6985 #undef WRITE_BYTE_FIELD | 6985 #undef WRITE_BYTE_FIELD |
6986 #undef NOBARRIER_READ_BYTE_FIELD | 6986 #undef NOBARRIER_READ_BYTE_FIELD |
6987 #undef NOBARRIER_WRITE_BYTE_FIELD | 6987 #undef NOBARRIER_WRITE_BYTE_FIELD |
6988 | 6988 |
6989 } } // namespace v8::internal | 6989 } } // namespace v8::internal |
6990 | 6990 |
6991 #endif // V8_OBJECTS_INL_H_ | 6991 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |