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 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1046 name, receiver, global, cell, lookup->IsDontDelete()); | 1046 name, receiver, global, cell, lookup->IsDontDelete()); |
1047 } | 1047 } |
1048 // There is only one shared stub for loading normalized | 1048 // There is only one shared stub for loading normalized |
1049 // properties. It does not traverse the prototype chain, so the | 1049 // properties. It does not traverse the prototype chain, so the |
1050 // property must be found in the receiver for the stub to be | 1050 // property must be found in the receiver for the stub to be |
1051 // applicable. | 1051 // applicable. |
1052 if (!holder.is_identical_to(receiver)) break; | 1052 if (!holder.is_identical_to(receiver)) break; |
1053 return isolate()->stub_cache()->ComputeLoadNormal(); | 1053 return isolate()->stub_cache()->ComputeLoadNormal(); |
1054 case CALLBACKS: { | 1054 case CALLBACKS: { |
1055 Handle<Object> callback(lookup->GetCallbackObject()); | 1055 Handle<Object> callback(lookup->GetCallbackObject()); |
1056 if (callback->IsAccessorInfo()) { | 1056 if (callback->IsExecutableAccessorInfo()) { |
1057 Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(callback); | 1057 Handle<ExecutableAccessorInfo> info = |
| 1058 Handle<ExecutableAccessorInfo>::cast(callback); |
1058 if (v8::ToCData<Address>(info->getter()) == 0) break; | 1059 if (v8::ToCData<Address>(info->getter()) == 0) break; |
1059 if (!info->IsCompatibleReceiver(*receiver)) break; | 1060 if (!info->IsCompatibleReceiver(*receiver)) break; |
1060 return isolate()->stub_cache()->ComputeLoadCallback( | 1061 return isolate()->stub_cache()->ComputeLoadCallback( |
1061 name, receiver, holder, info); | 1062 name, receiver, holder, info); |
1062 } else if (callback->IsAccessorPair()) { | 1063 } else if (callback->IsAccessorPair()) { |
1063 Handle<Object> getter(Handle<AccessorPair>::cast(callback)->getter()); | 1064 Handle<Object> getter(Handle<AccessorPair>::cast(callback)->getter()); |
1064 if (!getter->IsJSFunction()) break; | 1065 if (!getter->IsJSFunction()) break; |
1065 if (holder->IsGlobalObject()) break; | 1066 if (holder->IsGlobalObject()) break; |
1066 if (!holder->HasFastProperties()) break; | 1067 if (!holder->HasFastProperties()) break; |
1067 return isolate()->stub_cache()->ComputeLoadViaGetter( | 1068 return isolate()->stub_cache()->ComputeLoadViaGetter( |
1068 name, receiver, holder, Handle<JSFunction>::cast(getter)); | 1069 name, receiver, holder, Handle<JSFunction>::cast(getter)); |
1069 } | 1070 } |
| 1071 // TODO(dcarney): Handle correctly. |
| 1072 if (callback->IsDeclaredAccessorInfo()) break; |
1070 ASSERT(callback->IsForeign()); | 1073 ASSERT(callback->IsForeign()); |
1071 // No IC support for old-style native accessors. | 1074 // No IC support for old-style native accessors. |
1072 break; | 1075 break; |
1073 } | 1076 } |
1074 case INTERCEPTOR: | 1077 case INTERCEPTOR: |
1075 ASSERT(HasInterceptorGetter(*holder)); | 1078 ASSERT(HasInterceptorGetter(*holder)); |
1076 return isolate()->stub_cache()->ComputeLoadInterceptor( | 1079 return isolate()->stub_cache()->ComputeLoadInterceptor( |
1077 name, receiver, holder); | 1080 name, receiver, holder); |
1078 default: | 1081 default: |
1079 break; | 1082 break; |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1275 case FIELD: | 1278 case FIELD: |
1276 return isolate()->stub_cache()->ComputeKeyedLoadField( | 1279 return isolate()->stub_cache()->ComputeKeyedLoadField( |
1277 name, receiver, holder, lookup->GetFieldIndex()); | 1280 name, receiver, holder, lookup->GetFieldIndex()); |
1278 case CONSTANT_FUNCTION: { | 1281 case CONSTANT_FUNCTION: { |
1279 Handle<JSFunction> constant(lookup->GetConstantFunction()); | 1282 Handle<JSFunction> constant(lookup->GetConstantFunction()); |
1280 return isolate()->stub_cache()->ComputeKeyedLoadConstant( | 1283 return isolate()->stub_cache()->ComputeKeyedLoadConstant( |
1281 name, receiver, holder, constant); | 1284 name, receiver, holder, constant); |
1282 } | 1285 } |
1283 case CALLBACKS: { | 1286 case CALLBACKS: { |
1284 Handle<Object> callback_object(lookup->GetCallbackObject()); | 1287 Handle<Object> callback_object(lookup->GetCallbackObject()); |
1285 if (!callback_object->IsAccessorInfo()) break; | 1288 // TODO(dcarney): Handle DeclaredAccessorInfo correctly. |
1286 Handle<AccessorInfo> callback = | 1289 if (!callback_object->IsExecutableAccessorInfo()) break; |
1287 Handle<AccessorInfo>::cast(callback_object); | 1290 Handle<ExecutableAccessorInfo> callback = |
| 1291 Handle<ExecutableAccessorInfo>::cast(callback_object); |
1288 if (v8::ToCData<Address>(callback->getter()) == 0) break; | 1292 if (v8::ToCData<Address>(callback->getter()) == 0) break; |
1289 if (!callback->IsCompatibleReceiver(*receiver)) break; | 1293 if (!callback->IsCompatibleReceiver(*receiver)) break; |
1290 return isolate()->stub_cache()->ComputeKeyedLoadCallback( | 1294 return isolate()->stub_cache()->ComputeKeyedLoadCallback( |
1291 name, receiver, holder, callback); | 1295 name, receiver, holder, callback); |
1292 } | 1296 } |
1293 case INTERCEPTOR: | 1297 case INTERCEPTOR: |
1294 ASSERT(HasInterceptorGetter(lookup->holder())); | 1298 ASSERT(HasInterceptorGetter(lookup->holder())); |
1295 return isolate()->stub_cache()->ComputeKeyedLoadInterceptor( | 1299 return isolate()->stub_cache()->ComputeKeyedLoadInterceptor( |
1296 name, receiver, holder); | 1300 name, receiver, holder); |
1297 default: | 1301 default: |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1468 // global object. | 1472 // global object. |
1469 Handle<GlobalObject> global = Handle<GlobalObject>::cast(receiver); | 1473 Handle<GlobalObject> global = Handle<GlobalObject>::cast(receiver); |
1470 Handle<JSGlobalPropertyCell> cell(global->GetPropertyCell(lookup)); | 1474 Handle<JSGlobalPropertyCell> cell(global->GetPropertyCell(lookup)); |
1471 return isolate()->stub_cache()->ComputeStoreGlobal( | 1475 return isolate()->stub_cache()->ComputeStoreGlobal( |
1472 name, global, cell, strict_mode); | 1476 name, global, cell, strict_mode); |
1473 } | 1477 } |
1474 if (!holder.is_identical_to(receiver)) break; | 1478 if (!holder.is_identical_to(receiver)) break; |
1475 return isolate()->stub_cache()->ComputeStoreNormal(strict_mode); | 1479 return isolate()->stub_cache()->ComputeStoreNormal(strict_mode); |
1476 case CALLBACKS: { | 1480 case CALLBACKS: { |
1477 Handle<Object> callback(lookup->GetCallbackObject()); | 1481 Handle<Object> callback(lookup->GetCallbackObject()); |
1478 if (callback->IsAccessorInfo()) { | 1482 if (callback->IsExecutableAccessorInfo()) { |
1479 Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(callback); | 1483 Handle<ExecutableAccessorInfo> info = |
| 1484 Handle<ExecutableAccessorInfo>::cast(callback); |
1480 if (v8::ToCData<Address>(info->setter()) == 0) break; | 1485 if (v8::ToCData<Address>(info->setter()) == 0) break; |
1481 if (!holder->HasFastProperties()) break; | 1486 if (!holder->HasFastProperties()) break; |
1482 if (!info->IsCompatibleReceiver(*receiver)) break; | 1487 if (!info->IsCompatibleReceiver(*receiver)) break; |
1483 return isolate()->stub_cache()->ComputeStoreCallback( | 1488 return isolate()->stub_cache()->ComputeStoreCallback( |
1484 name, receiver, holder, info, strict_mode); | 1489 name, receiver, holder, info, strict_mode); |
1485 } else if (callback->IsAccessorPair()) { | 1490 } else if (callback->IsAccessorPair()) { |
1486 Handle<Object> setter(Handle<AccessorPair>::cast(callback)->setter()); | 1491 Handle<Object> setter(Handle<AccessorPair>::cast(callback)->setter()); |
1487 if (!setter->IsJSFunction()) break; | 1492 if (!setter->IsJSFunction()) break; |
1488 if (holder->IsGlobalObject()) break; | 1493 if (holder->IsGlobalObject()) break; |
1489 if (!holder->HasFastProperties()) break; | 1494 if (!holder->HasFastProperties()) break; |
1490 return isolate()->stub_cache()->ComputeStoreViaSetter( | 1495 return isolate()->stub_cache()->ComputeStoreViaSetter( |
1491 name, receiver, holder, Handle<JSFunction>::cast(setter), | 1496 name, receiver, holder, Handle<JSFunction>::cast(setter), |
1492 strict_mode); | 1497 strict_mode); |
1493 } | 1498 } |
| 1499 // TODO(dcarney): Handle correctly. |
| 1500 if (callback->IsDeclaredAccessorInfo()) break; |
1494 ASSERT(callback->IsForeign()); | 1501 ASSERT(callback->IsForeign()); |
1495 // No IC support for old-style native accessors. | 1502 // No IC support for old-style native accessors. |
1496 break; | 1503 break; |
1497 } | 1504 } |
1498 case INTERCEPTOR: | 1505 case INTERCEPTOR: |
1499 ASSERT(!receiver->GetNamedInterceptor()->setter()->IsUndefined()); | 1506 ASSERT(!receiver->GetNamedInterceptor()->setter()->IsUndefined()); |
1500 return isolate()->stub_cache()->ComputeStoreInterceptor( | 1507 return isolate()->stub_cache()->ComputeStoreInterceptor( |
1501 name, receiver, strict_mode); | 1508 name, receiver, strict_mode); |
1502 case CONSTANT_FUNCTION: | 1509 case CONSTANT_FUNCTION: |
1503 break; | 1510 break; |
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2552 #undef ADDR | 2559 #undef ADDR |
2553 }; | 2560 }; |
2554 | 2561 |
2555 | 2562 |
2556 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2563 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
2557 return IC_utilities[id]; | 2564 return IC_utilities[id]; |
2558 } | 2565 } |
2559 | 2566 |
2560 | 2567 |
2561 } } // namespace v8::internal | 2568 } } // namespace v8::internal |
OLD | NEW |