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/v8.h" | 5 #include "src/v8.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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 RUNTIME_FUNCTION(Runtime_FunctionBindArguments) { | 400 RUNTIME_FUNCTION(Runtime_FunctionBindArguments) { |
401 HandleScope scope(isolate); | 401 HandleScope scope(isolate); |
402 DCHECK(args.length() == 4); | 402 DCHECK(args.length() == 4); |
403 CONVERT_ARG_HANDLE_CHECKED(JSFunction, bound_function, 0); | 403 CONVERT_ARG_HANDLE_CHECKED(JSFunction, bound_function, 0); |
404 CONVERT_ARG_HANDLE_CHECKED(Object, bindee, 1); | 404 CONVERT_ARG_HANDLE_CHECKED(Object, bindee, 1); |
405 CONVERT_ARG_HANDLE_CHECKED(Object, this_object, 2); | 405 CONVERT_ARG_HANDLE_CHECKED(Object, this_object, 2); |
406 CONVERT_NUMBER_ARG_HANDLE_CHECKED(new_length, 3); | 406 CONVERT_NUMBER_ARG_HANDLE_CHECKED(new_length, 3); |
407 | 407 |
408 // TODO(lrn): Create bound function in C++ code from premade shared info. | 408 // TODO(lrn): Create bound function in C++ code from premade shared info. |
409 bound_function->shared()->set_bound(true); | 409 bound_function->shared()->set_bound(true); |
| 410 bound_function->shared()->set_inferred_name(isolate->heap()->empty_string()); |
410 // Get all arguments of calling function (Function.prototype.bind). | 411 // Get all arguments of calling function (Function.prototype.bind). |
411 int argc = 0; | 412 int argc = 0; |
412 SmartArrayPointer<Handle<Object> > arguments = | 413 SmartArrayPointer<Handle<Object> > arguments = |
413 GetCallerArguments(isolate, 0, &argc); | 414 GetCallerArguments(isolate, 0, &argc); |
414 // Don't count the this-arg. | 415 // Don't count the this-arg. |
415 if (argc > 0) { | 416 if (argc > 0) { |
416 RUNTIME_ASSERT(arguments[0].is_identical_to(this_object)); | 417 RUNTIME_ASSERT(arguments[0].is_identical_to(this_object)); |
417 argc--; | 418 argc--; |
418 } else { | 419 } else { |
419 RUNTIME_ASSERT(this_object->IsUndefined()); | 420 RUNTIME_ASSERT(this_object->IsUndefined()); |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 | 626 |
626 | 627 |
627 RUNTIME_FUNCTION(Runtime_IsFunction) { | 628 RUNTIME_FUNCTION(Runtime_IsFunction) { |
628 SealHandleScope shs(isolate); | 629 SealHandleScope shs(isolate); |
629 DCHECK(args.length() == 1); | 630 DCHECK(args.length() == 1); |
630 CONVERT_ARG_CHECKED(Object, obj, 0); | 631 CONVERT_ARG_CHECKED(Object, obj, 0); |
631 return isolate->heap()->ToBoolean(obj->IsJSFunction()); | 632 return isolate->heap()->ToBoolean(obj->IsJSFunction()); |
632 } | 633 } |
633 } | 634 } |
634 } // namespace v8::internal | 635 } // namespace v8::internal |
OLD | NEW |