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 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 HEAP->always_allocate_scope_depth_++; | 734 HEAP->always_allocate_scope_depth_++; |
735 } | 735 } |
736 | 736 |
737 | 737 |
738 AlwaysAllocateScope::~AlwaysAllocateScope() { | 738 AlwaysAllocateScope::~AlwaysAllocateScope() { |
739 HEAP->always_allocate_scope_depth_--; | 739 HEAP->always_allocate_scope_depth_--; |
740 ASSERT(HEAP->always_allocate_scope_depth_ == 0); | 740 ASSERT(HEAP->always_allocate_scope_depth_ == 0); |
741 } | 741 } |
742 | 742 |
743 | 743 |
744 LinearAllocationScope::LinearAllocationScope() { | |
745 HEAP->linear_allocation_scope_depth_++; | |
746 } | |
747 | |
748 | |
749 LinearAllocationScope::~LinearAllocationScope() { | |
750 HEAP->linear_allocation_scope_depth_--; | |
751 ASSERT(HEAP->linear_allocation_scope_depth_ >= 0); | |
752 } | |
753 | |
754 | |
755 #ifdef DEBUG | 744 #ifdef DEBUG |
756 void VerifyPointersVisitor::VisitPointers(Object** start, Object** end) { | 745 void VerifyPointersVisitor::VisitPointers(Object** start, Object** end) { |
757 for (Object** current = start; current < end; current++) { | 746 for (Object** current = start; current < end; current++) { |
758 if ((*current)->IsHeapObject()) { | 747 if ((*current)->IsHeapObject()) { |
759 HeapObject* object = HeapObject::cast(*current); | 748 HeapObject* object = HeapObject::cast(*current); |
760 ASSERT(HEAP->Contains(object)); | 749 ASSERT(HEAP->Contains(object)); |
761 ASSERT(object->map()->IsMap()); | 750 ASSERT(object->map()->IsMap()); |
762 } | 751 } |
763 } | 752 } |
764 } | 753 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 AssertNoAllocation::~AssertNoAllocation() { } | 808 AssertNoAllocation::~AssertNoAllocation() { } |
820 DisableAssertNoAllocation::DisableAssertNoAllocation() { } | 809 DisableAssertNoAllocation::DisableAssertNoAllocation() { } |
821 DisableAssertNoAllocation::~DisableAssertNoAllocation() { } | 810 DisableAssertNoAllocation::~DisableAssertNoAllocation() { } |
822 | 811 |
823 #endif | 812 #endif |
824 | 813 |
825 | 814 |
826 } } // namespace v8::internal | 815 } } // namespace v8::internal |
827 | 816 |
828 #endif // V8_HEAP_INL_H_ | 817 #endif // V8_HEAP_INL_H_ |
OLD | NEW |