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

Unified Diff: src/heap-inl.h

Issue 7468024: Fix overlap check in MoveBlock and fix assertion. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap-inl.h
diff --git a/src/heap-inl.h b/src/heap-inl.h
index 3f5554e2c2ea0049935701dc41ef6eca35e85c84..b0b4fbe2dcbd45f0a7a437e956efbf74004f0927 100644
--- a/src/heap-inl.h
+++ b/src/heap-inl.h
@@ -368,11 +368,7 @@ void Heap::MoveBlock(Address dst, Address src, int byte_size) {
int size_in_words = byte_size / kPointerSize;
- if ((dst < src) || (dst >= (src + size_in_words))) {
- ASSERT((dst >= (src + size_in_words)) ||
- ((OffsetFrom(reinterpret_cast<Address>(src)) -
- OffsetFrom(reinterpret_cast<Address>(dst))) >= kPointerSize));
-
+ if ((dst < src) || (dst >= (src + byte_size))) {
Object** src_slot = reinterpret_cast<Object**>(src);
Object** dst_slot = reinterpret_cast<Object**>(dst);
Object** end_slot = src_slot + size_in_words;
@@ -390,8 +386,7 @@ void Heap::MoveBlockToOldSpaceAndUpdateRegionMarks(Address dst,
Address src,
int byte_size) {
ASSERT(IsAligned(byte_size, kPointerSize));
- ASSERT((dst >= (src + byte_size)) ||
- ((OffsetFrom(src) - OffsetFrom(dst)) >= kPointerSize));
+ ASSERT((dst < src) || (dst >= (src + byte_size)));
CopyBlockToOldSpaceAndUpdateRegionMarks(dst, src, byte_size);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698