Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/runtime/ComponentInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "Walrus.h"

#include "runtime/ComponentInstance.h"
#include "runtime/DefinedFunctionTypes.h"
#include "runtime/Instance.h"
#include "runtime/Global.h"
#include "runtime/Memory.h"
Expand Down Expand Up @@ -507,7 +506,7 @@ ComponentInstance* ComponentInstance::InstantiateContext::instantiate(Component*
break;
}
case ComponentDeclaration::CanonResourceDrop: {
instance->m_coreFuncs.push_back(CanonFunction::createCanonFunction(m_store, m_functionTypes[DefinedFunctionTypes::I32R], CanonFunction::ResourceDrop));
instance->m_coreFuncs.push_back(CanonFunction::createCanonFunction(m_store, m_store->getDefinedFunctionType(Store::I32R), CanonFunction::ResourceDrop));
break;
}
case ComponentDeclaration::ImportKind: {
Expand Down Expand Up @@ -540,7 +539,7 @@ ComponentInstance* ComponentInstance::InstantiateContext::instantiate(Component*

#ifdef ENABLE_WASI
if (!success && external.sort == ComponentSort::Instance) {
ComponentInstance* importedInstance = wasi02LoadInstance(m_store, m_functionTypes, external.name);
ComponentInstance* importedInstance = wasi02LoadInstance(m_store, external.name);
if (importedInstance != nullptr) {
instance->m_instances.push_back(importedInstance);
success = true;
Expand All @@ -565,9 +564,9 @@ ComponentInstance* ComponentInstance::InstantiateContext::instantiate(Component*
return instance;
}

ComponentInstance* ComponentInstance::instantiate(ExecutionState& state, Store* store, DefinedFunctionTypes& functionTypes, Component* component)
ComponentInstance* ComponentInstance::instantiate(ExecutionState& state, Store* store, Component* component)
{
InstantiateContext context(state, store, functionTypes);
InstantiateContext context(state, store);
return context.instantiate(component, nullptr, nullptr);
}

Expand Down
8 changes: 2 additions & 6 deletions src/runtime/ComponentInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,15 +331,13 @@ class ComponentResourceRep : public ComponentResource {
};
};

class DefinedFunctionTypes;

class ComponentInstance : public Object {
#ifdef ENABLE_WASI
friend class ComponentInstanceWasi02;
#endif /* ENABLE_WASI */

public:
static ComponentInstance* instantiate(ExecutionState& state, Store* store, DefinedFunctionTypes& functionTypes, Component* component);
static ComponentInstance* instantiate(ExecutionState& state, Store* store, Component* component);

~ComponentInstance();

Expand Down Expand Up @@ -376,10 +374,9 @@ class ComponentInstance : public Object {

class InstantiateContext {
public:
InstantiateContext(ExecutionState& state, Store* store, DefinedFunctionTypes& functionTypes)
InstantiateContext(ExecutionState& state, Store* store)
: m_state(state)
, m_store(store)
, m_functionTypes(functionTypes)
{
}

Expand All @@ -388,7 +385,6 @@ class ComponentInstance : public Object {
private:
ExecutionState& m_state;
Store* m_store;
DefinedFunctionTypes& m_functionTypes;
};

static constexpr uint32_t FirstHandleIndex = 1;
Expand Down
Loading
Loading