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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 } | 478 } |
479 | 479 |
480 Handle<Code> Compile() { | 480 Handle<Code> Compile() { |
481 InitializeDescriptor(); | 481 InitializeDescriptor(); |
482 CallDescriptor* desc = descriptor_; | 482 CallDescriptor* desc = descriptor_; |
483 if (kPointerSize == 4) { | 483 if (kPointerSize == 4) { |
484 desc = testing_module_->GetI32WasmCallDescriptor(this->zone(), desc); | 484 desc = testing_module_->GetI32WasmCallDescriptor(this->zone(), desc); |
485 } | 485 } |
486 CompilationInfo info(debug_name_, this->isolate(), this->zone(), | 486 CompilationInfo info(debug_name_, this->isolate(), this->zone(), |
487 Code::ComputeFlags(Code::WASM_FUNCTION)); | 487 Code::ComputeFlags(Code::WASM_FUNCTION)); |
488 compiler::ZonePool zone_pool(this->isolate()->allocator()); | 488 v8::base::SmartPointer<OptimizedCompileJob> job( |
489 compiler::ZonePool::Scope pipeline_zone_scope(&zone_pool); | 489 Pipeline::NewWasmCompilationJob(&info, graph(), desc, |
490 Pipeline pipeline(&info); | 490 &source_position_table_)); |
491 pipeline.InitializeWasmCompilation(this->zone(), &zone_pool, this->graph(), | 491 Handle<Code> code = Handle<Code>::null(); |
492 &source_position_table_); | 492 if (job->OptimizeGraph() == OptimizedCompileJob::SUCCEEDED && |
493 Handle<Code> code; | 493 job->GenerateCode() == OptimizedCompileJob::SUCCEEDED) { |
494 if (pipeline.ExecuteWasmCompilation(desc)) { | 494 code = info.code(); |
495 code = pipeline.FinalizeWasmCompilation(desc); | |
496 } else { | |
497 code = Handle<Code>::null(); | |
498 } | 495 } |
499 pipeline_zone_scope.Destroy(); | |
500 #ifdef ENABLE_DISASSEMBLER | 496 #ifdef ENABLE_DISASSEMBLER |
501 if (!code.is_null() && FLAG_print_opt_code) { | 497 if (!code.is_null() && FLAG_print_opt_code) { |
502 OFStream os(stdout); | 498 OFStream os(stdout); |
503 code->Disassemble("wasm code", os); | 499 code->Disassemble("wasm code", os); |
504 } | 500 } |
505 #endif | 501 #endif |
506 | 502 |
507 return code; | 503 return code; |
508 } | 504 } |
509 | 505 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 if (p1 == MachineType::None()) return 1; | 643 if (p1 == MachineType::None()) return 1; |
648 if (p2 == MachineType::None()) return 2; | 644 if (p2 == MachineType::None()) return 2; |
649 if (p3 == MachineType::None()) return 3; | 645 if (p3 == MachineType::None()) return 3; |
650 return 4; | 646 return 4; |
651 } | 647 } |
652 }; | 648 }; |
653 | 649 |
654 } // namespace | 650 } // namespace |
655 | 651 |
656 #endif | 652 #endif |
OLD | NEW |