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 Handle<JSReceiver> recv; | |
767 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, recv, | |
Yang
2016/07/04 10:55:38
Can this actually throw? If it does, should we cat
jgruber
2016/07/04 12:40:19
Apparently, Object::ToObject() throws if null or u
| |
768 Object::ToObject(isolate, object)); | |
769 return *JSReceiver::GetConstructorName(recv); | |
770 } | |
761 | 771 |
762 RUNTIME_FUNCTION(Runtime_HasFastPackedElements) { | 772 RUNTIME_FUNCTION(Runtime_HasFastPackedElements) { |
763 SealHandleScope shs(isolate); | 773 SealHandleScope shs(isolate); |
764 DCHECK(args.length() == 1); | 774 DCHECK(args.length() == 1); |
765 CONVERT_ARG_CHECKED(HeapObject, obj, 0); | 775 CONVERT_ARG_CHECKED(HeapObject, obj, 0); |
766 return isolate->heap()->ToBoolean( | 776 return isolate->heap()->ToBoolean( |
767 IsFastPackedElementsKind(obj->map()->elements_kind())); | 777 IsFastPackedElementsKind(obj->map()->elements_kind())); |
768 } | 778 } |
769 | 779 |
770 | 780 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
996 isolate, o, key, &success, LookupIterator::OWN); | 1006 isolate, o, key, &success, LookupIterator::OWN); |
997 if (!success) return isolate->heap()->exception(); | 1007 if (!success) return isolate->heap()->exception(); |
998 MAYBE_RETURN( | 1008 MAYBE_RETURN( |
999 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR), | 1009 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR), |
1000 isolate->heap()->exception()); | 1010 isolate->heap()->exception()); |
1001 return *value; | 1011 return *value; |
1002 } | 1012 } |
1003 | 1013 |
1004 } // namespace internal | 1014 } // namespace internal |
1005 } // namespace v8 | 1015 } // namespace v8 |
OLD | NEW |