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/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 185 |
186 RUNTIME_FUNCTION(Runtime_FunctionIsAPIFunction) { | 186 RUNTIME_FUNCTION(Runtime_FunctionIsAPIFunction) { |
187 SealHandleScope shs(isolate); | 187 SealHandleScope shs(isolate); |
188 DCHECK(args.length() == 1); | 188 DCHECK(args.length() == 1); |
189 | 189 |
190 CONVERT_ARG_CHECKED(JSFunction, f, 0); | 190 CONVERT_ARG_CHECKED(JSFunction, f, 0); |
191 return isolate->heap()->ToBoolean(f->shared()->IsApiFunction()); | 191 return isolate->heap()->ToBoolean(f->shared()->IsApiFunction()); |
192 } | 192 } |
193 | 193 |
194 | 194 |
195 RUNTIME_FUNCTION(Runtime_FunctionIsBuiltin) { | 195 RUNTIME_FUNCTION(Runtime_FunctionHidesSource) { |
196 SealHandleScope shs(isolate); | 196 SealHandleScope shs(isolate); |
197 DCHECK(args.length() == 1); | 197 DCHECK(args.length() == 1); |
| 198 CONVERT_ARG_CHECKED(JSFunction, f, 0); |
198 | 199 |
199 CONVERT_ARG_CHECKED(JSFunction, f, 0); | 200 SharedFunctionInfo* shared = f->shared(); |
200 return isolate->heap()->ToBoolean(f->IsBuiltin()); | 201 bool hide_source = !shared->script()->IsScript() || |
| 202 Script::cast(shared->script())->hide_source(); |
| 203 return isolate->heap()->ToBoolean(hide_source); |
201 } | 204 } |
202 | 205 |
203 | 206 |
204 RUNTIME_FUNCTION(Runtime_SetCode) { | 207 RUNTIME_FUNCTION(Runtime_SetCode) { |
205 HandleScope scope(isolate); | 208 HandleScope scope(isolate); |
206 DCHECK(args.length() == 2); | 209 DCHECK(args.length() == 2); |
207 | 210 |
208 CONVERT_ARG_HANDLE_CHECKED(JSFunction, target, 0); | 211 CONVERT_ARG_HANDLE_CHECKED(JSFunction, target, 0); |
209 CONVERT_ARG_HANDLE_CHECKED(JSFunction, source, 1); | 212 CONVERT_ARG_HANDLE_CHECKED(JSFunction, source, 1); |
210 | 213 |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 | 648 |
646 | 649 |
647 RUNTIME_FUNCTION(Runtime_ThrowStrongModeTooFewArguments) { | 650 RUNTIME_FUNCTION(Runtime_ThrowStrongModeTooFewArguments) { |
648 HandleScope scope(isolate); | 651 HandleScope scope(isolate); |
649 DCHECK(args.length() == 0); | 652 DCHECK(args.length() == 0); |
650 THROW_NEW_ERROR_RETURN_FAILURE(isolate, | 653 THROW_NEW_ERROR_RETURN_FAILURE(isolate, |
651 NewTypeError(MessageTemplate::kStrongArity)); | 654 NewTypeError(MessageTemplate::kStrongArity)); |
652 } | 655 } |
653 } // namespace internal | 656 } // namespace internal |
654 } // namespace v8 | 657 } // namespace v8 |
OLD | NEW |