Home | History | Annotate | Download | only in wasm

Lines Matching refs:instance

35 #define TRACE_CHAIN(instance)        \
37 instance->PrintInstancesChain(); \
256 auto instance = WasmInstanceObject::cast(object);
258 if (instance->has_globals_buffer()) {
260 static_cast<Address>(instance->get_globals_buffer()->backing_store());
747 module_env.instance = &temp_instance;
855 Handle<WasmInstanceObject> other_instance(exported->instance(), isolate);
917 Handle<WasmInstanceObject> instance(
920 instance->module()->function_tables[table_index].map.FindOrInsert(
960 // Build an instance, in all of its glory.
981 // instance - such as globals addresses.
1000 // We do that last. Since we are holding on to the owner instance,
1031 TRACE("Reusing existing instance %d\n",
1041 // Allocate the instance object.
1043 Handle<WasmInstanceObject> instance =
1047 // Set up the globals for the new instance.
1065 instance->set_globals_buffer(*global_buffer);
1083 int num_imported_functions = ProcessImports(code_table, instance);
1092 // Set up the memory for the new instance.
1108 instance->set_memory_buffer(*memory_);
1128 // Set up the runtime support for the new instance.
1130 Handle<WeakCell> weak_link = factory->NewWeakCell(instance);
1145 // Set up the exports object for the new instance.
1147 ProcessExports(code_table, instance);
1150 // Set up the indirect function tables for the new instance.
1152 if (function_table_count > 0) InitializeTables(code_table, instance);
1162 // Set up and link the new instance.
1166 isolate_->global_handles()->Create(*instance);
1168 Handle<WeakCell> link_to_owning_instance = factory->NewWeakCell(instance);
1180 // Publish the new instance to the instances chain.
1198 DCHECK(wasm::IsWasmInstance(*instance));
1199 if (instance->has_memory_object()) {
1200 instance->get_memory_object()->AddInstance(*instance);
1210 module_env.instance = nullptr;
1219 isolate_, instance, factory->InternalizeUtf8String("start"),
1230 // It's unfortunate that the new instance is already linked in the
1239 TRACE("Finishing instance %d\n", compiled_module_->instance_id());
1241 return instance;
1247 Handle<WasmTableObject> table_object; // WebAssembly.Table instance
1390 Handle<WasmInstanceObject> instance) {
1495 instance->set_memory_object(*memory);
1566 // Allocate memory for a module instance as a new JSArrayBuffer.
1584 Handle<WasmInstanceObject> instance) {
1604 Handle<JSObject> exports_object = instance;
1613 JSObject::AddProperty(instance, exports_name, exports_object, READ_ONLY);
1638 isolate_, instance, name, export_code,
1664 if (!instance->has_memory_object()) {
1666 Handle<JSArrayBuffer> buffer(instance->get_memory_buffer(),
1671 instance->set_memory_object(*memory_object);
1674 instance->get_memory_object(), isolate_);
1716 Handle<WasmInstanceObject> instance) {
1788 module_env.instance = &temp_instance;
1795 isolate_, instance, isolate_->factory()->empty_string(),
1811 // redundant work and also because the new instance is not yet fully
1816 isolate_, table_instance.table_object, instance, index,
1834 // Instantiates a WASM module, creating a WebAssembly.Instance from a
1867 bool wasm::WasmIsAsmJs(Object* instance, Isolate* isolate) {
1868 if (instance->IsUndefined(isolate)) return false;
1869 DCHECK(IsWasmInstance(instance));
1871 GetCompiledModule(JSObject::cast(instance));
1877 Handle<Script> wasm::GetScript(Handle<JSObject> instance) {
1878 DCHECK(IsWasmInstance(*instance));
1879 WasmCompiledModule* compiled_module = GetCompiledModule(*instance);
1884 int wasm::GetAsmWasmSourcePosition(Handle<JSObject> instance, int func_index,
1886 return WasmDebugInfo::GetAsmJsSourcePosition(GetDebugInfo(instance),
1897 auto instance = Handle<WasmInstanceObject>::cast(object);
1898 if (instance->has_debug_info()) {
1899 Handle<WasmDebugInfo> info(instance->get_debug_info(),
1900 instance->GetIsolate());
1903 Handle<WasmDebugInfo> new_info = WasmDebugInfo::New(instance);
1904 instance->set_debug_info(*new_info);
2005 auto instance = Handle<WasmInstanceObject>::cast(object);
2006 if (instance->has_memory_buffer()) {
2007 return Handle<JSArrayBuffer>(instance->get_memory_buffer(), isolate);
2014 auto instance = Handle<WasmInstanceObject>::cast(object);
2015 instance->set_memory_buffer(buffer);
2016 instance->get_compiled_module()->set_ptr_to_memory(buffer);
2020 Handle<JSObject> instance) {
2022 GetInstanceMemory(isolate, instance);
2032 Handle<WasmInstanceObject> instance) {
2033 if (instance->has_memory_object()) {
2034 Handle<WasmMemoryObject> memory_object(instance->get_memory_object(),
2041 instance->get_compiled_module()->max_mem_pages();
2051 auto instance = Handle<WasmInstanceObject>::cast(object);
2052 if (pages == 0) return GetInstanceMemorySize(isolate, instance);
2053 uint32_t max_pages = GetMaxInstanceMemorySize(isolate, instance);
2059 GetInstanceMemory(isolate, instance);
2088 SetInstanceMemory(instance, *buffer);
2089 Handle<FixedArray> code_table = instance->get_compiled_module()->code_table();
2092 if (instance->has_memory_object()) {
2093 instance->get_memory_object()->set_buffer(*buffer);
2143 WasmInstanceObject* instance = WasmInstanceObject::cast(*object);
2144 WasmCompiledModule* compiled_module = instance->get_compiled_module();