OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 4139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4150 } | 4150 } |
4151 return SlowAsArrayIndex(index); | 4151 return SlowAsArrayIndex(index); |
4152 } | 4152 } |
4153 | 4153 |
4154 | 4154 |
4155 Object* JSReceiver::GetPrototype() { | 4155 Object* JSReceiver::GetPrototype() { |
4156 return HeapObject::cast(this)->map()->prototype(); | 4156 return HeapObject::cast(this)->map()->prototype(); |
4157 } | 4157 } |
4158 | 4158 |
4159 | 4159 |
| 4160 bool JSReceiver::HasProperty(String* name) { |
| 4161 if (IsJSProxy()) { |
| 4162 return JSProxy::cast(this)->HasPropertyWithHandler(name); |
| 4163 } |
| 4164 return GetPropertyAttribute(name) != ABSENT; |
| 4165 } |
| 4166 |
| 4167 |
| 4168 bool JSReceiver::HasLocalProperty(String* name) { |
| 4169 if (IsJSProxy()) { |
| 4170 return JSProxy::cast(this)->HasPropertyWithHandler(name); |
| 4171 } |
| 4172 return GetLocalPropertyAttribute(name) != ABSENT; |
| 4173 } |
| 4174 |
| 4175 |
4160 PropertyAttributes JSReceiver::GetPropertyAttribute(String* key) { | 4176 PropertyAttributes JSReceiver::GetPropertyAttribute(String* key) { |
4161 return GetPropertyAttributeWithReceiver(this, key); | 4177 return GetPropertyAttributeWithReceiver(this, key); |
4162 } | 4178 } |
4163 | 4179 |
4164 // TODO(504): this may be useful in other places too where JSGlobalProxy | 4180 // TODO(504): this may be useful in other places too where JSGlobalProxy |
4165 // is used. | 4181 // is used. |
4166 Object* JSObject::BypassGlobalProxy() { | 4182 Object* JSObject::BypassGlobalProxy() { |
4167 if (IsJSGlobalProxy()) { | 4183 if (IsJSGlobalProxy()) { |
4168 Object* proto = GetPrototype(); | 4184 Object* proto = GetPrototype(); |
4169 if (proto->IsNull()) return GetHeap()->undefined_value(); | 4185 if (proto->IsNull()) return GetHeap()->undefined_value(); |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4464 #undef WRITE_INT_FIELD | 4480 #undef WRITE_INT_FIELD |
4465 #undef READ_SHORT_FIELD | 4481 #undef READ_SHORT_FIELD |
4466 #undef WRITE_SHORT_FIELD | 4482 #undef WRITE_SHORT_FIELD |
4467 #undef READ_BYTE_FIELD | 4483 #undef READ_BYTE_FIELD |
4468 #undef WRITE_BYTE_FIELD | 4484 #undef WRITE_BYTE_FIELD |
4469 | 4485 |
4470 | 4486 |
4471 } } // namespace v8::internal | 4487 } } // namespace v8::internal |
4472 | 4488 |
4473 #endif // V8_OBJECTS_INL_H_ | 4489 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |