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

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

Issue 91803003: Move responsibility for definition of ExtraICState bits into the ICs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: A couple more nits. Created 7 years 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/ic-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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 return Handle<Map>::cast(map_or_code); 261 return Handle<Map>::cast(map_or_code);
262 } 262 }
263 263
264 264
265 KeyedAccessStoreMode TypeFeedbackOracle::GetStoreMode( 265 KeyedAccessStoreMode TypeFeedbackOracle::GetStoreMode(
266 TypeFeedbackId ast_id) { 266 TypeFeedbackId ast_id) {
267 Handle<Object> map_or_code = GetInfo(ast_id); 267 Handle<Object> map_or_code = GetInfo(ast_id);
268 if (map_or_code->IsCode()) { 268 if (map_or_code->IsCode()) {
269 Handle<Code> code = Handle<Code>::cast(map_or_code); 269 Handle<Code> code = Handle<Code>::cast(map_or_code);
270 if (code->kind() == Code::KEYED_STORE_IC) { 270 if (code->kind() == Code::KEYED_STORE_IC) {
271 return Code::GetKeyedAccessStoreMode(code->extra_ic_state()); 271 return KeyedStoreIC::GetKeyedAccessStoreMode(code->extra_ic_state());
272 } 272 }
273 } 273 }
274 return STANDARD_STORE; 274 return STANDARD_STORE;
275 } 275 }
276 276
277 277
278 void TypeFeedbackOracle::LoadReceiverTypes(Property* expr, 278 void TypeFeedbackOracle::LoadReceiverTypes(Property* expr,
279 Handle<String> name, 279 Handle<String> name,
280 SmallMapList* types) { 280 SmallMapList* types) {
281 Code::Flags flags = Code::ComputeFlags( 281 Code::Flags flags = Code::ComputeFlags(
282 Code::HANDLER, MONOMORPHIC, Code::kNoExtraICState, 282 Code::HANDLER, MONOMORPHIC, kNoExtraICState,
283 Code::NORMAL, Code::LOAD_IC); 283 Code::NORMAL, Code::LOAD_IC);
284 CollectReceiverTypes(expr->PropertyFeedbackId(), name, flags, types); 284 CollectReceiverTypes(expr->PropertyFeedbackId(), name, flags, types);
285 } 285 }
286 286
287 287
288 void TypeFeedbackOracle::StoreReceiverTypes(Assignment* expr, 288 void TypeFeedbackOracle::StoreReceiverTypes(Assignment* expr,
289 Handle<String> name, 289 Handle<String> name,
290 SmallMapList* types) { 290 SmallMapList* types) {
291 Code::Flags flags = Code::ComputeFlags( 291 Code::Flags flags = Code::ComputeFlags(
292 Code::HANDLER, MONOMORPHIC, Code::kNoExtraICState, 292 Code::HANDLER, MONOMORPHIC, kNoExtraICState,
293 Code::NORMAL, Code::STORE_IC); 293 Code::NORMAL, Code::STORE_IC);
294 CollectReceiverTypes(expr->AssignmentFeedbackId(), name, flags, types); 294 CollectReceiverTypes(expr->AssignmentFeedbackId(), name, flags, types);
295 } 295 }
296 296
297 297
298 void TypeFeedbackOracle::CallReceiverTypes(Call* expr, 298 void TypeFeedbackOracle::CallReceiverTypes(Call* expr,
299 Handle<String> name, 299 Handle<String> name,
300 CallKind call_kind, 300 CallKind call_kind,
301 SmallMapList* types) { 301 SmallMapList* types) {
302 int arity = expr->arguments()->length(); 302 int arity = expr->arguments()->length();
303 303
304 // Note: Currently we do not take string extra ic data into account 304 // Note: Currently we do not take string extra ic data into account
305 // here. 305 // here.
306 Code::ExtraICState extra_ic_state = 306 ContextualMode contextual_mode = call_kind == CALL_AS_FUNCTION
307 CallIC::Contextual::encode(call_kind == CALL_AS_FUNCTION); 307 ? CONTEXTUAL
308 : NOT_CONTEXTUAL;
309 ExtraICState extra_ic_state =
310 CallIC::Contextual::encode(contextual_mode);
308 311
309 Code::Flags flags = Code::ComputeMonomorphicFlags( 312 Code::Flags flags = Code::ComputeMonomorphicFlags(
310 Code::CALL_IC, extra_ic_state, OWN_MAP, Code::NORMAL, arity); 313 Code::CALL_IC, extra_ic_state, OWN_MAP, Code::NORMAL, arity);
311 CollectReceiverTypes(expr->CallFeedbackId(), name, flags, types); 314 CollectReceiverTypes(expr->CallFeedbackId(), name, flags, types);
312 } 315 }
313 316
314 317
315 CheckType TypeFeedbackOracle::GetCallCheckType(Call* expr) { 318 CheckType TypeFeedbackOracle::GetCallCheckType(Call* expr) {
316 Handle<Object> value = GetInfo(expr->CallFeedbackId()); 319 Handle<Object> value = GetInfo(expr->CallFeedbackId());
317 if (!value->IsSmi()) return RECEIVER_MAP_CHECK; 320 if (!value->IsSmi()) return RECEIVER_MAP_CHECK;
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 if (info.IsUninitialized()) return Representation::None(); 702 if (info.IsUninitialized()) return Representation::None();
700 if (info.IsSmi()) return Representation::Smi(); 703 if (info.IsSmi()) return Representation::Smi();
701 if (info.IsInteger32()) return Representation::Integer32(); 704 if (info.IsInteger32()) return Representation::Integer32();
702 if (info.IsDouble()) return Representation::Double(); 705 if (info.IsDouble()) return Representation::Double();
703 if (info.IsNumber()) return Representation::Double(); 706 if (info.IsNumber()) return Representation::Double();
704 return Representation::Tagged(); 707 return Representation::Tagged();
705 } 708 }
706 709
707 710
708 } } // namespace v8::internal 711 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/stub-cache.cc ('k') | src/x64/ic-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698