From: palfia@homejinni.com Date: Thu, 30 May 2013 01:22:04 +0000 (+0000) Subject: MIPS: Don't explicitly pass requested representations to constants; implement ConstantS X-Git-Tag: upstream/4.7.83~14055 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ec32721a0aa831926668bfdaba05f4df4c19bd77;p=platform%2Fupstream%2Fv8.git MIPS: Don't explicitly pass requested representations to constants; implement ConstantS Port r14874 (e93cc94e) BUG= Review URL: https://codereview.chromium.org/15731008 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14890 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index a9a4ec8..5f98ee4 100644 --- a/src/mips/lithium-codegen-mips.cc +++ b/src/mips/lithium-codegen-mips.cc @@ -1500,7 +1500,11 @@ void LCodeGen::DoSubI(LSubI* instr) { void LCodeGen::DoConstantI(LConstantI* instr) { - ASSERT(instr->result()->IsRegister()); + __ li(ToRegister(instr->result()), Operand(instr->value())); +} + + +void LCodeGen::DoConstantS(LConstantS* instr) { __ li(ToRegister(instr->result()), Operand(instr->value())); } diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc index 9a99d24..8c77adc 100644 --- a/src/mips/lithium-mips.cc +++ b/src/mips/lithium-mips.cc @@ -1927,11 +1927,13 @@ LInstruction* LChunkBuilder::DoReturn(HReturn* instr) { LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { Representation r = instr->representation(); - if (r.IsInteger32()) { + if (r.IsSmi()) { + return DefineAsRegister(new(zone()) LConstantS); + } else if (r.IsInteger32()) { return DefineAsRegister(new(zone()) LConstantI); } else if (r.IsDouble()) { return DefineAsRegister(new(zone()) LConstantD); - } else if (r.IsSmiOrTagged()) { + } else if (r.IsTagged()) { return DefineAsRegister(new(zone()) LConstantT); } else { UNREACHABLE(); diff --git a/src/mips/lithium-mips.h b/src/mips/lithium-mips.h index e3ada26..01dd6c2 100644 --- a/src/mips/lithium-mips.h +++ b/src/mips/lithium-mips.h @@ -87,6 +87,7 @@ class LCodeGen; V(CmpT) \ V(ConstantD) \ V(ConstantI) \ + V(ConstantS) \ V(ConstantT) \ V(Context) \ V(DebugBreak) \ @@ -1153,6 +1154,15 @@ class LConstantI: public LTemplateInstruction<1, 0, 0> { }; +class LConstantS: public LTemplateInstruction<1, 0, 0> { + public: + DECLARE_CONCRETE_INSTRUCTION(ConstantS, "constant-s") + DECLARE_HYDROGEN_ACCESSOR(Constant) + + Smi* value() const { return Smi::FromInt(hydrogen()->Integer32Value()); } +}; + + class LConstantD: public LTemplateInstruction<1, 0, 0> { public: DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")