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

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

Issue 12226090: Order arguments of ComputeMonomorphicFlags to match ComputeFlags. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 10 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') | 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 ? Handle<Map>::null() 209 ? Handle<Map>::null()
210 : Handle<Map>(first_map); 210 : Handle<Map>(first_map);
211 } 211 }
212 return Handle<Map>::cast(map_or_code); 212 return Handle<Map>::cast(map_or_code);
213 } 213 }
214 214
215 215
216 void TypeFeedbackOracle::LoadReceiverTypes(Property* expr, 216 void TypeFeedbackOracle::LoadReceiverTypes(Property* expr,
217 Handle<String> name, 217 Handle<String> name,
218 SmallMapList* types) { 218 SmallMapList* types) {
219 Code::Flags flags = 219 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC);
220 Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::NORMAL);
221 CollectReceiverTypes(expr->PropertyFeedbackId(), name, flags, types); 220 CollectReceiverTypes(expr->PropertyFeedbackId(), name, flags, types);
222 } 221 }
223 222
224 223
225 void TypeFeedbackOracle::StoreReceiverTypes(Assignment* expr, 224 void TypeFeedbackOracle::StoreReceiverTypes(Assignment* expr,
226 Handle<String> name, 225 Handle<String> name,
227 SmallMapList* types) { 226 SmallMapList* types) {
228 Code::Flags flags = 227 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::STORE_IC);
229 Code::ComputeMonomorphicFlags(Code::STORE_IC, Code::NORMAL);
230 CollectReceiverTypes(expr->AssignmentFeedbackId(), name, flags, types); 228 CollectReceiverTypes(expr->AssignmentFeedbackId(), name, flags, types);
231 } 229 }
232 230
233 231
234 void TypeFeedbackOracle::CallReceiverTypes(Call* expr, 232 void TypeFeedbackOracle::CallReceiverTypes(Call* expr,
235 Handle<String> name, 233 Handle<String> name,
236 CallKind call_kind, 234 CallKind call_kind,
237 SmallMapList* types) { 235 SmallMapList* types) {
238 int arity = expr->arguments()->length(); 236 int arity = expr->arguments()->length();
239 237
240 // Note: Currently we do not take string extra ic data into account 238 // Note: Currently we do not take string extra ic data into account
241 // here. 239 // here.
242 Code::ExtraICState extra_ic_state = 240 Code::ExtraICState extra_ic_state =
243 CallIC::Contextual::encode(call_kind == CALL_AS_FUNCTION); 241 CallIC::Contextual::encode(call_kind == CALL_AS_FUNCTION);
244 242
245 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::CALL_IC, 243 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::CALL_IC,
244 extra_ic_state,
246 Code::NORMAL, 245 Code::NORMAL,
247 extra_ic_state, 246 arity,
248 OWN_MAP, 247 OWN_MAP);
249 arity);
250 CollectReceiverTypes(expr->CallFeedbackId(), name, flags, types); 248 CollectReceiverTypes(expr->CallFeedbackId(), name, flags, types);
251 } 249 }
252 250
253 251
254 CheckType TypeFeedbackOracle::GetCallCheckType(Call* expr) { 252 CheckType TypeFeedbackOracle::GetCallCheckType(Call* expr) {
255 Handle<Object> value = GetInfo(expr->CallFeedbackId()); 253 Handle<Object> value = GetInfo(expr->CallFeedbackId());
256 if (!value->IsSmi()) return RECEIVER_MAP_CHECK; 254 if (!value->IsSmi()) return RECEIVER_MAP_CHECK;
257 CheckType check = static_cast<CheckType>(Smi::cast(*value)->value()); 255 CheckType check = static_cast<CheckType>(Smi::cast(*value)->value());
258 ASSERT(check != RECEIVER_MAP_CHECK); 256 ASSERT(check != RECEIVER_MAP_CHECK);
259 return check; 257 return check;
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 USE(maybe_result); 710 USE(maybe_result);
713 #ifdef DEBUG 711 #ifdef DEBUG
714 Object* result = NULL; 712 Object* result = NULL;
715 // Dictionary has been allocated with sufficient size for all elements. 713 // Dictionary has been allocated with sufficient size for all elements.
716 ASSERT(maybe_result->ToObject(&result)); 714 ASSERT(maybe_result->ToObject(&result));
717 ASSERT(*dictionary_ == result); 715 ASSERT(*dictionary_ == result);
718 #endif 716 #endif
719 } 717 }
720 718
721 } } // namespace v8::internal 719 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/stub-cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698