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 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1230 return code; | 1230 return code; |
1231 } | 1231 } |
1232 // There is only one shared stub for loading normalized | 1232 // There is only one shared stub for loading normalized |
1233 // properties. It does not traverse the prototype chain, so the | 1233 // properties. It does not traverse the prototype chain, so the |
1234 // property must be found in the object for the stub to be | 1234 // property must be found in the object for the stub to be |
1235 // applicable. | 1235 // applicable. |
1236 if (!object.is_identical_to(holder)) break; | 1236 if (!object.is_identical_to(holder)) break; |
1237 return isolate()->builtins()->LoadIC_Normal(); | 1237 return isolate()->builtins()->LoadIC_Normal(); |
1238 case CALLBACKS: { | 1238 case CALLBACKS: { |
1239 // Use simple field loads for some well-known callback properties. | 1239 // Use simple field loads for some well-known callback properties. |
1240 int object_offset; | |
1241 if (object->IsJSObject()) { | 1240 if (object->IsJSObject()) { |
1242 Handle<JSObject> receiver = Handle<JSObject>::cast(object); | 1241 Handle<JSObject> receiver = Handle<JSObject>::cast(object); |
1243 Handle<Map> map(receiver->map()); | 1242 Handle<Map> map(receiver->map()); |
| 1243 int object_offset; |
1244 if (Accessors::IsJSObjectFieldAccessor(map, name, &object_offset)) { | 1244 if (Accessors::IsJSObjectFieldAccessor(map, name, &object_offset)) { |
1245 PropertyIndex index = | 1245 return SimpleFieldLoad(object_offset / kPointerSize); |
1246 PropertyIndex::NewHeaderIndex(object_offset / kPointerSize); | |
1247 return compiler.CompileLoadField( | |
1248 receiver, receiver, name, index, Representation::Tagged()); | |
1249 } | 1246 } |
1250 } | 1247 } |
1251 | 1248 |
1252 Handle<Object> callback(lookup->GetCallbackObject(), isolate()); | 1249 Handle<Object> callback(lookup->GetCallbackObject(), isolate()); |
1253 if (callback->IsExecutableAccessorInfo()) { | 1250 if (callback->IsExecutableAccessorInfo()) { |
1254 Handle<ExecutableAccessorInfo> info = | 1251 Handle<ExecutableAccessorInfo> info = |
1255 Handle<ExecutableAccessorInfo>::cast(callback); | 1252 Handle<ExecutableAccessorInfo>::cast(callback); |
1256 if (v8::ToCData<Address>(info->getter()) == 0) break; | 1253 if (v8::ToCData<Address>(info->getter()) == 0) break; |
1257 if (!info->IsCompatibleReceiver(*object)) break; | 1254 if (!info->IsCompatibleReceiver(*object)) break; |
1258 return compiler.CompileLoadCallback(object, holder, name, info); | 1255 return compiler.CompileLoadCallback(object, holder, name, info); |
(...skipping 1509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2768 #undef ADDR | 2765 #undef ADDR |
2769 }; | 2766 }; |
2770 | 2767 |
2771 | 2768 |
2772 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2769 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
2773 return IC_utilities[id]; | 2770 return IC_utilities[id]; |
2774 } | 2771 } |
2775 | 2772 |
2776 | 2773 |
2777 } } // namespace v8::internal | 2774 } } // namespace v8::internal |
OLD | NEW |