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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 *target = e.obj_; | 345 *target = e.obj_; |
346 *size = e.size_; | 346 *size = e.size_; |
347 return; | 347 return; |
348 } | 348 } |
349 | 349 |
350 if (NewSpacePage::IsAtStart(reinterpret_cast<Address>(front_))) { | 350 if (NewSpacePage::IsAtStart(reinterpret_cast<Address>(front_))) { |
351 NewSpacePage* front_page = | 351 NewSpacePage* front_page = |
352 NewSpacePage::FromAddress(reinterpret_cast<Address>(front_)); | 352 NewSpacePage::FromAddress(reinterpret_cast<Address>(front_)); |
353 ASSERT(!front_page->prev_page()->is_anchor()); | 353 ASSERT(!front_page->prev_page()->is_anchor()); |
354 front_ = | 354 front_ = |
355 reinterpret_cast<intptr_t*>(front_page->prev_page()->body_limit()); | 355 reinterpret_cast<intptr_t*>(front_page->prev_page()->area_end()); |
356 } | 356 } |
357 *target = reinterpret_cast<HeapObject*>(*(--front_)); | 357 *target = reinterpret_cast<HeapObject*>(*(--front_)); |
358 *size = static_cast<int>(*(--front_)); | 358 *size = static_cast<int>(*(--front_)); |
359 // Assert no underflow. | 359 // Assert no underflow. |
360 SemiSpace::AssertValidRange(reinterpret_cast<Address>(rear_), | 360 SemiSpace::AssertValidRange(reinterpret_cast<Address>(rear_), |
361 reinterpret_cast<Address>(front_)); | 361 reinterpret_cast<Address>(front_)); |
362 } | 362 } |
363 | 363 |
364 private: | 364 private: |
365 // The front of the queue is higher in the memory page chain than the rear. | 365 // The front of the queue is higher in the memory page chain than the rear. |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 intptr_t CommittedMemory(); | 479 intptr_t CommittedMemory(); |
480 | 480 |
481 // Returns the amount of executable memory currently committed for the heap. | 481 // Returns the amount of executable memory currently committed for the heap. |
482 intptr_t CommittedMemoryExecutable(); | 482 intptr_t CommittedMemoryExecutable(); |
483 | 483 |
484 // Returns the available bytes in space w/o growing. | 484 // Returns the available bytes in space w/o growing. |
485 // Heap doesn't guarantee that it can allocate an object that requires | 485 // Heap doesn't guarantee that it can allocate an object that requires |
486 // all available bytes. Check MaxHeapObjectSize() instead. | 486 // all available bytes. Check MaxHeapObjectSize() instead. |
487 intptr_t Available(); | 487 intptr_t Available(); |
488 | 488 |
489 // Returns the maximum object size in paged space. | |
490 inline int MaxObjectSizeInPagedSpace(); | |
491 | |
492 // Returns of size of all objects residing in the heap. | 489 // Returns of size of all objects residing in the heap. |
493 intptr_t SizeOfObjects(); | 490 intptr_t SizeOfObjects(); |
494 | 491 |
495 // Return the starting address and a mask for the new space. And-masking an | 492 // Return the starting address and a mask for the new space. And-masking an |
496 // address with the mask will result in the start address of the new space | 493 // address with the mask will result in the start address of the new space |
497 // for all addresses in either semispace. | 494 // for all addresses in either semispace. |
498 Address NewSpaceStart() { return new_space_.start(); } | 495 Address NewSpaceStart() { return new_space_.start(); } |
499 uintptr_t NewSpaceMask() { return new_space_.mask(); } | 496 uintptr_t NewSpaceMask() { return new_space_.mask(); } |
500 Address NewSpaceTop() { return new_space_.top(); } | 497 Address NewSpaceTop() { return new_space_.top(); } |
501 | 498 |
(...skipping 2140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2642 private: | 2639 private: |
2643 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2640 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2644 }; | 2641 }; |
2645 #endif // DEBUG || LIVE_OBJECT_LIST | 2642 #endif // DEBUG || LIVE_OBJECT_LIST |
2646 | 2643 |
2647 } } // namespace v8::internal | 2644 } } // namespace v8::internal |
2648 | 2645 |
2649 #undef HEAP | 2646 #undef HEAP |
2650 | 2647 |
2651 #endif // V8_HEAP_H_ | 2648 #endif // V8_HEAP_H_ |
OLD | NEW |