| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 Map* map = GetCodeCacheMapForObject(receiver); | 143 Map* map = GetCodeCacheMapForObject(receiver); |
| 144 | 144 |
| 145 // Decide whether the inline cache failed because of changes to the | 145 // Decide whether the inline cache failed because of changes to the |
| 146 // receiver itself or changes to one of its prototypes. | 146 // receiver itself or changes to one of its prototypes. |
| 147 // | 147 // |
| 148 // If there are changes to the receiver itself, the map of the | 148 // If there are changes to the receiver itself, the map of the |
| 149 // receiver will have changed and the current target will not be in | 149 // receiver will have changed and the current target will not be in |
| 150 // the receiver map's code cache. Therefore, if the current target | 150 // the receiver map's code cache. Therefore, if the current target |
| 151 // is in the receiver map's code cache, the inline cache failed due | 151 // is in the receiver map's code cache, the inline cache failed due |
| 152 // to prototype check failure. | 152 // to prototype check failure. |
| 153 int index = map->IndexInCodeCache(String::cast(name), target); | 153 int index = map->IndexInCodeCache(name, target); |
| 154 if (index >= 0) { | 154 if (index >= 0) { |
| 155 // For keyed load/store, the most likely cause of cache failure is | 155 // For keyed load/store, the most likely cause of cache failure is |
| 156 // that the key has changed. We do not distinguish between | 156 // that the key has changed. We do not distinguish between |
| 157 // prototype and non-prototype failures for keyed access. | 157 // prototype and non-prototype failures for keyed access. |
| 158 Code::Kind kind = target->kind(); | 158 Code::Kind kind = target->kind(); |
| 159 if (kind == Code::KEYED_LOAD_IC || kind == Code::KEYED_STORE_IC) { | 159 if (kind == Code::KEYED_LOAD_IC || kind == Code::KEYED_STORE_IC) { |
| 160 return MONOMORPHIC; | 160 return MONOMORPHIC; |
| 161 } | 161 } |
| 162 | 162 |
| 163 // Remove the target from the code cache to avoid hitting the same | 163 // Remove the target from the code cache to avoid hitting the same |
| (...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1532 #undef ADDR | 1532 #undef ADDR |
| 1533 }; | 1533 }; |
| 1534 | 1534 |
| 1535 | 1535 |
| 1536 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 1536 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
| 1537 return IC_utilities[id]; | 1537 return IC_utilities[id]; |
| 1538 } | 1538 } |
| 1539 | 1539 |
| 1540 | 1540 |
| 1541 } } // namespace v8::internal | 1541 } } // namespace v8::internal |
| OLD | NEW |