Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WASM_RUN_UTILS_H | 5 #ifndef WASM_RUN_UTILS_H |
| 6 #define WASM_RUN_UTILS_H | 6 #define WASM_RUN_UTILS_H |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| 11 | 11 |
| 12 #include "src/base/utils/random-number-generator.h" | 12 #include "src/base/utils/random-number-generator.h" |
| 13 | 13 |
| 14 #include "src/compiler/graph-visualizer.h" | 14 #include "src/compiler/graph-visualizer.h" |
| 15 #include "src/compiler/int64-reducer.h" | |
| 15 #include "src/compiler/js-graph.h" | 16 #include "src/compiler/js-graph.h" |
| 16 #include "src/compiler/wasm-compiler.h" | 17 #include "src/compiler/wasm-compiler.h" |
| 17 | 18 |
| 18 #include "src/wasm/ast-decoder.h" | 19 #include "src/wasm/ast-decoder.h" |
| 19 #include "src/wasm/wasm-js.h" | 20 #include "src/wasm/wasm-js.h" |
| 20 #include "src/wasm/wasm-module.h" | 21 #include "src/wasm/wasm-module.h" |
| 21 #include "src/wasm/wasm-opcodes.h" | 22 #include "src/wasm/wasm-opcodes.h" |
| 22 | 23 |
| 23 #include "test/cctest/cctest.h" | 24 #include "test/cctest/cctest.h" |
| 24 #include "test/cctest/compiler/codegen-tester.h" | 25 #include "test/cctest/compiler/codegen-tester.h" |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 276 int result = static_cast<int>(env.total_locals); | 277 int result = static_cast<int>(env.total_locals); |
| 277 env.AddLocals(type, 1); | 278 env.AddLocals(type, 1); |
| 278 byte b = static_cast<byte>(result); | 279 byte b = static_cast<byte>(result); |
| 279 CHECK_EQ(result, b); | 280 CHECK_EQ(result, b); |
| 280 return b; | 281 return b; |
| 281 } | 282 } |
| 282 | 283 |
| 283 Handle<Code> Compile(ModuleEnv* module) { | 284 Handle<Code> Compile(ModuleEnv* module) { |
| 284 descriptor_ = module->GetWasmCallDescriptor(this->zone(), env.sig); | 285 descriptor_ = module->GetWasmCallDescriptor(this->zone(), env.sig); |
| 285 CompilationInfo info("wasm compile", this->isolate(), this->zone()); | 286 CompilationInfo info("wasm compile", this->isolate(), this->zone()); |
| 287 | |
| 288 #if !WASM_64 | |
| 289 Int64Reducer r(this->graph(), this->machine(), this->common(), | |
|
titzer
2016/02/02 10:14:35
I think you should move this use of the pipeline i
ahaas
2016/02/02 13:32:48
I call WasmCompiler::Int64LoweringForTesting now a
| |
| 290 this->zone()); | |
| 291 r.ReduceGraph(); | |
| 292 #endif | |
| 293 | |
| 286 Handle<Code> result = | 294 Handle<Code> result = |
| 287 Pipeline::GenerateCodeForTesting(&info, descriptor_, this->graph()); | 295 Pipeline::GenerateCodeForTesting(&info, descriptor_, this->graph()); |
| 288 #ifdef ENABLE_DISASSEMBLER | 296 #ifdef ENABLE_DISASSEMBLER |
| 289 if (!result.is_null() && FLAG_print_opt_code) { | 297 if (!result.is_null() && FLAG_print_opt_code) { |
| 290 OFStream os(stdout); | 298 OFStream os(stdout); |
| 291 result->Disassemble("wasm code", os); | 299 result->Disassemble("wasm code", os); |
| 292 } | 300 } |
| 293 #endif | 301 #endif |
| 294 | 302 |
| 295 return result; | 303 return result; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 407 if (p1 == MachineType::None()) return 1; | 415 if (p1 == MachineType::None()) return 1; |
| 408 if (p2 == MachineType::None()) return 2; | 416 if (p2 == MachineType::None()) return 2; |
| 409 if (p3 == MachineType::None()) return 3; | 417 if (p3 == MachineType::None()) return 3; |
| 410 return 4; | 418 return 4; |
| 411 } | 419 } |
| 412 }; | 420 }; |
| 413 | 421 |
| 414 } // namespace | 422 } // namespace |
| 415 | 423 |
| 416 #endif | 424 #endif |
| OLD | NEW |