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/messages.h" | 10 #include "src/messages.h" |
(...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1356 | 1356 |
1357 RUNTIME_FUNCTION(Runtime_ObjectEquals) { | 1357 RUNTIME_FUNCTION(Runtime_ObjectEquals) { |
1358 SealHandleScope shs(isolate); | 1358 SealHandleScope shs(isolate); |
1359 DCHECK(args.length() == 2); | 1359 DCHECK(args.length() == 2); |
1360 CONVERT_ARG_CHECKED(Object, obj1, 0); | 1360 CONVERT_ARG_CHECKED(Object, obj1, 0); |
1361 CONVERT_ARG_CHECKED(Object, obj2, 1); | 1361 CONVERT_ARG_CHECKED(Object, obj2, 1); |
1362 return isolate->heap()->ToBoolean(obj1 == obj2); | 1362 return isolate->heap()->ToBoolean(obj1 == obj2); |
1363 } | 1363 } |
1364 | 1364 |
1365 | 1365 |
1366 RUNTIME_FUNCTION(Runtime_IsObject) { | |
1367 SealHandleScope shs(isolate); | |
1368 DCHECK(args.length() == 1); | |
1369 CONVERT_ARG_CHECKED(Object, obj, 0); | |
1370 if (!obj->IsHeapObject()) return isolate->heap()->false_value(); | |
1371 if (obj->IsNull()) return isolate->heap()->true_value(); | |
1372 if (obj->IsUndetectableObject()) return isolate->heap()->false_value(); | |
1373 Map* map = HeapObject::cast(obj)->map(); | |
1374 bool is_non_callable_spec_object = | |
1375 map->instance_type() >= FIRST_NONCALLABLE_SPEC_OBJECT_TYPE && | |
1376 map->instance_type() <= LAST_NONCALLABLE_SPEC_OBJECT_TYPE; | |
1377 return isolate->heap()->ToBoolean(is_non_callable_spec_object); | |
1378 } | |
1379 | |
1380 | |
1381 RUNTIME_FUNCTION(Runtime_IsSpecObject) { | 1366 RUNTIME_FUNCTION(Runtime_IsSpecObject) { |
1382 SealHandleScope shs(isolate); | 1367 SealHandleScope shs(isolate); |
1383 DCHECK(args.length() == 1); | 1368 DCHECK(args.length() == 1); |
1384 CONVERT_ARG_CHECKED(Object, obj, 0); | 1369 CONVERT_ARG_CHECKED(Object, obj, 0); |
1385 return isolate->heap()->ToBoolean(obj->IsSpecObject()); | 1370 return isolate->heap()->ToBoolean(obj->IsSpecObject()); |
1386 } | 1371 } |
1387 | 1372 |
1388 | 1373 |
1389 RUNTIME_FUNCTION(Runtime_IsStrong) { | 1374 RUNTIME_FUNCTION(Runtime_IsStrong) { |
1390 SealHandleScope shs(isolate); | 1375 SealHandleScope shs(isolate); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1507 SealHandleScope scope(isolate); | 1492 SealHandleScope scope(isolate); |
1508 DCHECK_EQ(2, args.length()); | 1493 DCHECK_EQ(2, args.length()); |
1509 CONVERT_ARG_CHECKED(Object, object, 0); | 1494 CONVERT_ARG_CHECKED(Object, object, 0); |
1510 CONVERT_ARG_CHECKED(Object, prototype, 1); | 1495 CONVERT_ARG_CHECKED(Object, prototype, 1); |
1511 return isolate->heap()->ToBoolean( | 1496 return isolate->heap()->ToBoolean( |
1512 object->HasInPrototypeChain(isolate, prototype)); | 1497 object->HasInPrototypeChain(isolate, prototype)); |
1513 } | 1498 } |
1514 | 1499 |
1515 } // namespace internal | 1500 } // namespace internal |
1516 } // namespace v8 | 1501 } // namespace v8 |
OLD | NEW |