OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 3925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3936 #if DCHECK_IS_ON() | 3936 #if DCHECK_IS_ON() |
3937 namespace { | 3937 namespace { |
3938 | 3938 |
3939 static size_t g_check_mark_count = 0; | 3939 static size_t g_check_mark_count = 0; |
3940 | 3940 |
3941 bool ReportMarkedPointer(HeapObjectHeader*) { | 3941 bool ReportMarkedPointer(HeapObjectHeader*) { |
3942 g_check_mark_count++; | 3942 g_check_mark_count++; |
3943 // Do not try to mark the located heap object. | 3943 // Do not try to mark the located heap object. |
3944 return true; | 3944 return true; |
3945 } | 3945 } |
3946 } | 3946 } // namespace |
3947 #endif | 3947 #endif |
3948 | 3948 |
3949 TEST(HeapTest, CheckAndMarkPointer) { | 3949 TEST(HeapTest, CheckAndMarkPointer) { |
3950 #if DCHECK_IS_ON() | 3950 #if DCHECK_IS_ON() |
3951 ThreadHeap& heap = ThreadState::Current()->Heap(); | 3951 ThreadHeap& heap = ThreadState::Current()->Heap(); |
3952 ClearOutOldGarbage(); | 3952 ClearOutOldGarbage(); |
3953 | 3953 |
3954 Vector<Address> object_addresses; | 3954 Vector<Address> object_addresses; |
3955 Vector<Address> end_addresses; | 3955 Vector<Address> end_addresses; |
3956 Address large_object_address; | 3956 Address large_object_address; |
(...skipping 2755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6712 map.insert(key, IntWrapper::Create(i)); | 6712 map.insert(key, IntWrapper::Create(i)); |
6713 } | 6713 } |
6714 | 6714 |
6715 EXPECT_FALSE(string.Impl()->HasOneRef()); | 6715 EXPECT_FALSE(string.Impl()->HasOneRef()); |
6716 map.clear(); | 6716 map.clear(); |
6717 | 6717 |
6718 EXPECT_TRUE(string.Impl()->HasOneRef()); | 6718 EXPECT_TRUE(string.Impl()->HasOneRef()); |
6719 } | 6719 } |
6720 | 6720 |
6721 } // namespace blink | 6721 } // namespace blink |
OLD | NEW |