OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
313 | 313 |
314 bool Heap::InNewSpace(Object* object) { | 314 bool Heap::InNewSpace(Object* object) { |
315 bool result = new_space_.Contains(object); | 315 bool result = new_space_.Contains(object); |
316 ASSERT(!result || // Either not in new space | 316 ASSERT(!result || // Either not in new space |
317 gc_state_ != NOT_IN_GC || // ... or in the middle of GC | 317 gc_state_ != NOT_IN_GC || // ... or in the middle of GC |
318 InToSpace(object)); // ... or in to-space (where we allocate). | 318 InToSpace(object)); // ... or in to-space (where we allocate). |
319 return result; | 319 return result; |
320 } | 320 } |
321 | 321 |
322 | 322 |
323 bool Heap::InNewSpace(Address addr) { | 323 bool Heap::InNewSpace(Address address) { |
324 return new_space_.Contains(addr); | 324 return new_space_.Contains(address); |
Hannes Payer (out of office)
2013/03/07 12:27:42
Coding style fix.
| |
325 } | 325 } |
326 | 326 |
327 | 327 |
328 bool Heap::InFromSpace(Object* object) { | 328 bool Heap::InFromSpace(Object* object) { |
329 return new_space_.FromSpaceContains(object); | 329 return new_space_.FromSpaceContains(object); |
330 } | 330 } |
331 | 331 |
332 | 332 |
333 bool Heap::InToSpace(Object* object) { | 333 bool Heap::InToSpace(Object* object) { |
334 return new_space_.ToSpaceContains(object); | 334 return new_space_.ToSpaceContains(object); |
335 } | 335 } |
336 | 336 |
337 | 337 |
338 bool Heap::InOldPointerSpace(Address address) { | |
339 return old_pointer_space_->Contains(address); | |
340 } | |
341 | |
342 | |
343 bool Heap::InOldPointerSpace(Object* object) { | |
344 return InOldPointerSpace(reinterpret_cast<Address>(object)); | |
345 } | |
346 | |
347 | |
338 bool Heap::OldGenerationAllocationLimitReached() { | 348 bool Heap::OldGenerationAllocationLimitReached() { |
339 if (!incremental_marking()->IsStopped()) return false; | 349 if (!incremental_marking()->IsStopped()) return false; |
340 return OldGenerationSpaceAvailable() < 0; | 350 return OldGenerationSpaceAvailable() < 0; |
341 } | 351 } |
342 | 352 |
343 | 353 |
344 bool Heap::ShouldBePromoted(Address old_address, int object_size) { | 354 bool Heap::ShouldBePromoted(Address old_address, int object_size) { |
345 // An object should be promoted if: | 355 // An object should be promoted if: |
346 // - the object has survived a scavenge operation or | 356 // - the object has survived a scavenge operation or |
347 // - to space is already 25% full. | 357 // - to space is already 25% full. |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
868 AssertNoAllocation::~AssertNoAllocation() { } | 878 AssertNoAllocation::~AssertNoAllocation() { } |
869 DisableAssertNoAllocation::DisableAssertNoAllocation() { } | 879 DisableAssertNoAllocation::DisableAssertNoAllocation() { } |
870 DisableAssertNoAllocation::~DisableAssertNoAllocation() { } | 880 DisableAssertNoAllocation::~DisableAssertNoAllocation() { } |
871 | 881 |
872 #endif | 882 #endif |
873 | 883 |
874 | 884 |
875 } } // namespace v8::internal | 885 } } // namespace v8::internal |
876 | 886 |
877 #endif // V8_HEAP_INL_H_ | 887 #endif // V8_HEAP_INL_H_ |
OLD | NEW |