| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 <stdlib.h> | 5 #include <stdlib.h> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" |
| (...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1134 field_index = FieldIndex::ForDescriptor(*map, 1); | 1134 field_index = FieldIndex::ForDescriptor(*map, 1); |
| 1135 CHECK(field_index.is_inobject() && !field_index.is_double()); | 1135 CHECK(field_index.is_inobject() && !field_index.is_double()); |
| 1136 CHECK(!map->IsUnboxedDoubleField(field_index)); | 1136 CHECK(!map->IsUnboxedDoubleField(field_index)); |
| 1137 } | 1137 } |
| 1138 CHECK(isolate->heap()->new_space()->Contains(*obj)); | 1138 CHECK(isolate->heap()->new_space()->Contains(*obj)); |
| 1139 | 1139 |
| 1140 // Heap is ready, force |ec_page| to become an evacuation candidate and | 1140 // Heap is ready, force |ec_page| to become an evacuation candidate and |
| 1141 // simulate incremental marking. | 1141 // simulate incremental marking. |
| 1142 FLAG_stress_compaction = true; | 1142 FLAG_stress_compaction = true; |
| 1143 FLAG_manual_evacuation_candidates_selection = true; | 1143 FLAG_manual_evacuation_candidates_selection = true; |
| 1144 ec_page->SetFlag(MemoryChunk::FORCE_EVACUATION_CANDIDATE_FOR_TESTING); | 1144 heap::ForceEvacuationCandidate(ec_page); |
| 1145 heap::SimulateIncrementalMarking(heap); | 1145 heap::SimulateIncrementalMarking(heap); |
| 1146 // Disable stress compaction mode in order to let GC do scavenge. | 1146 // Disable stress compaction mode in order to let GC do scavenge. |
| 1147 FLAG_stress_compaction = false; | 1147 FLAG_stress_compaction = false; |
| 1148 | 1148 |
| 1149 // Check that everything is ready for triggering incremental write barrier | 1149 // Check that everything is ready for triggering incremental write barrier |
| 1150 // during scavenge (i.e. that |obj| is black and incremental marking is | 1150 // during scavenge (i.e. that |obj| is black and incremental marking is |
| 1151 // in compacting mode and |obj_value|'s page is an evacuation candidate). | 1151 // in compacting mode and |obj_value|'s page is an evacuation candidate). |
| 1152 IncrementalMarking* marking = heap->incremental_marking(); | 1152 IncrementalMarking* marking = heap->incremental_marking(); |
| 1153 CHECK(marking->IsCompacting()); | 1153 CHECK(marking->IsCompacting()); |
| 1154 CHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(*obj))); | 1154 CHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(*obj))); |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1452 | 1452 |
| 1453 // Make sure |obj_value| is placed on an old-space evacuation candidate. | 1453 // Make sure |obj_value| is placed on an old-space evacuation candidate. |
| 1454 heap::SimulateFullSpace(old_space); | 1454 heap::SimulateFullSpace(old_space); |
| 1455 obj_value = factory->NewJSArray(32 * KB, FAST_HOLEY_ELEMENTS, TENURED); | 1455 obj_value = factory->NewJSArray(32 * KB, FAST_HOLEY_ELEMENTS, TENURED); |
| 1456 ec_page = Page::FromAddress(obj_value->address()); | 1456 ec_page = Page::FromAddress(obj_value->address()); |
| 1457 CHECK_NE(ec_page, Page::FromAddress(obj->address())); | 1457 CHECK_NE(ec_page, Page::FromAddress(obj->address())); |
| 1458 } | 1458 } |
| 1459 | 1459 |
| 1460 // Heap is ready, force |ec_page| to become an evacuation candidate and | 1460 // Heap is ready, force |ec_page| to become an evacuation candidate and |
| 1461 // simulate incremental marking. | 1461 // simulate incremental marking. |
| 1462 ec_page->SetFlag(MemoryChunk::FORCE_EVACUATION_CANDIDATE_FOR_TESTING); | 1462 heap::ForceEvacuationCandidate(ec_page); |
| 1463 heap::SimulateIncrementalMarking(heap); | 1463 heap::SimulateIncrementalMarking(heap); |
| 1464 | 1464 |
| 1465 // Check that everything is ready for triggering incremental write barrier | 1465 // Check that everything is ready for triggering incremental write barrier |
| 1466 // (i.e. that both |obj| and |obj_value| are black and the marking phase is | 1466 // (i.e. that both |obj| and |obj_value| are black and the marking phase is |
| 1467 // still active and |obj_value|'s page is indeed an evacuation candidate). | 1467 // still active and |obj_value|'s page is indeed an evacuation candidate). |
| 1468 IncrementalMarking* marking = heap->incremental_marking(); | 1468 IncrementalMarking* marking = heap->incremental_marking(); |
| 1469 CHECK(marking->IsMarking()); | 1469 CHECK(marking->IsMarking()); |
| 1470 CHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(*obj))); | 1470 CHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(*obj))); |
| 1471 CHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(*obj_value))); | 1471 CHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(*obj_value))); |
| 1472 CHECK(MarkCompactCollector::IsOnEvacuationCandidate(*obj_value)); | 1472 CHECK(MarkCompactCollector::IsOnEvacuationCandidate(*obj_value)); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1554 | 1554 |
| 1555 // TODO(ishell): add respective tests for property kind reconfiguring from | 1555 // TODO(ishell): add respective tests for property kind reconfiguring from |
| 1556 // accessor field to double, once accessor fields are supported by | 1556 // accessor field to double, once accessor fields are supported by |
| 1557 // Map::ReconfigureProperty(). | 1557 // Map::ReconfigureProperty(). |
| 1558 | 1558 |
| 1559 | 1559 |
| 1560 // TODO(ishell): add respective tests for fast property removal case once | 1560 // TODO(ishell): add respective tests for fast property removal case once |
| 1561 // Map::ReconfigureProperty() supports that. | 1561 // Map::ReconfigureProperty() supports that. |
| 1562 | 1562 |
| 1563 #endif | 1563 #endif |
| OLD | NEW |