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

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

Issue 1134293002: Version 4.3.61.21 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.3
Patch Set: Created 5 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/heap/heap.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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 memento->set_allocation_site( 51 memento->set_allocation_site(
52 reinterpret_cast<AllocationSite*>(kHeapObjectTag), SKIP_WRITE_BARRIER); 52 reinterpret_cast<AllocationSite*>(kHeapObjectTag), SKIP_WRITE_BARRIER);
53 } 53 }
54 54
55 55
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
62 SetUpNewSpaceWithPoisonedMementoAtTop(); 61 SetUpNewSpaceWithPoisonedMementoAtTop();
63 62
64 // 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
65 // current new space top pointer. 64 // current new space top pointer.
66 CcTest::i_isolate()->heap()->CollectAllGarbage( 65 CcTest::i_isolate()->heap()->CollectAllGarbage(
66 Heap::kAbortIncrementalMarkingMask);
67 }
68
69
70 TEST(Regress470390) {
71 CcTest::InitializeVM();
72 if (!i::FLAG_allocation_site_pretenuring) return;
73 v8::HandleScope scope(CcTest::isolate());
74
75 SetUpNewSpaceWithPoisonedMementoAtTop();
76
77 // Set the new space limit to be equal to the top.
78 Address top = CcTest::i_isolate()->heap()->new_space()->top();
79 *(CcTest::i_isolate()->heap()->new_space()->allocation_limit_address()) = top;
80
81 // Call GC to see if we can handle a poisonous memento right after the
82 // current new space top pointer.
83 CcTest::i_isolate()->heap()->CollectAllGarbage(
67 Heap::kAbortIncrementalMarkingMask); 84 Heap::kAbortIncrementalMarkingMask);
68 } 85 }
69 86
70 87
71 TEST(BadMementoAfterTopForceScavenge) { 88 TEST(BadMementoAfterTopForceScavenge) {
72 CcTest::InitializeVM(); 89 CcTest::InitializeVM();
73 if (!i::FLAG_allocation_site_pretenuring) return; 90 if (!i::FLAG_allocation_site_pretenuring) return;
74 v8::HandleScope scope(CcTest::isolate()); 91 v8::HandleScope scope(CcTest::isolate());
75 92
76 SetUpNewSpaceWithPoisonedMementoAtTop(); 93 SetUpNewSpaceWithPoisonedMementoAtTop();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 AllocationMemento* memento = 129 AllocationMemento* memento =
113 reinterpret_cast<AllocationMemento*>(memento_address + kHeapObjectTag); 130 reinterpret_cast<AllocationMemento*>(memento_address + kHeapObjectTag);
114 CHECK_EQ(memento->map(), heap->allocation_memento_map()); 131 CHECK_EQ(memento->map(), heap->allocation_memento_map());
115 132
116 // Furthermore, how many mementos did we create? The count should match 133 // Furthermore, how many mementos did we create? The count should match
117 // call_count. Note, that mementos are allocated during the inobject slack 134 // call_count. Note, that mementos are allocated during the inobject slack
118 // tracking phase. 135 // tracking phase.
119 AllocationSite* site = memento->GetAllocationSite(); 136 AllocationSite* site = memento->GetAllocationSite();
120 CHECK_EQ(call_count, site->pretenure_create_count()->value()); 137 CHECK_EQ(call_count, site->pretenure_create_count()->value());
121 } 138 }
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698