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

Side by Side Diff: src/spaces.h

Issue 7352007: Add guard pages in front of platform allocations (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: '' Created 9 years, 5 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 | « src/platform-win32.cc ('k') | 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 // 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 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 #ifdef DEBUG 655 #ifdef DEBUG
656 // Reports statistic info of the space. 656 // Reports statistic info of the space.
657 void ReportStatistics(); 657 void ReportStatistics();
658 #endif 658 #endif
659 659
660 // Due to encoding limitation, we can only have 8K chunks. 660 // Due to encoding limitation, we can only have 8K chunks.
661 static const int kMaxNofChunks = 1 << kPageSizeBits; 661 static const int kMaxNofChunks = 1 << kPageSizeBits;
662 // If a chunk has at least 16 pages, the maximum heap size is about 662 // If a chunk has at least 16 pages, the maximum heap size is about
663 // 8K * 8K * 16 = 1G bytes. 663 // 8K * 8K * 16 = 1G bytes.
664 #ifdef V8_TARGET_ARCH_X64 664 #ifdef V8_TARGET_ARCH_X64
665 static const int kPagesPerChunk = 32; 665 #ifdef ENABLE_HEAP_PROTECTION
666 static const int kPagesPerChunk = 31;
667 #else // ENABLE_HEAP_PROTECTION
668 static const int kPagesPerChunk = 32;
669 #endif // ENABLE_HEAP_PROTECTION
666 // On 64 bit the chunk table consists of 4 levels of 4096-entry tables. 670 // On 64 bit the chunk table consists of 4 levels of 4096-entry tables.
667 static const int kPagesPerChunkLog2 = 5; 671 static const int kPagesPerChunkLog2 = 5;
668 static const int kChunkTableLevels = 4; 672 static const int kChunkTableLevels = 4;
669 static const int kChunkTableBitsPerLevel = 12; 673 static const int kChunkTableBitsPerLevel = 12;
670 #else 674 #else
671 static const int kPagesPerChunk = 16; 675 #ifdef ENABLE_HEAP_PROTECTION
676 static const int kPagesPerChunk = 15;
677 #else // ENABLE_HEAP_PROTECTION
678 static const int kPagesPerChunk = 16;
679 #endif // ENABLE_HEAP_PROTECTION
672 // On 32 bit the chunk table consists of 2 levels of 256-entry tables. 680 // On 32 bit the chunk table consists of 2 levels of 256-entry tables.
673 static const int kPagesPerChunkLog2 = 4; 681 static const int kPagesPerChunkLog2 = 4;
674 static const int kChunkTableLevels = 2; 682 static const int kChunkTableLevels = 2;
675 static const int kChunkTableBitsPerLevel = 8; 683 static const int kChunkTableBitsPerLevel = 8;
676 #endif 684 #endif // V8_TARGET_ARCH_X64
677 685
678 private: 686 private:
679 MemoryAllocator(); 687 MemoryAllocator();
680 688
681 static const int kChunkSize = kPagesPerChunk * Page::kPageSize; 689 static const int kChunkSize = kPagesPerChunk * Page::kPageSize;
682 static const int kChunkSizeLog2 = kPagesPerChunkLog2 + kPageSizeBits; 690 static const int kChunkSizeLog2 = kPagesPerChunkLog2 + kPageSizeBits;
683 691
684 // Maximum space size in bytes. 692 // Maximum space size in bytes.
685 intptr_t capacity_; 693 intptr_t capacity_;
686 // Maximum subset of capacity_ that can be executable 694 // Maximum subset of capacity_ that can be executable
(...skipping 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after
2360 } 2368 }
2361 // Must be small, since an iteration is used for lookup. 2369 // Must be small, since an iteration is used for lookup.
2362 static const int kMaxComments = 64; 2370 static const int kMaxComments = 64;
2363 }; 2371 };
2364 #endif 2372 #endif
2365 2373
2366 2374
2367 } } // namespace v8::internal 2375 } } // namespace v8::internal
2368 2376
2369 #endif // V8_SPACES_H_ 2377 #endif // V8_SPACES_H_
OLDNEW
« no previous file with comments | « src/platform-win32.cc ('k') | src/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698