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

Side by Side Diff: src/spaces.h

Issue 7379004: Add guard pages in front of platform allocations (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
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
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 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 #ifdef DEBUG 638 #ifdef DEBUG
639 // Reports statistic info of the space. 639 // Reports statistic info of the space.
640 void ReportStatistics(); 640 void ReportStatistics();
641 #endif 641 #endif
642 642
643 // Due to encoding limitation, we can only have 8K chunks. 643 // Due to encoding limitation, we can only have 8K chunks.
644 static const int kMaxNofChunks = 1 << kPageSizeBits; 644 static const int kMaxNofChunks = 1 << kPageSizeBits;
645 // If a chunk has at least 16 pages, the maximum heap size is about 645 // If a chunk has at least 16 pages, the maximum heap size is about
646 // 8K * 8K * 16 = 1G bytes. 646 // 8K * 8K * 16 = 1G bytes.
647 #ifdef V8_TARGET_ARCH_X64 647 #ifdef V8_TARGET_ARCH_X64
648 static const int kPagesPerChunk = 32; 648 static const int kPagesPerChunk = 31;
649 // On 64 bit the chunk table consists of 4 levels of 4096-entry tables. 649 // On 64 bit the chunk table consists of 4 levels of 4096-entry tables.
650 static const int kPagesPerChunkLog2 = 5; 650 static const int kPagesPerChunkLog2 = 5;
Vyacheslav Egorov (Chromium) 2011/07/15 11:59:14 1 << kPagesPerChunkLog2 no longer equals to kPages
Cris Neckar 2011/07/15 18:51:29 Never fear.. This isn't used anywhere so I got rid
651 static const int kChunkTableLevels = 4; 651 static const int kChunkTableLevels = 4;
652 static const int kChunkTableBitsPerLevel = 12; 652 static const int kChunkTableBitsPerLevel = 12;
653 #else 653 #else
654 static const int kPagesPerChunk = 16; 654 static const int kPagesPerChunk = 15;
655 // On 32 bit the chunk table consists of 2 levels of 256-entry tables. 655 // On 32 bit the chunk table consists of 2 levels of 256-entry tables.
656 static const int kPagesPerChunkLog2 = 4; 656 static const int kPagesPerChunkLog2 = 4;
657 static const int kChunkTableLevels = 2; 657 static const int kChunkTableLevels = 2;
658 static const int kChunkTableBitsPerLevel = 8; 658 static const int kChunkTableBitsPerLevel = 8;
659 #endif 659 #endif
660 660
661 private: 661 private:
662 MemoryAllocator(); 662 MemoryAllocator();
663 663
664 static const int kChunkSize = kPagesPerChunk * Page::kPageSize; 664 static const int kChunkSize = kPagesPerChunk * Page::kPageSize;
(...skipping 1646 matching lines...) Expand 10 before | Expand all | Expand 10 after
2311 } 2311 }
2312 // Must be small, since an iteration is used for lookup. 2312 // Must be small, since an iteration is used for lookup.
2313 static const int kMaxComments = 64; 2313 static const int kMaxComments = 64;
2314 }; 2314 };
2315 #endif 2315 #endif
2316 2316
2317 2317
2318 } } // namespace v8::internal 2318 } } // namespace v8::internal
2319 2319
2320 #endif // V8_SPACES_H_ 2320 #endif // V8_SPACES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698