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_INL_H_ | 5 #ifndef V8_HEAP_INL_H_ |
6 #define V8_HEAP_INL_H_ | 6 #define V8_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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 // Since this function is used for debugging only, we do not place | 462 // Since this function is used for debugging only, we do not place |
463 // asserts here, but check everything explicitly. | 463 // asserts here, but check everything explicitly. |
464 if (obj->map() == one_pointer_filler_map()) return false; | 464 if (obj->map() == one_pointer_filler_map()) return false; |
465 InstanceType type = obj->map()->instance_type(); | 465 InstanceType type = obj->map()->instance_type(); |
466 MemoryChunk* chunk = MemoryChunk::FromAddress(obj->address()); | 466 MemoryChunk* chunk = MemoryChunk::FromAddress(obj->address()); |
467 AllocationSpace src = chunk->owner()->identity(); | 467 AllocationSpace src = chunk->owner()->identity(); |
468 switch (src) { | 468 switch (src) { |
469 case NEW_SPACE: | 469 case NEW_SPACE: |
470 return dst == src || dst == TargetSpaceId(type); | 470 return dst == src || dst == TargetSpaceId(type); |
471 case OLD_POINTER_SPACE: | 471 case OLD_POINTER_SPACE: |
472 return dst == src && | 472 return dst == src && (dst == TargetSpaceId(type) || obj->IsFiller() || |
473 (dst == TargetSpaceId(type) || obj->IsFiller() || | 473 (obj->IsExternalString())); |
474 (obj->IsExternalString() && ExternalString::cast(obj)->is_short())); | |
475 case OLD_DATA_SPACE: | 474 case OLD_DATA_SPACE: |
476 return dst == src && dst == TargetSpaceId(type); | 475 return dst == src && dst == TargetSpaceId(type); |
477 case CODE_SPACE: | 476 case CODE_SPACE: |
478 return dst == src && type == CODE_TYPE; | 477 return dst == src && type == CODE_TYPE; |
479 case MAP_SPACE: | 478 case MAP_SPACE: |
480 case CELL_SPACE: | 479 case CELL_SPACE: |
481 case PROPERTY_CELL_SPACE: | 480 case PROPERTY_CELL_SPACE: |
482 case LO_SPACE: | 481 case LO_SPACE: |
483 return false; | 482 return false; |
484 case INVALID_SPACE: | 483 case INVALID_SPACE: |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 | 804 |
806 | 805 |
807 double GCTracer::SizeOfHeapObjects() { | 806 double GCTracer::SizeOfHeapObjects() { |
808 return (static_cast<double>(heap_->SizeOfObjects())) / MB; | 807 return (static_cast<double>(heap_->SizeOfObjects())) / MB; |
809 } | 808 } |
810 | 809 |
811 | 810 |
812 } } // namespace v8::internal | 811 } } // namespace v8::internal |
813 | 812 |
814 #endif // V8_HEAP_INL_H_ | 813 #endif // V8_HEAP_INL_H_ |
OLD | NEW |