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

Side by Side Diff: src/wasm/wasm-module.cc

Issue 1738943004: Adding Wasm + Wasm-asm variant fuzzer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 9 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 | « BUILD.gn ('k') | test/fuzzer/fuzzer.gyp » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 "src/macro-assembler.h" 5 #include "src/macro-assembler.h"
6 #include "src/objects.h" 6 #include "src/objects.h"
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/simulator.h" 9 #include "src/simulator.h"
10 10
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 508
509 int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start, 509 int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start,
510 const byte* module_end, bool asm_js) { 510 const byte* module_end, bool asm_js) {
511 HandleScope scope(isolate); 511 HandleScope scope(isolate);
512 Zone zone; 512 Zone zone;
513 // Decode the module, but don't verify function bodies, since we'll 513 // Decode the module, but don't verify function bodies, since we'll
514 // be compiling them anyway. 514 // be compiling them anyway.
515 ModuleResult result = DecodeWasmModule(isolate, &zone, module_start, 515 ModuleResult result = DecodeWasmModule(isolate, &zone, module_start,
516 module_end, false, kWasmOrigin); 516 module_end, false, kWasmOrigin);
517 if (result.failed()) { 517 if (result.failed()) {
518 if (result.val) {
519 delete result.val;
520 }
518 // Module verification failed. throw. 521 // Module verification failed. throw.
519 std::ostringstream str; 522 std::ostringstream str;
520 str << "WASM.compileRun() failed: " << result; 523 str << "WASM.compileRun() failed: " << result;
521 isolate->Throw( 524 isolate->Throw(
522 *isolate->factory()->NewStringFromAsciiChecked(str.str().c_str())); 525 *isolate->factory()->NewStringFromAsciiChecked(str.str().c_str()));
523 return -1; 526 return -1;
524 } 527 }
525 528
526 int32_t retval = CompileAndRunWasmModule(isolate, result.val); 529 int32_t retval = CompileAndRunWasmModule(isolate, result.val);
527 delete result.val; 530 delete result.val;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 } 609 }
607 if (result->IsHeapNumber()) { 610 if (result->IsHeapNumber()) {
608 return static_cast<int32_t>(HeapNumber::cast(*result)->value()); 611 return static_cast<int32_t>(HeapNumber::cast(*result)->value());
609 } 612 }
610 thrower.Error("WASM.compileRun() failed: Return value should be number"); 613 thrower.Error("WASM.compileRun() failed: Return value should be number");
611 return -1; 614 return -1;
612 } 615 }
613 } // namespace wasm 616 } // namespace wasm
614 } // namespace internal 617 } // namespace internal
615 } // namespace v8 618 } // namespace v8
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | test/fuzzer/fuzzer.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698