| 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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 | 633 |
| 634 void ExternalStringTable::AddOldString(String* string) { | 634 void ExternalStringTable::AddOldString(String* string) { |
| 635 ASSERT(string->IsExternalString()); | 635 ASSERT(string->IsExternalString()); |
| 636 ASSERT(!heap_->InNewSpace(string)); | 636 ASSERT(!heap_->InNewSpace(string)); |
| 637 old_space_strings_.Add(string); | 637 old_space_strings_.Add(string); |
| 638 } | 638 } |
| 639 | 639 |
| 640 | 640 |
| 641 void ExternalStringTable::ShrinkNewStrings(int position) { | 641 void ExternalStringTable::ShrinkNewStrings(int position) { |
| 642 new_space_strings_.Rewind(position); | 642 new_space_strings_.Rewind(position); |
| 643 #ifdef VERIFY_HEAP |
| 643 if (FLAG_verify_heap) { | 644 if (FLAG_verify_heap) { |
| 644 Verify(); | 645 Verify(); |
| 645 } | 646 } |
| 647 #endif |
| 646 } | 648 } |
| 647 | 649 |
| 648 | 650 |
| 649 void Heap::ClearInstanceofCache() { | 651 void Heap::ClearInstanceofCache() { |
| 650 set_instanceof_cache_function(the_hole_value()); | 652 set_instanceof_cache_function(the_hole_value()); |
| 651 } | 653 } |
| 652 | 654 |
| 653 | 655 |
| 654 Object* Heap::ToBoolean(bool condition) { | 656 Object* Heap::ToBoolean(bool condition) { |
| 655 return condition ? true_value() : false_value(); | 657 return condition ? true_value() : false_value(); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 HEAP->always_allocate_scope_depth_++; | 736 HEAP->always_allocate_scope_depth_++; |
| 735 } | 737 } |
| 736 | 738 |
| 737 | 739 |
| 738 AlwaysAllocateScope::~AlwaysAllocateScope() { | 740 AlwaysAllocateScope::~AlwaysAllocateScope() { |
| 739 HEAP->always_allocate_scope_depth_--; | 741 HEAP->always_allocate_scope_depth_--; |
| 740 ASSERT(HEAP->always_allocate_scope_depth_ == 0); | 742 ASSERT(HEAP->always_allocate_scope_depth_ == 0); |
| 741 } | 743 } |
| 742 | 744 |
| 743 | 745 |
| 744 #ifdef DEBUG | |
| 745 void VerifyPointersVisitor::VisitPointers(Object** start, Object** end) { | 746 void VerifyPointersVisitor::VisitPointers(Object** start, Object** end) { |
| 746 for (Object** current = start; current < end; current++) { | 747 for (Object** current = start; current < end; current++) { |
| 747 if ((*current)->IsHeapObject()) { | 748 if ((*current)->IsHeapObject()) { |
| 748 HeapObject* object = HeapObject::cast(*current); | 749 HeapObject* object = HeapObject::cast(*current); |
| 749 ASSERT(HEAP->Contains(object)); | 750 CHECK(HEAP->Contains(object)); |
| 750 ASSERT(object->map()->IsMap()); | 751 CHECK(object->map()->IsMap()); |
| 751 } | 752 } |
| 752 } | 753 } |
| 753 } | 754 } |
| 754 #endif | |
| 755 | 755 |
| 756 | 756 |
| 757 double GCTracer::SizeOfHeapObjects() { | 757 double GCTracer::SizeOfHeapObjects() { |
| 758 return (static_cast<double>(HEAP->SizeOfObjects())) / MB; | 758 return (static_cast<double>(HEAP->SizeOfObjects())) / MB; |
| 759 } | 759 } |
| 760 | 760 |
| 761 | 761 |
| 762 DisallowAllocationFailure::DisallowAllocationFailure() { | 762 DisallowAllocationFailure::DisallowAllocationFailure() { |
| 763 #ifdef DEBUG | 763 #ifdef DEBUG |
| 764 old_state_ = HEAP->disallow_allocation_failure_; | 764 old_state_ = HEAP->disallow_allocation_failure_; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 AssertNoAllocation::~AssertNoAllocation() { } | 808 AssertNoAllocation::~AssertNoAllocation() { } |
| 809 DisableAssertNoAllocation::DisableAssertNoAllocation() { } | 809 DisableAssertNoAllocation::DisableAssertNoAllocation() { } |
| 810 DisableAssertNoAllocation::~DisableAssertNoAllocation() { } | 810 DisableAssertNoAllocation::~DisableAssertNoAllocation() { } |
| 811 | 811 |
| 812 #endif | 812 #endif |
| 813 | 813 |
| 814 | 814 |
| 815 } } // namespace v8::internal | 815 } } // namespace v8::internal |
| 816 | 816 |
| 817 #endif // V8_HEAP_INL_H_ | 817 #endif // V8_HEAP_INL_H_ |
| OLD | NEW |