From: mvstanton@chromium.org Date: Wed, 4 Dec 2013 10:46:18 +0000 (+0000) Subject: Remove unnecessary overflow check in HGraphBuilder::BuildCreateAllocationMemento(). X-Git-Tag: upstream/4.7.83~11421 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a1a871fb5a1ec841c24ac8fec630221d272ee9c2;p=platform%2Fupstream%2Fv8.git Remove unnecessary overflow check in HGraphBuilder::BuildCreateAllocationMemento(). With this fix codegen looks like: mov ecx,[eax+0xf] ;;; <@52,#38> load-named-field add ecx,0x2 ;;; <@54,#40> add-i mov [eax+0xf],ecx ;;; <@56,#41> store-named-field without it there is an overflow check and jump to deopt. x64 code looks similar, except there is an (annoying) smi-untag then int32-to-smi around the add operation. R=bmeurer@chromium.org, hpayer@chromium.org Review URL: https://codereview.chromium.org/104313003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18255 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/hydrogen.cc b/src/hydrogen.cc index 900e07ecd..8dbecac11 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -2592,6 +2592,9 @@ void HGraphBuilder::BuildCreateAllocationMemento( AllocationSite::kMementoCreateCountOffset)); memento_create_count = AddUncasted( memento_create_count, graph()->GetConstant1()); + // This smi value is reset to zero after every gc, overflow isn't a problem + // since the counter is bounded by the new space size. + memento_create_count->ClearFlag(HValue::kCanOverflow); HStoreNamedField* store = Add( allocation_site, HObjectAccess::ForAllocationSiteOffset( AllocationSite::kMementoCreateCountOffset), memento_create_count);