Commit 34459d50 authored by titzer's avatar titzer Committed by Commit bot

[wasm] Rename WasmModuleInstance to WasmInstance.

R=clemensh@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2415533003
Cr-Commit-Position: refs/heads/master@{#40224}
parent 42884efd
......@@ -655,7 +655,7 @@ static inline int64_t ExecuteI64ReinterpretF64(double a, TrapReason* trap) {
}
static inline int32_t ExecuteGrowMemory(uint32_t delta_pages,
WasmModuleInstance* instance) {
WasmInstance* instance) {
// TODO(ahaas): Move memory allocation to wasm-module.cc for better
// encapsulation.
if (delta_pages > wasm::WasmModule::kMaxMemPages) {
......@@ -967,7 +967,7 @@ class CodeMap {
// Responsible for executing code directly.
class ThreadImpl : public WasmInterpreter::Thread {
public:
ThreadImpl(Zone* zone, CodeMap* codemap, WasmModuleInstance* instance)
ThreadImpl(Zone* zone, CodeMap* codemap, WasmInstance* instance)
: codemap_(codemap),
instance_(instance),
stack_(zone),
......@@ -1080,7 +1080,7 @@ class ThreadImpl : public WasmInterpreter::Thread {
};
CodeMap* codemap_;
WasmModuleInstance* instance_;
WasmInstance* instance_;
ZoneVector<WasmVal> stack_;
ZoneVector<Frame> frames_;
ZoneVector<Block> blocks_;
......@@ -1089,7 +1089,7 @@ class ThreadImpl : public WasmInterpreter::Thread {
TrapReason trap_reason_;
CodeMap* codemap() { return codemap_; }
WasmModuleInstance* instance() { return instance_; }
WasmInstance* instance() { return instance_; }
const WasmModule* module() { return instance_->module; }
void DoTrap(TrapReason trap, pc_t pc) {
......@@ -1718,11 +1718,11 @@ class ThreadImpl : public WasmInterpreter::Thread {
//============================================================================
class WasmInterpreterInternals : public ZoneObject {
public:
WasmModuleInstance* instance_;
WasmInstance* instance_;
CodeMap codemap_;
ZoneVector<ThreadImpl*> threads_;
WasmInterpreterInternals(Zone* zone, WasmModuleInstance* instance)
WasmInterpreterInternals(Zone* zone, WasmInstance* instance)
: instance_(instance),
codemap_(instance_ ? instance_->module : nullptr, zone),
threads_(zone) {
......@@ -1739,7 +1739,7 @@ class WasmInterpreterInternals : public ZoneObject {
//============================================================================
// Implementation of the public interface of the interpreter.
//============================================================================
WasmInterpreter::WasmInterpreter(WasmModuleInstance* instance,
WasmInterpreter::WasmInterpreter(WasmInstance* instance,
AccountingAllocator* allocator)
: zone_(allocator),
internals_(new (&zone_) WasmInterpreterInternals(&zone_, instance)) {}
......
......@@ -18,7 +18,7 @@ namespace wasm {
// forward declarations.
struct WasmFunction;
struct WasmModuleInstance;
struct WasmInstance;
class WasmInterpreterInternals;
typedef size_t pc_t;
......@@ -131,7 +131,7 @@ class V8_EXPORT_PRIVATE WasmInterpreter {
bool GetBreakpoint(const WasmFunction* function, int pc);
};
WasmInterpreter(WasmModuleInstance* instance, AccountingAllocator* allocator);
WasmInterpreter(WasmInstance* instance, AccountingAllocator* allocator);
~WasmInterpreter();
//==========================================================================
......
......@@ -929,7 +929,7 @@ MaybeHandle<WasmCompiledModule> WasmModule::CompileFunctions(
MaybeHandle<WasmCompiledModule> nothing;
WasmModuleInstance temp_instance(this);
WasmInstance temp_instance(this);
temp_instance.context = isolate->native_context();
temp_instance.mem_size = GetMinModuleMemSize(this);
temp_instance.mem_start = nullptr;
......
......@@ -257,7 +257,7 @@ struct WasmModule {
};
// An instantiated WASM module, including memory, function table, etc.
struct WasmModuleInstance {
struct WasmInstance {
const WasmModule* module; // static representation of the module.
// -- Heap allocated --------------------------------------------------------
Handle<JSObject> js_object; // JavaScript module object.
......@@ -272,7 +272,7 @@ struct WasmModuleInstance {
// -- raw globals -----------------------------------------------------------
byte* globals_start; // start of the globals area.
explicit WasmModuleInstance(const WasmModule* m)
explicit WasmInstance(const WasmModule* m)
: module(m),
function_tables(m->function_tables.size()),
function_code(m->functions.size()),
......@@ -285,7 +285,7 @@ struct WasmModuleInstance {
// minimal information about the globals, functions, and function tables.
struct ModuleEnv {
const WasmModule* module;
WasmModuleInstance* instance;
WasmInstance* instance;
ModuleOrigin origin;
bool IsValidGlobal(uint32_t index) const {
......
......@@ -66,7 +66,7 @@ const uint32_t kMaxGlobalsSize = 128;
// A helper for module environments that adds the ability to allocate memory
// and global variables. Contains a built-in {WasmModule} and
// {WasmModuleInstance}.
// {WasmInstance}.
class TestingModule : public ModuleEnv {
public:
explicit TestingModule(WasmExecutionMode mode = kExecuteCompiled)
......@@ -258,7 +258,7 @@ class TestingModule : public ModuleEnv {
private:
WasmExecutionMode execution_mode_;
WasmModule module_;
WasmModuleInstance instance_;
WasmInstance instance_;
Isolate* isolate_;
v8::internal::AccountingAllocator allocator_;
uint32_t global_offset;
......
......@@ -147,7 +147,7 @@ int32_t InterpretWasmModule(Isolate* isolate, ErrorThrower* thrower,
}
// The code verifies, we create an instance to run it in the interpreter.
WasmModuleInstance instance(module);
WasmInstance instance(module);
instance.context = isolate->native_context();
instance.mem_size = GetMinModuleMemSize(module);
// TODO(ahaas): Move memory allocation to wasm-module.cc for better
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment