Chromium Code Reviews| Index: src/runtime/runtime-function.cc |
| diff --git a/src/runtime/runtime-function.cc b/src/runtime/runtime-function.cc |
| index 608cc9548423a34543b739c6a6d85e0571200579..0476bc7080adaf53e289897a50101ea5b63bdcf1 100644 |
| --- a/src/runtime/runtime-function.cc |
| +++ b/src/runtime/runtime-function.cc |
| @@ -326,6 +326,34 @@ RUNTIME_FUNCTION(Runtime_SetNativeFlag) { |
| } |
| +RUNTIME_FUNCTION(Runtime_IsConstructor) { |
| + HandleScope handles(isolate); |
| + RUNTIME_ASSERT(args.length() == 1); |
| + |
| + CONVERT_ARG_CHECKED(Object, object, 0); |
|
Dmitry Lomov (no reviews)
2015/01/19 11:39:46
Must be CONVERT_HANDLE_ARG_CHECKED.
|
| + |
| + // TODO(caitp): implement this in a better/simpler way, allow inlining via TF |
| + if (object->IsJSFunction()) { |
| + JSFunction* func = JSFunction::cast(object); |
| + bool should_have_prototype = func->should_have_prototype(); |
| + if (func->shared()->bound()) { |
| + Handle<FixedArray> bound_args = |
| + Handle<FixedArray>(FixedArray::cast(func->function_bindings())); |
| + Handle<Object> bound_function( |
| + JSReceiver::cast(bound_args->get(JSFunction::kBoundFunctionIndex)), |
| + isolate); |
| + if (bound_function->IsJSFunction()) { |
| + JSFunction* bound = JSFunction::cast(*bound_function); |
| + DCHECK(!bound->shared()->bound()); |
| + should_have_prototype = bound->should_have_prototype(); |
| + } |
| + } |
| + return isolate->heap()->ToBoolean(should_have_prototype); |
| + } |
| + return isolate->heap()->false_value(); |
| +} |
| + |
| + |
| RUNTIME_FUNCTION(Runtime_SetInlineBuiltinFlag) { |
| SealHandleScope shs(isolate); |
| RUNTIME_ASSERT(args.length() == 1); |