| 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 <setjmp.h> | 8 #include <setjmp.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <stdlib.h> | 10 #include <stdlib.h> |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 // Get a new function from the testing module. | 602 // Get a new function from the testing module. |
| 603 int index = module->AddFunction(sig, Handle<Code>::null(), name); | 603 int index = module->AddFunction(sig, Handle<Code>::null(), name); |
| 604 function_ = testing_module_->GetFunctionAt(index); | 604 function_ = testing_module_->GetFunctionAt(index); |
| 605 } | 605 } |
| 606 | 606 |
| 607 Handle<Code> Compile() { | 607 Handle<Code> Compile() { |
| 608 CallDescriptor* desc = descriptor(); | 608 CallDescriptor* desc = descriptor(); |
| 609 if (kPointerSize == 4) { | 609 if (kPointerSize == 4) { |
| 610 desc = testing_module_->GetI32WasmCallDescriptor(this->zone(), desc); | 610 desc = testing_module_->GetI32WasmCallDescriptor(this->zone(), desc); |
| 611 } | 611 } |
| 612 CompilationInfo info(CStrVector("wasm"), this->isolate(), this->zone(), | 612 EmbeddedVector<char, 16> comp_name; |
| 613 int comp_name_len = SNPrintF(comp_name, "wasm#%u", this->function_index()); |
| 614 comp_name.Truncate(comp_name_len); |
| 615 CompilationInfo info(comp_name, this->isolate(), this->zone(), |
| 613 Code::ComputeFlags(Code::WASM_FUNCTION)); | 616 Code::ComputeFlags(Code::WASM_FUNCTION)); |
| 614 std::unique_ptr<CompilationJob> job(Pipeline::NewWasmCompilationJob( | 617 std::unique_ptr<CompilationJob> job(Pipeline::NewWasmCompilationJob( |
| 615 &info, &jsgraph, desc, &source_position_table_, nullptr, false)); | 618 &info, &jsgraph, desc, &source_position_table_, nullptr, false)); |
| 616 if (job->ExecuteJob() != CompilationJob::SUCCEEDED || | 619 if (job->ExecuteJob() != CompilationJob::SUCCEEDED || |
| 617 job->FinalizeJob() != CompilationJob::SUCCEEDED) | 620 job->FinalizeJob() != CompilationJob::SUCCEEDED) |
| 618 return Handle<Code>::null(); | 621 return Handle<Code>::null(); |
| 619 | 622 |
| 620 Handle<Code> code = info.code(); | 623 Handle<Code> code = info.code(); |
| 621 | 624 |
| 622 // Deopt data holds <WeakCell<wasm_instance>, func_index>. | 625 // Deopt data holds <WeakCell<wasm_instance>, func_index>. |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 void RunWasm_##name(WasmExecutionMode execution_mode) | 838 void RunWasm_##name(WasmExecutionMode execution_mode) |
| 836 | 839 |
| 837 #define WASM_EXEC_COMPILED_TEST(name) \ | 840 #define WASM_EXEC_COMPILED_TEST(name) \ |
| 838 void RunWasm_##name(WasmExecutionMode execution_mode); \ | 841 void RunWasm_##name(WasmExecutionMode execution_mode); \ |
| 839 TEST(RunWasmCompiled_##name) { RunWasm_##name(kExecuteCompiled); } \ | 842 TEST(RunWasmCompiled_##name) { RunWasm_##name(kExecuteCompiled); } \ |
| 840 void RunWasm_##name(WasmExecutionMode execution_mode) | 843 void RunWasm_##name(WasmExecutionMode execution_mode) |
| 841 | 844 |
| 842 } // namespace | 845 } // namespace |
| 843 | 846 |
| 844 #endif | 847 #endif |
| OLD | NEW |