Commit 575f7423 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[wasm] Remove unused {WasmCompiledModule::code_table} field.

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

Change-Id: I90bd4cf8ed31f46d475cd46de868e483c84c6aba
Reviewed-on: https://chromium-review.googlesource.com/959013Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51889}
parent b68db45b
......@@ -1487,7 +1487,6 @@ void WasmCompiledModule::WasmCompiledModuleVerify() {
VerifyObjectField(kNativeModuleOffset);
VerifyObjectField(kLazyCompileDataOffset);
VerifyObjectField(kUseTrapHandlerOffset);
VerifyObjectField(kCodeTableOffset);
VerifyObjectField(kFunctionTablesOffset);
VerifyObjectField(kEmptyFunctionTablesOffset);
}
......
This diff is collapsed.
......@@ -64,9 +64,6 @@ class LazyCompilationOrchestrator {
int func_index);
public:
Handle<Code> CompileLazyOnGCHeap(Isolate*, Handle<WasmInstanceObject>,
Handle<Code> caller, int call_offset,
int exported_func_index, bool patch_caller);
const wasm::WasmCode* CompileFromJsToWasm(Isolate*,
Handle<WasmInstanceObject>,
Handle<Code> caller,
......@@ -178,7 +175,6 @@ class AsyncCompileJob {
std::vector<DeferredHandles*> deferred_handles_;
Handle<WasmModuleObject> module_object_;
Handle<WasmCompiledModule> compiled_module_;
Handle<FixedArray> code_table_;
size_t outstanding_units_ = 0;
std::unique_ptr<CompileStep> step_;
CancelableTaskManager background_task_manager_;
......
......@@ -669,8 +669,6 @@ void WasmDebugInfo::RedirectToInterpreter(Handle<WasmDebugInfo> debug_info,
wasm::WasmModule* module = instance->module();
CodeRelocationMap code_to_relocate;
Handle<FixedArray> code_table(instance->compiled_module()->code_table(),
isolate);
// We may modify js wrappers, as well as wasm functions. Hence the 2
// modification scopes.
CodeSpaceMemoryModificationScope modification_scope(isolate->heap());
......
......@@ -1021,13 +1021,6 @@ class CodeMap {
return native_module->GetCode(function_index);
}
Code* GetImportedFunctionGC(uint32_t function_index) {
DCHECK(has_instance());
DCHECK_GT(module_->num_imported_functions, function_index);
FixedArray* code_table = instance()->compiled_module()->code_table();
return Code::cast(code_table->get(static_cast<int>(function_index)));
}
InterpreterCode* GetCode(const WasmFunction* function) {
InterpreterCode* code = GetCode(function->func_index);
DCHECK_EQ(function, code->function);
......
......@@ -138,7 +138,6 @@ WCM_OBJECT(FixedArray, source_positions, kSourcePositionsOffset)
WCM_OBJECT(Foreign, native_module, kNativeModuleOffset)
WCM_OBJECT(FixedArray, lazy_compile_data, kLazyCompileDataOffset)
WCM_SMALL_CONST_NUMBER(bool, use_trap_handler, kUseTrapHandlerOffset)
WCM_OBJECT(FixedArray, code_table, kCodeTableOffset)
WCM_OBJECT(FixedArray, function_tables, kFunctionTablesOffset)
WCM_OBJECT(FixedArray, empty_function_tables, kEmptyFunctionTablesOffset)
ACCESSORS(WasmCompiledModule, raw_next_instance, Object, kNextInstanceOffset);
......@@ -153,11 +152,6 @@ uint32_t WasmTableObject::current_length() { return functions()->length(); }
bool WasmMemoryObject::has_maximum_pages() { return maximum_pages() >= 0; }
void WasmCompiledModule::ReplaceCodeTableForTesting(
Handle<FixedArray> testing_table) {
set_code_table(*testing_table);
}
#include "src/objects/object-macros-undef.h"
} // namespace internal
......
......@@ -1181,8 +1181,7 @@ MaybeHandle<FixedArray> WasmSharedModuleData::CheckBreakPoints(
}
Handle<WasmCompiledModule> WasmCompiledModule::New(
Isolate* isolate, WasmModule* module, Handle<FixedArray> code_table,
Handle<FixedArray> export_wrappers,
Isolate* isolate, WasmModule* module, Handle<FixedArray> export_wrappers,
const std::vector<GlobalHandleAddress>& function_tables,
bool use_trap_handler) {
Handle<WasmCompiledModule> compiled_module = Handle<WasmCompiledModule>::cast(
......@@ -1210,10 +1209,6 @@ Handle<WasmCompiledModule> WasmCompiledModule::New(
v8::WeakCallbackType::kFinalizer);
compiled_module->GetNativeModule()->SetCompiledModule(weak_link);
}
// This is here just because it's easier for APIs that need to work with
// either code_table or native_module. Otherwise we need to check if
// has_code_table and pass undefined.
compiled_module->set_code_table(*code_table);
int function_count = static_cast<int>(module->functions.size());
Handle<FixedArray> source_positions =
......@@ -1239,7 +1234,6 @@ Handle<WasmCompiledModule> WasmCompiledModule::Clone(
ret->set_lazy_compile_data(module->lazy_compile_data());
}
ret->set_use_trap_handler(module->use_trap_handler());
ret->set_code_table(module->code_table());
if (module->has_function_tables()) {
ret->set_function_tables(module->function_tables());
}
......
......@@ -434,7 +434,6 @@ class WasmCompiledModule : public Struct {
V(kNativeModuleOffset, kPointerSize) \
V(kLazyCompileDataOffset, kPointerSize) \
V(kUseTrapHandlerOffset, kPointerSize) \
V(kCodeTableOffset, kPointerSize) \
V(kFunctionTablesOffset, kPointerSize) \
V(kEmptyFunctionTablesOffset, kPointerSize) \
V(kSize, 0)
......@@ -487,13 +486,12 @@ class WasmCompiledModule : public Struct {
WCM_OBJECT(FixedArray, lazy_compile_data)
// TODO(mstarzinger): Make {use_trap_handler} smaller.
WCM_SMALL_CONST_NUMBER(bool, use_trap_handler)
WCM_CONST_OBJECT(FixedArray, code_table)
WCM_OBJECT(FixedArray, function_tables)
WCM_CONST_OBJECT(FixedArray, empty_function_tables)
public:
static Handle<WasmCompiledModule> New(
Isolate* isolate, wasm::WasmModule* module, Handle<FixedArray> code_table,
Isolate* isolate, wasm::WasmModule* module,
Handle<FixedArray> export_wrappers,
const std::vector<wasm::GlobalHandleAddress>& function_tables,
bool use_trap_hander);
......@@ -524,16 +522,12 @@ class WasmCompiledModule : public Struct {
static bool SetBreakPoint(Handle<WasmCompiledModule>, int* position,
Handle<BreakPoint> break_point);
inline void ReplaceCodeTableForTesting(
std::vector<wasm::WasmCode*>&& testing_table);
// TODO(mstarzinger): following 4 unnecessary after we're done with
// FLAG_wasm_jit_to_native
static void SetTableValue(Isolate* isolate, Handle<FixedArray> table,
int index, Address value);
static void UpdateTableValue(FixedArray* table, int index, Address value);
static Address GetTableValue(FixedArray* table, int index);
inline void ReplaceCodeTableForTesting(Handle<FixedArray> testing_table);
void LogWasmCodes(Isolate* isolate);
......
......@@ -654,9 +654,9 @@ MaybeHandle<WasmCompiledModule> DeserializeNativeModule(
Handle<FixedArray> export_wrappers = isolate->factory()->NewFixedArray(
static_cast<int>(export_wrappers_size), TENURED);
Handle<WasmCompiledModule> compiled_module = WasmCompiledModule::New(
isolate, shared->module(), isolate->factory()->empty_fixed_array(),
export_wrappers, std::vector<wasm::GlobalHandleAddress>(),
Handle<WasmCompiledModule> compiled_module =
WasmCompiledModule::New(isolate, shared->module(), export_wrappers,
std::vector<wasm::GlobalHandleAddress>(),
trap_handler::IsTrapHandlerEnabled());
compiled_module->OnWasmModuleDecodingComplete(shared);
script->set_wasm_compiled_module(*compiled_module);
......
......@@ -230,10 +230,9 @@ Handle<WasmInstanceObject> TestingModuleBuilder::InitInstanceObject() {
Handle<WasmSharedModuleData> shared_module_data =
WasmSharedModuleData::New(isolate_, module_wrapper, empty_string, script,
Handle<ByteArray>::null());
Handle<FixedArray> code_table = isolate_->factory()->NewFixedArray(0);
Handle<FixedArray> export_wrappers = isolate_->factory()->NewFixedArray(0);
Handle<WasmCompiledModule> compiled_module = WasmCompiledModule::New(
isolate_, test_module_ptr_, code_table, export_wrappers, function_tables_,
isolate_, test_module_ptr_, export_wrappers, function_tables_,
trap_handler::IsTrapHandlerEnabled());
compiled_module->OnWasmModuleDecodingComplete(shared_module_data);
// This method is called when we initialize TestEnvironment. We don't
......
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