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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 2182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2193 // try to promote the object. | 2193 // try to promote the object. |
2194 if (SemiSpaceCopyObject<alignment>(map, slot, object, object_size)) { | 2194 if (SemiSpaceCopyObject<alignment>(map, slot, object, object_size)) { |
2195 return; | 2195 return; |
2196 } | 2196 } |
2197 } | 2197 } |
2198 | 2198 |
2199 if (PromoteObject<object_contents, alignment>(map, slot, object, | 2199 if (PromoteObject<object_contents, alignment>(map, slot, object, |
2200 object_size)) { | 2200 object_size)) { |
2201 return; | 2201 return; |
2202 } | 2202 } |
2203 V8::FatalProcessOutOfMemory("Scavenge promotion failed"); | 2203 |
| 2204 // If promotion failed, we try to copy the object to the other semi-space |
| 2205 if (SemiSpaceCopyObject<alignment>(map, slot, object, object_size)) return; |
| 2206 |
| 2207 UNREACHABLE(); |
2204 } | 2208 } |
2205 | 2209 |
2206 | 2210 |
2207 static inline void EvacuateJSFunction(Map* map, HeapObject** slot, | 2211 static inline void EvacuateJSFunction(Map* map, HeapObject** slot, |
2208 HeapObject* object) { | 2212 HeapObject* object) { |
2209 ObjectEvacuationStrategy<POINTER_OBJECT>::template VisitSpecialized< | 2213 ObjectEvacuationStrategy<POINTER_OBJECT>::template VisitSpecialized< |
2210 JSFunction::kSize>(map, slot, object); | 2214 JSFunction::kSize>(map, slot, object); |
2211 | 2215 |
2212 MapWord map_word = object->map_word(); | 2216 MapWord map_word = object->map_word(); |
2213 DCHECK(map_word.IsForwardingAddress()); | 2217 DCHECK(map_word.IsForwardingAddress()); |
(...skipping 4306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6520 static_cast<int>(object_sizes_last_time_[index])); | 6524 static_cast<int>(object_sizes_last_time_[index])); |
6521 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6525 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6522 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6526 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6523 | 6527 |
6524 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6528 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6525 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6529 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6526 ClearObjectStats(); | 6530 ClearObjectStats(); |
6527 } | 6531 } |
6528 } | 6532 } |
6529 } // namespace v8::internal | 6533 } // namespace v8::internal |
OLD | NEW |