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/macro-assembler.h" | 5 #include "src/macro-assembler.h" |
6 #include "src/objects.h" | 6 #include "src/objects.h" |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/simulator.h" | 9 #include "src/simulator.h" |
10 | 10 |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 instance.import_code.push_back(code); | 452 instance.import_code.push_back(code); |
453 index++; | 453 index++; |
454 } | 454 } |
455 } | 455 } |
456 | 456 |
457 //------------------------------------------------------------------------- | 457 //------------------------------------------------------------------------- |
458 // Compile all functions in the module. | 458 // Compile all functions in the module. |
459 //------------------------------------------------------------------------- | 459 //------------------------------------------------------------------------- |
460 | 460 |
461 // First pass: compile each function and initialize the code table. | 461 // First pass: compile each function and initialize the code table. |
462 index = 0; | 462 index = FLAG_skip_compiling_wasm_funcs; |
463 for (const WasmFunction& func : functions) { | 463 while (index < functions.size()) { |
| 464 const WasmFunction& func = functions[index]; |
464 if (thrower.error()) break; | 465 if (thrower.error()) break; |
465 DCHECK_EQ(index, func.func_index); | 466 DCHECK_EQ(index, func.func_index); |
466 | 467 |
467 WasmName str = GetName(func.name_offset, func.name_length); | 468 WasmName str = GetName(func.name_offset, func.name_length); |
468 WasmName str_null = {nullptr, 0}; | 469 WasmName str_null = {nullptr, 0}; |
469 Handle<String> name = factory->InternalizeUtf8String( | 470 Handle<String> name = factory->InternalizeUtf8String( |
470 Vector<const char>(str.name, str.length)); | 471 Vector<const char>(str.name, str.length)); |
471 Handle<Code> code = Handle<Code>::null(); | 472 Handle<Code> code = Handle<Code>::null(); |
472 Handle<JSFunction> function = Handle<JSFunction>::null(); | 473 Handle<JSFunction> function = Handle<JSFunction>::null(); |
473 if (func.external) { | 474 if (func.external) { |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 } | 689 } |
689 if (result->IsHeapNumber()) { | 690 if (result->IsHeapNumber()) { |
690 return static_cast<int32_t>(HeapNumber::cast(*result)->value()); | 691 return static_cast<int32_t>(HeapNumber::cast(*result)->value()); |
691 } | 692 } |
692 thrower.Error("WASM.compileRun() failed: Return value should be number"); | 693 thrower.Error("WASM.compileRun() failed: Return value should be number"); |
693 return -1; | 694 return -1; |
694 } | 695 } |
695 } // namespace wasm | 696 } // namespace wasm |
696 } // namespace internal | 697 } // namespace internal |
697 } // namespace v8 | 698 } // namespace v8 |
OLD | NEW |