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

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

Issue 12221064: Implement many KeyedStoreStubs using Crankshaft (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Final review feedback Created 7 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 | « src/stub-cache.cc ('k') | src/x64/code-stubs-x64.cc » ('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 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 119 }
120 return false; 120 return false;
121 } 121 }
122 122
123 123
124 bool TypeFeedbackOracle::StoreIsMonomorphicNormal(TypeFeedbackId ast_id) { 124 bool TypeFeedbackOracle::StoreIsMonomorphicNormal(TypeFeedbackId ast_id) {
125 Handle<Object> map_or_code = GetInfo(ast_id); 125 Handle<Object> map_or_code = GetInfo(ast_id);
126 if (map_or_code->IsMap()) return true; 126 if (map_or_code->IsMap()) return true;
127 if (map_or_code->IsCode()) { 127 if (map_or_code->IsCode()) {
128 Handle<Code> code = Handle<Code>::cast(map_or_code); 128 Handle<Code> code = Handle<Code>::cast(map_or_code);
129 bool standard_store = 129 bool standard_store = FLAG_compiled_keyed_stores ||
130 Code::GetKeyedAccessStoreMode(code->extra_ic_state()) == 130 (Code::GetKeyedAccessStoreMode(code->extra_ic_state()) ==
131 STANDARD_STORE; 131 STANDARD_STORE);
132 bool preliminary_checks = 132 bool preliminary_checks =
133 code->is_keyed_store_stub() && 133 code->is_keyed_store_stub() &&
134 standard_store && 134 standard_store &&
135 code->ic_state() == MONOMORPHIC && 135 code->ic_state() == MONOMORPHIC &&
136 Code::ExtractTypeFromFlags(code->flags()) == Code::NORMAL; 136 Code::ExtractTypeFromFlags(code->flags()) == Code::NORMAL;
137 if (!preliminary_checks) return false; 137 if (!preliminary_checks) return false;
138 Map* map = code->FindFirstMap(); 138 Map* map = code->FindFirstMap();
139 return map != NULL && !CanRetainOtherContext(map, *native_context_); 139 return map != NULL && !CanRetainOtherContext(map, *native_context_);
140 } 140 }
141 return false; 141 return false;
142 } 142 }
143 143
144 144
145 bool TypeFeedbackOracle::StoreIsPolymorphic(TypeFeedbackId ast_id) { 145 bool TypeFeedbackOracle::StoreIsPolymorphic(TypeFeedbackId ast_id) {
146 Handle<Object> map_or_code = GetInfo(ast_id); 146 Handle<Object> map_or_code = GetInfo(ast_id);
147 if (map_or_code->IsCode()) { 147 if (map_or_code->IsCode()) {
148 Handle<Code> code = Handle<Code>::cast(map_or_code); 148 Handle<Code> code = Handle<Code>::cast(map_or_code);
149 bool standard_store = 149 bool standard_store = FLAG_compiled_keyed_stores ||
150 Code::GetKeyedAccessStoreMode(code->extra_ic_state()) == 150 (Code::GetKeyedAccessStoreMode(code->extra_ic_state()) ==
151 STANDARD_STORE; 151 STANDARD_STORE);
152 return code->is_keyed_store_stub() && standard_store && 152 return code->is_keyed_store_stub() && standard_store &&
153 code->ic_state() == POLYMORPHIC; 153 code->ic_state() == POLYMORPHIC;
154 } 154 }
155 return false; 155 return false;
156 } 156 }
157 157
158 158
159 bool TypeFeedbackOracle::CallIsMonomorphic(Call* expr) { 159 bool TypeFeedbackOracle::CallIsMonomorphic(Call* expr) {
160 Handle<Object> value = GetInfo(expr->CallFeedbackId()); 160 Handle<Object> value = GetInfo(expr->CallFeedbackId());
161 return value->IsMap() || value->IsSmi() || value->IsJSFunction(); 161 return value->IsMap() || value->IsSmi() || value->IsJSFunction();
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 USE(maybe_result); 758 USE(maybe_result);
759 #ifdef DEBUG 759 #ifdef DEBUG
760 Object* result = NULL; 760 Object* result = NULL;
761 // Dictionary has been allocated with sufficient size for all elements. 761 // Dictionary has been allocated with sufficient size for all elements.
762 ASSERT(maybe_result->ToObject(&result)); 762 ASSERT(maybe_result->ToObject(&result));
763 ASSERT(*dictionary_ == result); 763 ASSERT(*dictionary_ == result);
764 #endif 764 #endif
765 } 765 }
766 766
767 } } // namespace v8::internal 767 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/stub-cache.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698