Fixing more wasm warnings.

R=ahaas@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#32952}
This commit is contained in:
bradnelson 2015-12-17 06:55:02 -08:00 committed by Commit bot
parent 7b775118b9
commit d9ffa30563
3 changed files with 12 additions and 9 deletions

View File

@ -319,7 +319,7 @@ class AsmWasmBuilderImpl : public AstVisitor {
std::vector<uint8_t> index =
UnsignedLEB128From(LookupOrInsertFunction(var));
current_function_builder_->EmitCode(
index.data(), static_cast<uint32_t>(index.size()));
&index[0], static_cast<uint32_t>(index.size()));
} else {
if (is_set_op_) {
if (var->IsContextSlot()) {
@ -786,11 +786,11 @@ class AsmWasmBuilderImpl : public AstVisitor {
if (is_local) {
uint32_t pos_of_index[1] = {0};
current_function_builder_->EmitCode(
index_vec.data(), static_cast<uint32_t>(index_vec.size()),
pos_of_index, 1);
&index_vec[0], static_cast<uint32_t>(index_vec.size()), pos_of_index,
1);
} else {
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 {
return kFloat64;
} else {
UNREACHABLE();
return kInt32;
}
}

View File

@ -73,8 +73,8 @@ FunctionSig* WasmOpcodes::Signature(WasmOpcode opcode) {
bool WasmOpcodes::IsSupported(WasmOpcode opcode) {
switch (opcode) {
#if !WASM_64
switch (opcode) {
// Opcodes not supported on 32-bit platforms.
case kExprI64Add:
case kExprI64Sub:
@ -120,11 +120,13 @@ bool WasmOpcodes::IsSupported(WasmOpcode opcode) {
case kExprI64UConvertF32:
case kExprI64UConvertF64:
#endif
return false;
default:
return true;
}
#else
return true;
#endif
}
} // namespace wasm
} // namespace internal

View File

@ -264,7 +264,7 @@ class WasmFunctionCompiler : public HandleAndZoneScope,
uint32_t CompileAndAdd(TestingModule* module) {
uint32_t index = 0;
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));
return index;
@ -2620,7 +2620,7 @@ TEST(Run_WasmCallF32StackParameter) {
TestingModule module;
WasmFunctionCompiler t(&sig);
BUILD(t, WASM_GET_LOCAL(17));
unsigned index = t.CompileAndAdd(&module);
uint32_t index = t.CompileAndAdd(&module);
// Build the calling function.
WasmRunner<float> r;
@ -2646,7 +2646,7 @@ TEST(Run_WasmCallF64StackParameter) {
TestingModule module;
WasmFunctionCompiler t(&sig);
BUILD(t, WASM_GET_LOCAL(17));
unsigned index = t.CompileAndAdd(&module);
uint32_t index = t.CompileAndAdd(&module);
// Build the calling function.
WasmRunner<double> r;