From 276c2a0dec0bd18312825ee9297d7ef58b540025 Mon Sep 17 00:00:00 2001 From: "weiliang.lin@intel.com" Date: Fri, 5 Sep 2014 05:22:41 +0000 Subject: [PATCH] X87: enable snapshot Tweak LConstantD and LStoreKeyed to avoid fp register spilling BUG= R=weiliang.lin@intel.com Review URL: https://codereview.chromium.org/545673003 Patch from Jing Bao . git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23710 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/x87/lithium-x87.cc | 11 +++++------ src/x87/lithium-x87.h | 6 ------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/x87/lithium-x87.cc b/src/x87/lithium-x87.cc index 1ff9f91..3e64f19 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(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,10 @@ 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 { diff --git a/src/x87/lithium-x87.h b/src/x87/lithium-x87.h index 18c62de..e54ba02 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) -- 2.7.4