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> |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 Handle<Code> Compile() { | 542 Handle<Code> Compile() { |
543 InitializeDescriptor(); | 543 InitializeDescriptor(); |
544 CallDescriptor* desc = descriptor_; | 544 CallDescriptor* desc = descriptor_; |
545 if (kPointerSize == 4) { | 545 if (kPointerSize == 4) { |
546 desc = testing_module_->GetI32WasmCallDescriptor(this->zone(), desc); | 546 desc = testing_module_->GetI32WasmCallDescriptor(this->zone(), desc); |
547 } | 547 } |
548 CompilationInfo info(debug_name_, this->isolate(), this->zone(), | 548 CompilationInfo info(debug_name_, this->isolate(), this->zone(), |
549 Code::ComputeFlags(Code::WASM_FUNCTION)); | 549 Code::ComputeFlags(Code::WASM_FUNCTION)); |
550 std::unique_ptr<CompilationJob> job(Pipeline::NewWasmCompilationJob( | 550 std::unique_ptr<CompilationJob> job(Pipeline::NewWasmCompilationJob( |
551 &info, graph(), desc, &source_position_table_)); | 551 &info, graph(), desc, &source_position_table_)); |
552 if (job->OptimizeGraph() != CompilationJob::SUCCEEDED || | 552 if (job->ExecuteJob() != CompilationJob::SUCCEEDED || |
553 job->GenerateCode() != CompilationJob::SUCCEEDED) | 553 job->FinalizeJob() != CompilationJob::SUCCEEDED) |
554 return Handle<Code>::null(); | 554 return Handle<Code>::null(); |
555 | 555 |
556 Handle<Code> code = info.code(); | 556 Handle<Code> code = info.code(); |
557 | 557 |
558 // Length is always 2, since usually <wasm_obj, func_index> is stored in | 558 // Length is always 2, since usually <wasm_obj, func_index> is stored in |
559 // the deopt data. Here, we only store the function index. | 559 // the deopt data. Here, we only store the function index. |
560 DCHECK(code->deoptimization_data() == nullptr || | 560 DCHECK(code->deoptimization_data() == nullptr || |
561 code->deoptimization_data()->length() == 0); | 561 code->deoptimization_data()->length() == 0); |
562 Handle<FixedArray> deopt_data = | 562 Handle<FixedArray> deopt_data = |
563 isolate()->factory()->NewFixedArray(2, TENURED); | 563 isolate()->factory()->NewFixedArray(2, TENURED); |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 // interpreter. | 774 // interpreter. |
775 #define WASM_EXEC_TEST(name) \ | 775 #define WASM_EXEC_TEST(name) \ |
776 void RunWasm_##name(WasmExecutionMode execution_mode); \ | 776 void RunWasm_##name(WasmExecutionMode execution_mode); \ |
777 TEST(RunWasmCompiled_##name) { RunWasm_##name(kExecuteCompiled); } \ | 777 TEST(RunWasmCompiled_##name) { RunWasm_##name(kExecuteCompiled); } \ |
778 TEST(RunWasmInterpreted_##name) { RunWasm_##name(kExecuteInterpreted); } \ | 778 TEST(RunWasmInterpreted_##name) { RunWasm_##name(kExecuteInterpreted); } \ |
779 void RunWasm_##name(WasmExecutionMode execution_mode) | 779 void RunWasm_##name(WasmExecutionMode execution_mode) |
780 | 780 |
781 } // namespace | 781 } // namespace |
782 | 782 |
783 #endif | 783 #endif |
OLD | NEW |