Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1137)

Side by Side Diff: src/runtime/runtime-function.cc

Issue 2366863002: Mirror API for IsAsyncFunction (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/mirror-function-async.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/mirror-function-async.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698