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

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 59c17af1a682f895da807efe188584cb698e9507..dfa9cea71a73a1f895da56237c1107c0e819c08b 100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -133,9 +133,19 @@ CodeRange::CodeRange(Isolate* isolate)
}
-bool CodeRange::SetUp(const size_t requested) {
+bool CodeRange::SetUp(size_t requested) {
ASSERT(code_range_ == NULL);
+ if (requested == 0) {
+ // On 64-bit platform(s), we put all code objects in a 512 MB range of
+ // virtual address space, so that they can call each other with near calls.
+ if (kIs64BitArch) {
+ requested = 512 * MB;
+ } else {
+ return true;
+ }
+ }
+
code_range_ = new VirtualMemory(requested);
CHECK(code_range_ != NULL);
if (!code_range_->IsReserved()) {
@@ -146,7 +156,8 @@ 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));
+ LOG(isolate_,
+ NewEvent("CodeRange", code_range_->address(), requested));
Address base = reinterpret_cast<Address>(code_range_->address());
Address aligned_base =
RoundUp(reinterpret_cast<Address>(code_range_->address()),
« include/v8.h ('K') | « src/spaces.h ('k') | test/cctest/test-mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698