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/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 RUNTIME_FUNCTION(Runtime_FunctionGetSourceCode) { | 98 RUNTIME_FUNCTION(Runtime_FunctionGetSourceCode) { |
99 HandleScope scope(isolate); | 99 HandleScope scope(isolate); |
100 DCHECK(args.length() == 1); | 100 DCHECK(args.length() == 1); |
101 | 101 |
102 CONVERT_ARG_HANDLE_CHECKED(JSFunction, f, 0); | 102 CONVERT_ARG_HANDLE_CHECKED(JSFunction, f, 0); |
103 Handle<SharedFunctionInfo> shared(f->shared()); | 103 Handle<SharedFunctionInfo> shared(f->shared()); |
104 return *shared->GetSourceCode(); | 104 return *shared->GetSourceCode(); |
105 } | 105 } |
106 | 106 |
107 | 107 |
| 108 RUNTIME_FUNCTION(Runtime_FunctionIsAsync) { |
| 109 SealHandleScope shs(isolate); |
| 110 DCHECK(args.length() == 1); |
| 111 CONVERT_ARG_CHECKED(JSFunction, f, 0); |
| 112 return isolate->heap()->ToBoolean(f->shared()->is_async()); |
| 113 } |
| 114 |
| 115 |
108 RUNTIME_FUNCTION(Runtime_FunctionGetScriptSourcePosition) { | 116 RUNTIME_FUNCTION(Runtime_FunctionGetScriptSourcePosition) { |
109 SealHandleScope shs(isolate); | 117 SealHandleScope shs(isolate); |
110 DCHECK(args.length() == 1); | 118 DCHECK(args.length() == 1); |
111 | 119 |
112 CONVERT_ARG_CHECKED(JSFunction, fun, 0); | 120 CONVERT_ARG_CHECKED(JSFunction, fun, 0); |
113 int pos = fun->shared()->start_position(); | 121 int pos = fun->shared()->start_position(); |
114 return Smi::FromInt(pos); | 122 return Smi::FromInt(pos); |
115 } | 123 } |
116 | 124 |
117 | 125 |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 | 606 |
599 | 607 |
600 RUNTIME_FUNCTION(Runtime_ThrowStrongModeTooFewArguments) { | 608 RUNTIME_FUNCTION(Runtime_ThrowStrongModeTooFewArguments) { |
601 HandleScope scope(isolate); | 609 HandleScope scope(isolate); |
602 DCHECK(args.length() == 0); | 610 DCHECK(args.length() == 0); |
603 THROW_NEW_ERROR_RETURN_FAILURE(isolate, | 611 THROW_NEW_ERROR_RETURN_FAILURE(isolate, |
604 NewTypeError(MessageTemplate::kStrongArity)); | 612 NewTypeError(MessageTemplate::kStrongArity)); |
605 } | 613 } |
606 } // namespace internal | 614 } // namespace internal |
607 } // namespace v8 | 615 } // namespace v8 |
OLD | NEW |