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 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1055 // GetElement can trigger a getter which can cause allocation. | 1055 // GetElement can trigger a getter which can cause allocation. |
1056 // This was not always the case. This ASSERT is here to catch | 1056 // This was not always the case. This ASSERT is here to catch |
1057 // leftover incorrect uses. | 1057 // leftover incorrect uses. |
1058 ASSERT(AllowHeapAllocation::IsAllowed()); | 1058 ASSERT(AllowHeapAllocation::IsAllowed()); |
1059 CALL_HEAP_FUNCTION(isolate, | 1059 CALL_HEAP_FUNCTION(isolate, |
1060 object->GetElementWithReceiver(isolate, *object, index), | 1060 object->GetElementWithReceiver(isolate, *object, index), |
1061 Object); | 1061 Object); |
1062 } | 1062 } |
1063 | 1063 |
1064 | 1064 |
1065 Object* Object::GetElementNoExceptionThrown(Isolate* isolate, uint32_t index) { | 1065 static Handle<Object> GetElementNoExceptionThrownHelper(Isolate* isolate, |
1066 MaybeObject* maybe = GetElementWithReceiver(isolate, this, index); | 1066 Handle<Object> object, |
1067 ASSERT(!maybe->IsFailure()); | 1067 uint32_t index) { |
1068 Object* result = NULL; // Initialization to please compiler. | 1068 CALL_HEAP_FUNCTION(isolate, |
1069 maybe->ToObject(&result); | 1069 object->GetElementWithReceiver(isolate, *object, index), |
| 1070 Object); |
| 1071 } |
| 1072 |
| 1073 Handle<Object> Object::GetElementNoExceptionThrown(Isolate* isolate, |
| 1074 Handle<Object> object, |
| 1075 uint32_t index) { |
| 1076 Handle<Object> result = |
| 1077 GetElementNoExceptionThrownHelper(isolate, object, index); |
| 1078 CHECK_NOT_EMPTY_HANDLE(isolate, result); |
1070 return result; | 1079 return result; |
1071 } | 1080 } |
1072 | 1081 |
1073 | 1082 |
1074 MaybeObject* Object::GetProperty(Name* key) { | 1083 MaybeObject* Object::GetProperty(Name* key) { |
1075 PropertyAttributes attributes; | 1084 PropertyAttributes attributes; |
1076 return GetPropertyWithReceiver(this, key, &attributes); | 1085 return GetPropertyWithReceiver(this, key, &attributes); |
1077 } | 1086 } |
1078 | 1087 |
1079 | 1088 |
(...skipping 5705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6785 #undef READ_UINT32_FIELD | 6794 #undef READ_UINT32_FIELD |
6786 #undef WRITE_UINT32_FIELD | 6795 #undef WRITE_UINT32_FIELD |
6787 #undef READ_SHORT_FIELD | 6796 #undef READ_SHORT_FIELD |
6788 #undef WRITE_SHORT_FIELD | 6797 #undef WRITE_SHORT_FIELD |
6789 #undef READ_BYTE_FIELD | 6798 #undef READ_BYTE_FIELD |
6790 #undef WRITE_BYTE_FIELD | 6799 #undef WRITE_BYTE_FIELD |
6791 | 6800 |
6792 } } // namespace v8::internal | 6801 } } // namespace v8::internal |
6793 | 6802 |
6794 #endif // V8_OBJECTS_INL_H_ | 6803 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |