| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 TEST(Regress340063) { | 56 TEST(Regress340063) { |
| 57 CcTest::InitializeVM(); | 57 CcTest::InitializeVM(); |
| 58 if (!i::FLAG_allocation_site_pretenuring) return; | 58 if (!i::FLAG_allocation_site_pretenuring) return; |
| 59 v8::HandleScope scope(CcTest::isolate()); | 59 v8::HandleScope scope(CcTest::isolate()); |
| 60 | 60 |
| 61 SetUpNewSpaceWithPoisonedMementoAtTop(); | 61 SetUpNewSpaceWithPoisonedMementoAtTop(); |
| 62 | 62 |
| 63 // Call GC to see if we can handle a poisonous memento right after the | 63 // Call GC to see if we can handle a poisonous memento right after the |
| 64 // current new space top pointer. | 64 // current new space top pointer. |
| 65 CcTest::i_isolate()->heap()->CollectAllGarbage( | 65 CcTest::i_isolate()->heap()->CollectAllGarbage( |
| 66 Heap::kAbortIncrementalMarkingMask); | 66 "Regress340063", Heap::kAbortIncrementalMarkingMask); |
| 67 } | 67 } |
| 68 | 68 |
| 69 | 69 |
| 70 TEST(Regress470390) { | 70 TEST(Regress470390) { |
| 71 CcTest::InitializeVM(); | 71 CcTest::InitializeVM(); |
| 72 if (!i::FLAG_allocation_site_pretenuring) return; | 72 if (!i::FLAG_allocation_site_pretenuring) return; |
| 73 v8::HandleScope scope(CcTest::isolate()); | 73 v8::HandleScope scope(CcTest::isolate()); |
| 74 | 74 |
| 75 SetUpNewSpaceWithPoisonedMementoAtTop(); | 75 SetUpNewSpaceWithPoisonedMementoAtTop(); |
| 76 | 76 |
| 77 // Set the new space limit to be equal to the top. | 77 // Set the new space limit to be equal to the top. |
| 78 Address top = CcTest::i_isolate()->heap()->new_space()->top(); | 78 Address top = CcTest::i_isolate()->heap()->new_space()->top(); |
| 79 *(CcTest::i_isolate()->heap()->new_space()->allocation_limit_address()) = top; | 79 *(CcTest::i_isolate()->heap()->new_space()->allocation_limit_address()) = top; |
| 80 | 80 |
| 81 // Call GC to see if we can handle a poisonous memento right after the | 81 // Call GC to see if we can handle a poisonous memento right after the |
| 82 // current new space top pointer. | 82 // current new space top pointer. |
| 83 CcTest::i_isolate()->heap()->CollectAllGarbage( | 83 CcTest::i_isolate()->heap()->CollectAllGarbage( |
| 84 Heap::kAbortIncrementalMarkingMask); | 84 "Regress470390", Heap::kAbortIncrementalMarkingMask); |
| 85 } | 85 } |
| 86 | 86 |
| 87 | 87 |
| 88 TEST(BadMementoAfterTopForceScavenge) { | 88 TEST(BadMementoAfterTopForceScavenge) { |
| 89 CcTest::InitializeVM(); | 89 CcTest::InitializeVM(); |
| 90 if (!i::FLAG_allocation_site_pretenuring) return; | 90 if (!i::FLAG_allocation_site_pretenuring) return; |
| 91 v8::HandleScope scope(CcTest::isolate()); | 91 v8::HandleScope scope(CcTest::isolate()); |
| 92 | 92 |
| 93 SetUpNewSpaceWithPoisonedMementoAtTop(); | 93 SetUpNewSpaceWithPoisonedMementoAtTop(); |
| 94 | 94 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 AllocationMemento* memento = | 130 AllocationMemento* memento = |
| 131 reinterpret_cast<AllocationMemento*>(memento_address + kHeapObjectTag); | 131 reinterpret_cast<AllocationMemento*>(memento_address + kHeapObjectTag); |
| 132 CHECK_EQ(memento->map(), heap->allocation_memento_map()); | 132 CHECK_EQ(memento->map(), heap->allocation_memento_map()); |
| 133 | 133 |
| 134 // Furthermore, how many mementos did we create? The count should match | 134 // Furthermore, how many mementos did we create? The count should match |
| 135 // call_count. Note, that mementos are allocated during the inobject slack | 135 // call_count. Note, that mementos are allocated during the inobject slack |
| 136 // tracking phase. | 136 // tracking phase. |
| 137 AllocationSite* site = memento->GetAllocationSite(); | 137 AllocationSite* site = memento->GetAllocationSite(); |
| 138 CHECK_EQ(call_count, site->pretenure_create_count()->value()); | 138 CHECK_EQ(call_count, site->pretenure_create_count()->value()); |
| 139 } | 139 } |
| OLD | NEW |