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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 } | 562 } |
563 | 563 |
564 bool FinishCompilation(Isolate* isolate, const WasmModule* module, | 564 bool FinishCompilation(Isolate* isolate, const WasmModule* module, |
565 const Handle<JSReceiver> ffi, | 565 const Handle<JSReceiver> ffi, |
566 const std::vector<Handle<Code>>& results, | 566 const std::vector<Handle<Code>>& results, |
567 const WasmModuleInstance& instance, | 567 const WasmModuleInstance& instance, |
568 const Handle<FixedArray>& code_table, | 568 const Handle<FixedArray>& code_table, |
569 ErrorThrower& thrower, Factory* factory, | 569 ErrorThrower& thrower, Factory* factory, |
570 ModuleEnv& module_env, CodeStats& code_stats, | 570 ModuleEnv& module_env, CodeStats& code_stats, |
571 PropertyDescriptor& desc) { | 571 PropertyDescriptor& desc) { |
| 572 if (thrower.error()) return false; |
572 for (uint32_t i = FLAG_skip_compiling_wasm_funcs; | 573 for (uint32_t i = FLAG_skip_compiling_wasm_funcs; |
573 i < module->functions.size(); i++) { | 574 i < module->functions.size(); i++) { |
574 const WasmFunction& func = module->functions[i]; | 575 const WasmFunction& func = module->functions[i]; |
575 if (thrower.error()) break; | |
576 | 576 |
577 DCHECK_EQ(i, func.func_index); | 577 DCHECK_EQ(i, func.func_index); |
578 WasmName str = module->GetName(func.name_offset, func.name_length); | 578 WasmName str = module->GetName(func.name_offset, func.name_length); |
579 Handle<Code> code = Handle<Code>::null(); | 579 Handle<Code> code = Handle<Code>::null(); |
580 Handle<JSFunction> function = Handle<JSFunction>::null(); | 580 Handle<JSFunction> function = Handle<JSFunction>::null(); |
581 Handle<String> function_name = Handle<String>::null(); | 581 Handle<String> function_name = Handle<String>::null(); |
582 if (FLAG_wasm_num_compilation_tasks != 0) { | 582 if (FLAG_wasm_num_compilation_tasks != 0) { |
583 code = results[i]; | 583 code = results[i]; |
584 } else { | 584 } else { |
585 // Compile the function. | 585 // Compile the function. |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 uint32_t func_index) { | 982 uint32_t func_index) { |
983 Object* func_names_arr_obj = wasm->GetInternalField(kWasmFunctionNamesArray); | 983 Object* func_names_arr_obj = wasm->GetInternalField(kWasmFunctionNamesArray); |
984 if (func_names_arr_obj->IsUndefined()) return Handle<String>::null(); | 984 if (func_names_arr_obj->IsUndefined()) return Handle<String>::null(); |
985 return GetWasmFunctionNameFromTable( | 985 return GetWasmFunctionNameFromTable( |
986 handle(ByteArray::cast(func_names_arr_obj)), func_index); | 986 handle(ByteArray::cast(func_names_arr_obj)), func_index); |
987 } | 987 } |
988 | 988 |
989 } // namespace wasm | 989 } // namespace wasm |
990 } // namespace internal | 990 } // namespace internal |
991 } // namespace v8 | 991 } // namespace v8 |
OLD | NEW |