| 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/base/atomic-utils.h" | 5 #include "src/base/atomic-utils.h" |
| 6 #include "src/macro-assembler.h" | 6 #include "src/macro-assembler.h" |
| 7 #include "src/objects.h" | 7 #include "src/objects.h" |
| 8 #include "src/property-descriptor.h" | 8 #include "src/property-descriptor.h" |
| 9 #include "src/v8.h" | 9 #include "src/v8.h" |
| 10 | 10 |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 // 4) After the parallel phase of all compilation units has started, the | 767 // 4) After the parallel phase of all compilation units has started, the |
| 768 // main thread waits for all {WasmCompilationTask} instances to finish. | 768 // main thread waits for all {WasmCompilationTask} instances to finish. |
| 769 WaitForCompilationTasks(isolate, task_ids.get(), pending_tasks); | 769 WaitForCompilationTasks(isolate, task_ids.get(), pending_tasks); |
| 770 // Finish the compilation of the remaining compilation units. | 770 // Finish the compilation of the remaining compilation units. |
| 771 FinishCompilationUnits(executed_units, results, result_mutex); | 771 FinishCompilationUnits(executed_units, results, result_mutex); |
| 772 } | 772 } |
| 773 // 5) The main thread finishes the compilation. | 773 // 5) The main thread finishes the compilation. |
| 774 if (!FinishCompilation(isolate, this, ffi, results, instance, code_table, | 774 if (!FinishCompilation(isolate, this, ffi, results, instance, code_table, |
| 775 thrower, factory, module_env, code_stats, desc)) { | 775 thrower, factory, module_env, code_stats, desc)) { |
| 776 instance.js_object = Handle<JSObject>::null(); | 776 instance.js_object = Handle<JSObject>::null(); |
| 777 return instance.js_object; |
| 777 } | 778 } |
| 778 | 779 |
| 779 // Patch all direct call sites. | 780 // Patch all direct call sites. |
| 780 linker.Link(instance.function_table, this->function_table); | 781 linker.Link(instance.function_table, this->function_table); |
| 781 instance.js_object->SetInternalField(kWasmModuleFunctionTable, | 782 instance.js_object->SetInternalField(kWasmModuleFunctionTable, |
| 782 Smi::FromInt(0)); | 783 Smi::FromInt(0)); |
| 783 | 784 |
| 784 //------------------------------------------------------------------------- | 785 //------------------------------------------------------------------------- |
| 785 // Create and populate the exports object. | 786 // Create and populate the exports object. |
| 786 //------------------------------------------------------------------------- | 787 //------------------------------------------------------------------------- |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 981 uint32_t func_index) { | 982 uint32_t func_index) { |
| 982 Object* func_names_arr_obj = wasm->GetInternalField(kWasmFunctionNamesArray); | 983 Object* func_names_arr_obj = wasm->GetInternalField(kWasmFunctionNamesArray); |
| 983 if (func_names_arr_obj->IsUndefined()) return Handle<String>::null(); | 984 if (func_names_arr_obj->IsUndefined()) return Handle<String>::null(); |
| 984 return GetWasmFunctionNameFromTable( | 985 return GetWasmFunctionNameFromTable( |
| 985 handle(ByteArray::cast(func_names_arr_obj)), func_index); | 986 handle(ByteArray::cast(func_names_arr_obj)), func_index); |
| 986 } | 987 } |
| 987 | 988 |
| 988 } // namespace wasm | 989 } // namespace wasm |
| 989 } // namespace internal | 990 } // namespace internal |
| 990 } // namespace v8 | 991 } // namespace v8 |
| OLD | NEW |