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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 } | 160 } |
161 | 161 |
162 // Clear the code cache for this map to avoid hitting the same | 162 // Clear the code cache for this map to avoid hitting the same |
163 // invalid stub again. It seems likely that most of the code in | 163 // invalid stub again. It seems likely that most of the code in |
164 // the cache is invalid if one of the stubs is so we flush the | 164 // the cache is invalid if one of the stubs is so we flush the |
165 // entire code cache. | 165 // entire code cache. |
166 map->ClearCodeCache(); | 166 map->ClearCodeCache(); |
167 | 167 |
168 return MONOMORPHIC_PROTOTYPE_FAILURE; | 168 return MONOMORPHIC_PROTOTYPE_FAILURE; |
169 } | 169 } |
| 170 |
| 171 // The builtins object is special. It only changes when javascript |
| 172 // builtins are loaded lazily. It is important to keep inline |
| 173 // caches for the builtins object monomorphic. Therefore, if we get |
| 174 // an inline cache miss for the builtins object after lazily loading |
| 175 // javascript builtins, we clear the code cache and return |
| 176 // uninitialized as the state to force the inline cache back to |
| 177 // monomorphic state. |
| 178 if (receiver->IsJSBuiltinsObject()) { |
| 179 map->ClearCodeCache(); |
| 180 return UNINITIALIZED; |
| 181 } |
| 182 |
170 return MONOMORPHIC; | 183 return MONOMORPHIC; |
171 } | 184 } |
172 | 185 |
173 | 186 |
174 RelocMode IC::ComputeMode() { | 187 RelocMode IC::ComputeMode() { |
175 Address addr = address(); | 188 Address addr = address(); |
176 Code* code = Code::cast(Heap::FindCodeObject(addr)); | 189 Code* code = Code::cast(Heap::FindCodeObject(addr)); |
177 for (RelocIterator it(code, RelocInfo::kCodeTargetMask); | 190 for (RelocIterator it(code, RelocInfo::kCodeTargetMask); |
178 !it.done(); it.next()) { | 191 !it.done(); it.next()) { |
179 RelocInfo* info = it.rinfo(); | 192 RelocInfo* info = it.rinfo(); |
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1150 #undef ADDR | 1163 #undef ADDR |
1151 }; | 1164 }; |
1152 | 1165 |
1153 | 1166 |
1154 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 1167 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
1155 return IC_utilities[id]; | 1168 return IC_utilities[id]; |
1156 } | 1169 } |
1157 | 1170 |
1158 | 1171 |
1159 } } // namespace v8::internal | 1172 } } // namespace v8::internal |
OLD | NEW |