Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: test/cctest/test-unboxed-doubles.cc

Issue 2900603004: [heap] Add --stress-incremental-marking flag. (Closed)
Patch Set: fix test Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/test-strings.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/accessors.h" 10 #include "src/accessors.h"
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 CcTest::CollectGarbage(i::NEW_SPACE); 1102 CcTest::CollectGarbage(i::NEW_SPACE);
1103 1103
1104 CHECK(isolate->heap()->old_space()->Contains(*obj)); 1104 CHECK(isolate->heap()->old_space()->Contains(*obj));
1105 1105
1106 CHECK_EQ(boom_value, GetDoubleFieldValue(*obj, field_index)); 1106 CHECK_EQ(boom_value, GetDoubleFieldValue(*obj, field_index));
1107 } 1107 }
1108 1108
1109 1109
1110 TEST(DoScavengeWithIncrementalWriteBarrier) { 1110 TEST(DoScavengeWithIncrementalWriteBarrier) {
1111 if (FLAG_never_compact || !FLAG_incremental_marking) return; 1111 if (FLAG_never_compact || !FLAG_incremental_marking) return;
1112 FLAG_stress_incremental_marking = false;
1112 CcTest::InitializeVM(); 1113 CcTest::InitializeVM();
1113 v8::HandleScope scope(CcTest::isolate()); 1114 v8::HandleScope scope(CcTest::isolate());
1114 Isolate* isolate = CcTest::i_isolate(); 1115 Isolate* isolate = CcTest::i_isolate();
1115 Factory* factory = isolate->factory(); 1116 Factory* factory = isolate->factory();
1116 Heap* heap = CcTest::heap(); 1117 Heap* heap = CcTest::heap();
1117 PagedSpace* old_space = heap->old_space(); 1118 PagedSpace* old_space = heap->old_space();
1118 1119
1119 // The plan: create |obj_value| in old space and ensure that it is allocated 1120 // The plan: create |obj_value| in old space and ensure that it is allocated
1120 // on evacuation candidate page, create |obj| with double and tagged fields 1121 // on evacuation candidate page, create |obj| with double and tagged fields
1121 // in new space and write |obj_value| to tagged field of |obj|, do two 1122 // in new space and write |obj_value| to tagged field of |obj|, do two
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
1450 } 1451 }
1451 CHECK_EQ(boom_value, obj->RawFastDoublePropertyAsBitsAt(double_field_index)); 1452 CHECK_EQ(boom_value, obj->RawFastDoublePropertyAsBitsAt(double_field_index));
1452 } 1453 }
1453 1454
1454 1455
1455 static void TestIncrementalWriteBarrier(Handle<Map> map, Handle<Map> new_map, 1456 static void TestIncrementalWriteBarrier(Handle<Map> map, Handle<Map> new_map,
1456 int tagged_descriptor, 1457 int tagged_descriptor,
1457 int double_descriptor, 1458 int double_descriptor,
1458 bool check_tagged_value = true) { 1459 bool check_tagged_value = true) {
1459 if (FLAG_never_compact || !FLAG_incremental_marking) return; 1460 if (FLAG_never_compact || !FLAG_incremental_marking) return;
1461 FLAG_stress_incremental_marking = false;
1460 FLAG_manual_evacuation_candidates_selection = true; 1462 FLAG_manual_evacuation_candidates_selection = true;
1461 Isolate* isolate = CcTest::i_isolate(); 1463 Isolate* isolate = CcTest::i_isolate();
1462 Factory* factory = isolate->factory(); 1464 Factory* factory = isolate->factory();
1463 Heap* heap = CcTest::heap(); 1465 Heap* heap = CcTest::heap();
1464 PagedSpace* old_space = heap->old_space(); 1466 PagedSpace* old_space = heap->old_space();
1465 1467
1466 // The plan: create |obj| by |map| in old space, create |obj_value| in 1468 // The plan: create |obj| by |map| in old space, create |obj_value| in
1467 // old space and ensure it end up in evacuation candidate page. Start 1469 // old space and ensure it end up in evacuation candidate page. Start
1468 // incremental marking and ensure that incremental write barrier is triggered 1470 // incremental marking and ensure that incremental write barrier is triggered
1469 // when |obj_value| is written to property |tagged_descriptor| of |obj|. 1471 // when |obj_value| is written to property |tagged_descriptor| of |obj|.
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
1532 } 1534 }
1533 CHECK_EQ(boom_value, obj->RawFastDoublePropertyAsBitsAt(double_field_index)); 1535 CHECK_EQ(boom_value, obj->RawFastDoublePropertyAsBitsAt(double_field_index));
1534 } 1536 }
1535 1537
1536 enum OldToWriteBarrierKind { 1538 enum OldToWriteBarrierKind {
1537 OLD_TO_OLD_WRITE_BARRIER, 1539 OLD_TO_OLD_WRITE_BARRIER,
1538 OLD_TO_NEW_WRITE_BARRIER 1540 OLD_TO_NEW_WRITE_BARRIER
1539 }; 1541 };
1540 static void TestWriteBarrierObjectShiftFieldsRight( 1542 static void TestWriteBarrierObjectShiftFieldsRight(
1541 OldToWriteBarrierKind write_barrier_kind) { 1543 OldToWriteBarrierKind write_barrier_kind) {
1544 FLAG_stress_incremental_marking = false;
1542 CcTest::InitializeVM(); 1545 CcTest::InitializeVM();
1543 Isolate* isolate = CcTest::i_isolate(); 1546 Isolate* isolate = CcTest::i_isolate();
1544 v8::HandleScope scope(CcTest::isolate()); 1547 v8::HandleScope scope(CcTest::isolate());
1545 1548
1546 Handle<FieldType> any_type = FieldType::Any(isolate); 1549 Handle<FieldType> any_type = FieldType::Any(isolate);
1547 1550
1548 CompileRun("function func() { return 1; }"); 1551 CompileRun("function func() { return 1; }");
1549 1552
1550 Handle<JSObject> func = GetObject("func"); 1553 Handle<JSObject> func = GetObject("func");
1551 1554
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1583 1586
1584 // TODO(ishell): add respective tests for property kind reconfiguring from 1587 // TODO(ishell): add respective tests for property kind reconfiguring from
1585 // accessor field to double, once accessor fields are supported by 1588 // accessor field to double, once accessor fields are supported by
1586 // Map::ReconfigureProperty(). 1589 // Map::ReconfigureProperty().
1587 1590
1588 1591
1589 // TODO(ishell): add respective tests for fast property removal case once 1592 // TODO(ishell): add respective tests for fast property removal case once
1590 // Map::ReconfigureProperty() supports that. 1593 // Map::ReconfigureProperty() supports that.
1591 1594
1592 #endif 1595 #endif
OLDNEW
« no previous file with comments | « test/cctest/test-strings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698