| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 905 default: | 905 default: |
| 906 return; | 906 return; |
| 907 } | 907 } |
| 908 | 908 |
| 909 // If we're unable to compute the stub (not enough memory left), we | 909 // If we're unable to compute the stub (not enough memory left), we |
| 910 // simply avoid updating the caches. | 910 // simply avoid updating the caches. |
| 911 if (code->IsFailure()) return; | 911 if (code->IsFailure()) return; |
| 912 | 912 |
| 913 // Patch the call site depending on the state of the cache. | 913 // Patch the call site depending on the state of the cache. |
| 914 if (state == UNINITIALIZED || state == MONOMORPHIC_PROTOTYPE_FAILURE) { | 914 if (state == UNINITIALIZED || state == MONOMORPHIC_PROTOTYPE_FAILURE) { |
| 915 Heap::store_ic_created(); | |
| 916 set_target(Code::cast(code)); | 915 set_target(Code::cast(code)); |
| 917 } else if (state == MONOMORPHIC) { | 916 } else if (state == MONOMORPHIC) { |
| 918 // Only move to mega morphic if the target changes. | 917 // Only move to mega morphic if the target changes. |
| 919 if (target() != Code::cast(code)) set_target(megamorphic_stub()); | 918 if (target() != Code::cast(code)) set_target(megamorphic_stub()); |
| 920 } | 919 } |
| 921 | 920 |
| 922 #ifdef DEBUG | 921 #ifdef DEBUG |
| 923 TraceIC("StoreIC", name, state, target()); | 922 TraceIC("StoreIC", name, state, target()); |
| 924 #endif | 923 #endif |
| 925 } | 924 } |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1210 #undef ADDR | 1209 #undef ADDR |
| 1211 }; | 1210 }; |
| 1212 | 1211 |
| 1213 | 1212 |
| 1214 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 1213 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
| 1215 return IC_utilities[id]; | 1214 return IC_utilities[id]; |
| 1216 } | 1215 } |
| 1217 | 1216 |
| 1218 | 1217 |
| 1219 } } // namespace v8::internal | 1218 } } // namespace v8::internal |
| OLD | NEW |