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 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 | 751 |
752 // Return property without being observable by accessors or interceptors. | 752 // Return property without being observable by accessors or interceptors. |
753 RUNTIME_FUNCTION(Runtime_GetDataProperty) { | 753 RUNTIME_FUNCTION(Runtime_GetDataProperty) { |
754 HandleScope scope(isolate); | 754 HandleScope scope(isolate); |
755 DCHECK(args.length() == 2); | 755 DCHECK(args.length() == 2); |
756 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, object, 0); | 756 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, object, 0); |
757 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); | 757 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); |
758 return *JSReceiver::GetDataProperty(object, name); | 758 return *JSReceiver::GetDataProperty(object, name); |
759 } | 759 } |
760 | 760 |
| 761 RUNTIME_FUNCTION(Runtime_GetConstructorName) { |
| 762 HandleScope scope(isolate); |
| 763 DCHECK(args.length() == 1); |
| 764 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
| 765 |
| 766 CHECK(!object->IsUndefined(isolate) && !object->IsNull(isolate)); |
| 767 Handle<JSReceiver> recv = Object::ToObject(isolate, object).ToHandleChecked(); |
| 768 return *JSReceiver::GetConstructorName(recv); |
| 769 } |
761 | 770 |
762 RUNTIME_FUNCTION(Runtime_HasFastPackedElements) { | 771 RUNTIME_FUNCTION(Runtime_HasFastPackedElements) { |
763 SealHandleScope shs(isolate); | 772 SealHandleScope shs(isolate); |
764 DCHECK(args.length() == 1); | 773 DCHECK(args.length() == 1); |
765 CONVERT_ARG_CHECKED(HeapObject, obj, 0); | 774 CONVERT_ARG_CHECKED(HeapObject, obj, 0); |
766 return isolate->heap()->ToBoolean( | 775 return isolate->heap()->ToBoolean( |
767 IsFastPackedElementsKind(obj->map()->elements_kind())); | 776 IsFastPackedElementsKind(obj->map()->elements_kind())); |
768 } | 777 } |
769 | 778 |
770 | 779 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 isolate, o, key, &success, LookupIterator::OWN); | 1005 isolate, o, key, &success, LookupIterator::OWN); |
997 if (!success) return isolate->heap()->exception(); | 1006 if (!success) return isolate->heap()->exception(); |
998 MAYBE_RETURN( | 1007 MAYBE_RETURN( |
999 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR), | 1008 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR), |
1000 isolate->heap()->exception()); | 1009 isolate->heap()->exception()); |
1001 return *value; | 1010 return *value; |
1002 } | 1011 } |
1003 | 1012 |
1004 } // namespace internal | 1013 } // namespace internal |
1005 } // namespace v8 | 1014 } // namespace v8 |
OLD | NEW |