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

Side by Side Diff: test/fuzzer/fuzzer-support.cc

Issue 1953253003: [fuzzer] Force a GC before shutting down isolates (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 | « no previous file | 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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 "test/fuzzer/fuzzer-support.h" 5 #include "test/fuzzer/fuzzer-support.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <string.h> 9 #include <string.h>
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 FuzzerSupport::~FuzzerSupport() { 61 FuzzerSupport::~FuzzerSupport() {
62 { 62 {
63 v8::Isolate::Scope isolate_scope(isolate_); 63 v8::Isolate::Scope isolate_scope(isolate_);
64 while (v8::platform::PumpMessageLoop(platform_, isolate_)) /* empty */ 64 while (v8::platform::PumpMessageLoop(platform_, isolate_)) /* empty */
65 ; 65 ;
66 66
67 v8::HandleScope handle_scope(isolate_); 67 v8::HandleScope handle_scope(isolate_);
68 context_.Reset(); 68 context_.Reset();
69 } 69 }
70 70
71 isolate_->LowMemoryNotification();
ulan 2016/05/06 12:27:11 Wouldn't RequestGarbageCollectionForTesting be mor
71 isolate_->Dispose(); 72 isolate_->Dispose();
72 isolate_ = nullptr; 73 isolate_ = nullptr;
73 74
74 delete allocator_; 75 delete allocator_;
75 allocator_ = nullptr; 76 allocator_ = nullptr;
76 77
77 v8::V8::Dispose(); 78 v8::V8::Dispose();
78 v8::V8::ShutdownPlatform(); 79 v8::V8::ShutdownPlatform();
79 80
80 delete platform_; 81 delete platform_;
(...skipping 13 matching lines...) Expand all
94 return handle_scope.Escape(context); 95 return handle_scope.Escape(context);
95 } 96 }
96 97
97 } // namespace v8_fuzzer 98 } // namespace v8_fuzzer
98 99
99 extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { 100 extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) {
100 v8_fuzzer::g_fuzzer_support = new v8_fuzzer::FuzzerSupport(argc, argv); 101 v8_fuzzer::g_fuzzer_support = new v8_fuzzer::FuzzerSupport(argc, argv);
101 atexit(&v8_fuzzer::DeleteFuzzerSupport); 102 atexit(&v8_fuzzer::DeleteFuzzerSupport);
102 return 0; 103 return 0;
103 } 104 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698