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

Side by Side Diff: src/ic.cc

Issue 24512003: Reset IC to premonomorphic rather than uninitialized. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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/ic.h ('k') | test/cctest/test-heap.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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 case Code::TO_BOOLEAN_IC: 396 case Code::TO_BOOLEAN_IC:
397 // Clearing these is tricky and does not 397 // Clearing these is tricky and does not
398 // make any performance difference. 398 // make any performance difference.
399 return; 399 return;
400 default: UNREACHABLE(); 400 default: UNREACHABLE();
401 } 401 }
402 } 402 }
403 403
404 404
405 void CallICBase::Clear(Address address, Code* target) { 405 void CallICBase::Clear(Address address, Code* target) {
406 if (target->ic_state() == UNINITIALIZED) return; 406 if (IsCleared(target)) return;
407 bool contextual = CallICBase::Contextual::decode(target->extra_ic_state()); 407 bool contextual = CallICBase::Contextual::decode(target->extra_ic_state());
408 Code* code = 408 Code* code =
409 target->GetIsolate()->stub_cache()->FindCallInitialize( 409 target->GetIsolate()->stub_cache()->FindCallInitialize(
410 target->arguments_count(), 410 target->arguments_count(),
411 contextual ? RelocInfo::CODE_TARGET_CONTEXT : RelocInfo::CODE_TARGET, 411 contextual ? RelocInfo::CODE_TARGET_CONTEXT : RelocInfo::CODE_TARGET,
412 target->kind()); 412 target->kind());
413 SetTargetAtAddress(address, code); 413 SetTargetAtAddress(address, code);
414 } 414 }
415 415
416 416
417 void KeyedLoadIC::Clear(Isolate* isolate, Address address, Code* target) { 417 void KeyedLoadIC::Clear(Isolate* isolate, Address address, Code* target) {
418 if (target->ic_state() == UNINITIALIZED) return; 418 if (IsCleared(target)) return;
419 // Make sure to also clear the map used in inline fast cases. If we 419 // Make sure to also clear the map used in inline fast cases. If we
420 // do not clear these maps, cached code can keep objects alive 420 // do not clear these maps, cached code can keep objects alive
421 // through the embedded maps. 421 // through the embedded maps.
422 SetTargetAtAddress(address, *initialize_stub(isolate)); 422 SetTargetAtAddress(address, *pre_monomorphic_stub(isolate));
423 } 423 }
424 424
425 425
426 void LoadIC::Clear(Isolate* isolate, Address address, Code* target) { 426 void LoadIC::Clear(Isolate* isolate, Address address, Code* target) {
427 if (target->ic_state() == UNINITIALIZED) return; 427 if (IsCleared(target)) return;
428 SetTargetAtAddress(address, *initialize_stub(isolate)); 428 SetTargetAtAddress(address, *pre_monomorphic_stub(isolate));
429 } 429 }
430 430
431 431
432 void StoreIC::Clear(Isolate* isolate, Address address, Code* target) { 432 void StoreIC::Clear(Isolate* isolate, Address address, Code* target) {
433 if (target->ic_state() == UNINITIALIZED) return; 433 if (IsCleared(target)) return;
434 SetTargetAtAddress(address, 434 SetTargetAtAddress(address,
435 (Code::GetStrictMode(target->extra_ic_state()) == kStrictMode) 435 (Code::GetStrictMode(target->extra_ic_state()) == kStrictMode)
436 ? *initialize_stub_strict(isolate) 436 ? *pre_monomorphic_stub_strict(isolate)
437 : *initialize_stub(isolate)); 437 : *pre_monomorphic_stub(isolate));
438 } 438 }
439 439
440 440
441 void KeyedStoreIC::Clear(Isolate* isolate, Address address, Code* target) { 441 void KeyedStoreIC::Clear(Isolate* isolate, Address address, Code* target) {
442 if (target->ic_state() == UNINITIALIZED) return; 442 if (IsCleared(target)) return;
443 SetTargetAtAddress(address, 443 SetTargetAtAddress(address,
444 (Code::GetStrictMode(target->extra_ic_state()) == kStrictMode) 444 (Code::GetStrictMode(target->extra_ic_state()) == kStrictMode)
445 ? *initialize_stub_strict(isolate) 445 ? *pre_monomorphic_stub_strict(isolate)
446 : *initialize_stub(isolate)); 446 : *pre_monomorphic_stub(isolate));
447 } 447 }
448 448
449 449
450 void CompareIC::Clear(Isolate* isolate, Address address, Code* target) { 450 void CompareIC::Clear(Isolate* isolate, Address address, Code* target) {
451 ASSERT(target->major_key() == CodeStub::CompareIC); 451 ASSERT(target->major_key() == CodeStub::CompareIC);
452 CompareIC::State handler_state; 452 CompareIC::State handler_state;
453 Token::Value op; 453 Token::Value op;
454 ICCompareStub::DecodeMinorKey(target->stub_info(), NULL, NULL, 454 ICCompareStub::DecodeMinorKey(target->stub_info(), NULL, NULL,
455 &handler_state, &op); 455 &handler_state, &op);
456 // Only clear CompareICs that can retain objects. 456 // Only clear CompareICs that can retain objects.
(...skipping 2705 matching lines...) Expand 10 before | Expand all | Expand 10 after
3162 #undef ADDR 3162 #undef ADDR
3163 }; 3163 };
3164 3164
3165 3165
3166 Address IC::AddressFromUtilityId(IC::UtilityId id) { 3166 Address IC::AddressFromUtilityId(IC::UtilityId id) {
3167 return IC_utilities[id]; 3167 return IC_utilities[id];
3168 } 3168 }
3169 3169
3170 3170
3171 } } // namespace v8::internal 3171 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ic.h ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698