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

Side by Side Diff: src/type-info.cc

Issue 32263002: Add a soft-deopt in keyed element access when current IC is pre-monomorphic and no type feedback wa… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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 | « src/type-info.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 if (!preliminary_checks) return false; 121 if (!preliminary_checks) return false;
122 Map* map = code->FindFirstMap(); 122 Map* map = code->FindFirstMap();
123 if (map == NULL) return false; 123 if (map == NULL) return false;
124 map = map->CurrentMapForDeprecated(); 124 map = map->CurrentMapForDeprecated();
125 return map != NULL && !CanRetainOtherContext(map, *native_context_); 125 return map != NULL && !CanRetainOtherContext(map, *native_context_);
126 } 126 }
127 return false; 127 return false;
128 } 128 }
129 129
130 130
131 bool TypeFeedbackOracle::LoadIsPreMonomorphic(Property* expr) {
132 Handle<Object> map_or_code = GetInfo(expr->PropertyFeedbackId());
133 if (map_or_code->IsCode()) {
134 Handle<Code> code = Handle<Code>::cast(map_or_code);
135 return code->ic_state() == PREMONOMORPHIC;
136 }
137 return false;
138 }
139
140
131 bool TypeFeedbackOracle::LoadIsPolymorphic(Property* expr) { 141 bool TypeFeedbackOracle::LoadIsPolymorphic(Property* expr) {
132 Handle<Object> map_or_code = GetInfo(expr->PropertyFeedbackId()); 142 Handle<Object> map_or_code = GetInfo(expr->PropertyFeedbackId());
133 if (map_or_code->IsCode()) { 143 if (map_or_code->IsCode()) {
134 Handle<Code> code = Handle<Code>::cast(map_or_code); 144 Handle<Code> code = Handle<Code>::cast(map_or_code);
135 return code->is_keyed_load_stub() && code->ic_state() == POLYMORPHIC; 145 return code->is_keyed_load_stub() && code->ic_state() == POLYMORPHIC;
136 } 146 }
137 return false; 147 return false;
138 } 148 }
139 149
140 150
(...skipping 18 matching lines...) Expand all
159 if (!preliminary_checks) return false; 169 if (!preliminary_checks) return false;
160 Map* map = code->FindFirstMap(); 170 Map* map = code->FindFirstMap();
161 if (map == NULL) return false; 171 if (map == NULL) return false;
162 map = map->CurrentMapForDeprecated(); 172 map = map->CurrentMapForDeprecated();
163 return map != NULL && !CanRetainOtherContext(map, *native_context_); 173 return map != NULL && !CanRetainOtherContext(map, *native_context_);
164 } 174 }
165 return false; 175 return false;
166 } 176 }
167 177
168 178
179 bool TypeFeedbackOracle::StoreIsPreMonomorphic(TypeFeedbackId ast_id) {
180 Handle<Object> map_or_code = GetInfo(ast_id);
181 if (map_or_code->IsCode()) {
182 Handle<Code> code = Handle<Code>::cast(map_or_code);
183 return code->ic_state() == PREMONOMORPHIC;
184 }
185 return false;
186 }
187
188
169 bool TypeFeedbackOracle::StoreIsKeyedPolymorphic(TypeFeedbackId ast_id) { 189 bool TypeFeedbackOracle::StoreIsKeyedPolymorphic(TypeFeedbackId ast_id) {
170 Handle<Object> map_or_code = GetInfo(ast_id); 190 Handle<Object> map_or_code = GetInfo(ast_id);
171 if (map_or_code->IsCode()) { 191 if (map_or_code->IsCode()) {
172 Handle<Code> code = Handle<Code>::cast(map_or_code); 192 Handle<Code> code = Handle<Code>::cast(map_or_code);
173 return code->is_keyed_store_stub() && 193 return code->is_keyed_store_stub() &&
174 code->ic_state() == POLYMORPHIC; 194 code->ic_state() == POLYMORPHIC;
175 } 195 }
176 return false; 196 return false;
177 } 197 }
178 198
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 if (feedback != NULL) SetInfo(ast_id, feedback); 635 if (feedback != NULL) SetInfo(ast_id, feedback);
616 } 636 }
617 } 637 }
618 } else { 638 } else {
619 SetInfo(ast_id, target); 639 SetInfo(ast_id, target);
620 } 640 }
621 break; 641 break;
622 642
623 case Code::KEYED_LOAD_IC: 643 case Code::KEYED_LOAD_IC:
624 case Code::KEYED_STORE_IC: 644 case Code::KEYED_STORE_IC:
625 if (target->ic_state() == MONOMORPHIC ||
626 target->ic_state() == POLYMORPHIC) {
627 SetInfo(ast_id, target);
628 }
629 break;
630
631 case Code::BINARY_OP_IC: 645 case Code::BINARY_OP_IC:
632 case Code::COMPARE_IC: 646 case Code::COMPARE_IC:
633 case Code::TO_BOOLEAN_IC: 647 case Code::TO_BOOLEAN_IC:
634 case Code::COMPARE_NIL_IC: 648 case Code::COMPARE_NIL_IC:
635 SetInfo(ast_id, target); 649 SetInfo(ast_id, target);
636 break; 650 break;
637 651
638 default: 652 default:
639 break; 653 break;
640 } 654 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 if (info.IsUninitialized()) return Representation::None(); 694 if (info.IsUninitialized()) return Representation::None();
681 if (info.IsSmi()) return Representation::Smi(); 695 if (info.IsSmi()) return Representation::Smi();
682 if (info.IsInteger32()) return Representation::Integer32(); 696 if (info.IsInteger32()) return Representation::Integer32();
683 if (info.IsDouble()) return Representation::Double(); 697 if (info.IsDouble()) return Representation::Double();
684 if (info.IsNumber()) return Representation::Double(); 698 if (info.IsNumber()) return Representation::Double();
685 return Representation::Tagged(); 699 return Representation::Tagged();
686 } 700 }
687 701
688 702
689 } } // namespace v8::internal 703 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/type-info.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698