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

Unified Diff: src/heap/spaces.cc

Issue 1147503002: MIPS64: Improve long branches utilizing code range. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use CodeRange only for LO space. Created 5 years, 7 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/heap/spaces.cc
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc
index 8069e51ce19b7b304926556216d53c5ea8f0818a..aa279921164d7f09b23de6043a120afc63913ed0 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -114,7 +114,14 @@ bool CodeRange::SetUp(size_t requested) {
}
DCHECK(!kRequiresCodeRange || requested <= kMaximalCodeRangeSize);
+#ifdef V8_TARGET_ARCH_MIPS64
+ // To use pseudo-relative jumps such as j/jal instructions which have 28-bit
+ // encoded immediate, the addresses have to be in range of 256Mb aligned
+ // region.
+ code_range_ = new base::VirtualMemory(requested, kMaximalCodeRangeSize);
+#else
code_range_ = new base::VirtualMemory(requested);
+#endif
CHECK(code_range_ != NULL);
if (!code_range_->IsReserved()) {
delete code_range_;
@@ -645,7 +652,14 @@ MemoryChunk* MemoryAllocator::AllocateChunk(intptr_t reserve_area_size,
base::OS::CommitPageSize());
// Allocate executable memory either from code range or from the
// OS.
+#ifdef V8_TARGET_ARCH_MIPS64
+ // Use code range only for large object space on mips64 to keep address
+ // range within 256-MB memory region.
+ if (isolate_->code_range() != NULL && isolate_->code_range()->valid() &&
+ commit_size > CodePageAreaSize()) {
Erik Corry 2015/06/04 10:28:15 The commit_size includes the CodePageGuardStartOff
dusmil.imgtec 2015/06/04 11:04:40 Done.
dusmil.imgtec 2015/06/04 11:04:40 Thank you for spotting this, typo mistake sorry. T
+#else
if (isolate_->code_range() != NULL && isolate_->code_range()->valid()) {
+#endif
base = isolate_->code_range()->AllocateRawMemory(chunk_size, commit_size,
&chunk_size);
DCHECK(
« no previous file with comments | « src/globals.h ('k') | src/mips64/assembler-mips64.h » ('j') | src/mips64/assembler-mips64.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698