OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/frames-inl.h" | 10 #include "src/frames-inl.h" |
11 #include "src/isolate-inl.h" | 11 #include "src/isolate-inl.h" |
12 #include "src/messages.h" | 12 #include "src/messages.h" |
13 #include "src/profiler/cpu-profiler.h" | 13 #include "src/profiler/cpu-profiler.h" |
| 14 #include "src/wasm/wasm-module.h" |
14 | 15 |
15 namespace v8 { | 16 namespace v8 { |
16 namespace internal { | 17 namespace internal { |
17 | 18 |
18 RUNTIME_FUNCTION(Runtime_FunctionGetName) { | 19 RUNTIME_FUNCTION(Runtime_FunctionGetName) { |
19 SealHandleScope shs(isolate); | 20 SealHandleScope shs(isolate); |
20 DCHECK(args.length() == 1); | 21 DCHECK(args.length() == 1); |
21 | 22 |
22 CONVERT_ARG_CHECKED(JSFunction, f, 0); | 23 CONVERT_ARG_CHECKED(JSFunction, f, 0); |
23 return f->shared()->name(); | 24 return f->shared()->name(); |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 RUNTIME_FUNCTION(Runtime_FunctionToString) { | 296 RUNTIME_FUNCTION(Runtime_FunctionToString) { |
296 HandleScope scope(isolate); | 297 HandleScope scope(isolate); |
297 DCHECK_EQ(1, args.length()); | 298 DCHECK_EQ(1, args.length()); |
298 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, function, 0); | 299 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, function, 0); |
299 return function->IsJSBoundFunction() | 300 return function->IsJSBoundFunction() |
300 ? *JSBoundFunction::ToString( | 301 ? *JSBoundFunction::ToString( |
301 Handle<JSBoundFunction>::cast(function)) | 302 Handle<JSBoundFunction>::cast(function)) |
302 : *JSFunction::ToString(Handle<JSFunction>::cast(function)); | 303 : *JSFunction::ToString(Handle<JSFunction>::cast(function)); |
303 } | 304 } |
304 | 305 |
| 306 RUNTIME_FUNCTION(Runtime_WasmGetFunctionName) { |
| 307 HandleScope scope(isolate); |
| 308 DCHECK_EQ(2, args.length()); |
| 309 |
| 310 CONVERT_ARG_HANDLE_CHECKED(JSObject, wasm, 0); |
| 311 CONVERT_SMI_ARG_CHECKED(func_index, 1); |
| 312 |
| 313 return *wasm::GetWasmFunctionName(wasm, func_index); |
| 314 } |
| 315 |
305 } // namespace internal | 316 } // namespace internal |
306 } // namespace v8 | 317 } // namespace v8 |
OLD | NEW |