| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/builtins/builtins.h" | 5 #include "src/builtins/builtins.h" |
| 6 #include "src/builtins/builtins-utils.h" | 6 #include "src/builtins/builtins-utils.h" |
| 7 | 7 |
| 8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
| 9 #include "src/string-builder.h" | 9 #include "src/string-builder.h" |
| 10 | 10 |
| 11 namespace v8 { | 11 namespace v8 { |
| 12 namespace internal { | 12 namespace internal { |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 // ES6 section 19.2.1.1.1 CreateDynamicFunction | 16 // ES6 section 19.2.1.1.1 CreateDynamicFunction |
| 17 MaybeHandle<Object> CreateDynamicFunction(Isolate* isolate, | 17 MaybeHandle<Object> CreateDynamicFunction(Isolate* isolate, |
| 18 BuiltinArguments args, | 18 BuiltinArguments args, |
| 19 const char* token) { | 19 const char* token) { |
| 20 // Compute number of arguments, ignoring the receiver. | 20 // Compute number of arguments, ignoring the receiver. |
| 21 DCHECK_LE(1, args.length()); | 21 DCHECK_LE(1, args.length()); |
| 22 int const argc = args.length() - 1; | 22 int const argc = args.length() - 1; |
| 23 | 23 |
| 24 Handle<JSFunction> target = args.target<JSFunction>(); | 24 Handle<JSFunction> target = args.target(); |
| 25 Handle<JSObject> target_global_proxy(target->global_proxy(), isolate); | 25 Handle<JSObject> target_global_proxy(target->global_proxy(), isolate); |
| 26 | 26 |
| 27 if (!Builtins::AllowDynamicFunction(isolate, target, target_global_proxy)) { | 27 if (!Builtins::AllowDynamicFunction(isolate, target, target_global_proxy)) { |
| 28 isolate->CountUsage(v8::Isolate::kFunctionConstructorReturnedUndefined); | 28 isolate->CountUsage(v8::Isolate::kFunctionConstructorReturnedUndefined); |
| 29 return isolate->factory()->undefined_value(); | 29 return isolate->factory()->undefined_value(); |
| 30 } | 30 } |
| 31 | 31 |
| 32 // Build the source string. | 32 // Build the source string. |
| 33 Handle<String> source; | 33 Handle<String> source; |
| 34 { | 34 { |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 | 288 |
| 289 Node* f = assembler->Parameter(0); | 289 Node* f = assembler->Parameter(0); |
| 290 Node* v = assembler->Parameter(1); | 290 Node* v = assembler->Parameter(1); |
| 291 Node* context = assembler->Parameter(4); | 291 Node* context = assembler->Parameter(4); |
| 292 Node* result = assembler->OrdinaryHasInstance(context, f, v); | 292 Node* result = assembler->OrdinaryHasInstance(context, f, v); |
| 293 assembler->Return(result); | 293 assembler->Return(result); |
| 294 } | 294 } |
| 295 | 295 |
| 296 } // namespace internal | 296 } // namespace internal |
| 297 } // namespace v8 | 297 } // namespace v8 |
| OLD | NEW |