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 #ifndef V8_HEAP_HEAP_H_ | 5 #ifndef V8_HEAP_HEAP_H_ |
6 #define V8_HEAP_HEAP_H_ | 6 #define V8_HEAP_HEAP_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
693 // Indicies for direct access into argument objects. | 693 // Indicies for direct access into argument objects. |
694 static const int kArgumentsLengthIndex = 0; | 694 static const int kArgumentsLengthIndex = 0; |
695 // callee is only valid in sloppy mode. | 695 // callee is only valid in sloppy mode. |
696 static const int kArgumentsCalleeIndex = 1; | 696 static const int kArgumentsCalleeIndex = 1; |
697 | 697 |
698 // Finalizes an external string by deleting the associated external | 698 // Finalizes an external string by deleting the associated external |
699 // data and clearing the resource pointer. | 699 // data and clearing the resource pointer. |
700 inline void FinalizeExternalString(String* string); | 700 inline void FinalizeExternalString(String* string); |
701 | 701 |
702 // Initialize a filler object to keep the ability to iterate over the heap | 702 // Initialize a filler object to keep the ability to iterate over the heap |
703 // when shortening objects. | 703 // when introducing gaps within pages. |
704 void CreateFillerObjectAt(Address addr, int size); | 704 void CreateFillerObjectAt(Address addr, int size); |
705 | 705 |
706 bool CanMoveObjectStart(HeapObject* object); | 706 bool CanMoveObjectStart(HeapObject* object); |
707 | 707 |
708 // Maintain consistency of live bytes during incremental marking. | |
Hannes Payer (out of office)
2014/08/05 10:45:07
Move the enum before the comment and describe in a
Michael Starzinger
2014/08/05 11:01:06
Done.
| |
708 enum InvocationMode { FROM_GC, FROM_MUTATOR }; | 709 enum InvocationMode { FROM_GC, FROM_MUTATOR }; |
710 void AdjustLiveBytes(Address address, int by, InvocationMode mode); | |
709 | 711 |
710 // Maintain marking consistency for IncrementalMarking. | 712 // Trim the given array from the left. Note that this relocates the object |
711 void AdjustLiveBytes(Address address, int by, InvocationMode mode); | 713 // start and hence is only valid if there is only a single reference to it. |
714 FixedArrayBase* LeftTrimFixedArray(FixedArrayBase* obj, int elements_to_trim); | |
715 | |
716 // Trim the given array from the right. | |
717 template<Heap::InvocationMode mode> | |
718 void RightTrimFixedArray(FixedArrayBase* obj, int elements_to_trim); | |
712 | 719 |
713 // Converts the given boolean condition to JavaScript boolean value. | 720 // Converts the given boolean condition to JavaScript boolean value. |
714 inline Object* ToBoolean(bool condition); | 721 inline Object* ToBoolean(bool condition); |
715 | 722 |
716 // Performs garbage collection operation. | 723 // Performs garbage collection operation. |
717 // Returns whether there is a chance that another major GC could | 724 // Returns whether there is a chance that another major GC could |
718 // collect more garbage. | 725 // collect more garbage. |
719 inline bool CollectGarbage( | 726 inline bool CollectGarbage( |
720 AllocationSpace space, const char* gc_reason = NULL, | 727 AllocationSpace space, const char* gc_reason = NULL, |
721 const GCCallbackFlags gc_callback_flags = kNoGCCallbackFlags); | 728 const GCCallbackFlags gc_callback_flags = kNoGCCallbackFlags); |
(...skipping 1806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2528 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2535 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2529 | 2536 |
2530 private: | 2537 private: |
2531 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2538 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2532 }; | 2539 }; |
2533 #endif // DEBUG | 2540 #endif // DEBUG |
2534 } | 2541 } |
2535 } // namespace v8::internal | 2542 } // namespace v8::internal |
2536 | 2543 |
2537 #endif // V8_HEAP_HEAP_H_ | 2544 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |