| 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 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1353 name, receiver, holder, info); | 1353 name, receiver, holder, info); |
| 1354 } else if (callback->IsAccessorPair()) { | 1354 } else if (callback->IsAccessorPair()) { |
| 1355 Handle<Object> getter(Handle<AccessorPair>::cast(callback)->getter(), | 1355 Handle<Object> getter(Handle<AccessorPair>::cast(callback)->getter(), |
| 1356 isolate()); | 1356 isolate()); |
| 1357 if (!getter->IsJSFunction()) break; | 1357 if (!getter->IsJSFunction()) break; |
| 1358 if (holder->IsGlobalObject()) break; | 1358 if (holder->IsGlobalObject()) break; |
| 1359 if (!holder->HasFastProperties()) break; | 1359 if (!holder->HasFastProperties()) break; |
| 1360 Handle<JSFunction> function = Handle<JSFunction>::cast(getter); | 1360 Handle<JSFunction> function = Handle<JSFunction>::cast(getter); |
| 1361 CallOptimization call_optimization(function); | 1361 CallOptimization call_optimization(function); |
| 1362 if (call_optimization.is_simple_api_call() && | 1362 if (call_optimization.is_simple_api_call() && |
| 1363 call_optimization.IsCompatibleReceiver(*receiver)) { | 1363 call_optimization.IsCompatibleReceiver(*receiver) && |
| 1364 FLAG_js_accessor_ics) { |
| 1364 return isolate()->stub_cache()->ComputeLoadCallback( | 1365 return isolate()->stub_cache()->ComputeLoadCallback( |
| 1365 name, receiver, holder, call_optimization); | 1366 name, receiver, holder, call_optimization); |
| 1366 } | 1367 } |
| 1367 return isolate()->stub_cache()->ComputeLoadViaGetter( | 1368 return isolate()->stub_cache()->ComputeLoadViaGetter( |
| 1368 name, receiver, holder, function); | 1369 name, receiver, holder, function); |
| 1369 } else if (receiver->IsJSArray() && | 1370 } else if (receiver->IsJSArray() && |
| 1370 name->Equals(isolate()->heap()->length_string())) { | 1371 name->Equals(isolate()->heap()->length_string())) { |
| 1371 PropertyIndex lengthIndex = | 1372 PropertyIndex lengthIndex = |
| 1372 PropertyIndex::NewHeaderIndex(JSArray::kLengthOffset / kPointerSize); | 1373 PropertyIndex::NewHeaderIndex(JSArray::kLengthOffset / kPointerSize); |
| 1373 return isolate()->stub_cache()->ComputeLoadField( | 1374 return isolate()->stub_cache()->ComputeLoadField( |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1561 } else if (callback_object->IsAccessorPair()) { | 1562 } else if (callback_object->IsAccessorPair()) { |
| 1562 Handle<Object> getter( | 1563 Handle<Object> getter( |
| 1563 Handle<AccessorPair>::cast(callback_object)->getter(), | 1564 Handle<AccessorPair>::cast(callback_object)->getter(), |
| 1564 isolate()); | 1565 isolate()); |
| 1565 if (!getter->IsJSFunction()) break; | 1566 if (!getter->IsJSFunction()) break; |
| 1566 if (holder->IsGlobalObject()) break; | 1567 if (holder->IsGlobalObject()) break; |
| 1567 if (!holder->HasFastProperties()) break; | 1568 if (!holder->HasFastProperties()) break; |
| 1568 Handle<JSFunction> function = Handle<JSFunction>::cast(getter); | 1569 Handle<JSFunction> function = Handle<JSFunction>::cast(getter); |
| 1569 CallOptimization call_optimization(function); | 1570 CallOptimization call_optimization(function); |
| 1570 if (call_optimization.is_simple_api_call() && | 1571 if (call_optimization.is_simple_api_call() && |
| 1571 call_optimization.IsCompatibleReceiver(*receiver)) { | 1572 call_optimization.IsCompatibleReceiver(*receiver) && |
| 1573 FLAG_js_accessor_ics) { |
| 1572 return isolate()->stub_cache()->ComputeKeyedLoadCallback( | 1574 return isolate()->stub_cache()->ComputeKeyedLoadCallback( |
| 1573 name, receiver, holder, call_optimization); | 1575 name, receiver, holder, call_optimization); |
| 1574 } | 1576 } |
| 1575 } | 1577 } |
| 1576 break; | 1578 break; |
| 1577 } | 1579 } |
| 1578 case INTERCEPTOR: | 1580 case INTERCEPTOR: |
| 1579 ASSERT(HasInterceptorGetter(lookup->holder())); | 1581 ASSERT(HasInterceptorGetter(lookup->holder())); |
| 1580 return isolate()->stub_cache()->ComputeKeyedLoadInterceptor( | 1582 return isolate()->stub_cache()->ComputeKeyedLoadInterceptor( |
| 1581 name, receiver, holder); | 1583 name, receiver, holder); |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1827 name, receiver, holder, info, strict_mode); | 1829 name, receiver, holder, info, strict_mode); |
| 1828 } else if (callback->IsAccessorPair()) { | 1830 } else if (callback->IsAccessorPair()) { |
| 1829 Handle<Object> setter( | 1831 Handle<Object> setter( |
| 1830 Handle<AccessorPair>::cast(callback)->setter(), isolate()); | 1832 Handle<AccessorPair>::cast(callback)->setter(), isolate()); |
| 1831 if (!setter->IsJSFunction()) break; | 1833 if (!setter->IsJSFunction()) break; |
| 1832 if (holder->IsGlobalObject()) break; | 1834 if (holder->IsGlobalObject()) break; |
| 1833 if (!holder->HasFastProperties()) break; | 1835 if (!holder->HasFastProperties()) break; |
| 1834 Handle<JSFunction> function = Handle<JSFunction>::cast(setter); | 1836 Handle<JSFunction> function = Handle<JSFunction>::cast(setter); |
| 1835 CallOptimization call_optimization(function); | 1837 CallOptimization call_optimization(function); |
| 1836 if (call_optimization.is_simple_api_call() && | 1838 if (call_optimization.is_simple_api_call() && |
| 1837 call_optimization.IsCompatibleReceiver(*receiver)) { | 1839 call_optimization.IsCompatibleReceiver(*receiver) && |
| 1840 FLAG_js_accessor_ics) { |
| 1838 return isolate()->stub_cache()->ComputeStoreCallback( | 1841 return isolate()->stub_cache()->ComputeStoreCallback( |
| 1839 name, receiver, holder, call_optimization, strict_mode); | 1842 name, receiver, holder, call_optimization, strict_mode); |
| 1840 } | 1843 } |
| 1841 return isolate()->stub_cache()->ComputeStoreViaSetter( | 1844 return isolate()->stub_cache()->ComputeStoreViaSetter( |
| 1842 name, receiver, holder, Handle<JSFunction>::cast(setter), | 1845 name, receiver, holder, Handle<JSFunction>::cast(setter), |
| 1843 strict_mode); | 1846 strict_mode); |
| 1844 } | 1847 } |
| 1845 // TODO(dcarney): Handle correctly. | 1848 // TODO(dcarney): Handle correctly. |
| 1846 if (callback->IsDeclaredAccessorInfo()) break; | 1849 if (callback->IsDeclaredAccessorInfo()) break; |
| 1847 ASSERT(callback->IsForeign()); | 1850 ASSERT(callback->IsForeign()); |
| (...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3136 #undef ADDR | 3139 #undef ADDR |
| 3137 }; | 3140 }; |
| 3138 | 3141 |
| 3139 | 3142 |
| 3140 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 3143 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
| 3141 return IC_utilities[id]; | 3144 return IC_utilities[id]; |
| 3142 } | 3145 } |
| 3143 | 3146 |
| 3144 | 3147 |
| 3145 } } // namespace v8::internal | 3148 } } // namespace v8::internal |
| OLD | NEW |