OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 return Failure::Exception(); | 762 return Failure::Exception(); |
763 } | 763 } |
764 | 764 |
765 | 765 |
766 bool Object::HasSpecificClassOf(String* name) { | 766 bool Object::HasSpecificClassOf(String* name) { |
767 return this->IsJSObject() && (JSObject::cast(this)->class_name() == name); | 767 return this->IsJSObject() && (JSObject::cast(this)->class_name() == name); |
768 } | 768 } |
769 | 769 |
770 | 770 |
771 MaybeObject* Object::GetElement(uint32_t index) { | 771 MaybeObject* Object::GetElement(uint32_t index) { |
| 772 // GetElement can trigger a getter which can cause allocation. |
| 773 // This was not always the case. This ASSERT is here to catch |
| 774 // leftover incorrect uses. |
| 775 ASSERT(Heap::IsAllocationAllowed()); |
772 return GetElementWithReceiver(this, index); | 776 return GetElementWithReceiver(this, index); |
773 } | 777 } |
774 | 778 |
775 | 779 |
776 Object* Object::GetElementNoExceptionThrown(uint32_t index) { | 780 Object* Object::GetElementNoExceptionThrown(uint32_t index) { |
777 MaybeObject* maybe = GetElementWithReceiver(this, index); | 781 MaybeObject* maybe = GetElementWithReceiver(this, index); |
778 ASSERT(!maybe->IsFailure()); | 782 ASSERT(!maybe->IsFailure()); |
779 Object* result = NULL; // Initialization to please compiler. | 783 Object* result = NULL; // Initialization to please compiler. |
780 maybe->ToObject(&result); | 784 maybe->ToObject(&result); |
781 return result; | 785 return result; |
(...skipping 3149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3931 #undef WRITE_INT_FIELD | 3935 #undef WRITE_INT_FIELD |
3932 #undef READ_SHORT_FIELD | 3936 #undef READ_SHORT_FIELD |
3933 #undef WRITE_SHORT_FIELD | 3937 #undef WRITE_SHORT_FIELD |
3934 #undef READ_BYTE_FIELD | 3938 #undef READ_BYTE_FIELD |
3935 #undef WRITE_BYTE_FIELD | 3939 #undef WRITE_BYTE_FIELD |
3936 | 3940 |
3937 | 3941 |
3938 } } // namespace v8::internal | 3942 } } // namespace v8::internal |
3939 | 3943 |
3940 #endif // V8_OBJECTS_INL_H_ | 3944 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |