Revision: 15604
Author: [email protected]
Date: Wed Jul 10 09:00:48 2013
Log: Revert "Allow NORMAL ICs to go polymorphic."
BUG=
[email protected]
Review URL: https://chromiumcodereview.appspot.com/18881006
http://code.google.com/p/v8/source/detail?r=15604
Modified:
/branches/bleeding_edge/src/ic.cc
=======================================
--- /branches/bleeding_edge/src/ic.cc Wed Jul 10 08:24:15 2013
+++ /branches/bleeding_edge/src/ic.cc Wed Jul 10 09:00:48 2013
@@ -978,6 +978,12 @@
Handle<String> name,
Handle<Code> code,
StrictModeFlag strict_mode) {
+ if (code->type() == Code::NORMAL) return false;
+ if (target()->ic_state() == MONOMORPHIC &&
+ target()->type() == Code::NORMAL) {
+ return false;
+ }
+
MapHandleList receiver_maps;
CodeHandleList handlers;
@@ -986,12 +992,7 @@
Handle<Map> new_receiver_map(receiver->map());
{
DisallowHeapAllocation no_gc;
- if (target()->ic_state() == POLYMORPHIC ||
- (target()->ic_state() == MONOMORPHIC &&
- target()->type() != Code::NORMAL)) {
- target()->FindAllMaps(&receiver_maps);
- }
-
+ target()->FindAllMaps(&receiver_maps);
int number_of_maps = receiver_maps.length();
number_of_valid_maps = number_of_maps;
@@ -1011,9 +1012,12 @@
if (number_of_valid_maps >= 4) return false;
- if (number_of_maps > 0) {
- target()->FindAllCode(&handlers, receiver_maps.length());
+ // Only allow 0 maps in case target() was reset to UNINITIALIZED by
the GC.
+ // In that case, allow the IC to go back monomorphic.
+ if (number_of_maps == 0 && target()->ic_state() != UNINITIALIZED) {
+ return false;
}
+ target()->FindAllCode(&handlers, receiver_maps.length());
}
number_of_valid_maps++;
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.