OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 for (Object** current = start; current < end; current++) { | 813 for (Object** current = start; current < end; current++) { |
814 if ((*current)->IsHeapObject()) { | 814 if ((*current)->IsHeapObject()) { |
815 HeapObject* object = HeapObject::cast(*current); | 815 HeapObject* object = HeapObject::cast(*current); |
816 CHECK(object->GetIsolate()->heap()->Contains(object)); | 816 CHECK(object->GetIsolate()->heap()->Contains(object)); |
817 CHECK(object->map()->IsMap()); | 817 CHECK(object->map()->IsMap()); |
818 } | 818 } |
819 } | 819 } |
820 } | 820 } |
821 | 821 |
822 | 822 |
| 823 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
| 824 for (Object** current = start; current < end; current++) { |
| 825 CHECK((*current)->IsSmi()); |
| 826 } |
| 827 } |
| 828 |
| 829 |
823 double GCTracer::SizeOfHeapObjects() { | 830 double GCTracer::SizeOfHeapObjects() { |
824 return (static_cast<double>(heap_->SizeOfObjects())) / MB; | 831 return (static_cast<double>(heap_->SizeOfObjects())) / MB; |
825 } | 832 } |
826 | 833 |
827 | 834 |
828 DisallowAllocationFailure::DisallowAllocationFailure() { | 835 DisallowAllocationFailure::DisallowAllocationFailure() { |
829 #ifdef DEBUG | 836 #ifdef DEBUG |
830 Isolate* isolate = Isolate::Current(); | 837 Isolate* isolate = Isolate::Current(); |
831 old_state_ = isolate->heap()->disallow_allocation_failure_; | 838 old_state_ = isolate->heap()->disallow_allocation_failure_; |
832 isolate->heap()->disallow_allocation_failure_ = true; | 839 isolate->heap()->disallow_allocation_failure_ = true; |
833 #endif | 840 #endif |
834 } | 841 } |
835 | 842 |
836 | 843 |
837 DisallowAllocationFailure::~DisallowAllocationFailure() { | 844 DisallowAllocationFailure::~DisallowAllocationFailure() { |
838 #ifdef DEBUG | 845 #ifdef DEBUG |
839 Isolate* isolate = Isolate::Current(); | 846 Isolate* isolate = Isolate::Current(); |
840 isolate->heap()->disallow_allocation_failure_ = old_state_; | 847 isolate->heap()->disallow_allocation_failure_ = old_state_; |
841 #endif | 848 #endif |
842 } | 849 } |
843 | 850 |
844 | 851 |
845 } } // namespace v8::internal | 852 } } // namespace v8::internal |
846 | 853 |
847 #endif // V8_HEAP_INL_H_ | 854 #endif // V8_HEAP_INL_H_ |
OLD | NEW |