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

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

Issue 2384513002: [wasm] Implement WebAssembly.validate() (Closed)
Patch Set: Address review comments. 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 | « 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 <memory> 8 #include <memory>
9 9
10 #include "src/api.h" 10 #include "src/api.h"
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 const std::vector<Handle<Code>>* code_table); 391 const std::vector<Handle<Code>>* code_table);
392 392
393 Handle<JSObject> CreateCompiledModuleObject(Isolate* isolate, 393 Handle<JSObject> CreateCompiledModuleObject(Isolate* isolate,
394 Handle<FixedArray> compiled_module, 394 Handle<FixedArray> compiled_module,
395 ModuleOrigin origin); 395 ModuleOrigin origin);
396 396
397 V8_EXPORT_PRIVATE MaybeHandle<JSObject> CreateModuleObjectFromBytes( 397 V8_EXPORT_PRIVATE MaybeHandle<JSObject> CreateModuleObjectFromBytes(
398 Isolate* isolate, const byte* start, const byte* end, ErrorThrower* thrower, 398 Isolate* isolate, const byte* start, const byte* end, ErrorThrower* thrower,
399 ModuleOrigin origin); 399 ModuleOrigin origin);
400 400
401 V8_EXPORT_PRIVATE bool ValidateModuleBytes(Isolate* isolate, const byte* start,
402 const byte* end,
403 ErrorThrower* thrower,
404 ModuleOrigin origin);
405
401 // Get the number of imported functions for a WASM instance. 406 // Get the number of imported functions for a WASM instance.
402 uint32_t GetNumImportedFunctions(Handle<JSObject> wasm_object); 407 uint32_t GetNumImportedFunctions(Handle<JSObject> wasm_object);
403 408
404 // Assumed to be called with a code object associated to a wasm module instance. 409 // Assumed to be called with a code object associated to a wasm module instance.
405 // Intended to be called from runtime functions. 410 // Intended to be called from runtime functions.
406 // Returns undefined if the runtime support was not setup, nullptr if the 411 // Returns undefined if the runtime support was not setup, nullptr if the
407 // instance 412 // instance
408 // was collected, or the instance object owning the Code object 413 // was collected, or the instance object owning the Code object
409 Object* GetOwningWasmInstance(Object* undefined, Code* code); 414 Object* GetOwningWasmInstance(Object* undefined, Code* code);
410 415
411 MaybeHandle<JSArrayBuffer> GetInstanceMemory(Isolate* isolate, 416 MaybeHandle<JSArrayBuffer> GetInstanceMemory(Isolate* isolate,
412 Handle<JSObject> instance); 417 Handle<JSObject> instance);
413 void SetInstanceMemory(Handle<JSObject> instance, JSArrayBuffer* buffer); 418 void SetInstanceMemory(Handle<JSObject> instance, JSArrayBuffer* buffer);
414 419
415 namespace testing { 420 namespace testing {
416 421
417 void ValidateInstancesChain(Isolate* isolate, Handle<JSObject> module_obj, 422 void ValidateInstancesChain(Isolate* isolate, Handle<JSObject> module_obj,
418 int instance_count); 423 int instance_count);
419 void ValidateModuleState(Isolate* isolate, Handle<JSObject> module_obj); 424 void ValidateModuleState(Isolate* isolate, Handle<JSObject> module_obj);
420 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance); 425 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance);
421 426
422 } // namespace testing 427 } // namespace testing
423 } // namespace wasm 428 } // namespace wasm
424 } // namespace internal 429 } // namespace internal
425 } // namespace v8 430 } // namespace v8
426 431
427 #endif // V8_WASM_MODULE_H_ 432 #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