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

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

Issue 1943313002: [wasm] Fix for 608630: allow proxies as FFI. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 | « src/wasm/wasm-js.cc ('k') | src/wasm/wasm-module.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 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 #ifndef V8_WASM_MODULE_H_ 5 #ifndef V8_WASM_MODULE_H_
6 #define V8_WASM_MODULE_H_ 6 #define V8_WASM_MODULE_H_
7 7
8 #include "src/wasm/wasm-opcodes.h" 8 #include "src/wasm/wasm-opcodes.h"
9 #include "src/wasm/wasm-result.h" 9 #include "src/wasm/wasm-result.h"
10 10
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 return GetNameOrNull(function->name_offset, function->name_length); 214 return GetNameOrNull(function->name_offset, function->name_length);
215 } 215 }
216 216
217 // Checks the given offset range is contained within the module bytes. 217 // Checks the given offset range is contained within the module bytes.
218 bool BoundsCheck(uint32_t start, uint32_t end) const { 218 bool BoundsCheck(uint32_t start, uint32_t end) const {
219 size_t size = module_end - module_start; 219 size_t size = module_end - module_start;
220 return start <= size && end <= size; 220 return start <= size && end <= size;
221 } 221 }
222 222
223 // Creates a new instantiation of the module in the given isolate. 223 // Creates a new instantiation of the module in the given isolate.
224 MaybeHandle<JSObject> Instantiate(Isolate* isolate, Handle<JSObject> ffi, 224 MaybeHandle<JSObject> Instantiate(Isolate* isolate, Handle<JSReceiver> ffi,
225 Handle<JSArrayBuffer> memory); 225 Handle<JSArrayBuffer> memory);
226 }; 226 };
227 227
228 // An instantiated WASM module, including memory, function table, etc. 228 // An instantiated WASM module, including memory, function table, etc.
229 struct WasmModuleInstance { 229 struct WasmModuleInstance {
230 WasmModule* module; // static representation of the module. 230 WasmModule* module; // static representation of the module.
231 // -- Heap allocated -------------------------------------------------------- 231 // -- Heap allocated --------------------------------------------------------
232 Handle<JSObject> js_object; // JavaScript module object. 232 Handle<JSObject> js_object; // JavaScript module object.
233 Handle<Context> context; // JavaScript native context. 233 Handle<Context> context; // JavaScript native context.
234 Handle<JSArrayBuffer> mem_buffer; // Handle to array buffer of memory. 234 Handle<JSArrayBuffer> mem_buffer; // Handle to array buffer of memory.
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 // Extract a function name from the given wasm object. 334 // Extract a function name from the given wasm object.
335 // Returns undefined if the function is unnamed or the function index is 335 // Returns undefined if the function is unnamed or the function index is
336 // invalid. 336 // invalid.
337 Handle<Object> GetWasmFunctionName(Handle<JSObject> wasm, uint32_t func_index); 337 Handle<Object> GetWasmFunctionName(Handle<JSObject> wasm, uint32_t func_index);
338 338
339 } // namespace wasm 339 } // namespace wasm
340 } // namespace internal 340 } // namespace internal
341 } // namespace v8 341 } // namespace v8
342 342
343 #endif // V8_WASM_MODULE_H_ 343 #endif // V8_WASM_MODULE_H_
OLDNEW
« no previous file with comments | « src/wasm/wasm-js.cc ('k') | src/wasm/wasm-module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698