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

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

Issue 2365633002: [wasm] Make sure the interpreter only executes preprocessed code. (Closed)
Patch Set: Preprocess at the right place 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 | « no previous file | no next file » | 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 "src/wasm/wasm-interpreter.h" 5 #include "src/wasm/wasm-interpreter.h"
6 6
7 #include "src/utils.h" 7 #include "src/utils.h"
8 #include "src/wasm/ast-decoder.h" 8 #include "src/wasm/ast-decoder.h"
9 #include "src/wasm/decoder.h" 9 #include "src/wasm/decoder.h"
10 #include "src/wasm/wasm-external-refs.h" 10 #include "src/wasm/wasm-external-refs.h"
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 module->module_start + function->code_start_offset; 934 module->module_start + function->code_start_offset;
935 const byte* code_end = module->module_start + function->code_end_offset; 935 const byte* code_end = module->module_start + function->code_end_offset;
936 AddFunction(function, code_start, code_end); 936 AddFunction(function, code_start, code_end);
937 } 937 }
938 } 938 }
939 939
940 InterpreterCode* FindCode(const WasmFunction* function) { 940 InterpreterCode* FindCode(const WasmFunction* function) {
941 if (function->func_index < interpreter_code_.size()) { 941 if (function->func_index < interpreter_code_.size()) {
942 InterpreterCode* code = &interpreter_code_[function->func_index]; 942 InterpreterCode* code = &interpreter_code_[function->func_index];
943 DCHECK_EQ(function, code->function); 943 DCHECK_EQ(function, code->function);
944 return code; 944 return Preprocess(code);
945 } 945 }
946 return nullptr; 946 return nullptr;
947 } 947 }
948 948
949 InterpreterCode* GetCode(uint32_t function_index) { 949 InterpreterCode* GetCode(uint32_t function_index) {
950 CHECK_LT(function_index, interpreter_code_.size()); 950 CHECK_LT(function_index, interpreter_code_.size());
951 return Preprocess(&interpreter_code_[function_index]); 951 return Preprocess(&interpreter_code_[function_index]);
952 } 952 }
953 953
954 InterpreterCode* GetIndirectCode(uint32_t table_index, uint32_t entry_index) { 954 InterpreterCode* GetIndirectCode(uint32_t table_index, uint32_t entry_index) {
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
1850 1850
1851 ControlTransferMap WasmInterpreter::ComputeControlTransfersForTesting( 1851 ControlTransferMap WasmInterpreter::ComputeControlTransfersForTesting(
1852 Zone* zone, const byte* start, const byte* end) { 1852 Zone* zone, const byte* start, const byte* end) {
1853 ControlTransfers targets(zone, 0, start, end); 1853 ControlTransfers targets(zone, 0, start, end);
1854 return targets.map_; 1854 return targets.map_;
1855 } 1855 }
1856 1856
1857 } // namespace wasm 1857 } // namespace wasm
1858 } // namespace internal 1858 } // namespace internal
1859 } // namespace v8 1859 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698