Commit 662cfb44 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[wasm] Remove obsolete {WasmFunctionInfo} structure.

R=titzer@chromium.org
BUG=v8:7549

Change-Id: Ibae3ea41306ae89ee5caaa6ab2fdec6f08f2040c
Reviewed-on: https://chromium-review.googlesource.com/962361Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51927}
parent 9123f3a4
......@@ -1526,46 +1526,6 @@ void WasmCompiledModule::LogWasmCodes(Isolate* isolate) {
}
}
void AttachWasmFunctionInfo(Isolate* isolate, Handle<Code> code,
MaybeHandle<WeakCell> weak_instance,
int func_index) {
DCHECK(weak_instance.is_null() ||
weak_instance.ToHandleChecked()->value()->IsWasmInstanceObject());
Handle<FixedArray> deopt_data = isolate->factory()->NewFixedArray(2, TENURED);
if (!weak_instance.is_null()) {
// TODO(wasm): Introduce constants for the indexes in wasm deopt data.
deopt_data->set(0, *weak_instance.ToHandleChecked());
}
deopt_data->set(1, Smi::FromInt(func_index));
code->set_deoptimization_data(*deopt_data);
}
void AttachWasmFunctionInfo(Isolate* isolate, Handle<Code> code,
MaybeHandle<WasmInstanceObject> instance,
int func_index) {
MaybeHandle<WeakCell> weak_instance;
if (!instance.is_null()) {
weak_instance = isolate->factory()->NewWeakCell(instance.ToHandleChecked());
}
AttachWasmFunctionInfo(isolate, code, weak_instance, func_index);
}
WasmFunctionInfo GetWasmFunctionInfo(Isolate* isolate, Handle<Code> code) {
FixedArray* deopt_data = code->deoptimization_data();
DCHECK_LE(2, deopt_data->length());
MaybeHandle<WasmInstanceObject> instance;
Object* maybe_weak_instance = deopt_data->get(0);
if (maybe_weak_instance->IsWeakCell()) {
Object* maybe_instance = WeakCell::cast(maybe_weak_instance)->value();
if (maybe_instance) {
instance = handle(WasmInstanceObject::cast(maybe_instance), isolate);
}
}
int func_index = Smi::ToInt(deopt_data->get(1));
return {instance, func_index};
}
#undef TRACE
} // namespace internal
......
......@@ -618,27 +618,6 @@ class WasmDebugInfo : public Struct {
wasm::FunctionSig*);
};
// Attach function information in the form of deoptimization data to the given
// code object. This information will be used for generating stack traces,
// calling imported functions in the interpreter, knowing which function to
// compile in a lazy compile stub, and more. The deopt data will be a newly
// allocated FixedArray of length 2, where the first element is a WeakCell
// containing the WasmInstanceObject, and the second element is the function
// index.
// If calling this method repeatedly for the same instance, pass a WeakCell
// directly in order to avoid creating many cells pointing to the same instance.
void AttachWasmFunctionInfo(Isolate*, Handle<Code>,
MaybeHandle<WeakCell> weak_instance,
int func_index);
void AttachWasmFunctionInfo(Isolate*, Handle<Code>,
MaybeHandle<WasmInstanceObject>, int func_index);
struct WasmFunctionInfo {
MaybeHandle<WasmInstanceObject> instance;
int func_index;
};
WasmFunctionInfo GetWasmFunctionInfo(Isolate*, Handle<Code>);
#undef DECL_OPTIONAL_ACCESSORS
#undef WCM_CONST_OBJECT
#undef WCM_LARGE_NUMBER
......
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