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 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
937 | 937 |
938 RUNTIME_FUNCTION(Runtime_ValueOf) { | 938 RUNTIME_FUNCTION(Runtime_ValueOf) { |
939 SealHandleScope shs(isolate); | 939 SealHandleScope shs(isolate); |
940 DCHECK(args.length() == 1); | 940 DCHECK(args.length() == 1); |
941 CONVERT_ARG_CHECKED(Object, obj, 0); | 941 CONVERT_ARG_CHECKED(Object, obj, 0); |
942 if (!obj->IsJSValue()) return obj; | 942 if (!obj->IsJSValue()) return obj; |
943 return JSValue::cast(obj)->value(); | 943 return JSValue::cast(obj)->value(); |
944 } | 944 } |
945 | 945 |
946 | 946 |
947 RUNTIME_FUNCTION(Runtime_SetValueOf) { | |
948 SealHandleScope shs(isolate); | |
949 DCHECK(args.length() == 2); | |
950 CONVERT_ARG_CHECKED(Object, obj, 0); | |
951 CONVERT_ARG_CHECKED(Object, value, 1); | |
952 if (!obj->IsJSValue()) return value; | |
953 JSValue::cast(obj)->set_value(value); | |
954 return value; | |
955 } | |
956 | |
957 | |
958 RUNTIME_FUNCTION(Runtime_JSValueGetValue) { | |
959 SealHandleScope shs(isolate); | |
960 DCHECK(args.length() == 1); | |
961 CONVERT_ARG_CHECKED(JSValue, obj, 0); | |
962 return JSValue::cast(obj)->value(); | |
963 } | |
964 | |
965 | |
966 RUNTIME_FUNCTION(Runtime_IsJSReceiver) { | 947 RUNTIME_FUNCTION(Runtime_IsJSReceiver) { |
967 SealHandleScope shs(isolate); | 948 SealHandleScope shs(isolate); |
968 DCHECK(args.length() == 1); | 949 DCHECK(args.length() == 1); |
969 CONVERT_ARG_CHECKED(Object, obj, 0); | 950 CONVERT_ARG_CHECKED(Object, obj, 0); |
970 return isolate->heap()->ToBoolean(obj->IsJSReceiver()); | 951 return isolate->heap()->ToBoolean(obj->IsJSReceiver()); |
971 } | 952 } |
972 | 953 |
973 | 954 |
974 RUNTIME_FUNCTION(Runtime_IsStrong) { | 955 RUNTIME_FUNCTION(Runtime_IsStrong) { |
975 SealHandleScope shs(isolate); | 956 SealHandleScope shs(isolate); |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1296 DCHECK(args.length() == 2); | 1277 DCHECK(args.length() == 2); |
1297 CONVERT_ARG_HANDLE_CHECKED(Object, o, 0); | 1278 CONVERT_ARG_HANDLE_CHECKED(Object, o, 0); |
1298 CONVERT_ARG_HANDLE_CHECKED(Object, properties, 1); | 1279 CONVERT_ARG_HANDLE_CHECKED(Object, properties, 1); |
1299 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 1280 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
1300 isolate, o, JSReceiver::DefineProperties(isolate, o, properties)); | 1281 isolate, o, JSReceiver::DefineProperties(isolate, o, properties)); |
1301 return *o; | 1282 return *o; |
1302 } | 1283 } |
1303 | 1284 |
1304 } // namespace internal | 1285 } // namespace internal |
1305 } // namespace v8 | 1286 } // namespace v8 |
OLD | NEW |