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" |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 RUNTIME_FUNCTION(Runtime_FunctionToString) { | 285 RUNTIME_FUNCTION(Runtime_FunctionToString) { |
286 HandleScope scope(isolate); | 286 HandleScope scope(isolate); |
287 DCHECK_EQ(1, args.length()); | 287 DCHECK_EQ(1, args.length()); |
288 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, function, 0); | 288 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, function, 0); |
289 return function->IsJSBoundFunction() | 289 return function->IsJSBoundFunction() |
290 ? *JSBoundFunction::ToString( | 290 ? *JSBoundFunction::ToString( |
291 Handle<JSBoundFunction>::cast(function)) | 291 Handle<JSBoundFunction>::cast(function)) |
292 : *JSFunction::ToString(Handle<JSFunction>::cast(function)); | 292 : *JSFunction::ToString(Handle<JSFunction>::cast(function)); |
293 } | 293 } |
294 | 294 |
| 295 RUNTIME_FUNCTION(Runtime_FunctionIsAsyncFunction) { |
| 296 SealHandleScope shs(isolate); |
| 297 DCHECK_EQ(1, args.length()); |
| 298 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, function, 0); |
| 299 bool is_async = false; |
| 300 if (function->IsFunction()) { |
| 301 is_async = Handle<JSFunction>::cast(function)->shared()->is_async(); |
| 302 } |
| 303 return isolate->heap()->ToBoolean(is_async); |
| 304 } |
| 305 |
295 } // namespace internal | 306 } // namespace internal |
296 } // namespace v8 | 307 } // namespace v8 |
OLD | NEW |