Commit d9ffa305 authored by bradnelson's avatar bradnelson Committed by Commit bot

Fixing more wasm warnings.

R=ahaas@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1536663002

Cr-Commit-Position: refs/heads/master@{#32952}
parent 7b775118
...@@ -319,7 +319,7 @@ class AsmWasmBuilderImpl : public AstVisitor { ...@@ -319,7 +319,7 @@ class AsmWasmBuilderImpl : public AstVisitor {
std::vector<uint8_t> index = std::vector<uint8_t> index =
UnsignedLEB128From(LookupOrInsertFunction(var)); UnsignedLEB128From(LookupOrInsertFunction(var));
current_function_builder_->EmitCode( current_function_builder_->EmitCode(
index.data(), static_cast<uint32_t>(index.size())); &index[0], static_cast<uint32_t>(index.size()));
} else { } else {
if (is_set_op_) { if (is_set_op_) {
if (var->IsContextSlot()) { if (var->IsContextSlot()) {
...@@ -786,11 +786,11 @@ class AsmWasmBuilderImpl : public AstVisitor { ...@@ -786,11 +786,11 @@ class AsmWasmBuilderImpl : public AstVisitor {
if (is_local) { if (is_local) {
uint32_t pos_of_index[1] = {0}; uint32_t pos_of_index[1] = {0};
current_function_builder_->EmitCode( current_function_builder_->EmitCode(
index_vec.data(), static_cast<uint32_t>(index_vec.size()), &index_vec[0], static_cast<uint32_t>(index_vec.size()), pos_of_index,
pos_of_index, 1); 1);
} else { } else {
current_function_builder_->EmitCode( current_function_builder_->EmitCode(
index_vec.data(), static_cast<uint32_t>(index_vec.size())); &index_vec[0], static_cast<uint32_t>(index_vec.size()));
} }
} }
...@@ -856,6 +856,7 @@ class AsmWasmBuilderImpl : public AstVisitor { ...@@ -856,6 +856,7 @@ class AsmWasmBuilderImpl : public AstVisitor {
return kFloat64; return kFloat64;
} else { } else {
UNREACHABLE(); UNREACHABLE();
return kInt32;
} }
} }
......
...@@ -73,8 +73,8 @@ FunctionSig* WasmOpcodes::Signature(WasmOpcode opcode) { ...@@ -73,8 +73,8 @@ FunctionSig* WasmOpcodes::Signature(WasmOpcode opcode) {
bool WasmOpcodes::IsSupported(WasmOpcode opcode) { bool WasmOpcodes::IsSupported(WasmOpcode opcode) {
switch (opcode) {
#if !WASM_64 #if !WASM_64
switch (opcode) {
// Opcodes not supported on 32-bit platforms. // Opcodes not supported on 32-bit platforms.
case kExprI64Add: case kExprI64Add:
case kExprI64Sub: case kExprI64Sub:
...@@ -120,11 +120,13 @@ bool WasmOpcodes::IsSupported(WasmOpcode opcode) { ...@@ -120,11 +120,13 @@ bool WasmOpcodes::IsSupported(WasmOpcode opcode) {
case kExprI64UConvertF32: case kExprI64UConvertF32:
case kExprI64UConvertF64: case kExprI64UConvertF64:
#endif
return false; return false;
default: default:
return true; return true;
} }
#else
return true;
#endif
} }
} // namespace wasm } // namespace wasm
} // namespace internal } // namespace internal
......
...@@ -264,7 +264,7 @@ class WasmFunctionCompiler : public HandleAndZoneScope, ...@@ -264,7 +264,7 @@ class WasmFunctionCompiler : public HandleAndZoneScope,
uint32_t CompileAndAdd(TestingModule* module) { uint32_t CompileAndAdd(TestingModule* module) {
uint32_t index = 0; uint32_t index = 0;
if (module->module && module->module->functions) { if (module->module && module->module->functions) {
index = module->module->functions->size(); index = static_cast<uint32_t>(module->module->functions->size());
} }
module->AddFunction(env.sig, Compile(module)); module->AddFunction(env.sig, Compile(module));
return index; return index;
...@@ -2620,7 +2620,7 @@ TEST(Run_WasmCallF32StackParameter) { ...@@ -2620,7 +2620,7 @@ TEST(Run_WasmCallF32StackParameter) {
TestingModule module; TestingModule module;
WasmFunctionCompiler t(&sig); WasmFunctionCompiler t(&sig);
BUILD(t, WASM_GET_LOCAL(17)); BUILD(t, WASM_GET_LOCAL(17));
unsigned index = t.CompileAndAdd(&module); uint32_t index = t.CompileAndAdd(&module);
// Build the calling function. // Build the calling function.
WasmRunner<float> r; WasmRunner<float> r;
...@@ -2646,7 +2646,7 @@ TEST(Run_WasmCallF64StackParameter) { ...@@ -2646,7 +2646,7 @@ TEST(Run_WasmCallF64StackParameter) {
TestingModule module; TestingModule module;
WasmFunctionCompiler t(&sig); WasmFunctionCompiler t(&sig);
BUILD(t, WASM_GET_LOCAL(17)); BUILD(t, WASM_GET_LOCAL(17));
unsigned index = t.CompileAndAdd(&module); uint32_t index = t.CompileAndAdd(&module);
// Build the calling function. // Build the calling function.
WasmRunner<double> r; WasmRunner<double> r;
......
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