Reviewers: Weiliang,

Description:
X87: enable snapshot

Tweak LConstantD and LStoreKeyed to avoid fp register spilling

BUG=

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

SVN Base: https://github.com/v8/v8.git@bleeding_edge

Affected files (+4, -12 lines):
  M src/x87/lithium-x87.h
  M src/x87/lithium-x87.cc


Index: src/x87/lithium-x87.cc
diff --git a/src/x87/lithium-x87.cc b/src/x87/lithium-x87.cc
index 1ff9f911b7a090cf4d32fe66750b70d424bf2eca..9dfd62defb3271398c586fa9f002790ae2c1d7a6 100644
--- a/src/x87/lithium-x87.cc
+++ b/src/x87/lithium-x87.cc
@@ -2054,10 +2054,7 @@ LInstruction* LChunkBuilder::DoConstant(HConstant* instr) {
   } else if (r.IsInteger32()) {
     return DefineAsRegister(new(zone()) LConstantI);
   } else if (r.IsDouble()) {
-    double value = instr->DoubleValue();
-    bool value_is_zero = BitCast<uint64_t, double>(value) == 0;
-    LOperand* temp = value_is_zero ? NULL : TempRegister();
-    return DefineAsRegister(new(zone()) LConstantD(temp));
+    return DefineAsRegister(new(zone()) LConstantD);
   } else if (r.IsExternal()) {
     return DefineAsRegister(new(zone()) LConstantE);
   } else if (r.IsTagged()) {
@@ -2248,8 +2245,9 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {

     if (instr->value()->representation().IsDouble()) {
       LOperand* object = UseRegisterAtStart(instr->elements());
-      LOperand* val = NULL;
-      val = UseRegisterAtStart(instr->value());
+      // For storing double hole, no fp register required.
+      LOperand* val = instr->IsConstantHoleStore()
+          ? NULL : UseRegisterAtStart(instr->value());
       LOperand* key = UseRegisterOrConstantAtStart(instr->key());
       return new(zone()) LStoreKeyed(object, key, val);
     } else {
Index: src/x87/lithium-x87.h
diff --git a/src/x87/lithium-x87.h b/src/x87/lithium-x87.h
index 18c62defaba0905c2cb3541a69d2982430317918..e54ba023f83ce5ee0bfacee05466f7af2d4457be 100644
--- a/src/x87/lithium-x87.h
+++ b/src/x87/lithium-x87.h
@@ -1336,12 +1336,6 @@ class LConstantS FINAL : public LTemplateInstruction<1, 0, 0> {

 class LConstantD FINAL : public LTemplateInstruction<1, 0, 1> {
  public:
-  explicit LConstantD(LOperand* temp) {
-    temps_[0] = temp;
-  }
-
-  LOperand* temp() { return temps_[0]; }
-
   DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
   DECLARE_HYDROGEN_ACCESSOR(Constant)



--
--
v8-dev mailing list
v8-dev@googlegroups.com
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 v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to