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/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 HandleScope scope(isolate); | 595 HandleScope scope(isolate); |
596 DCHECK(args.length() == 1); | 596 DCHECK(args.length() == 1); |
597 CONVERT_ARG_HANDLE_CHECKED(Object, receiver, 0); | 597 CONVERT_ARG_HANDLE_CHECKED(Object, receiver, 0); |
598 if (receiver->IsNull() || receiver->IsUndefined()) { | 598 if (receiver->IsNull() || receiver->IsUndefined()) { |
599 return isolate->global_proxy(); | 599 return isolate->global_proxy(); |
600 } | 600 } |
601 return *Object::ToObject(isolate, receiver).ToHandleChecked(); | 601 return *Object::ToObject(isolate, receiver).ToHandleChecked(); |
602 } | 602 } |
603 | 603 |
604 | 604 |
605 RUNTIME_FUNCTION(Runtime_IsConstructCall) { | |
606 HandleScope scope(isolate); | |
607 DCHECK(args.length() == 0); | |
608 JavaScriptFrameIterator it(isolate); | |
609 List<FrameSummary> frames(FLAG_max_inlining_levels + 1); | |
610 it.frame()->Summarize(&frames); | |
611 FrameSummary& summary = frames.last(); | |
612 return isolate->heap()->ToBoolean(summary.is_constructor()); | |
613 } | |
614 | |
615 | |
616 RUNTIME_FUNCTION(Runtime_IsFunction) { | 605 RUNTIME_FUNCTION(Runtime_IsFunction) { |
617 SealHandleScope shs(isolate); | 606 SealHandleScope shs(isolate); |
618 DCHECK(args.length() == 1); | 607 DCHECK(args.length() == 1); |
619 CONVERT_ARG_CHECKED(Object, obj, 0); | 608 CONVERT_ARG_CHECKED(Object, obj, 0); |
620 return isolate->heap()->ToBoolean(obj->IsJSFunction()); | 609 return isolate->heap()->ToBoolean(obj->IsJSFunction()); |
621 } | 610 } |
622 | 611 |
623 | 612 |
624 RUNTIME_FUNCTION(Runtime_ThrowStrongModeTooFewArguments) { | 613 RUNTIME_FUNCTION(Runtime_ThrowStrongModeTooFewArguments) { |
625 HandleScope scope(isolate); | 614 HandleScope scope(isolate); |
626 DCHECK(args.length() == 0); | 615 DCHECK(args.length() == 0); |
627 THROW_NEW_ERROR_RETURN_FAILURE(isolate, | 616 THROW_NEW_ERROR_RETURN_FAILURE(isolate, |
628 NewTypeError(MessageTemplate::kStrongArity)); | 617 NewTypeError(MessageTemplate::kStrongArity)); |
629 } | 618 } |
630 | 619 |
631 } // namespace internal | 620 } // namespace internal |
632 } // namespace v8 | 621 } // namespace v8 |
OLD | NEW |