Commit 00ec4833 authored by bradnelson's avatar bradnelson Committed by Commit bot

[wasm] [asm.js] Ignore unused function tables in AsmWasmBuilder.

Incremental parsing of asm.js means we can see function tables that
are unused in the AsmWasmBuilder before they've been initialized.

BUG=669899
R=aseemgarg@chromium.org

Review-Url: https://codereview.chromium.org/2546553002
Cr-Commit-Position: refs/heads/master@{#41403}
parent d6c2f4de
...@@ -782,7 +782,10 @@ class AsmWasmBuilderImpl final : public AstVisitor<AsmWasmBuilderImpl> { ...@@ -782,7 +782,10 @@ class AsmWasmBuilderImpl final : public AstVisitor<AsmWasmBuilderImpl> {
void PopulateFunctionTable(VariableProxy* table, ArrayLiteral* funcs) { void PopulateFunctionTable(VariableProxy* table, ArrayLiteral* funcs) {
FunctionTableIndices* indices = LookupFunctionTable(table->var()); FunctionTableIndices* indices = LookupFunctionTable(table->var());
DCHECK_NOT_NULL(indices); // Ignore unused function tables.
if (indices == nullptr) {
return;
}
for (int i = 0; i < funcs->values()->length(); ++i) { for (int i = 0; i < funcs->values()->length(); ++i) {
VariableProxy* func = funcs->values()->at(i)->AsVariableProxy(); VariableProxy* func = funcs->values()->at(i)->AsVariableProxy();
DCHECK_NOT_NULL(func); DCHECK_NOT_NULL(func);
......
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
try {
(function () {
})();
} catch(e) {; }
function __f_113() {
}
(function () {
function __f_89() {
"use asm";
function __f_63(__v_26, __v_28) {
__v_26 = __v_26|0;
__v_28 = __v_28|0;
}
function __f_21(table_id, fun_id, arg1, arg2) {
table_id = table_id|0;
fun_id = fun_id|0;
arg1 = arg1|0;
arg2 = arg2|0;
}
var __v_17 = [];
}
var module = __f_89();
})();
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