Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(395)

Side by Side Diff: src/ic.cc

Issue 872001: Fix code cache lookup for keyed IC's... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698