From 662cfb44e438e2b666a466497dfd2552a5d204c0 Mon Sep 17 00:00:00 2001 From: Michael Starzinger Date: Wed, 14 Mar 2018 13:50:39 +0100 Subject: [PATCH] [wasm] Remove obsolete {WasmFunctionInfo} structure. R=titzer@chromium.org BUG=v8:7549 Change-Id: Ibae3ea41306ae89ee5caaa6ab2fdec6f08f2040c Reviewed-on: https://chromium-review.googlesource.com/962361 Reviewed-by: Ben Titzer Commit-Queue: Michael Starzinger Cr-Commit-Position: refs/heads/master@{#51927} --- src/wasm/wasm-objects.cc | 40 ---------------------------------------- src/wasm/wasm-objects.h | 21 --------------------- 2 files changed, 61 deletions(-) diff --git a/src/wasm/wasm-objects.cc b/src/wasm/wasm-objects.cc index b1da69186d..893039c23b 100644 --- a/src/wasm/wasm-objects.cc +++ b/src/wasm/wasm-objects.cc @@ -1526,46 +1526,6 @@ void WasmCompiledModule::LogWasmCodes(Isolate* isolate) { } } -void AttachWasmFunctionInfo(Isolate* isolate, Handle code, - MaybeHandle weak_instance, - int func_index) { - DCHECK(weak_instance.is_null() || - weak_instance.ToHandleChecked()->value()->IsWasmInstanceObject()); - Handle 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, - MaybeHandle instance, - int func_index) { - MaybeHandle 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) { - FixedArray* deopt_data = code->deoptimization_data(); - DCHECK_LE(2, deopt_data->length()); - MaybeHandle 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 diff --git a/src/wasm/wasm-objects.h b/src/wasm/wasm-objects.h index b83c5bd92c..5aa328b1d4 100644 --- a/src/wasm/wasm-objects.h +++ b/src/wasm/wasm-objects.h @@ -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, - MaybeHandle weak_instance, - int func_index); -void AttachWasmFunctionInfo(Isolate*, Handle, - MaybeHandle, int func_index); - -struct WasmFunctionInfo { - MaybeHandle instance; - int func_index; -}; -WasmFunctionInfo GetWasmFunctionInfo(Isolate*, Handle); - #undef DECL_OPTIONAL_ACCESSORS #undef WCM_CONST_OBJECT #undef WCM_LARGE_NUMBER