Chromium Code Reviews| 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 1973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1984 Foreign* p = Foreign::cast(GetCallbacksObject(descriptor_number)); | 1984 Foreign* p = Foreign::cast(GetCallbacksObject(descriptor_number)); |
| 1985 return reinterpret_cast<AccessorDescriptor*>(p->foreign_address()); | 1985 return reinterpret_cast<AccessorDescriptor*>(p->foreign_address()); |
| 1986 } | 1986 } |
| 1987 | 1987 |
| 1988 | 1988 |
| 1989 bool DescriptorArray::IsProperty(int descriptor_number) { | 1989 bool DescriptorArray::IsProperty(int descriptor_number) { |
| 1990 return IsRealProperty(GetType(descriptor_number)); | 1990 return IsRealProperty(GetType(descriptor_number)); |
| 1991 } | 1991 } |
| 1992 | 1992 |
| 1993 | 1993 |
| 1994 bool DescriptorArray::IsTransition(int descriptor_number) { | 1994 bool DescriptorArray::IsTransitionOnly(int descriptor_number) { |
| 1995 return IsTransitionType(GetType(descriptor_number)); | 1995 switch (GetType(descriptor_number)) { |
| 1996 case MAP_TRANSITION: | |
| 1997 case CONSTANT_TRANSITION: | |
| 1998 case ELEMENTS_TRANSITION: | |
| 1999 return true; | |
| 2000 case CALLBACKS: { | |
| 2001 Object* value = GetValue(descriptor_number); | |
| 2002 if (!value->IsAccessorPair()) return false; | |
| 2003 AccessorPair* accessors = AccessorPair::cast(value); | |
| 2004 return accessors->getter()->IsMap() && accessors->setter()->IsMap(); | |
| 2005 } | |
| 2006 case NORMAL: | |
| 2007 case FIELD: | |
| 2008 case CONSTANT_FUNCTION: | |
| 2009 case HANDLER: | |
| 2010 case INTERCEPTOR: | |
| 2011 case NULL_DESCRIPTOR: | |
| 2012 return false; | |
| 2013 } | |
| 2014 UNREACHABLE(); // keep the compiler happy | |
|
Jakob Kummerow
2012/02/03 13:17:14
nit: Leading capital letter and trailing period.
Sven Panne
2012/02/03 13:33:14
Done.
| |
| 2015 return false; | |
| 1996 } | 2016 } |
| 1997 | 2017 |
| 1998 | 2018 |
| 1999 bool DescriptorArray::IsNullDescriptor(int descriptor_number) { | 2019 bool DescriptorArray::IsNullDescriptor(int descriptor_number) { |
| 2000 return GetType(descriptor_number) == NULL_DESCRIPTOR; | 2020 return GetType(descriptor_number) == NULL_DESCRIPTOR; |
| 2001 } | 2021 } |
| 2002 | 2022 |
| 2003 | 2023 |
| 2004 bool DescriptorArray::IsDontEnum(int descriptor_number) { | 2024 bool DescriptorArray::IsDontEnum(int descriptor_number) { |
| 2005 return PropertyDetails(GetDetails(descriptor_number)).IsDontEnum(); | 2025 return PropertyDetails(GetDetails(descriptor_number)).IsDontEnum(); |
| (...skipping 2878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4884 #undef WRITE_INT_FIELD | 4904 #undef WRITE_INT_FIELD |
| 4885 #undef READ_SHORT_FIELD | 4905 #undef READ_SHORT_FIELD |
| 4886 #undef WRITE_SHORT_FIELD | 4906 #undef WRITE_SHORT_FIELD |
| 4887 #undef READ_BYTE_FIELD | 4907 #undef READ_BYTE_FIELD |
| 4888 #undef WRITE_BYTE_FIELD | 4908 #undef WRITE_BYTE_FIELD |
| 4889 | 4909 |
| 4890 | 4910 |
| 4891 } } // namespace v8::internal | 4911 } } // namespace v8::internal |
| 4892 | 4912 |
| 4893 #endif // V8_OBJECTS_INL_H_ | 4913 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |