| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #include "src/compiler/wasm-compiler.h" | 5 #include "src/compiler/wasm-compiler.h" |
| 6 | 6 |
| 7 #include "src/isolate-inl.h" | 7 #include "src/isolate-inl.h" |
| 8 | 8 |
| 9 #include "src/base/platform/elapsed-timer.h" | 9 #include "src/base/platform/elapsed-timer.h" |
| 10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
| (...skipping 2577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2588 // Add the function as another context for the exception | 2588 // Add the function as another context for the exception |
| 2589 ScopedVector<char> buffer(128); | 2589 ScopedVector<char> buffer(128); |
| 2590 wasm::WasmName name = | 2590 wasm::WasmName name = |
| 2591 module_env->module->GetName(function.name_offset, function.name_length); | 2591 module_env->module->GetName(function.name_offset, function.name_length); |
| 2592 SNPrintF(buffer, "Compiling WASM function #%d:%.*s failed:", | 2592 SNPrintF(buffer, "Compiling WASM function #%d:%.*s failed:", |
| 2593 function.func_index, name.length, name.name); | 2593 function.func_index, name.length, name.name); |
| 2594 thrower.Failed(buffer.start(), result); | 2594 thrower.Failed(buffer.start(), result); |
| 2595 return Handle<Code>::null(); | 2595 return Handle<Code>::null(); |
| 2596 } | 2596 } |
| 2597 | 2597 |
| 2598 if (function.func_index >= FLAG_trace_wasm_ast_start && |
| 2599 function.func_index < FLAG_trace_wasm_ast_end) { |
| 2600 PrintAst(body); |
| 2601 } |
| 2602 |
| 2598 if (FLAG_trace_wasm_decode_time) { | 2603 if (FLAG_trace_wasm_decode_time) { |
| 2599 decode_ms = decode_timer.Elapsed().InMillisecondsF(); | 2604 decode_ms = decode_timer.Elapsed().InMillisecondsF(); |
| 2600 } | 2605 } |
| 2601 | 2606 |
| 2602 base::ElapsedTimer compile_timer; | 2607 base::ElapsedTimer compile_timer; |
| 2603 if (FLAG_trace_wasm_decode_time) { | 2608 if (FLAG_trace_wasm_decode_time) { |
| 2604 compile_timer.Start(); | 2609 compile_timer.Start(); |
| 2605 } | 2610 } |
| 2606 // Run the compiler pipeline to generate machine code. | 2611 // Run the compiler pipeline to generate machine code. |
| 2607 CallDescriptor* descriptor = | 2612 CallDescriptor* descriptor = |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2649 static_cast<int>(function.code_end_offset - function.code_start_offset), | 2654 static_cast<int>(function.code_end_offset - function.code_start_offset), |
| 2650 decode_ms, static_cast<int>(graph.NodeCount()), compile_ms); | 2655 decode_ms, static_cast<int>(graph.NodeCount()), compile_ms); |
| 2651 } | 2656 } |
| 2652 return code; | 2657 return code; |
| 2653 } | 2658 } |
| 2654 | 2659 |
| 2655 | 2660 |
| 2656 } // namespace compiler | 2661 } // namespace compiler |
| 2657 } // namespace internal | 2662 } // namespace internal |
| 2658 } // namespace v8 | 2663 } // namespace v8 |
| OLD | NEW |