Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Unified Diff: src/heap/spaces.h

Issue 742733002: Reserve code range block for evacuation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/heap/spaces.h
diff --git a/src/heap/spaces.h b/src/heap/spaces.h
index ef294b243948b3cd4bbdc5101385baf295cb8a73..f3345f185cc1e68fb70cde85f0b4df5f08da0cad 100644
--- a/src/heap/spaces.h
+++ b/src/heap/spaces.h
@@ -900,6 +900,9 @@ class CodeRange {
bool UncommitRawMemory(Address start, size_t length);
void FreeRawMemory(Address buf, size_t length);
+ void ReserveEmergencyBlock();
+ void ReleaseEmergencyBlock();
+
private:
Isolate* isolate_;
@@ -908,6 +911,7 @@ class CodeRange {
// Plain old data class, just a struct plus a constructor.
class FreeBlock {
public:
+ FreeBlock() : start(0), size(0) {}
FreeBlock(Address start_arg, size_t size_arg)
: start(start_arg), size(size_arg) {
DCHECK(IsAddressAligned(start, MemoryChunk::kAlignment));
@@ -932,6 +936,8 @@ class CodeRange {
List<FreeBlock> allocation_list_;
int current_allocation_block_index_;
+ FreeBlock emergency_block_;
Hannes Payer (out of office) 2014/11/20 08:00:37 Please add a comment that describes the concept of
ulan 2014/11/20 13:49:30 Done.
+
// Finds a block on the allocation list that contains at least the
// requested amount of memory. If none is found, sorts and merges
// the existing free memory blocks, and searches again.
@@ -940,6 +946,8 @@ class CodeRange {
// Compares the start addresses of two free blocks.
static int CompareFreeBlockAddress(const FreeBlock* left,
const FreeBlock* right);
+ bool ReserveBlock(const size_t requested_size, FreeBlock* block);
+ void ReleaseBlock(const FreeBlock* block);
DISALLOW_COPY_AND_ASSIGN(CodeRange);
};
« src/heap/heap.cc ('K') | « src/heap/mark-compact.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698