OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 2976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2987 | 2987 |
2988 Object* JSObject::GetPrototype() { | 2988 Object* JSObject::GetPrototype() { |
2989 return JSObject::cast(this)->map()->prototype(); | 2989 return JSObject::cast(this)->map()->prototype(); |
2990 } | 2990 } |
2991 | 2991 |
2992 | 2992 |
2993 PropertyAttributes JSObject::GetPropertyAttribute(String* key) { | 2993 PropertyAttributes JSObject::GetPropertyAttribute(String* key) { |
2994 return GetPropertyAttributeWithReceiver(this, key); | 2994 return GetPropertyAttributeWithReceiver(this, key); |
2995 } | 2995 } |
2996 | 2996 |
| 2997 // TODO(504): this may be useful in other places too where JSGlobalProxy |
| 2998 // is used. |
| 2999 Object* JSObject::BypassGlobalProxy() { |
| 3000 if (IsJSGlobalProxy()) { |
| 3001 Object* proto = GetPrototype(); |
| 3002 if (proto->IsNull()) return Heap::undefined_value(); |
| 3003 ASSERT(proto->IsJSGlobalObject()); |
| 3004 return proto; |
| 3005 } |
| 3006 return this; |
| 3007 } |
| 3008 |
| 3009 |
| 3010 bool JSObject::HasHiddenPropertiesObject() { |
| 3011 ASSERT(!IsJSGlobalProxy()); |
| 3012 return GetPropertyAttributePostInterceptor(this, |
| 3013 Heap::hidden_symbol(), |
| 3014 false) != ABSENT; |
| 3015 } |
| 3016 |
| 3017 |
| 3018 Object* JSObject::GetHiddenPropertiesObject() { |
| 3019 ASSERT(!IsJSGlobalProxy()); |
| 3020 PropertyAttributes attributes; |
| 3021 return GetLocalPropertyPostInterceptor(this, |
| 3022 Heap::hidden_symbol(), |
| 3023 &attributes); |
| 3024 } |
| 3025 |
| 3026 |
| 3027 Object* JSObject::SetHiddenPropertiesObject(Object* hidden_obj) { |
| 3028 ASSERT(!IsJSGlobalProxy()); |
| 3029 return SetPropertyPostInterceptor(Heap::hidden_symbol(), |
| 3030 hidden_obj, |
| 3031 DONT_ENUM); |
| 3032 } |
| 3033 |
2997 | 3034 |
2998 bool JSObject::HasElement(uint32_t index) { | 3035 bool JSObject::HasElement(uint32_t index) { |
2999 return HasElementWithReceiver(this, index); | 3036 return HasElementWithReceiver(this, index); |
3000 } | 3037 } |
3001 | 3038 |
3002 | 3039 |
3003 bool AccessorInfo::all_can_read() { | 3040 bool AccessorInfo::all_can_read() { |
3004 return BooleanBit::get(flag(), kAllCanReadBit); | 3041 return BooleanBit::get(flag(), kAllCanReadBit); |
3005 } | 3042 } |
3006 | 3043 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3100 #undef WRITE_INT_FIELD | 3137 #undef WRITE_INT_FIELD |
3101 #undef READ_SHORT_FIELD | 3138 #undef READ_SHORT_FIELD |
3102 #undef WRITE_SHORT_FIELD | 3139 #undef WRITE_SHORT_FIELD |
3103 #undef READ_BYTE_FIELD | 3140 #undef READ_BYTE_FIELD |
3104 #undef WRITE_BYTE_FIELD | 3141 #undef WRITE_BYTE_FIELD |
3105 | 3142 |
3106 | 3143 |
3107 } } // namespace v8::internal | 3144 } } // namespace v8::internal |
3108 | 3145 |
3109 #endif // V8_OBJECTS_INL_H_ | 3146 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |