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

Side by Side Diff: src/hydrogen-instructions.cc

Issue 143413019: Load elimination fix with a test case. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review notes applied Created 6 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/hydrogen-instructions.h ('k') | src/hydrogen-load-elimination.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 3557 matching lines...) Expand 10 before | Expand all | Expand 10 after
3568 HInnerAllocatedObject::New(zone, context(), dominating_allocate_, 3568 HInnerAllocatedObject::New(zone, context(), dominating_allocate_,
3569 dominating_allocate_->size(), type()); 3569 dominating_allocate_->size(), type());
3570 free_space_instr->InsertBefore(this); 3570 free_space_instr->InsertBefore(this);
3571 HConstant* filler_map = HConstant::New( 3571 HConstant* filler_map = HConstant::New(
3572 zone, 3572 zone,
3573 context(), 3573 context(),
3574 isolate()->factory()->free_space_map()); 3574 isolate()->factory()->free_space_map());
3575 filler_map->FinalizeUniqueness(); // TODO(titzer): should be init'd a'ready 3575 filler_map->FinalizeUniqueness(); // TODO(titzer): should be init'd a'ready
3576 filler_map->InsertAfter(free_space_instr); 3576 filler_map->InsertAfter(free_space_instr);
3577 HInstruction* store_map = HStoreNamedField::New(zone, context(), 3577 HInstruction* store_map = HStoreNamedField::New(zone, context(),
3578 free_space_instr, HObjectAccess::ForMap(), filler_map); 3578 free_space_instr, HObjectAccess::ForMap(), filler_map,
3579 INITIALIZING_STORE);
3579 store_map->SetFlag(HValue::kHasNoObservableSideEffects); 3580 store_map->SetFlag(HValue::kHasNoObservableSideEffects);
3580 store_map->InsertAfter(filler_map); 3581 store_map->InsertAfter(filler_map);
3581 3582
3582 // We must explicitly force Smi representation here because on x64 we 3583 // We must explicitly force Smi representation here because on x64 we
3583 // would otherwise automatically choose int32, but the actual store 3584 // would otherwise automatically choose int32, but the actual store
3584 // requires a Smi-tagged value. 3585 // requires a Smi-tagged value.
3585 HConstant* filler_size = HConstant::CreateAndInsertAfter( 3586 HConstant* filler_size = HConstant::CreateAndInsertAfter(
3586 zone, context(), free_space_size, Representation::Smi(), store_map); 3587 zone, context(), free_space_size, Representation::Smi(), store_map);
3587 // Must force Smi representation for x64 (see comment above). 3588 // Must force Smi representation for x64 (see comment above).
3588 HObjectAccess access = 3589 HObjectAccess access =
3589 HObjectAccess::ForJSObjectOffset(FreeSpace::kSizeOffset, 3590 HObjectAccess::ForJSObjectOffset(FreeSpace::kSizeOffset,
3590 Representation::Smi()); 3591 Representation::Smi());
3591 HStoreNamedField* store_size = HStoreNamedField::New(zone, context(), 3592 HStoreNamedField* store_size = HStoreNamedField::New(zone, context(),
3592 free_space_instr, access, filler_size); 3593 free_space_instr, access, filler_size, INITIALIZING_STORE);
3593 store_size->SetFlag(HValue::kHasNoObservableSideEffects); 3594 store_size->SetFlag(HValue::kHasNoObservableSideEffects);
3594 store_size->InsertAfter(filler_size); 3595 store_size->InsertAfter(filler_size);
3595 filler_free_space_size_ = store_size; 3596 filler_free_space_size_ = store_size;
3596 } 3597 }
3597 3598
3598 3599
3599 void HAllocate::ClearNextMapWord(int offset) { 3600 void HAllocate::ClearNextMapWord(int offset) {
3600 if (MustClearNextMapWord()) { 3601 if (MustClearNextMapWord()) {
3601 Zone* zone = block()->zone(); 3602 Zone* zone = block()->zone();
3602 HObjectAccess access = HObjectAccess::ForJSObjectOffset(offset); 3603 HObjectAccess access = HObjectAccess::ForJSObjectOffset(offset);
3603 HStoreNamedField* clear_next_map = 3604 HStoreNamedField* clear_next_map =
3604 HStoreNamedField::New(zone, context(), this, access, 3605 HStoreNamedField::New(zone, context(), this, access,
3605 block()->graph()->GetConstant0()); 3606 block()->graph()->GetConstant0(), INITIALIZING_STORE);
3606 clear_next_map->ClearAllSideEffects(); 3607 clear_next_map->ClearAllSideEffects();
3607 clear_next_map->InsertAfter(this); 3608 clear_next_map->InsertAfter(this);
3608 } 3609 }
3609 } 3610 }
3610 3611
3611 3612
3612 void HAllocate::PrintDataTo(StringStream* stream) { 3613 void HAllocate::PrintDataTo(StringStream* stream) {
3613 size()->PrintNameTo(stream); 3614 size()->PrintNameTo(stream);
3614 stream->Add(" ("); 3615 stream->Add(" (");
3615 if (IsNewSpaceAllocation()) stream->Add("N"); 3616 if (IsNewSpaceAllocation()) stream->Add("N");
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
4407 break; 4408 break;
4408 case kExternalMemory: 4409 case kExternalMemory:
4409 stream->Add("[external-memory]"); 4410 stream->Add("[external-memory]");
4410 break; 4411 break;
4411 } 4412 }
4412 4413
4413 stream->Add("@%d", offset()); 4414 stream->Add("@%d", offset());
4414 } 4415 }
4415 4416
4416 } } // namespace v8::internal 4417 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/hydrogen-load-elimination.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698