Index: src/compiler/wasm-compiler.cc |
diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc |
index 3e4a2a77864e7e8431159a3ea53067b1e8249689..15dab06f6958aa071e642591be68f85d8b0e5265 100644 |
--- a/src/compiler/wasm-compiler.cc |
+++ b/src/compiler/wasm-compiler.cc |
@@ -3051,13 +3051,16 @@ class WasmCompilationUnit { |
isolate_->factory()->NewFixedArray(2, TENURED); |
if (!module_env_->instance->js_object.is_null()) { |
deopt_data->set(0, *module_env_->instance->js_object); |
- deopt_data->set(1, Smi::FromInt(function_->func_index)); |
- } else if (info_.GetDebugName().get() != nullptr) { |
- MaybeHandle<String> maybe_name = isolate_->factory()->NewStringFromUtf8( |
- CStrVector(info_.GetDebugName().get())); |
+ } else { |
+ base::SmartArrayPointer<char> debug_name = info_.GetDebugName(); |
+ MaybeHandle<String> maybe_name; |
+ if (debug_name.get() != nullptr) |
+ maybe_name = isolate_->factory()->NewStringFromUtf8( |
Yang
2016/05/03 18:59:07
Can we have brackets around if-body here and below
Clemens Hammacher
2016/05/04 09:06:19
It turned out the first if is even redundant, so I
|
+ CStrVector(debug_name.get())); |
if (!maybe_name.is_null()) |
deopt_data->set(0, *maybe_name.ToHandleChecked()); |
} |
+ deopt_data->set(1, Smi::FromInt(function_->func_index)); |
deopt_data->set_length(2); |
code->set_deoptimization_data(*deopt_data); |