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

Unified Diff: src/heap/heap.cc

Issue 1172333002: MIPS64: Fix memory allocation when code range is used for LO space only. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove ifdefs and make checks valid on mips64. Created 5 years, 6 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
« no previous file with comments | « src/factory.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 456fc34fc8cf8601d5902937d3451cc8a0205a58..d2398717a4a1c0e56f9319968005439dfc4cad71 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -3847,7 +3847,8 @@ AllocationResult Heap::AllocateCode(int object_size, bool immovable) {
Code* code = Code::cast(result);
DCHECK(IsAligned(bit_cast<intptr_t>(code->address()), kCodeAlignment));
DCHECK(isolate_->code_range() == NULL || !isolate_->code_range()->valid() ||
- isolate_->code_range()->contains(code->address()));
+ isolate_->code_range()->contains(code->address()) ||
+ object_size <= code_space()->AreaSize());
code->set_gc_metadata(Smi::FromInt(0));
code->set_ic_age(global_ic_age_);
return code;
@@ -3872,7 +3873,8 @@ AllocationResult Heap::CopyCode(Code* code) {
// Relocate the copy.
DCHECK(IsAligned(bit_cast<intptr_t>(new_code->address()), kCodeAlignment));
DCHECK(isolate_->code_range() == NULL || !isolate_->code_range()->valid() ||
- isolate_->code_range()->contains(code->address()));
+ isolate_->code_range()->contains(code->address()) ||
+ obj_size <= code_space()->AreaSize());
new_code->Relocate(new_addr - old_addr);
return new_code;
}
@@ -3918,7 +3920,9 @@ AllocationResult Heap::CopyCode(Code* code, Vector<byte> reloc_info) {
// Relocate the copy.
DCHECK(IsAligned(bit_cast<intptr_t>(new_code->address()), kCodeAlignment));
DCHECK(isolate_->code_range() == NULL || !isolate_->code_range()->valid() ||
- isolate_->code_range()->contains(code->address()));
+ isolate_->code_range()->contains(code->address()) ||
+ new_obj_size <= code_space()->AreaSize());
+
new_code->Relocate(new_addr - old_addr);
#ifdef VERIFY_HEAP
« no previous file with comments | « src/factory.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698