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

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

Issue 2310143002: [heap] Introduce enum of garbage collection reasons. (Closed)
Patch Set: rebase Created 4 years, 3 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/cctest.h ('k') | test/cctest/heap/heap-utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 EmptyMessageQueues(isolate_); 100 EmptyMessageQueues(isolate_);
101 } else { 101 } else {
102 EmptyMessageQueues(isolate_); 102 EmptyMessageQueues(isolate_);
103 } 103 }
104 isolate_->Exit(); 104 isolate_->Exit();
105 } 105 }
106 } 106 }
107 107
108 i::Heap* CcTest::heap() { return i_isolate()->heap(); } 108 i::Heap* CcTest::heap() { return i_isolate()->heap(); }
109 109
110 void CcTest::CollectGarbage(i::AllocationSpace space) {
111 heap()->CollectGarbage(space, i::GarbageCollectionReason::kTesting);
112 }
113
114 void CcTest::CollectAllGarbage(int flags) {
115 heap()->CollectAllGarbage(flags, i::GarbageCollectionReason::kTesting);
116 }
117
118 void CcTest::CollectAllAvailableGarbage() {
119 heap()->CollectAllAvailableGarbage(i::GarbageCollectionReason::kTesting);
120 }
121
110 v8::base::RandomNumberGenerator* CcTest::random_number_generator() { 122 v8::base::RandomNumberGenerator* CcTest::random_number_generator() {
111 return InitIsolateOnce()->random_number_generator(); 123 return InitIsolateOnce()->random_number_generator();
112 } 124 }
113 125
114 v8::Local<v8::Object> CcTest::global() { 126 v8::Local<v8::Object> CcTest::global() {
115 return isolate()->GetCurrentContext()->Global(); 127 return isolate()->GetCurrentContext()->Global();
116 } 128 }
117 129
118 void CcTest::InitializeVM() { 130 void CcTest::InitializeVM() {
119 CHECK(!v8::base::NoBarrier_Load(&isolate_used_)); 131 CHECK(!v8::base::NoBarrier_Load(&isolate_used_));
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 CcTest::TearDown(); 327 CcTest::TearDown();
316 // TODO(svenpanne) See comment above. 328 // TODO(svenpanne) See comment above.
317 // if (!disable_automatic_dispose_) v8::V8::Dispose(); 329 // if (!disable_automatic_dispose_) v8::V8::Dispose();
318 v8::V8::ShutdownPlatform(); 330 v8::V8::ShutdownPlatform();
319 delete platform; 331 delete platform;
320 return 0; 332 return 0;
321 } 333 }
322 334
323 RegisterThreadedTest *RegisterThreadedTest::first_ = NULL; 335 RegisterThreadedTest *RegisterThreadedTest::first_ = NULL;
324 int RegisterThreadedTest::count_ = 0; 336 int RegisterThreadedTest::count_ = 0;
OLDNEW
« no previous file with comments | « test/cctest/cctest.h ('k') | test/cctest/heap/heap-utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698