Mercurial > hg > truffle
comparison src/share/vm/memory/heap.cpp @ 14518:d8041d695d19
Merged with jdk9/dev/hotspot changeset 3812c088b945
author | twisti |
---|---|
date | Tue, 11 Mar 2014 18:45:59 -0700 |
parents | 58fc8e2b7b6d 63a4eb8bcd23 |
children | b51e29501f30 4ca6dc0799b6 |
comparison
equal
deleted
inserted
replaced
14141:f97c5ec83832 | 14518:d8041d695d19 |
---|---|
181 | 181 |
182 void* CodeHeap::allocate(size_t instance_size, bool is_critical) { | 182 void* CodeHeap::allocate(size_t instance_size, bool is_critical) { |
183 size_t number_of_segments = size_to_segments(instance_size + sizeof(HeapBlock)); | 183 size_t number_of_segments = size_to_segments(instance_size + sizeof(HeapBlock)); |
184 assert(segments_to_size(number_of_segments) >= sizeof(FreeBlock), "not enough room for FreeList"); | 184 assert(segments_to_size(number_of_segments) >= sizeof(FreeBlock), "not enough room for FreeList"); |
185 | 185 |
186 // First check if we can satify request from freelist | 186 // First check if we can satisfy request from freelist |
187 debug_only(verify()); | 187 debug_only(verify()); |
188 HeapBlock* block = search_freelist(number_of_segments, is_critical); | 188 HeapBlock* block = search_freelist(number_of_segments, is_critical); |
189 debug_only(if (VerifyCodeCacheOften) verify()); | 189 debug_only(if (VerifyCodeCacheOften) verify()); |
190 if (block != NULL) { | 190 if (block != NULL) { |
191 assert(block->length() >= number_of_segments && block->length() < number_of_segments + CodeCacheMinBlockLength, "sanity check"); | 191 assert(block->length() >= number_of_segments && block->length() < number_of_segments + CodeCacheMinBlockLength, "sanity check"); |
370 b->set_link(NULL); | 370 b->set_link(NULL); |
371 return; | 371 return; |
372 } | 372 } |
373 | 373 |
374 // Scan for right place to put into list. List | 374 // Scan for right place to put into list. List |
375 // is sorted by increasing addresseses | 375 // is sorted by increasing addresses |
376 FreeBlock* prev = NULL; | 376 FreeBlock* prev = NULL; |
377 FreeBlock* cur = _freelist; | 377 FreeBlock* cur = _freelist; |
378 while(cur != NULL && cur < b) { | 378 while(cur != NULL && cur < b) { |
379 assert(prev == NULL || prev < cur, "must be ordered"); | 379 assert(prev == NULL || prev < cur, "must be ordered"); |
380 prev = cur; | 380 prev = cur; |