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/deoptimizer.h" | 8 #include "src/deoptimizer.h" |
9 #include "src/frames-inl.h" | 9 #include "src/frames-inl.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 | 460 |
461 RUNTIME_FUNCTION(Runtime_HaveSameMap) { | 461 RUNTIME_FUNCTION(Runtime_HaveSameMap) { |
462 SealHandleScope shs(isolate); | 462 SealHandleScope shs(isolate); |
463 DCHECK(args.length() == 2); | 463 DCHECK(args.length() == 2); |
464 CONVERT_ARG_CHECKED(JSObject, obj1, 0); | 464 CONVERT_ARG_CHECKED(JSObject, obj1, 0); |
465 CONVERT_ARG_CHECKED(JSObject, obj2, 1); | 465 CONVERT_ARG_CHECKED(JSObject, obj2, 1); |
466 return isolate->heap()->ToBoolean(obj1->map() == obj2->map()); | 466 return isolate->heap()->ToBoolean(obj1->map() == obj2->map()); |
467 } | 467 } |
468 | 468 |
469 | 469 |
| 470 RUNTIME_FUNCTION(Runtime_InNewSpace) { |
| 471 SealHandleScope shs(isolate); |
| 472 DCHECK(args.length() == 1); |
| 473 CONVERT_ARG_CHECKED(Object, obj, 0); |
| 474 return isolate->heap()->ToBoolean(isolate->heap()->InNewSpace(obj)); |
| 475 } |
| 476 |
| 477 |
470 #define ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(Name) \ | 478 #define ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(Name) \ |
471 RUNTIME_FUNCTION(Runtime_Has##Name) { \ | 479 RUNTIME_FUNCTION(Runtime_Has##Name) { \ |
472 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ | 480 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ |
473 return isolate->heap()->ToBoolean(obj->Has##Name()); \ | 481 return isolate->heap()->ToBoolean(obj->Has##Name()); \ |
474 } | 482 } |
475 | 483 |
476 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiElements) | 484 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiElements) |
477 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastObjectElements) | 485 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastObjectElements) |
478 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiOrObjectElements) | 486 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiOrObjectElements) |
479 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastDoubleElements) | 487 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastDoubleElements) |
(...skipping 11 matching lines...) Expand all Loading... |
491 RUNTIME_FUNCTION(Runtime_HasFixed##Type##Elements) { \ | 499 RUNTIME_FUNCTION(Runtime_HasFixed##Type##Elements) { \ |
492 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ | 500 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ |
493 return isolate->heap()->ToBoolean(obj->HasFixed##Type##Elements()); \ | 501 return isolate->heap()->ToBoolean(obj->HasFixed##Type##Elements()); \ |
494 } | 502 } |
495 | 503 |
496 TYPED_ARRAYS(FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION) | 504 TYPED_ARRAYS(FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION) |
497 | 505 |
498 #undef FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION | 506 #undef FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION |
499 } // namespace internal | 507 } // namespace internal |
500 } // namespace v8 | 508 } // namespace v8 |
OLD | NEW |