Commit d9e305d4 authored by Dan Elphick's avatar Dan Elphick Committed by Commit Bot

Remove redundant logic in AllowedToBeMigrated

Simplifies boolean logic since shortcuts mean most will never be
executed and also replaces variables with constants to improve
readability.

Change-Id: Ic1678bc60c3e85daced758ce139f7d03c25632dc
Reviewed-on: https://chromium-review.googlesource.com/928320Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51419}
parent 3537bc6e
......@@ -6644,12 +6644,11 @@ bool Heap::AllowedToBeMigrated(HeapObject* obj, AllocationSpace dst) {
AllocationSpace src = chunk->owner()->identity();
switch (src) {
case NEW_SPACE:
return dst == src || dst == OLD_SPACE;
return dst == NEW_SPACE || dst == OLD_SPACE;
case OLD_SPACE:
return dst == src &&
(dst == OLD_SPACE || obj->IsFiller() || obj->IsExternalString());
return dst == OLD_SPACE;
case CODE_SPACE:
return dst == src && type == CODE_TYPE;
return dst == CODE_SPACE && type == CODE_TYPE;
case MAP_SPACE:
case LO_SPACE:
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment