Commit 94bac158 authored by titzer's avatar titzer Committed by Commit Bot

[wasm] Remove some small TODOs and small fixes.

R=clemensh@chromium.org,ahaas@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2963603003
Cr-Commit-Position: refs/heads/master@{#46283}
parent 7d232d7d
......@@ -121,7 +121,6 @@ i::wasm::ModuleWireBytes GetFirstArgumentAsBytes(
i::wasm::kV8MaxWasmModuleSize, length);
}
if (thrower->error()) return i::wasm::ModuleWireBytes(nullptr, nullptr);
// TODO(titzer): use the handle as well?
return i::wasm::ModuleWireBytes(start, start + length);
}
......@@ -839,12 +838,10 @@ Handle<JSFunction> InstallGetter(Isolate* isolate, Handle<JSObject> object,
void WasmJs::Install(Isolate* isolate) {
Handle<JSGlobalObject> global = isolate->global_object();
Handle<Context> context(global->native_context(), isolate);
// TODO(titzer): once FLAG_expose_wasm is gone, this should become a DCHECK.
// Check if the map is already installed and do nothing otherwise.
if (context->get(Context::WASM_FUNCTION_MAP_INDEX)->IsMap()) return;
// Install Maps.
// TODO(titzer): Also make one for strict mode functions?
Handle<Map> prev_map = Handle<Map>(context->sloppy_function_map(), isolate);
InstanceType instance_type = prev_map->instance_type();
......
......@@ -358,7 +358,7 @@ WasmInstanceObject* wasm::GetOwningWasmInstance(Code* code) {
}
WasmModule::WasmModule(std::unique_ptr<Zone> owned)
: signature_zone(std::move(owned)), pending_tasks(new base::Semaphore(0)) {}
: signature_zone(std::move(owned)) {}
WasmFunction* wasm::GetWasmFunctionForImportWrapper(Isolate* isolate,
Handle<Object> target) {
......
......@@ -183,14 +183,6 @@ struct V8_EXPORT_PRIVATE WasmModule {
std::vector<WasmImport> import_table; // import table.
std::vector<WasmExport> export_table; // export table.
std::vector<WasmTableInit> table_inits; // initializations of tables
// We store the semaphore here to extend its lifetime. In <libc-2.21, which we
// use on the try bots, semaphore::Wait() can return while some compilation
// tasks are still executing semaphore::Signal(). If the semaphore is cleaned
// up right after semaphore::Wait() returns, then this can cause an
// invalid-semaphore error in the compilation tasks.
// TODO(wasm): Move this semaphore back to CompileInParallel when the try bots
// switch to libc-2.21 or higher.
std::unique_ptr<base::Semaphore> pending_tasks;
WasmModule() : WasmModule(nullptr) {}
WasmModule(std::unique_ptr<Zone> owned);
......
......@@ -271,7 +271,7 @@ Handle<FixedArray> WasmTableObject::AddDispatchTable(
if (instance.is_null()) return dispatch_tables;
// TODO(titzer): use weak cells here to avoid leaking instances.
// Grow the dispatch table and add a new triple at the end.
// Grow the dispatch table and add a new entry at the end.
Handle<FixedArray> new_dispatch_tables =
isolate->factory()->CopyFixedArrayAndGrow(dispatch_tables, 4);
......@@ -360,9 +360,9 @@ Handle<JSArrayBuffer> GrowMemoryBuffer(Isolate* isolate,
// TODO(gdeepti): Change the protection here instead of allocating a new
// buffer before guard regions are turned on, see issue #5886.
const bool enable_guard_regions =
(old_buffer.is_null() && EnableGuardRegions()) ||
(!old_buffer.is_null() && old_buffer->has_guard_region());
const bool enable_guard_regions = old_buffer.is_null()
? EnableGuardRegions()
: old_buffer->has_guard_region();
size_t new_size =
static_cast<size_t>(old_pages + pages) * WasmModule::kPageSize;
Handle<JSArrayBuffer> new_buffer =
......
......@@ -399,13 +399,6 @@ FunctionSig* WasmOpcodes::AtomicSignature(WasmOpcode opcode) {
kSimpleExprSigs[kAtomicExprSigTable[opcode & 0xff]]);
}
// TODO(titzer): pull WASM_64 up to a common header.
#if !V8_TARGET_ARCH_32_BIT || V8_TARGET_ARCH_X64
#define WASM_64 1
#else
#define WASM_64 0
#endif
int WasmOpcodes::TrapReasonToMessageId(TrapReason reason) {
switch (reason) {
#define TRAPREASON_TO_MESSAGE(name) \
......
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