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

Unified Diff: src/heap/heap-inl.h

Issue 1632913003: [heap] Move to page lookups for SemiSpace, NewSpace, and Heap containment methods (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: mips ports Created 4 years, 10 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/heap/heap.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap-inl.h
diff --git a/src/heap/heap-inl.h b/src/heap/heap-inl.h
index d54d644bdb4e542069b8693dddcceb1882961c1b..34c2e3faeaa19576303e5646feaef025d37da72e 100644
--- a/src/heap/heap-inl.h
+++ b/src/heap/heap-inl.h
@@ -359,10 +359,6 @@ bool Heap::InNewSpace(Object* object) {
return result;
}
-
-bool Heap::InNewSpace(Address address) { return new_space_.Contains(address); }
-
-
bool Heap::InFromSpace(Object* object) {
return new_space_.FromSpaceContains(object);
}
@@ -372,14 +368,15 @@ bool Heap::InToSpace(Object* object) {
return new_space_.ToSpaceContains(object);
}
+bool Heap::InOldSpace(Object* object) { return old_space_->Contains(object); }
-bool Heap::InOldSpace(Address address) { return old_space_->Contains(address); }
-
-
-bool Heap::InOldSpace(Object* object) {
- return InOldSpace(reinterpret_cast<Address>(object));
+bool Heap::InNewSpaceSlow(Address address) {
+ return new_space_.ContainsSlow(address);
}
+bool Heap::InOldSpaceSlow(Address address) {
+ return old_space_->ContainsSlow(address);
+}
bool Heap::OldGenerationAllocationLimitReached() {
if (!incremental_marking()->IsStopped()) return false;
@@ -394,18 +391,11 @@ bool Heap::ShouldBePromoted(Address old_address, int object_size) {
(!page->ContainsLimit(age_mark) || old_address < age_mark);
}
-
-void Heap::RecordWrite(Address address, int offset) {
- if (!InNewSpace(address)) store_buffer_.Mark(address + offset);
-}
-
-
-void Heap::RecordWrites(Address address, int start, int len) {
- if (!InNewSpace(address)) {
- for (int i = 0; i < len; i++) {
- store_buffer_.Mark(address + start + i * kPointerSize);
- }
+void Heap::RecordWrite(Object* object, int offset, Object* o) {
+ if (!InNewSpace(o) || !object->IsHeapObject() || InNewSpace(object)) {
+ return;
}
+ store_buffer_.Mark(HeapObject::cast(object)->address() + offset);
}
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698