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 <memory> |
| 6 |
5 #include "src/base/atomic-utils.h" | 7 #include "src/base/atomic-utils.h" |
6 #include "src/macro-assembler.h" | 8 #include "src/macro-assembler.h" |
7 #include "src/objects.h" | 9 #include "src/objects.h" |
8 #include "src/property-descriptor.h" | 10 #include "src/property-descriptor.h" |
9 #include "src/v8.h" | 11 #include "src/v8.h" |
10 | 12 |
11 #include "src/simulator.h" | 13 #include "src/simulator.h" |
12 | 14 |
13 #include "src/wasm/ast-decoder.h" | 15 #include "src/wasm/ast-decoder.h" |
14 #include "src/wasm/module-decoder.h" | 16 #include "src/wasm/module-decoder.h" |
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 InitializeParallelCompilation(isolate, module->functions, compilation_units, | 789 InitializeParallelCompilation(isolate, module->functions, compilation_units, |
788 *module_env, *thrower); | 790 *module_env, *thrower); |
789 | 791 |
790 // Objects for the synchronization with the background threads. | 792 // Objects for the synchronization with the background threads. |
791 base::Mutex result_mutex; | 793 base::Mutex result_mutex; |
792 base::AtomicNumber<size_t> next_unit( | 794 base::AtomicNumber<size_t> next_unit( |
793 static_cast<size_t>(FLAG_skip_compiling_wasm_funcs)); | 795 static_cast<size_t>(FLAG_skip_compiling_wasm_funcs)); |
794 | 796 |
795 // 2) The main thread spawns {WasmCompilationTask} instances which run on | 797 // 2) The main thread spawns {WasmCompilationTask} instances which run on |
796 // the background threads. | 798 // the background threads. |
797 base::SmartArrayPointer<uint32_t> task_ids(StartCompilationTasks( | 799 std::unique_ptr<uint32_t[]> task_ids(StartCompilationTasks( |
798 isolate, compilation_units, executed_units, module->pending_tasks.get(), | 800 isolate, compilation_units, executed_units, module->pending_tasks.get(), |
799 result_mutex, next_unit)); | 801 result_mutex, next_unit)); |
800 | 802 |
801 // 3.a) The background threads and the main thread pick one compilation | 803 // 3.a) The background threads and the main thread pick one compilation |
802 // unit at a time and execute the parallel phase of the compilation | 804 // unit at a time and execute the parallel phase of the compilation |
803 // unit. After finishing the execution of the parallel phase, the | 805 // unit. After finishing the execution of the parallel phase, the |
804 // result is enqueued in {executed_units}. | 806 // result is enqueued in {executed_units}. |
805 while (FetchAndExecuteCompilationUnit(isolate, &compilation_units, | 807 while (FetchAndExecuteCompilationUnit(isolate, &compilation_units, |
806 &executed_units, &result_mutex, | 808 &executed_units, &result_mutex, |
807 &next_unit)) { | 809 &next_unit)) { |
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1548 return static_cast<int32_t>(HeapNumber::cast(*result)->value()); | 1550 return static_cast<int32_t>(HeapNumber::cast(*result)->value()); |
1549 } | 1551 } |
1550 thrower.Error("WASM.compileRun() failed: Return value should be number"); | 1552 thrower.Error("WASM.compileRun() failed: Return value should be number"); |
1551 return -1; | 1553 return -1; |
1552 } | 1554 } |
1553 | 1555 |
1554 } // namespace testing | 1556 } // namespace testing |
1555 } // namespace wasm | 1557 } // namespace wasm |
1556 } // namespace internal | 1558 } // namespace internal |
1557 } // namespace v8 | 1559 } // namespace v8 |
OLD | NEW |