Commit ec32721a authored by palfia@homejinni.com's avatar palfia@homejinni.com

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
parent 4ee5e29b
......@@ -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()));
}
......
......@@ -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();
......
......@@ -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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment