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

Side by Side Diff: test/cctest/test-mementos.cc

Issue 2885883004: [heap] Fix verification of unsafe object layout changes. (Closed)
Patch Set: remove redundant check Created 3 years, 7 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 | « src/runtime/runtime-object.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 // 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 // Allocate a string, the GC may suspect a memento behind the string. 51 // Allocate a string, the GC may suspect a memento behind the string.
52 Handle<SeqOneByteString> string = 52 Handle<SeqOneByteString> string =
53 isolate->factory()->NewRawOneByteString(12).ToHandleChecked(); 53 isolate->factory()->NewRawOneByteString(12).ToHandleChecked();
54 CHECK(*string); 54 CHECK(*string);
55 55
56 // Create an allocation memento behind the string with a garbage allocation 56 // Create an allocation memento behind the string with a garbage allocation
57 // site pointer. 57 // site pointer.
58 AllocationMemento* memento = 58 AllocationMemento* memento =
59 reinterpret_cast<AllocationMemento*>(new_space->top() + kHeapObjectTag); 59 reinterpret_cast<AllocationMemento*>(new_space->top() + kHeapObjectTag);
60 memento->set_map_no_write_barrier(heap->allocation_memento_map()); 60 memento->set_map_after_allocation(heap->allocation_memento_map(),
61 SKIP_WRITE_BARRIER);
61 memento->set_allocation_site( 62 memento->set_allocation_site(
62 reinterpret_cast<AllocationSite*>(kHeapObjectTag), SKIP_WRITE_BARRIER); 63 reinterpret_cast<AllocationSite*>(kHeapObjectTag), SKIP_WRITE_BARRIER);
63 } 64 }
64 65
65 66
66 TEST(Regress340063) { 67 TEST(Regress340063) {
67 CcTest::InitializeVM(); 68 CcTest::InitializeVM();
68 if (!i::FLAG_allocation_site_pretenuring) return; 69 if (!i::FLAG_allocation_site_pretenuring) return;
69 v8::HandleScope scope(CcTest::isolate()); 70 v8::HandleScope scope(CcTest::isolate());
70 71
(...skipping 25 matching lines...) Expand all
96 TEST(BadMementoAfterTopForceScavenge) { 97 TEST(BadMementoAfterTopForceScavenge) {
97 CcTest::InitializeVM(); 98 CcTest::InitializeVM();
98 if (!i::FLAG_allocation_site_pretenuring) return; 99 if (!i::FLAG_allocation_site_pretenuring) return;
99 v8::HandleScope scope(CcTest::isolate()); 100 v8::HandleScope scope(CcTest::isolate());
100 101
101 SetUpNewSpaceWithPoisonedMementoAtTop(); 102 SetUpNewSpaceWithPoisonedMementoAtTop();
102 103
103 // Force GC to test the poisoned memento handling 104 // Force GC to test the poisoned memento handling
104 CcTest::CollectGarbage(i::NEW_SPACE); 105 CcTest::CollectGarbage(i::NEW_SPACE);
105 } 106 }
OLDNEW
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698