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 v8::base::SmartPointer<OptimizedCompileJob> job( | 488 v8::base::SmartPointer<CompilationJob> job(Pipeline::NewWasmCompilationJob( |
489 Pipeline::NewWasmCompilationJob(&info, graph(), desc, | 489 &info, graph(), desc, &source_position_table_)); |
490 &source_position_table_)); | |
491 Handle<Code> code = Handle<Code>::null(); | 490 Handle<Code> code = Handle<Code>::null(); |
492 if (job->OptimizeGraph() == OptimizedCompileJob::SUCCEEDED && | 491 if (job->OptimizeGraph() == CompilationJob::SUCCEEDED && |
493 job->GenerateCode() == OptimizedCompileJob::SUCCEEDED) { | 492 job->GenerateCode() == CompilationJob::SUCCEEDED) { |
494 code = info.code(); | 493 code = info.code(); |
495 } | 494 } |
496 #ifdef ENABLE_DISASSEMBLER | 495 #ifdef ENABLE_DISASSEMBLER |
497 if (!code.is_null() && FLAG_print_opt_code) { | 496 if (!code.is_null() && FLAG_print_opt_code) { |
498 OFStream os(stdout); | 497 OFStream os(stdout); |
499 code->Disassemble("wasm code", os); | 498 code->Disassemble("wasm code", os); |
500 } | 499 } |
501 #endif | 500 #endif |
502 | 501 |
503 return code; | 502 return code; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 if (p1 == MachineType::None()) return 1; | 642 if (p1 == MachineType::None()) return 1; |
644 if (p2 == MachineType::None()) return 2; | 643 if (p2 == MachineType::None()) return 2; |
645 if (p3 == MachineType::None()) return 3; | 644 if (p3 == MachineType::None()) return 3; |
646 return 4; | 645 return 4; |
647 } | 646 } |
648 }; | 647 }; |
649 | 648 |
650 } // namespace | 649 } // namespace |
651 | 650 |
652 #endif | 651 #endif |
OLD | NEW |