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

Side by Side Diff: src/spaces.h

Issue 332373002: Do GC if CodeRange fails to allocate a block. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/spaces.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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_SPACES_H_ 5 #ifndef V8_SPACES_H_
6 #define V8_SPACES_H_ 6 #define V8_SPACES_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/base/atomicops.h" 9 #include "src/base/atomicops.h"
10 #include "src/hashmap.h" 10 #include "src/hashmap.h"
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 // allocation list. 978 // allocation list.
979 List<FreeBlock> free_list_; 979 List<FreeBlock> free_list_;
980 // Memory is allocated from the free blocks on the allocation list. 980 // Memory is allocated from the free blocks on the allocation list.
981 // The block at current_allocation_block_index_ is the current block. 981 // The block at current_allocation_block_index_ is the current block.
982 List<FreeBlock> allocation_list_; 982 List<FreeBlock> allocation_list_;
983 int current_allocation_block_index_; 983 int current_allocation_block_index_;
984 984
985 // Finds a block on the allocation list that contains at least the 985 // Finds a block on the allocation list that contains at least the
986 // requested amount of memory. If none is found, sorts and merges 986 // requested amount of memory. If none is found, sorts and merges
987 // the existing free memory blocks, and searches again. 987 // the existing free memory blocks, and searches again.
988 // If none can be found, terminates V8 with FatalProcessOutOfMemory. 988 // If none can be found, returns false.
989 void GetNextAllocationBlock(size_t requested); 989 bool GetNextAllocationBlock(size_t requested);
990 // Compares the start addresses of two free blocks. 990 // Compares the start addresses of two free blocks.
991 static int CompareFreeBlockAddress(const FreeBlock* left, 991 static int CompareFreeBlockAddress(const FreeBlock* left,
992 const FreeBlock* right); 992 const FreeBlock* right);
993 993
994 DISALLOW_COPY_AND_ASSIGN(CodeRange); 994 DISALLOW_COPY_AND_ASSIGN(CodeRange);
995 }; 995 };
996 996
997 997
998 class SkipList { 998 class SkipList {
999 public: 999 public:
(...skipping 2000 matching lines...) Expand 10 before | Expand all | Expand 10 after
3000 } 3000 }
3001 // Must be small, since an iteration is used for lookup. 3001 // Must be small, since an iteration is used for lookup.
3002 static const int kMaxComments = 64; 3002 static const int kMaxComments = 64;
3003 }; 3003 };
3004 #endif 3004 #endif
3005 3005
3006 3006
3007 } } // namespace v8::internal 3007 } } // namespace v8::internal
3008 3008
3009 #endif // V8_SPACES_H_ 3009 #endif // V8_SPACES_H_
OLDNEW
« no previous file with comments | « no previous file | src/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698