Home | History | Annotate | Download | only in wasm

Lines Matching defs:instance

48 // an instance finalizer is not guaranteed to run upon isolate shutdown,
56 // on an instance.
57 #define SET(instance, field, value) \
61 instance->set_##field(v); \
64 // Allocates initial native storage for a given instance.
65 WasmInstanceNativeAllocations(Handle<WasmInstanceObject> instance,
68 SET(instance, imported_function_targets,
71 SET(instance, imported_mutable_globals,
89 Handle<WasmInstanceObject> instance,
91 uint32_t old_size = instance->indirect_function_table_size();
102 Handle<FixedArray> old(instance->indirect_function_table_instances(),
114 instance->set_indirect_function_table_size(new_size);
115 SET(instance, indirect_function_table_sig_ids,
117 SET(instance, indirect_function_table_targets,
120 instance->set_indirect_function_table_instances(*new_instances);
122 IndirectFunctionTableEntry(instance, static_cast<int>(j)).clear();
143 WasmInstanceObject* instance) {
145 instance->managed_native_allocations())
266 Handle<WasmInstanceObject> instance(
270 WasmInstanceObject::GetOrCreateDebugInfo(instance);
367 Handle<WasmInstanceObject> instance) {
371 WasmInstanceObject::GetOrCreateDebugInfo(instance);
767 Handle<WasmInstanceObject> instance,
773 if (instance.is_null()) return;
782 *instance);
796 // Tables are stored in the instance object, no code patching is
797 // necessary. We simply have to grow the raw tables in each instance
804 Handle<WasmInstanceObject> instance(
806 DCHECK_EQ(old_size, instance->indirect_function_table_size());
808 WasmInstanceObject::EnsureIndirectFunctionTableWithMinimumSize(instance,
825 Handle<WasmInstanceObject> other_instance(exported_function->instance(),
833 handle(exported_function->instance(), isolate),
842 // We simply need to update the IFTs for each instance that imports
949 void SetInstanceMemory(Handle<WasmInstanceObject> instance,
951 instance->SetRawMemory(reinterpret_cast<byte*>(buffer->backing_store()),
958 byte* mem_start = instance->memory_start();
959 size_t mem_size = instance->memory_size();
1026 Handle<WasmInstanceObject> instance) {
1033 isolate, old_instances, MaybeObjectHandle::Weak(instance));
1036 SetInstanceMemory(instance, buffer);
1040 Handle<WasmInstanceObject> instance) {
1042 memory->instances()->RemoveOne(MaybeObjectHandle::Weak(instance));
1073 Handle<WasmInstanceObject> instance(
1075 SetInstanceMemory(instance, new_buffer);
1130 void IndirectFunctionTableEntry::set(int sig_id, WasmInstanceObject* instance,
1132 TRACE_IFT("IFT entry %p[%d] = {sig_id=%d, instance=%p, target=%" PRIuPTR
1134 *instance_, index_, sig_id, instance, call_target);
1137 instance_->indirect_function_table_instances()->set(index_, instance);
1140 WasmInstanceObject* IndirectFunctionTableEntry::instance() {
1164 void ImportedFunctionEntry::set_wasm_to_wasm(WasmInstanceObject* instance,
1166 TRACE_IFT("Import WASM %p[%d] = {instance=%p, target=%" PRIuPTR "}\n",
1167 *instance_, index_, instance, call_target);
1168 instance_->imported_function_instances()->set(index_, instance);
1174 WasmInstanceObject* ImportedFunctionEntry::instance() {
1193 Handle<WasmInstanceObject> instance, uint32_t minimum_size) {
1194 uint32_t old_size = instance->indirect_function_table_size();
1197 Isolate* isolate = instance->GetIsolate();
1199 auto native_allocations = GetNativeAllocations(*instance);
1200 native_allocations->resize_indirect_function_table(isolate, instance,
1231 Handle<WasmInstanceObject> instance) {
1232 if (instance->has_debug_info()) {
1233 return handle(instance->debug_info(), instance->GetIsolate());
1235 Handle<WasmDebugInfo> new_info = WasmDebugInfo::New(instance);
1236 DCHECK(instance->has_debug_info());
1247 Handle<WasmInstanceObject> instance(
1256 isolate, native_allocations_size, instance, num_imported_functions,
1258 instance->set_managed_native_allocations(*native_allocations);
1262 instance->set_imported_function_instances(*imported_function_instances);
1266 instance->set_imported_function_callables(*imported_function_callables);
1269 instance->set_centry_stub(*centry_stub);
1271 instance->SetRawMemory(nullptr, 0);
1272 instance->set_roots_array_address(
1274 instance->set_stack_limit_address(
1276 instance->set_real_stack_limit_address(
1278 instance->set_globals_start(nullptr);
1279 instance->set_indirect_function_table_size(0);
1280 instance->set_indirect_function_table_sig_ids(nullptr);
1281 instance->set_indirect_function_table_targets(nullptr);
1282 instance->set_native_context(*isolate->native_context());
1283 instance->set_module_object(*module_object);
1284 instance->set_undefined_value(ReadOnlyRoots(isolate).undefined_value());
1285 instance->set_null_value(ReadOnlyRoots(isolate).null_value());
1286 instance->set_jump_table_start(
1289 // Insert the new instance into the modules weak list of instances.
1294 isolate, weak_instance_list, MaybeObjectHandle::Weak(instance));
1297 return instance;
1304 WasmInstanceObject* instance = reinterpret_cast<WasmInstanceObject*>(*p);
1307 // instances before the instance is destroyed.
1308 TRACE("Finalizing instance of %p {\n",
1309 instance->module_object()->native_module());
1312 // that {instance->compiled_module()->module()}, which is a
1314 // Weak references to this instance won't be cleared until
1317 if (instance->has_memory_object()) {
1318 WasmMemoryObject::RemoveInstance(handle(instance->memory_object(), isolate),
1319 handle(instance, isolate));
1322 // Free raw C++ memory associated with the instance.
1323 GetNativeAllocations(instance)->free();
1332 Handle<WasmInstanceObject> instance) {
1333 Handle<Object> global_handle = isolate->global_handles()->Create(*instance);
1359 WasmInstanceObject* WasmExportedFunction::instance() {
1360 return shared()->wasm_exported_function_data()->instance();
1368 Isolate* isolate, Handle<WasmInstanceObject> instance,
1372 int num_imported_functions = instance->module()->num_imported_functions;
1376 instance->module_object()->native_module()->jump_table_offset(
1385 function_data->set_instance(*instance);
1409 return instance()->GetCallTarget(function_index());