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

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

Issue 2384183002: [wasm] cleanup wasm-module.cc (Closed)
Patch Set: [wasm] cleanup wasm-module.cc 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/runtime/runtime-wasm.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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 314
315 Handle<Code> GetFunctionCode(uint32_t index) { 315 Handle<Code> GetFunctionCode(uint32_t index) {
316 DCHECK_NOT_NULL(instance); 316 DCHECK_NOT_NULL(instance);
317 return instance->function_code[index]; 317 return instance->function_code[index];
318 } 318 }
319 319
320 static compiler::CallDescriptor* GetWasmCallDescriptor(Zone* zone, 320 static compiler::CallDescriptor* GetWasmCallDescriptor(Zone* zone,
321 FunctionSig* sig); 321 FunctionSig* sig);
322 static compiler::CallDescriptor* GetI32WasmCallDescriptor( 322 static compiler::CallDescriptor* GetI32WasmCallDescriptor(
323 Zone* zone, compiler::CallDescriptor* descriptor); 323 Zone* zone, compiler::CallDescriptor* descriptor);
324 compiler::CallDescriptor* GetCallDescriptor(Zone* zone, uint32_t index);
325 }; 324 };
326 325
327 // A helper for printing out the names of functions. 326 // A helper for printing out the names of functions.
328 struct WasmFunctionName { 327 struct WasmFunctionName {
329 const WasmFunction* function_; 328 const WasmFunction* function_;
330 const WasmModule* module_; 329 const WasmModule* module_;
331 WasmFunctionName(const WasmFunction* function, const ModuleEnv* menv) 330 WasmFunctionName(const WasmFunction* function, const ModuleEnv* menv)
332 : function_(function), module_(menv ? menv->module : nullptr) {} 331 : function_(function), module_(menv ? menv->module : nullptr) {}
333 }; 332 };
334 333
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 V8_EXPORT_PRIVATE bool ValidateModuleBytes(Isolate* isolate, const byte* start, 502 V8_EXPORT_PRIVATE bool ValidateModuleBytes(Isolate* isolate, const byte* start,
504 const byte* end, 503 const byte* end,
505 ErrorThrower* thrower, 504 ErrorThrower* thrower,
506 ModuleOrigin origin); 505 ModuleOrigin origin);
507 506
508 // Get the number of imported functions for a WASM instance. 507 // Get the number of imported functions for a WASM instance.
509 uint32_t GetNumImportedFunctions(Handle<JSObject> wasm_object); 508 uint32_t GetNumImportedFunctions(Handle<JSObject> wasm_object);
510 509
511 // Assumed to be called with a code object associated to a wasm module instance. 510 // Assumed to be called with a code object associated to a wasm module instance.
512 // Intended to be called from runtime functions. 511 // Intended to be called from runtime functions.
513 // Returns undefined if the runtime support was not setup, nullptr if the 512 // Returns nullptr on failing to get owning instance.
514 // instance 513 Object* GetOwningWasmInstance(Code* code);
515 // was collected, or the instance object owning the Code object
516 Object* GetOwningWasmInstance(Object* undefined, Code* code);
517 514
518 MaybeHandle<JSArrayBuffer> GetInstanceMemory(Isolate* isolate, 515 MaybeHandle<JSArrayBuffer> GetInstanceMemory(Isolate* isolate,
519 Handle<JSObject> instance); 516 Handle<JSObject> instance);
520 void SetInstanceMemory(Handle<JSObject> instance, JSArrayBuffer* buffer); 517 void SetInstanceMemory(Handle<JSObject> instance, JSArrayBuffer* buffer);
521 518
522 namespace testing { 519 namespace testing {
523 520
524 void ValidateInstancesChain(Isolate* isolate, Handle<JSObject> module_obj, 521 void ValidateInstancesChain(Isolate* isolate, Handle<JSObject> module_obj,
525 int instance_count); 522 int instance_count);
526 void ValidateModuleState(Isolate* isolate, Handle<JSObject> module_obj); 523 void ValidateModuleState(Isolate* isolate, Handle<JSObject> module_obj);
527 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance); 524 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance);
528 525
529 } // namespace testing 526 } // namespace testing
530 } // namespace wasm 527 } // namespace wasm
531 } // namespace internal 528 } // namespace internal
532 } // namespace v8 529 } // namespace v8
533 530
534 #endif // V8_WASM_MODULE_H_ 531 #endif // V8_WASM_MODULE_H_
OLDNEW
« no previous file with comments | « src/runtime/runtime-wasm.cc ('k') | src/wasm/wasm-module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698