[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}
This commit is contained in:
parent
d6c2f4de9d
commit
00ec48335e
@ -782,7 +782,10 @@ class AsmWasmBuilderImpl final : public AstVisitor<AsmWasmBuilderImpl> {
|
||||
|
||||
void PopulateFunctionTable(VariableProxy* table, ArrayLiteral* funcs) {
|
||||
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) {
|
||||
VariableProxy* func = funcs->values()->at(i)->AsVariableProxy();
|
||||
DCHECK_NOT_NULL(func);
|
||||
|
27
test/mjsunit/asm/regress-669899.js
Normal file
27
test/mjsunit/asm/regress-669899.js
Normal file
@ -0,0 +1,27 @@
|
||||
// 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();
|
||||
})();
|
Loading…
Reference in New Issue
Block a user