OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 } | 1057 } |
1058 | 1058 |
1059 | 1059 |
1060 Handle<Object> Object::GetElement(Isolate* isolate, | 1060 Handle<Object> Object::GetElement(Isolate* isolate, |
1061 Handle<Object> object, | 1061 Handle<Object> object, |
1062 uint32_t index) { | 1062 uint32_t index) { |
1063 // GetElement can trigger a getter which can cause allocation. | 1063 // GetElement can trigger a getter which can cause allocation. |
1064 // This was not always the case. This ASSERT is here to catch | 1064 // This was not always the case. This ASSERT is here to catch |
1065 // leftover incorrect uses. | 1065 // leftover incorrect uses. |
1066 ASSERT(AllowHeapAllocation::IsAllowed()); | 1066 ASSERT(AllowHeapAllocation::IsAllowed()); |
1067 CALL_HEAP_FUNCTION(isolate, | 1067 return Object::GetElementWithReceiver(isolate, object, object, index); |
1068 object->GetElementWithReceiver(isolate, *object, index), | |
1069 Object); | |
1070 } | 1068 } |
1071 | 1069 |
1072 | 1070 |
1073 static Handle<Object> GetElementNoExceptionThrownHelper(Isolate* isolate, | |
1074 Handle<Object> object, | |
1075 uint32_t index) { | |
1076 CALL_HEAP_FUNCTION(isolate, | |
1077 object->GetElementWithReceiver(isolate, *object, index), | |
1078 Object); | |
1079 } | |
1080 | |
1081 Handle<Object> Object::GetElementNoExceptionThrown(Isolate* isolate, | 1071 Handle<Object> Object::GetElementNoExceptionThrown(Isolate* isolate, |
1082 Handle<Object> object, | 1072 Handle<Object> object, |
1083 uint32_t index) { | 1073 uint32_t index) { |
1084 Handle<Object> result = | 1074 Handle<Object> result = |
1085 GetElementNoExceptionThrownHelper(isolate, object, index); | 1075 Object::GetElementWithReceiver(isolate, object, object, index); |
1086 CHECK_NOT_EMPTY_HANDLE(isolate, result); | 1076 CHECK_NOT_EMPTY_HANDLE(isolate, result); |
1087 return result; | 1077 return result; |
1088 } | 1078 } |
1089 | 1079 |
1090 | 1080 |
1091 MaybeObject* Object::GetProperty(Name* key) { | 1081 MaybeObject* Object::GetProperty(Name* key) { |
1092 PropertyAttributes attributes; | 1082 PropertyAttributes attributes; |
1093 return GetPropertyWithReceiver(this, key, &attributes); | 1083 return GetPropertyWithReceiver(this, key, &attributes); |
1094 } | 1084 } |
1095 | 1085 |
(...skipping 5703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6799 #undef READ_UINT32_FIELD | 6789 #undef READ_UINT32_FIELD |
6800 #undef WRITE_UINT32_FIELD | 6790 #undef WRITE_UINT32_FIELD |
6801 #undef READ_SHORT_FIELD | 6791 #undef READ_SHORT_FIELD |
6802 #undef WRITE_SHORT_FIELD | 6792 #undef WRITE_SHORT_FIELD |
6803 #undef READ_BYTE_FIELD | 6793 #undef READ_BYTE_FIELD |
6804 #undef WRITE_BYTE_FIELD | 6794 #undef WRITE_BYTE_FIELD |
6805 | 6795 |
6806 } } // namespace v8::internal | 6796 } } // namespace v8::internal |
6807 | 6797 |
6808 #endif // V8_OBJECTS_INL_H_ | 6798 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |