MIPS: Fix HInnerAllocatedObject to use an HValue for the offset.

Port r18181 (2b41b833)

BUG=
R=plind44@gmail.com

Review URL: https://codereview.chromium.org/99763003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18212 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
palfia@homejinni.com 2013-12-02 21:16:21 +00:00
parent f854247076
commit 68e0ca2e08
3 changed files with 20 additions and 13 deletions

View File

@ -4102,7 +4102,13 @@ void LCodeGen::DoStoreCodeEntry(LStoreCodeEntry* instr) {
void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) {
Register result = ToRegister(instr->result());
Register base = ToRegister(instr->base_object());
__ Addu(result, base, Operand(instr->offset()));
if (instr->offset()->IsConstantOperand()) {
LConstantOperand* offset = LConstantOperand::cast(instr->offset());
__ Addu(result, base, Operand(ToInteger32(offset)));
} else {
Register offset = ToRegister(instr->offset());
__ Addu(result, base, offset);
}
}

View File

@ -277,7 +277,8 @@ void LStoreCodeEntry::PrintDataTo(StringStream* stream) {
void LInnerAllocatedObject::PrintDataTo(StringStream* stream) {
stream->Add(" = ");
base_object()->PrintTo(stream);
stream->Add(" + %d", offset());
stream->Add(" + ");
offset()->PrintTo(stream);
}
@ -1119,11 +1120,11 @@ LInstruction* LChunkBuilder::DoStoreCodeEntry(
LInstruction* LChunkBuilder::DoInnerAllocatedObject(
HInnerAllocatedObject* inner_object) {
LOperand* base_object = UseRegisterAtStart(inner_object->base_object());
LInnerAllocatedObject* result =
new(zone()) LInnerAllocatedObject(base_object);
return DefineAsRegister(result);
HInnerAllocatedObject* instr) {
LOperand* base_object = UseRegisterAtStart(instr->base_object());
LOperand* offset = UseRegisterOrConstantAtStart(instr->offset());
return DefineAsRegister(
new(zone()) LInnerAllocatedObject(base_object, offset));
}

View File

@ -1778,19 +1778,19 @@ class LStoreCodeEntry V8_FINAL: public LTemplateInstruction<0, 1, 1> {
};
class LInnerAllocatedObject V8_FINAL: public LTemplateInstruction<1, 1, 0> {
class LInnerAllocatedObject V8_FINAL: public LTemplateInstruction<1, 2, 0> {
public:
explicit LInnerAllocatedObject(LOperand* base_object) {
LInnerAllocatedObject(LOperand* base_object, LOperand* offset) {
inputs_[0] = base_object;
inputs_[1] = offset;
}
LOperand* base_object() { return inputs_[0]; }
int offset() { return hydrogen()->offset(); }
LOperand* base_object() const { return inputs_[0]; }
LOperand* offset() const { return inputs_[1]; }
virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject, "sub-allocated-object")
DECLARE_HYDROGEN_ACCESSOR(InnerAllocatedObject)
DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject, "inner-allocated-object")
};