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

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

Issue 2042253002: [icu] Support loading data file from default location (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Format Created 4 years, 6 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/interpreter/generate-bytecode-expectations.cc ('k') | tools/parser-shell.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 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 22 matching lines...) Expand all
33 void* data = AllocateUninitialized(length); 33 void* data = AllocateUninitialized(length);
34 return data == NULL ? data : memset(data, 0, length); 34 return data == NULL ? data : memset(data, 0, length);
35 } 35 }
36 virtual void* AllocateUninitialized(size_t length) { return malloc(length); } 36 virtual void* AllocateUninitialized(size_t length) { return malloc(length); }
37 virtual void Free(void* data, size_t) { free(data); } 37 virtual void Free(void* data, size_t) { free(data); }
38 }; 38 };
39 39
40 FuzzerSupport::FuzzerSupport(int* argc, char*** argv) { 40 FuzzerSupport::FuzzerSupport(int* argc, char*** argv) {
41 v8::internal::FLAG_expose_gc = true; 41 v8::internal::FLAG_expose_gc = true;
42 v8::V8::SetFlagsFromCommandLine(argc, *argv, true); 42 v8::V8::SetFlagsFromCommandLine(argc, *argv, true);
43 v8::V8::InitializeICU(); 43 v8::V8::InitializeICUDefaultLocation((*argv)[0]);
44 v8::V8::InitializeExternalStartupData((*argv)[0]); 44 v8::V8::InitializeExternalStartupData((*argv)[0]);
45 platform_ = v8::platform::CreateDefaultPlatform(); 45 platform_ = v8::platform::CreateDefaultPlatform();
46 v8::V8::InitializePlatform(platform_); 46 v8::V8::InitializePlatform(platform_);
47 v8::V8::Initialize(); 47 v8::V8::Initialize();
48 48
49 allocator_ = new ArrayBufferAllocator; 49 allocator_ = new ArrayBufferAllocator;
50 v8::Isolate::CreateParams create_params; 50 v8::Isolate::CreateParams create_params;
51 create_params.array_buffer_allocator = allocator_; 51 create_params.array_buffer_allocator = allocator_;
52 isolate_ = v8::Isolate::New(create_params); 52 isolate_ = v8::Isolate::New(create_params);
53 53
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 return handle_scope.Escape(context); 95 return handle_scope.Escape(context);
96 } 96 }
97 97
98 } // namespace v8_fuzzer 98 } // namespace v8_fuzzer
99 99
100 extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { 100 extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) {
101 v8_fuzzer::g_fuzzer_support = new v8_fuzzer::FuzzerSupport(argc, argv); 101 v8_fuzzer::g_fuzzer_support = new v8_fuzzer::FuzzerSupport(argc, argv);
102 atexit(&v8_fuzzer::DeleteFuzzerSupport); 102 atexit(&v8_fuzzer::DeleteFuzzerSupport);
103 return 0; 103 return 0;
104 } 104 }
OLDNEW
« no previous file with comments | « test/cctest/interpreter/generate-bytecode-expectations.cc ('k') | tools/parser-shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698