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/wasm-section-fuzzers.cc

Issue 2394213003: Named all zones in the project (Closed)
Patch Set: Merge branch 'master' into zonenames Created 4 years, 2 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/fuzzer/wasm-code.cc ('k') | test/unittests/compiler/loop-peeling-unittest.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/wasm-section-fuzzers.h" 5 #include "test/fuzzer/wasm-section-fuzzers.h"
6 6
7 #include "include/v8.h" 7 #include "include/v8.h"
8 #include "src/isolate.h" 8 #include "src/isolate.h"
9 #include "src/wasm/wasm-module-builder.h" 9 #include "src/wasm/wasm-module-builder.h"
10 #include "src/wasm/wasm-module.h" 10 #include "src/wasm/wasm-module.h"
(...skipping 18 matching lines...) Expand all
29 if (i_isolate->has_pending_exception()) { 29 if (i_isolate->has_pending_exception()) {
30 i_isolate->clear_pending_exception(); 30 i_isolate->clear_pending_exception();
31 } 31 }
32 32
33 v8::Isolate::Scope isolate_scope(isolate); 33 v8::Isolate::Scope isolate_scope(isolate);
34 v8::HandleScope handle_scope(isolate); 34 v8::HandleScope handle_scope(isolate);
35 v8::Context::Scope context_scope(support->GetContext()); 35 v8::Context::Scope context_scope(support->GetContext());
36 v8::TryCatch try_catch(isolate); 36 v8::TryCatch try_catch(isolate);
37 37
38 v8::internal::AccountingAllocator allocator; 38 v8::internal::AccountingAllocator allocator;
39 v8::internal::Zone zone(&allocator); 39 v8::internal::Zone zone(&allocator, ZONE_NAME);
40 40
41 ZoneBuffer buffer(&zone); 41 ZoneBuffer buffer(&zone);
42 buffer.write_u32(kWasmMagic); 42 buffer.write_u32(kWasmMagic);
43 buffer.write_u32(kWasmVersion); 43 buffer.write_u32(kWasmVersion);
44 if (section == kNameSectionCode) { 44 if (section == kNameSectionCode) {
45 buffer.write_u8(kUnknownSectionCode); 45 buffer.write_u8(kUnknownSectionCode);
46 buffer.write_size(size + kNameStringLength + 1); 46 buffer.write_size(size + kNameStringLength + 1);
47 buffer.write_u8(kNameStringLength); 47 buffer.write_u8(kNameStringLength);
48 buffer.write(reinterpret_cast<const uint8_t*>(kNameString), 48 buffer.write(reinterpret_cast<const uint8_t*>(kNameString),
49 kNameStringLength); 49 kNameStringLength);
50 buffer.write(data, size); 50 buffer.write(data, size);
51 } else { 51 } else {
52 buffer.write_u8(section); 52 buffer.write_u8(section);
53 buffer.write_size(size); 53 buffer.write_size(size);
54 buffer.write(data, size); 54 buffer.write(data, size);
55 } 55 }
56 56
57 ErrorThrower thrower(i_isolate, "decoder"); 57 ErrorThrower thrower(i_isolate, "decoder");
58 58
59 std::unique_ptr<const WasmModule> module(testing::DecodeWasmModuleForTesting( 59 std::unique_ptr<const WasmModule> module(testing::DecodeWasmModuleForTesting(
60 i_isolate, &zone, &thrower, buffer.begin(), buffer.end(), kWasmOrigin)); 60 i_isolate, &zone, &thrower, buffer.begin(), buffer.end(), kWasmOrigin));
61 61
62 return 0; 62 return 0;
63 } 63 }
OLDNEW
« no previous file with comments | « test/fuzzer/wasm-code.cc ('k') | test/unittests/compiler/loop-peeling-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698