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 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 | 829 |
830 | 830 |
831 RUNTIME_FUNCTION(Runtime_IsJSReceiver) { | 831 RUNTIME_FUNCTION(Runtime_IsJSReceiver) { |
832 SealHandleScope shs(isolate); | 832 SealHandleScope shs(isolate); |
833 DCHECK(args.length() == 1); | 833 DCHECK(args.length() == 1); |
834 CONVERT_ARG_CHECKED(Object, obj, 0); | 834 CONVERT_ARG_CHECKED(Object, obj, 0); |
835 return isolate->heap()->ToBoolean(obj->IsJSReceiver()); | 835 return isolate->heap()->ToBoolean(obj->IsJSReceiver()); |
836 } | 836 } |
837 | 837 |
838 | 838 |
839 RUNTIME_FUNCTION(Runtime_IsStrong) { | |
840 SealHandleScope shs(isolate); | |
841 DCHECK(args.length() == 1); | |
842 CONVERT_ARG_CHECKED(Object, obj, 0); | |
843 return isolate->heap()->ToBoolean(obj->IsJSReceiver() && | |
844 JSReceiver::cast(obj)->map()->is_strong()); | |
845 } | |
846 | |
847 | |
848 RUNTIME_FUNCTION(Runtime_ClassOf) { | 839 RUNTIME_FUNCTION(Runtime_ClassOf) { |
849 SealHandleScope shs(isolate); | 840 SealHandleScope shs(isolate); |
850 DCHECK(args.length() == 1); | 841 DCHECK(args.length() == 1); |
851 CONVERT_ARG_CHECKED(Object, obj, 0); | 842 CONVERT_ARG_CHECKED(Object, obj, 0); |
852 if (!obj->IsJSReceiver()) return isolate->heap()->null_value(); | 843 if (!obj->IsJSReceiver()) return isolate->heap()->null_value(); |
853 return JSReceiver::cast(obj)->class_name(); | 844 return JSReceiver::cast(obj)->class_name(); |
854 } | 845 } |
855 | 846 |
856 | 847 |
857 RUNTIME_FUNCTION(Runtime_DefineGetterPropertyUnchecked) { | 848 RUNTIME_FUNCTION(Runtime_DefineGetterPropertyUnchecked) { |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 DCHECK(args.length() == 2); | 1122 DCHECK(args.length() == 2); |
1132 CONVERT_ARG_HANDLE_CHECKED(Object, o, 0); | 1123 CONVERT_ARG_HANDLE_CHECKED(Object, o, 0); |
1133 CONVERT_ARG_HANDLE_CHECKED(Object, properties, 1); | 1124 CONVERT_ARG_HANDLE_CHECKED(Object, properties, 1); |
1134 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 1125 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
1135 isolate, o, JSReceiver::DefineProperties(isolate, o, properties)); | 1126 isolate, o, JSReceiver::DefineProperties(isolate, o, properties)); |
1136 return *o; | 1127 return *o; |
1137 } | 1128 } |
1138 | 1129 |
1139 } // namespace internal | 1130 } // namespace internal |
1140 } // namespace v8 | 1131 } // namespace v8 |
OLD | NEW |