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 4789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4800 return result; | 4800 return result; |
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) { |
Igor Sheludko
2014/04/29 12:22:56
Probably it would be better to add
if (!FLAG_col
ulan
2014/04/29 12:26:17
Moved the common check "if (!FLAG_collect_maps) re
| |
4811 if (object->IsMap()) { | 4811 if (object->IsMap()) { |
4812 return Map::cast(object)->CanTransition() && | 4812 return Map::cast(object)->CanTransition() && |
4813 FLAG_collect_maps && | 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_collect_maps && |
4819 FLAG_weak_embedded_objects_in_optimized_code; | |
4819 } | 4820 } |
4820 return false; | 4821 return false; |
4821 } | 4822 } |
4822 | 4823 |
4823 | 4824 |
4824 class Code::FindAndReplacePattern { | 4825 class Code::FindAndReplacePattern { |
4825 public: | 4826 public: |
4826 FindAndReplacePattern() : count_(0) { } | 4827 FindAndReplacePattern() : count_(0) { } |
4827 void Add(Handle<Map> map_to_find, Handle<Object> obj_to_replace) { | 4828 void Add(Handle<Map> map_to_find, Handle<Object> obj_to_replace) { |
4828 ASSERT(count_ < kMaxCount); | 4829 ASSERT(count_ < kMaxCount); |
(...skipping 2153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6982 #undef READ_SHORT_FIELD | 6983 #undef READ_SHORT_FIELD |
6983 #undef WRITE_SHORT_FIELD | 6984 #undef WRITE_SHORT_FIELD |
6984 #undef READ_BYTE_FIELD | 6985 #undef READ_BYTE_FIELD |
6985 #undef WRITE_BYTE_FIELD | 6986 #undef WRITE_BYTE_FIELD |
6986 #undef NOBARRIER_READ_BYTE_FIELD | 6987 #undef NOBARRIER_READ_BYTE_FIELD |
6987 #undef NOBARRIER_WRITE_BYTE_FIELD | 6988 #undef NOBARRIER_WRITE_BYTE_FIELD |
6988 | 6989 |
6989 } } // namespace v8::internal | 6990 } } // namespace v8::internal |
6990 | 6991 |
6991 #endif // V8_OBJECTS_INL_H_ | 6992 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |