OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef WASM_RUN_UTILS_H | 5 #ifndef WASM_RUN_UTILS_H |
6 #define WASM_RUN_UTILS_H | 6 #define WASM_RUN_UTILS_H |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 #include <string.h> | 10 #include <string.h> |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 DCHECK(code->deoptimization_data() == nullptr || | 499 DCHECK(code->deoptimization_data() == nullptr || |
500 code->deoptimization_data()->length() == 0); | 500 code->deoptimization_data()->length() == 0); |
501 Handle<FixedArray> deopt_data = | 501 Handle<FixedArray> deopt_data = |
502 isolate()->factory()->NewFixedArray(2, TENURED); | 502 isolate()->factory()->NewFixedArray(2, TENURED); |
503 if (debug_name_.start() != nullptr) { | 503 if (debug_name_.start() != nullptr) { |
504 MaybeHandle<String> maybe_name = | 504 MaybeHandle<String> maybe_name = |
505 isolate()->factory()->NewStringFromUtf8(debug_name_, TENURED); | 505 isolate()->factory()->NewStringFromUtf8(debug_name_, TENURED); |
506 if (!maybe_name.is_null()) | 506 if (!maybe_name.is_null()) |
507 deopt_data->set(0, *maybe_name.ToHandleChecked()); | 507 deopt_data->set(0, *maybe_name.ToHandleChecked()); |
508 } | 508 } |
| 509 deopt_data->set(1, Smi::FromInt(function_index_)); |
509 deopt_data->set_length(2); | 510 deopt_data->set_length(2); |
510 code->set_deoptimization_data(*deopt_data); | 511 code->set_deoptimization_data(*deopt_data); |
511 | 512 |
512 #ifdef ENABLE_DISASSEMBLER | 513 #ifdef ENABLE_DISASSEMBLER |
513 if (FLAG_print_opt_code) { | 514 if (FLAG_print_opt_code) { |
514 OFStream os(stdout); | 515 OFStream os(stdout); |
515 code->Disassemble("wasm code", os); | 516 code->Disassemble("wasm code", os); |
516 } | 517 } |
517 #endif | 518 #endif |
518 | 519 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 if (p1 == MachineType::None()) return 1; | 660 if (p1 == MachineType::None()) return 1; |
660 if (p2 == MachineType::None()) return 2; | 661 if (p2 == MachineType::None()) return 2; |
661 if (p3 == MachineType::None()) return 3; | 662 if (p3 == MachineType::None()) return 3; |
662 return 4; | 663 return 4; |
663 } | 664 } |
664 }; | 665 }; |
665 | 666 |
666 } // namespace | 667 } // namespace |
667 | 668 |
668 #endif | 669 #endif |
OLD | NEW |