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 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 | 1099 |
1100 MaybeHandle<Object> Object::GetPropertyOrElement(Handle<Object> object, | 1100 MaybeHandle<Object> Object::GetPropertyOrElement(Handle<Object> object, |
1101 Handle<Name> name) { | 1101 Handle<Name> name) { |
1102 uint32_t index; | 1102 uint32_t index; |
1103 Isolate* isolate = name->GetIsolate(); | 1103 Isolate* isolate = name->GetIsolate(); |
1104 if (name->AsArrayIndex(&index)) return GetElement(isolate, object, index); | 1104 if (name->AsArrayIndex(&index)) return GetElement(isolate, object, index); |
1105 return GetProperty(object, name); | 1105 return GetProperty(object, name); |
1106 } | 1106 } |
1107 | 1107 |
1108 | 1108 |
| 1109 MaybeHandle<Object> Object::GetProperty(Isolate* isolate, |
| 1110 Handle<Object> object, |
| 1111 const char* name) { |
| 1112 Handle<String> str = isolate->factory()->InternalizeUtf8String(name); |
| 1113 ASSERT(!str.is_null()); |
| 1114 #ifdef DEBUG |
| 1115 uint32_t index; // Assert that the name is not an array index. |
| 1116 ASSERT(!str->AsArrayIndex(&index)); |
| 1117 #endif // DEBUG |
| 1118 return GetProperty(object, str); |
| 1119 } |
| 1120 |
| 1121 |
1109 MaybeHandle<Object> JSProxy::GetElementWithHandler(Handle<JSProxy> proxy, | 1122 MaybeHandle<Object> JSProxy::GetElementWithHandler(Handle<JSProxy> proxy, |
1110 Handle<Object> receiver, | 1123 Handle<Object> receiver, |
1111 uint32_t index) { | 1124 uint32_t index) { |
1112 return GetPropertyWithHandler( | 1125 return GetPropertyWithHandler( |
1113 proxy, receiver, proxy->GetIsolate()->factory()->Uint32ToString(index)); | 1126 proxy, receiver, proxy->GetIsolate()->factory()->Uint32ToString(index)); |
1114 } | 1127 } |
1115 | 1128 |
1116 | 1129 |
1117 MaybeHandle<Object> JSProxy::SetElementWithHandler(Handle<JSProxy> proxy, | 1130 MaybeHandle<Object> JSProxy::SetElementWithHandler(Handle<JSProxy> proxy, |
1118 Handle<JSReceiver> receiver, | 1131 Handle<JSReceiver> receiver, |
(...skipping 5855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6974 #undef READ_SHORT_FIELD | 6987 #undef READ_SHORT_FIELD |
6975 #undef WRITE_SHORT_FIELD | 6988 #undef WRITE_SHORT_FIELD |
6976 #undef READ_BYTE_FIELD | 6989 #undef READ_BYTE_FIELD |
6977 #undef WRITE_BYTE_FIELD | 6990 #undef WRITE_BYTE_FIELD |
6978 #undef NOBARRIER_READ_BYTE_FIELD | 6991 #undef NOBARRIER_READ_BYTE_FIELD |
6979 #undef NOBARRIER_WRITE_BYTE_FIELD | 6992 #undef NOBARRIER_WRITE_BYTE_FIELD |
6980 | 6993 |
6981 } } // namespace v8::internal | 6994 } } // namespace v8::internal |
6982 | 6995 |
6983 #endif // V8_OBJECTS_INL_H_ | 6996 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |