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/compiler/wasm-compiler.h" | 5 #include "src/compiler/wasm-compiler.h" |
6 | 6 |
7 #include "src/isolate-inl.h" | 7 #include "src/isolate-inl.h" |
8 | 8 |
9 #include "src/base/platform/elapsed-timer.h" | 9 #include "src/base/platform/elapsed-timer.h" |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
(...skipping 2996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3007 compile_timer.Start(); | 3007 compile_timer.Start(); |
3008 } | 3008 } |
3009 Handle<Code> code = info_.code(); | 3009 Handle<Code> code = info_.code(); |
3010 DCHECK(!code.is_null()); | 3010 DCHECK(!code.is_null()); |
3011 DCHECK(code->deoptimization_data() == nullptr || | 3011 DCHECK(code->deoptimization_data() == nullptr || |
3012 code->deoptimization_data()->length() == 0); | 3012 code->deoptimization_data()->length() == 0); |
3013 Handle<FixedArray> deopt_data = | 3013 Handle<FixedArray> deopt_data = |
3014 isolate_->factory()->NewFixedArray(2, TENURED); | 3014 isolate_->factory()->NewFixedArray(2, TENURED); |
3015 if (!module_env_->instance->js_object.is_null()) { | 3015 if (!module_env_->instance->js_object.is_null()) { |
3016 deopt_data->set(0, *module_env_->instance->js_object); | 3016 deopt_data->set(0, *module_env_->instance->js_object); |
3017 deopt_data->set(1, Smi::FromInt(function_->func_index)); | |
3018 } else if (info_.GetDebugName().get() != nullptr) { | |
3019 MaybeHandle<String> maybe_name = isolate_->factory()->NewStringFromUtf8( | |
3020 CStrVector(info_.GetDebugName().get())); | |
3021 if (!maybe_name.is_null()) | |
3022 deopt_data->set(0, *maybe_name.ToHandleChecked()); | |
3023 } | 3017 } |
| 3018 deopt_data->set(1, Smi::FromInt(function_->func_index)); |
3024 deopt_data->set_length(2); | 3019 deopt_data->set_length(2); |
3025 code->set_deoptimization_data(*deopt_data); | 3020 code->set_deoptimization_data(*deopt_data); |
3026 | 3021 |
3027 RecordFunctionCompilation( | 3022 RecordFunctionCompilation( |
3028 Logger::FUNCTION_TAG, &info_, "WASM_function", function_->func_index, | 3023 Logger::FUNCTION_TAG, &info_, "WASM_function", function_->func_index, |
3029 module_env_->module->GetName(function_->name_offset, | 3024 module_env_->module->GetName(function_->name_offset, |
3030 function_->name_length)); | 3025 function_->name_length)); |
3031 | 3026 |
3032 if (FLAG_trace_wasm_decode_time) { | 3027 if (FLAG_trace_wasm_decode_time) { |
3033 double compile_ms = compile_timer.Elapsed().InMillisecondsF(); | 3028 double compile_ms = compile_timer.Elapsed().InMillisecondsF(); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3077 const wasm::WasmFunction* function) { | 3072 const wasm::WasmFunction* function) { |
3078 WasmCompilationUnit* unit = | 3073 WasmCompilationUnit* unit = |
3079 CreateWasmCompilationUnit(thrower, isolate, module_env, function, 0); | 3074 CreateWasmCompilationUnit(thrower, isolate, module_env, function, 0); |
3080 ExecuteCompilation(unit); | 3075 ExecuteCompilation(unit); |
3081 return FinishCompilation(unit); | 3076 return FinishCompilation(unit); |
3082 } | 3077 } |
3083 | 3078 |
3084 } // namespace compiler | 3079 } // namespace compiler |
3085 } // namespace internal | 3080 } // namespace internal |
3086 } // namespace v8 | 3081 } // namespace v8 |
OLD | NEW |