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/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1579 } | 1579 } |
1580 // If {object} is not a receiver, return false. | 1580 // If {object} is not a receiver, return false. |
1581 if (!object->IsJSReceiver()) { | 1581 if (!object->IsJSReceiver()) { |
1582 return isolate->heap()->false_value(); | 1582 return isolate->heap()->false_value(); |
1583 } | 1583 } |
1584 // Check if {callable} is bound, if so, get [[BoundFunction]] from it and use | 1584 // Check if {callable} is bound, if so, get [[BoundFunction]] from it and use |
1585 // that instead of {callable}. | 1585 // that instead of {callable}. |
1586 if (callable->IsJSFunction()) { | 1586 if (callable->IsJSFunction()) { |
1587 Handle<JSFunction> function = Handle<JSFunction>::cast(callable); | 1587 Handle<JSFunction> function = Handle<JSFunction>::cast(callable); |
1588 if (function->shared()->bound()) { | 1588 if (function->shared()->bound()) { |
1589 Handle<FixedArray> bindings(function->function_bindings(), isolate); | 1589 Handle<BindingsArray> bindings(function->function_bindings(), isolate); |
1590 callable = | 1590 callable = handle(bindings->bound_function(), isolate); |
1591 handle(bindings->get(JSFunction::kBoundFunctionIndex), isolate); | |
1592 } | 1591 } |
1593 } | 1592 } |
1594 DCHECK(callable->IsCallable()); | 1593 DCHECK(callable->IsCallable()); |
1595 // Get the "prototype" of {callable}; raise an error if it's not a receiver. | 1594 // Get the "prototype" of {callable}; raise an error if it's not a receiver. |
1596 Handle<Object> prototype; | 1595 Handle<Object> prototype; |
1597 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 1596 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
1598 isolate, prototype, | 1597 isolate, prototype, |
1599 Object::GetProperty(callable, isolate->factory()->prototype_string())); | 1598 Object::GetProperty(callable, isolate->factory()->prototype_string())); |
1600 if (!prototype->IsJSReceiver()) { | 1599 if (!prototype->IsJSReceiver()) { |
1601 THROW_NEW_ERROR_RETURN_FAILURE( | 1600 THROW_NEW_ERROR_RETURN_FAILURE( |
(...skipping 29 matching lines...) Expand all Loading... |
1631 RUNTIME_FUNCTION(Runtime_IsAccessCheckNeeded) { | 1630 RUNTIME_FUNCTION(Runtime_IsAccessCheckNeeded) { |
1632 SealHandleScope shs(isolate); | 1631 SealHandleScope shs(isolate); |
1633 DCHECK_EQ(1, args.length()); | 1632 DCHECK_EQ(1, args.length()); |
1634 CONVERT_ARG_CHECKED(Object, object, 0); | 1633 CONVERT_ARG_CHECKED(Object, object, 0); |
1635 return isolate->heap()->ToBoolean(object->IsAccessCheckNeeded()); | 1634 return isolate->heap()->ToBoolean(object->IsAccessCheckNeeded()); |
1636 } | 1635 } |
1637 | 1636 |
1638 | 1637 |
1639 } // namespace internal | 1638 } // namespace internal |
1640 } // namespace v8 | 1639 } // namespace v8 |
OLD | NEW |