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

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

Issue 2496203002: [wasm] Reimplement function verification in the module decoder. (Closed)
Patch Set: Create a dummy ModuleEnv Created 4 years, 1 month 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 | « src/wasm/module-decoder.cc ('k') | test/common/wasm/wasm-module-runner.h » ('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 <memory> 5 #include <memory>
6 6
7 #include "src/base/atomic-utils.h" 7 #include "src/base/atomic-utils.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 9
10 #include "src/macro-assembler.h" 10 #include "src/macro-assembler.h"
(...skipping 1907 matching lines...) Expand 10 before | Expand all | Expand 10 after
1918 offset_tables_len); 1918 offset_tables_len);
1919 compiled_module->set_asm_js_offset_tables(offset_tables); 1919 compiled_module->set_asm_js_offset_tables(offset_tables);
1920 } 1920 }
1921 1921
1922 return WasmModuleObject::New(isolate, compiled_module); 1922 return WasmModuleObject::New(isolate, compiled_module);
1923 } 1923 }
1924 1924
1925 bool wasm::ValidateModuleBytes(Isolate* isolate, const byte* start, 1925 bool wasm::ValidateModuleBytes(Isolate* isolate, const byte* start,
1926 const byte* end, ErrorThrower* thrower, 1926 const byte* end, ErrorThrower* thrower,
1927 ModuleOrigin origin) { 1927 ModuleOrigin origin) {
1928 ModuleResult result = DecodeWasmModule(isolate, start, end, false, origin); 1928 ModuleResult result = DecodeWasmModule(isolate, start, end, true, origin);
1929 if (result.val) { 1929 if (result.val) {
1930 delete result.val; 1930 delete result.val;
1931 } else { 1931 } else {
1932 DCHECK(!result.ok()); 1932 DCHECK(!result.ok());
1933 } 1933 }
1934 return result.ok(); 1934 return result.ok();
1935 } 1935 }
1936 1936
1937 MaybeHandle<JSArrayBuffer> wasm::GetInstanceMemory(Isolate* isolate, 1937 MaybeHandle<JSArrayBuffer> wasm::GetInstanceMemory(Isolate* isolate,
1938 Handle<JSObject> object) { 1938 Handle<JSObject> object) {
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
2102 CHECK_NOT_NULL(result.val); 2102 CHECK_NOT_NULL(result.val);
2103 module = const_cast<WasmModule*>(result.val); 2103 module = const_cast<WasmModule*>(result.val);
2104 } 2104 }
2105 2105
2106 Handle<WasmModuleWrapper> module_wrapper = 2106 Handle<WasmModuleWrapper> module_wrapper =
2107 WasmModuleWrapper::New(isolate, module); 2107 WasmModuleWrapper::New(isolate, module);
2108 2108
2109 compiled_module->set_module_wrapper(module_wrapper); 2109 compiled_module->set_module_wrapper(module_wrapper);
2110 DCHECK(WasmCompiledModule::IsWasmCompiledModule(*compiled_module)); 2110 DCHECK(WasmCompiledModule::IsWasmCompiledModule(*compiled_module));
2111 } 2111 }
OLDNEW
« no previous file with comments | « src/wasm/module-decoder.cc ('k') | test/common/wasm/wasm-module-runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698