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 <memory> | 5 #include <memory> |
6 | 6 |
7 #include "src/assembler-inl.h" | 7 #include "src/assembler-inl.h" |
8 #include "src/base/adapters.h" | 8 #include "src/base/adapters.h" |
9 #include "src/base/atomic-utils.h" | 9 #include "src/base/atomic-utils.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 3219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3230 bool is_js_to_wasm = caller->kind() == Code::JS_TO_WASM_FUNCTION; | 3230 bool is_js_to_wasm = caller->kind() == Code::JS_TO_WASM_FUNCTION; |
3231 Handle<WasmCompiledModule> compiled_module(instance->compiled_module(), | 3231 Handle<WasmCompiledModule> compiled_module(instance->compiled_module(), |
3232 isolate); | 3232 isolate); |
3233 | 3233 |
3234 if (is_js_to_wasm) { | 3234 if (is_js_to_wasm) { |
3235 non_compiled_functions.push_back({0, exported_func_index}); | 3235 non_compiled_functions.push_back({0, exported_func_index}); |
3236 } else if (patch_caller) { | 3236 } else if (patch_caller) { |
3237 DisallowHeapAllocation no_gc; | 3237 DisallowHeapAllocation no_gc; |
3238 SeqOneByteString* module_bytes = compiled_module->module_bytes(); | 3238 SeqOneByteString* module_bytes = compiled_module->module_bytes(); |
3239 SourcePositionTableIterator source_pos_iterator( | 3239 SourcePositionTableIterator source_pos_iterator( |
3240 caller->source_position_table()); | 3240 caller->SourcePositionTable()); |
3241 DCHECK_EQ(2, caller->deoptimization_data()->length()); | 3241 DCHECK_EQ(2, caller->deoptimization_data()->length()); |
3242 int caller_func_index = | 3242 int caller_func_index = |
3243 Smi::cast(caller->deoptimization_data()->get(1))->value(); | 3243 Smi::cast(caller->deoptimization_data()->get(1))->value(); |
3244 const byte* func_bytes = | 3244 const byte* func_bytes = |
3245 module_bytes->GetChars() + compiled_module->module() | 3245 module_bytes->GetChars() + compiled_module->module() |
3246 ->functions[caller_func_index] | 3246 ->functions[caller_func_index] |
3247 .code_start_offset; | 3247 .code_start_offset; |
3248 for (RelocIterator it(*caller, RelocInfo::kCodeTargetMask); !it.done(); | 3248 for (RelocIterator it(*caller, RelocInfo::kCodeTargetMask); !it.done(); |
3249 it.next()) { | 3249 it.next()) { |
3250 Code* callee = | 3250 Code* callee = |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3306 callee_compiled->instruction_start()); | 3306 callee_compiled->instruction_start()); |
3307 } | 3307 } |
3308 DCHECK_EQ(non_compiled_functions.size(), idx); | 3308 DCHECK_EQ(non_compiled_functions.size(), idx); |
3309 } | 3309 } |
3310 | 3310 |
3311 Code* ret = | 3311 Code* ret = |
3312 Code::cast(compiled_module->code_table()->get(func_to_return_idx)); | 3312 Code::cast(compiled_module->code_table()->get(func_to_return_idx)); |
3313 DCHECK_EQ(Code::WASM_FUNCTION, ret->kind()); | 3313 DCHECK_EQ(Code::WASM_FUNCTION, ret->kind()); |
3314 return handle(ret, isolate); | 3314 return handle(ret, isolate); |
3315 } | 3315 } |
OLD | NEW |