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

Unified Diff: src/spaces.cc

Issue 228923002: Allow the embedder to pass the virtual memory limit to v8 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: src/spaces.cc
diff --git a/src/spaces.cc b/src/spaces.cc
index 20efbf72e080f36d8fe9e50833cce25043f7c928..b4dbf1cb4b86d0dad24c48c4e814545e1b69079e 100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -135,8 +135,17 @@ CodeRange::CodeRange(Isolate* isolate)
bool CodeRange::SetUp(const size_t requested) {
ASSERT(code_range_ == NULL);
+ size_t actual_requested = requested;
Michael Starzinger 2014/04/09 12:03:04 nit: Instead of having two variables "actual_reque
jochen (gone - plz use gerrit) 2014/04/09 12:44:56 Done.
- code_range_ = new VirtualMemory(requested);
+ if (actual_requested == 0) {
+ if (kIs64BitArch) {
+ actual_requested = 512 * MB;
+ } else {
+ return true;
+ }
+ }
+
+ code_range_ = new VirtualMemory(actual_requested);
CHECK(code_range_ != NULL);
if (!code_range_->IsReserved()) {
delete code_range_;
@@ -145,8 +154,9 @@ bool CodeRange::SetUp(const size_t requested) {
}
// We are sure that we have mapped a block of requested addresses.
- ASSERT(code_range_->size() == requested);
- LOG(isolate_, NewEvent("CodeRange", code_range_->address(), requested));
+ ASSERT(code_range_->size() == actual_requested);
+ LOG(isolate_,
+ NewEvent("CodeRange", code_range_->address(), actual_requested));
Address base = reinterpret_cast<Address>(code_range_->address());
Address aligned_base =
RoundUp(reinterpret_cast<Address>(code_range_->address()),

Powered by Google App Engine
This is Rietveld 408576698