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