Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 269 | 269 |
| 270 bool Heap::InNewSpace(Object* object) { | 270 bool Heap::InNewSpace(Object* object) { |
| 271 bool result = new_space_.Contains(object); | 271 bool result = new_space_.Contains(object); |
| 272 ASSERT(!result || // Either not in new space | 272 ASSERT(!result || // Either not in new space |
| 273 gc_state_ != NOT_IN_GC || // ... or in the middle of GC | 273 gc_state_ != NOT_IN_GC || // ... or in the middle of GC |
| 274 InToSpace(object)); // ... or in to-space (where we allocate). | 274 InToSpace(object)); // ... or in to-space (where we allocate). |
| 275 return result; | 275 return result; |
| 276 } | 276 } |
| 277 | 277 |
| 278 | 278 |
| 279 bool Heap::InMovingPage(Object* object) { | |
|
Vyacheslav Egorov (Chromium)
2011/10/21 11:34:35
I think we really don't need to invoke any increme
| |
| 280 if (object->IsSmi()) return false; | |
| 281 HeapObject* heap_object = HeapObject::cast(object); | |
| 282 if (InNewSpace(heap_object)) return true; | |
| 283 Address address = heap_object->address(); | |
| 284 if (lo_space()->Contains(heap_object)) return false; | |
| 285 if (old_pointer_space()->FirstPage()->Contains(address)) return false; | |
| 286 if (old_data_space()->FirstPage()->Contains(address)) return false; | |
| 287 if (map_space()->FirstPage()->Contains(address)) return false; | |
| 288 return true; | |
| 289 } | |
| 290 | |
| 291 | |
| 279 bool Heap::InNewSpace(Address addr) { | 292 bool Heap::InNewSpace(Address addr) { |
| 280 return new_space_.Contains(addr); | 293 return new_space_.Contains(addr); |
| 281 } | 294 } |
| 282 | 295 |
| 283 | 296 |
| 284 bool Heap::InFromSpace(Object* object) { | 297 bool Heap::InFromSpace(Object* object) { |
| 285 return new_space_.FromSpaceContains(object); | 298 return new_space_.FromSpaceContains(object); |
| 286 } | 299 } |
| 287 | 300 |
| 288 | 301 |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 674 | 687 |
| 675 | 688 |
| 676 Heap* _inline_get_heap_() { | 689 Heap* _inline_get_heap_() { |
| 677 return HEAP; | 690 return HEAP; |
| 678 } | 691 } |
| 679 | 692 |
| 680 | 693 |
| 681 } } // namespace v8::internal | 694 } } // namespace v8::internal |
| 682 | 695 |
| 683 #endif // V8_HEAP_INL_H_ | 696 #endif // V8_HEAP_INL_H_ |
| OLD | NEW |