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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 | 374 |
375 rep_builder.AddReturn(MachineRepresentation::kWord32); | 375 rep_builder.AddReturn(MachineRepresentation::kWord32); |
376 for (int i = 0; i < WASM_RUNNER_MAX_NUM_PARAMETERS + 1; i++) { | 376 for (int i = 0; i < WASM_RUNNER_MAX_NUM_PARAMETERS + 1; i++) { |
377 rep_builder.AddParam(MachineRepresentation::kWord32); | 377 rep_builder.AddParam(MachineRepresentation::kWord32); |
378 } | 378 } |
379 Int64Lowering r(graph(), machine(), common(), zone(), | 379 Int64Lowering r(graph(), machine(), common(), zone(), |
380 rep_builder.Build()); | 380 rep_builder.Build()); |
381 r.LowerGraph(); | 381 r.LowerGraph(); |
382 } | 382 } |
383 | 383 |
384 CompilationInfo info("testing", isolate, graph()->zone()); | 384 CompilationInfo info(ArrayVector("testing"), isolate, graph()->zone()); |
385 code_ = | 385 code_ = |
386 Pipeline::GenerateCodeForTesting(&info, descriptor, graph(), nullptr); | 386 Pipeline::GenerateCodeForTesting(&info, descriptor, graph(), nullptr); |
387 CHECK(!code_.is_null()); | 387 CHECK(!code_.is_null()); |
388 #ifdef ENABLE_DISASSEMBLER | 388 #ifdef ENABLE_DISASSEMBLER |
389 if (FLAG_print_opt_code) { | 389 if (FLAG_print_opt_code) { |
390 OFStream os(stdout); | 390 OFStream os(stdout); |
391 code_->Disassemble("wasm wrapper", os); | 391 code_->Disassemble("wasm wrapper", os); |
392 } | 392 } |
393 #endif | 393 #endif |
394 } | 394 } |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 DCHECK_EQ(index, result); | 474 DCHECK_EQ(index, result); |
475 return result; | 475 return result; |
476 } | 476 } |
477 | 477 |
478 Handle<Code> Compile() { | 478 Handle<Code> Compile() { |
479 InitializeDescriptor(); | 479 InitializeDescriptor(); |
480 CallDescriptor* desc = descriptor_; | 480 CallDescriptor* desc = descriptor_; |
481 if (kPointerSize == 4) { | 481 if (kPointerSize == 4) { |
482 desc = testing_module_->GetI32WasmCallDescriptor(this->zone(), desc); | 482 desc = testing_module_->GetI32WasmCallDescriptor(this->zone(), desc); |
483 } | 483 } |
484 CompilationInfo info(debug_name_, this->isolate(), this->zone(), | 484 CompilationInfo info(CStrVector(debug_name_), this->isolate(), this->zone(), |
485 Code::ComputeFlags(Code::WASM_FUNCTION)); | 485 Code::ComputeFlags(Code::WASM_FUNCTION)); |
486 Handle<Code> result = Pipeline::GenerateWASMCode(&info, desc, this->graph(), | 486 Handle<Code> result = Pipeline::GenerateWASMCode(&info, desc, this->graph(), |
487 &source_position_table_); | 487 &source_position_table_); |
488 #ifdef ENABLE_DISASSEMBLER | 488 #ifdef ENABLE_DISASSEMBLER |
489 if (!result.is_null() && FLAG_print_opt_code) { | 489 if (!result.is_null() && FLAG_print_opt_code) { |
490 OFStream os(stdout); | 490 OFStream os(stdout); |
491 result->Disassemble("wasm code", os); | 491 result->Disassemble("wasm code", os); |
492 } | 492 } |
493 #endif | 493 #endif |
494 | 494 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 if (p1 == MachineType::None()) return 1; | 635 if (p1 == MachineType::None()) return 1; |
636 if (p2 == MachineType::None()) return 2; | 636 if (p2 == MachineType::None()) return 2; |
637 if (p3 == MachineType::None()) return 3; | 637 if (p3 == MachineType::None()) return 3; |
638 return 4; | 638 return 4; |
639 } | 639 } |
640 }; | 640 }; |
641 | 641 |
642 } // namespace | 642 } // namespace |
643 | 643 |
644 #endif | 644 #endif |
OLD | NEW |