Revision: 18283
Author:   [email protected]
Date:     Mon Dec  9 16:51:57 2013 UTC
Log:      HLoadNamedField for Smis optimized for x64

[email protected]

Review URL: https://codereview.chromium.org/108633003
http://code.google.com/p/v8/source/detail?r=18283

Modified:
 /branches/bleeding_edge/src/hydrogen-instructions.h
 /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc

=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Wed Dec 4 11:39:24 2013 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.h Mon Dec 9 16:51:57 2013 UTC
@@ -6216,7 +6216,11 @@
       set_representation(Representation::Integer32());
     } else if (representation.IsSmi()) {
       set_type(HType::Smi());
-      set_representation(representation);
+      if (SmiValuesAre32Bits()) {
+        set_representation(Representation::Integer32());
+      } else {
+        set_representation(representation);
+      }
     } else if (representation.IsDouble() ||
                representation.IsExternal() ||
                representation.IsInteger32()) {
=======================================
--- /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Wed Dec 4 11:39:24 2013 UTC +++ /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Mon Dec 9 16:51:57 2013 UTC
@@ -2843,7 +2843,17 @@
     __ movq(result, FieldOperand(object, JSObject::kPropertiesOffset));
     object = result;
   }
-  __ Load(result, FieldOperand(object, offset), access.representation());
+
+  Representation representation = access.representation();
+  if (representation.IsSmi() &&
+      instr->hydrogen()->representation().IsInteger32()) {
+    // Read int value directly from upper half of the smi.
+    STATIC_ASSERT(kSmiTag == 0);
+    STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32);
+    offset += kPointerSize / 2;
+    representation = Representation::Integer32();
+  }
+  __ Load(result, FieldOperand(object, offset), representation);
 }


--
--
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