OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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/messages.h" | 5 #include "src/messages.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/execution.h" | 8 #include "src/execution.h" |
9 #include "src/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
10 #include "src/keys.h" | 10 #include "src/keys.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 Handle<Object> CallSite::GetFileName() { | 198 Handle<Object> CallSite::GetFileName() { |
199 if (!IsJavaScript()) return isolate_->factory()->null_value(); | 199 if (!IsJavaScript()) return isolate_->factory()->null_value(); |
200 Object* script = fun_->shared()->script(); | 200 Object* script = fun_->shared()->script(); |
201 if (!script->IsScript()) return isolate_->factory()->null_value(); | 201 if (!script->IsScript()) return isolate_->factory()->null_value(); |
202 return Handle<Object>(Script::cast(script)->name(), isolate_); | 202 return Handle<Object>(Script::cast(script)->name(), isolate_); |
203 } | 203 } |
204 | 204 |
205 | 205 |
206 Handle<Object> CallSite::GetFunctionName() { | 206 Handle<Object> CallSite::GetFunctionName() { |
207 if (IsWasm()) { | 207 if (IsWasm()) { |
208 return wasm::GetWasmFunctionNameOrNull(isolate_, wasm_obj_, | 208 MaybeHandle<String> name = |
209 wasm_func_index_); | 209 wasm::GetWasmFunctionName(wasm_obj_, wasm_func_index_); |
| 210 if (name.is_null()) return isolate_->factory()->null_value(); |
| 211 return name.ToHandleChecked(); |
210 } | 212 } |
211 Handle<String> result = JSFunction::GetName(fun_); | 213 Handle<String> result = JSFunction::GetName(fun_); |
212 if (result->length() != 0) return result; | 214 if (result->length() != 0) return result; |
213 | 215 |
214 Handle<Object> script(fun_->shared()->script(), isolate_); | 216 Handle<Object> script(fun_->shared()->script(), isolate_); |
215 if (script->IsScript() && | 217 if (script->IsScript() && |
216 Handle<Script>::cast(script)->compilation_type() == | 218 Handle<Script>::cast(script)->compilation_type() == |
217 Script::COMPILATION_TYPE_EVAL) { | 219 Script::COMPILATION_TYPE_EVAL) { |
218 return isolate_->factory()->eval_string(); | 220 return isolate_->factory()->eval_string(); |
219 } | 221 } |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 builder.AppendCharacter(*c); | 443 builder.AppendCharacter(*c); |
442 } | 444 } |
443 } | 445 } |
444 | 446 |
445 return builder.Finish(); | 447 return builder.Finish(); |
446 } | 448 } |
447 | 449 |
448 | 450 |
449 } // namespace internal | 451 } // namespace internal |
450 } // namespace v8 | 452 } // namespace v8 |
OLD | NEW |