| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 // When the stack is in the overflowed state, objects marked as overflowed | 200 // When the stack is in the overflowed state, objects marked as overflowed |
| 201 // have been reached and marked but their children have not been visited yet. | 201 // have been reached and marked but their children have not been visited yet. |
| 202 // After emptying the marking stack, we clear the overflow flag and traverse | 202 // After emptying the marking stack, we clear the overflow flag and traverse |
| 203 // the heap looking for objects marked as overflowed, push them on the stack, | 203 // the heap looking for objects marked as overflowed, push them on the stack, |
| 204 // and continue with marking. This process repeats until all reachable | 204 // and continue with marking. This process repeats until all reachable |
| 205 // objects have been marked. | 205 // objects have been marked. |
| 206 | 206 |
| 207 static MarkingStack marking_stack; | 207 static MarkingStack marking_stack; |
| 208 | 208 |
| 209 | 209 |
| 210 inline HeapObject* ShortCircuitConsString(Object** p) { | 210 static inline HeapObject* ShortCircuitConsString(Object** p) { |
| 211 // Optimization: If the heap object pointed to by p is a non-symbol | 211 // Optimization: If the heap object pointed to by p is a non-symbol |
| 212 // cons string whose right substring is Heap::empty_string, update | 212 // cons string whose right substring is Heap::empty_string, update |
| 213 // it in place to its left substring. Return the updated value. | 213 // it in place to its left substring. Return the updated value. |
| 214 // | 214 // |
| 215 // Here we assume that if we change *p, we replace it with a heap object | 215 // Here we assume that if we change *p, we replace it with a heap object |
| 216 // (ie, the left substring of a cons string is always a heap object). | 216 // (ie, the left substring of a cons string is always a heap object). |
| 217 // | 217 // |
| 218 // The check performed is: | 218 // The check performed is: |
| 219 // object->IsConsString() && !object->IsSymbol() && | 219 // object->IsConsString() && !object->IsSymbol() && |
| 220 // (ConsString::cast(object)->second() == Heap::empty_string()) | 220 // (ConsString::cast(object)->second() == Heap::empty_string()) |
| (...skipping 1546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1767 | 1767 |
| 1768 void MarkCompactCollector::RebuildRSets() { | 1768 void MarkCompactCollector::RebuildRSets() { |
| 1769 #ifdef DEBUG | 1769 #ifdef DEBUG |
| 1770 ASSERT(state_ == RELOCATE_OBJECTS); | 1770 ASSERT(state_ == RELOCATE_OBJECTS); |
| 1771 state_ = REBUILD_RSETS; | 1771 state_ = REBUILD_RSETS; |
| 1772 #endif | 1772 #endif |
| 1773 Heap::RebuildRSets(); | 1773 Heap::RebuildRSets(); |
| 1774 } | 1774 } |
| 1775 | 1775 |
| 1776 } } // namespace v8::internal | 1776 } } // namespace v8::internal |
| OLD | NEW |