OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_HEAP_HEAP_INL_H_ | 5 #ifndef V8_HEAP_HEAP_INL_H_ |
6 #define V8_HEAP_HEAP_INL_H_ | 6 #define V8_HEAP_HEAP_INL_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 // asserts here, but check everything explicitly. | 454 // asserts here, but check everything explicitly. |
455 if (obj->map() == one_pointer_filler_map()) return false; | 455 if (obj->map() == one_pointer_filler_map()) return false; |
456 InstanceType type = obj->map()->instance_type(); | 456 InstanceType type = obj->map()->instance_type(); |
457 MemoryChunk* chunk = MemoryChunk::FromAddress(obj->address()); | 457 MemoryChunk* chunk = MemoryChunk::FromAddress(obj->address()); |
458 AllocationSpace src = chunk->owner()->identity(); | 458 AllocationSpace src = chunk->owner()->identity(); |
459 switch (src) { | 459 switch (src) { |
460 case NEW_SPACE: | 460 case NEW_SPACE: |
461 return dst == src || dst == TargetSpaceId(type); | 461 return dst == src || dst == TargetSpaceId(type); |
462 case OLD_POINTER_SPACE: | 462 case OLD_POINTER_SPACE: |
463 return dst == src && (dst == TargetSpaceId(type) || obj->IsFiller() || | 463 return dst == src && (dst == TargetSpaceId(type) || obj->IsFiller() || |
464 (obj->IsExternalString() && | 464 obj->IsExternalString()); |
465 ExternalString::cast(obj)->is_short())); | |
466 case OLD_DATA_SPACE: | 465 case OLD_DATA_SPACE: |
467 return dst == src && dst == TargetSpaceId(type); | 466 return dst == src && dst == TargetSpaceId(type); |
468 case CODE_SPACE: | 467 case CODE_SPACE: |
469 return dst == src && type == CODE_TYPE; | 468 return dst == src && type == CODE_TYPE; |
470 case MAP_SPACE: | 469 case MAP_SPACE: |
471 case CELL_SPACE: | 470 case CELL_SPACE: |
472 case PROPERTY_CELL_SPACE: | 471 case PROPERTY_CELL_SPACE: |
473 case LO_SPACE: | 472 case LO_SPACE: |
474 return false; | 473 return false; |
475 case INVALID_SPACE: | 474 case INVALID_SPACE: |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 | 779 |
781 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 780 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
782 for (Object** current = start; current < end; current++) { | 781 for (Object** current = start; current < end; current++) { |
783 CHECK((*current)->IsSmi()); | 782 CHECK((*current)->IsSmi()); |
784 } | 783 } |
785 } | 784 } |
786 } | 785 } |
787 } // namespace v8::internal | 786 } // namespace v8::internal |
788 | 787 |
789 #endif // V8_HEAP_HEAP_INL_H_ | 788 #endif // V8_HEAP_HEAP_INL_H_ |
OLD | NEW |