OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 } |
OLD | NEW |