[asm.js] Remove dead nullptr check of signatures.

R=clemensh@chromium.org

Change-Id: I616a972283cc85ccaf63c46d0cc11ccbb7563a46
Reviewed-on: https://chromium-review.googlesource.com/504527
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45289}
This commit is contained in:
Michael Starzinger 2017-05-12 13:58:45 +02:00 committed by Commit Bot
parent f0082e5631
commit 6c75e145ec

View File

@ -156,7 +156,7 @@ FunctionSig* AsmJsParser::ConvertSignature(
} else if (param->IsA(AsmType::Int())) { } else if (param->IsA(AsmType::Int())) {
sig_builder.AddParam(kWasmI32); sig_builder.AddParam(kWasmI32);
} else { } else {
return nullptr; UNREACHABLE();
} }
} }
if (!return_type->IsA(AsmType::Void())) { if (!return_type->IsA(AsmType::Void())) {
@ -167,7 +167,7 @@ FunctionSig* AsmJsParser::ConvertSignature(
} else if (return_type->IsA(AsmType::Signed())) { } else if (return_type->IsA(AsmType::Signed())) {
sig_builder.AddReturn(kWasmI32); sig_builder.AddReturn(kWasmI32);
} else { } else {
return 0; UNREACHABLE();
} }
} }
return sig_builder.Build(); return sig_builder.Build();
@ -767,9 +767,6 @@ void AsmJsParser::ValidateFunction() {
// TODO(bradnelson): WasmModuleBuilder can't take this in the right order. // TODO(bradnelson): WasmModuleBuilder can't take this in the right order.
// We should fix that so we can use it instead. // We should fix that so we can use it instead.
FunctionSig* sig = ConvertSignature(return_type_, params); FunctionSig* sig = ConvertSignature(return_type_, params);
if (sig == nullptr) {
FAIL("Invalid function signature in declaration");
}
current_function_builder_->SetSignature(sig); current_function_builder_->SetSignature(sig);
for (auto local : locals) { for (auto local : locals) {
current_function_builder_->AddLocal(local); current_function_builder_->AddLocal(local);
@ -2140,9 +2137,6 @@ AsmType* AsmJsParser::ValidateCall() {
function_type->AsFunctionType()->AddArgument(t); function_type->AsFunctionType()->AddArgument(t);
} }
FunctionSig* sig = ConvertSignature(return_type, param_types); FunctionSig* sig = ConvertSignature(return_type, param_types);
if (sig == nullptr) {
FAILn("Invalid function signature");
}
uint32_t signature_index = module_builder_->AddSignature(sig); uint32_t signature_index = module_builder_->AddSignature(sig);
// Emit actual function invocation depending on the kind. At this point we // Emit actual function invocation depending on the kind. At this point we