| OLD | NEW |
| 1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 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/wasm/wasm-code-specialization.h" | 5 #include "src/wasm/wasm-code-specialization.h" |
| 6 | 6 |
| 7 #include "src/assembler-inl.h" | 7 #include "src/assembler-inl.h" |
| 8 #include "src/objects-inl.h" | 8 #include "src/objects-inl.h" |
| 9 #include "src/source-position-table.h" | 9 #include "src/source-position-table.h" |
| 10 #include "src/wasm/decoder.h" | 10 #include "src/wasm/decoder.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 do { | 34 do { |
| 35 byte_pos = iterator.source_position().ScriptOffset(); | 35 byte_pos = iterator.source_position().ScriptOffset(); |
| 36 iterator.Advance(); | 36 iterator.Advance(); |
| 37 } while (!iterator.done() && iterator.code_offset() <= offset); | 37 } while (!iterator.done() && iterator.code_offset() <= offset); |
| 38 return byte_pos; | 38 return byte_pos; |
| 39 } | 39 } |
| 40 | 40 |
| 41 class PatchDirectCallsHelper { | 41 class PatchDirectCallsHelper { |
| 42 public: | 42 public: |
| 43 PatchDirectCallsHelper(WasmInstanceObject* instance, Code* code) | 43 PatchDirectCallsHelper(WasmInstanceObject* instance, Code* code) |
| 44 : source_pos_it(code->source_position_table()), | 44 : source_pos_it(code->SourcePositionTable()), decoder(nullptr, nullptr) { |
| 45 decoder(nullptr, nullptr) { | |
| 46 FixedArray* deopt_data = code->deoptimization_data(); | 45 FixedArray* deopt_data = code->deoptimization_data(); |
| 47 DCHECK_EQ(2, deopt_data->length()); | 46 DCHECK_EQ(2, deopt_data->length()); |
| 48 WasmCompiledModule* comp_mod = instance->compiled_module(); | 47 WasmCompiledModule* comp_mod = instance->compiled_module(); |
| 49 int func_index = Smi::cast(deopt_data->get(1))->value(); | 48 int func_index = Smi::cast(deopt_data->get(1))->value(); |
| 50 func_bytes = comp_mod->module_bytes()->GetChars() + | 49 func_bytes = comp_mod->module_bytes()->GetChars() + |
| 51 comp_mod->module()->functions[func_index].code_start_offset; | 50 comp_mod->module()->functions[func_index].code_start_offset; |
| 52 } | 51 } |
| 53 | 52 |
| 54 SourcePositionTableIterator source_pos_it; | 53 SourcePositionTableIterator source_pos_it; |
| 55 Decoder decoder; | 54 Decoder decoder; |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 new_function_table_size, icache_flush_mode); | 262 new_function_table_size, icache_flush_mode); |
| 264 changed = true; | 263 changed = true; |
| 265 break; | 264 break; |
| 266 default: | 265 default: |
| 267 UNREACHABLE(); | 266 UNREACHABLE(); |
| 268 } | 267 } |
| 269 } | 268 } |
| 270 | 269 |
| 271 return changed; | 270 return changed; |
| 272 } | 271 } |
| OLD | NEW |