| 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 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1074 } | 1074 } |
| 1075 return Failure::Exception(); | 1075 return Failure::Exception(); |
| 1076 } | 1076 } |
| 1077 | 1077 |
| 1078 | 1078 |
| 1079 bool Object::HasSpecificClassOf(String* name) { | 1079 bool Object::HasSpecificClassOf(String* name) { |
| 1080 return this->IsJSObject() && (JSObject::cast(this)->class_name() == name); | 1080 return this->IsJSObject() && (JSObject::cast(this)->class_name() == name); |
| 1081 } | 1081 } |
| 1082 | 1082 |
| 1083 | 1083 |
| 1084 MaybeHandle<Object> JSObject::GetPropertyAfterAccessCheck( |
| 1085 Isolate* isolate, |
| 1086 Handle<Object> receiver, |
| 1087 Handle<Name> name, |
| 1088 LookupResult* result, |
| 1089 PropertyAttributes* attributes) { |
| 1090 Handle<Object> value; |
| 1091 switch (result->type()) { |
| 1092 case NORMAL: { |
| 1093 value = JSObject::GetNormalizedProperty( |
| 1094 handle(result->holder(), isolate), result); |
| 1095 break; |
| 1096 } |
| 1097 case FIELD: |
| 1098 value = JSObject::FastPropertyAt(handle(result->holder(), isolate), |
| 1099 result->representation(), |
| 1100 result->GetFieldIndex().field_index()); |
| 1101 break; |
| 1102 case CONSTANT: |
| 1103 return handle(result->GetConstant(), isolate); |
| 1104 case CALLBACKS: |
| 1105 return JSObject::GetPropertyWithCallback( |
| 1106 handle(result->holder(), isolate), |
| 1107 receiver, |
| 1108 handle(result->GetCallbackObject(), isolate), |
| 1109 name); |
| 1110 case HANDLER: |
| 1111 return JSProxy::GetPropertyWithHandler( |
| 1112 handle(result->proxy(), isolate), receiver, name); |
| 1113 case INTERCEPTOR: |
| 1114 return JSObject::GetPropertyWithInterceptor( |
| 1115 handle(result->holder(), isolate), receiver, name, attributes); |
| 1116 case NONEXISTENT: |
| 1117 UNREACHABLE(); |
| 1118 break; |
| 1119 } |
| 1120 ASSERT(!value->IsTheHole() || result->IsReadOnly()); |
| 1121 return value->IsTheHole() |
| 1122 ? Handle<Object>::cast(isolate->factory()->undefined_value()) : value; |
| 1123 } |
| 1124 |
| 1125 |
| 1084 MaybeHandle<Object> Object::GetProperty(Handle<Object> object, | 1126 MaybeHandle<Object> Object::GetProperty(Handle<Object> object, |
| 1085 Handle<Name> name) { | 1127 Handle<Name> name) { |
| 1086 PropertyAttributes attributes; | 1128 PropertyAttributes attributes; |
| 1087 return GetPropertyWithReceiver(object, object, name, &attributes); | 1129 return GetPropertyWithReceiver(object, object, name, &attributes); |
| 1088 } | 1130 } |
| 1089 | 1131 |
| 1090 | 1132 |
| 1091 MaybeHandle<Object> Object::GetElement(Isolate* isolate, | 1133 MaybeHandle<Object> Object::GetElement(Isolate* isolate, |
| 1092 Handle<Object> object, | 1134 Handle<Object> object, |
| 1093 uint32_t index) { | 1135 uint32_t index) { |
| (...skipping 6007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7101 #undef READ_SHORT_FIELD | 7143 #undef READ_SHORT_FIELD |
| 7102 #undef WRITE_SHORT_FIELD | 7144 #undef WRITE_SHORT_FIELD |
| 7103 #undef READ_BYTE_FIELD | 7145 #undef READ_BYTE_FIELD |
| 7104 #undef WRITE_BYTE_FIELD | 7146 #undef WRITE_BYTE_FIELD |
| 7105 #undef NOBARRIER_READ_BYTE_FIELD | 7147 #undef NOBARRIER_READ_BYTE_FIELD |
| 7106 #undef NOBARRIER_WRITE_BYTE_FIELD | 7148 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7107 | 7149 |
| 7108 } } // namespace v8::internal | 7150 } } // namespace v8::internal |
| 7109 | 7151 |
| 7110 #endif // V8_OBJECTS_INL_H_ | 7152 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |