Reviewers: Benedikt Meurer, Hannes Payer,

Message:
Hi guys, here is the restored overflow check. Hannes, the reason we didn't see it was because we cleared the overflow bit on the wrong instruction (the store,
not the add).
Thanks,
--Michael

Description:
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.


Please review this at https://codereview.chromium.org/104313003/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+2, -0 lines):
  M src/hydrogen.cc


Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 900e07ecdf9fa68a32540fc76be401d0b064a343..ef00703da7551eb0d76c61da21d6759dca4156e0 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -2592,6 +2592,8 @@ void HGraphBuilder::BuildCreateAllocationMemento(
             AllocationSite::kMementoCreateCountOffset));
     memento_create_count = AddUncasted<HAdd>(
         memento_create_count, graph()->GetConstant1());
+ // This smi value is reset to zero after every gc, overflow isn't a problem.
+    memento_create_count->ClearFlag(HValue::kCanOverflow);
     HStoreNamedField* store = Add<HStoreNamedField>(
         allocation_site, HObjectAccess::ForAllocationSiteOffset(
AllocationSite::kMementoCreateCountOffset), memento_create_count);


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to