| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api.h" | 8 #include "src/api.h" |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
| (...skipping 4902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4913 case Heap::k##name##RootIndex: \ | 4913 case Heap::k##name##RootIndex: \ |
| 4914 return true; | 4914 return true; |
| 4915 IMMORTAL_IMMOVABLE_ROOT_LIST(CASE); | 4915 IMMORTAL_IMMOVABLE_ROOT_LIST(CASE); |
| 4916 #undef CASE | 4916 #undef CASE |
| 4917 default: | 4917 default: |
| 4918 return false; | 4918 return false; |
| 4919 } | 4919 } |
| 4920 } | 4920 } |
| 4921 | 4921 |
| 4922 | 4922 |
| 4923 bool Heap::GetRootListIndex(Handle<HeapObject> object, | |
| 4924 Heap::RootListIndex* index_return) { | |
| 4925 Object* ptr = *object; | |
| 4926 #define IMMORTAL_IMMOVABLE_ROOT(Name) \ | |
| 4927 if (ptr == roots_[Heap::k##Name##RootIndex]) { \ | |
| 4928 *index_return = k##Name##RootIndex; \ | |
| 4929 return true; \ | |
| 4930 } | |
| 4931 IMMORTAL_IMMOVABLE_ROOT_LIST(IMMORTAL_IMMOVABLE_ROOT) | |
| 4932 #undef IMMORTAL_IMMOVABLE_ROOT | |
| 4933 return false; | |
| 4934 } | |
| 4935 | |
| 4936 | |
| 4937 #ifdef VERIFY_HEAP | 4923 #ifdef VERIFY_HEAP |
| 4938 void Heap::Verify() { | 4924 void Heap::Verify() { |
| 4939 CHECK(HasBeenSetUp()); | 4925 CHECK(HasBeenSetUp()); |
| 4940 HandleScope scope(isolate()); | 4926 HandleScope scope(isolate()); |
| 4941 | 4927 |
| 4942 store_buffer()->Verify(); | 4928 store_buffer()->Verify(); |
| 4943 | 4929 |
| 4944 if (mark_compact_collector()->sweeping_in_progress()) { | 4930 if (mark_compact_collector()->sweeping_in_progress()) { |
| 4945 // We have to wait here for the sweeper threads to have an iterable heap. | 4931 // We have to wait here for the sweeper threads to have an iterable heap. |
| 4946 mark_compact_collector()->EnsureSweepingCompleted(); | 4932 mark_compact_collector()->EnsureSweepingCompleted(); |
| (...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6630 *object_type = "CODE_TYPE"; \ | 6616 *object_type = "CODE_TYPE"; \ |
| 6631 *object_sub_type = "CODE_AGE/" #name; \ | 6617 *object_sub_type = "CODE_AGE/" #name; \ |
| 6632 return true; | 6618 return true; |
| 6633 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6619 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
| 6634 #undef COMPARE_AND_RETURN_NAME | 6620 #undef COMPARE_AND_RETURN_NAME |
| 6635 } | 6621 } |
| 6636 return false; | 6622 return false; |
| 6637 } | 6623 } |
| 6638 } // namespace internal | 6624 } // namespace internal |
| 6639 } // namespace v8 | 6625 } // namespace v8 |
| OLD | NEW |