MIPS: HInnerAllocatedObject instruction allows hydrogen code to carve up...

MIPS: HInnerAllocatedObject instruction allows hydrogen code to carve up allocated regions into sub objects.

Port r13928 (ff66bd4bcdb580438d96c610bcbe8852bb127908)

BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13985 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent a5be5da2
......@@ -4005,6 +4005,13 @@ void LCodeGen::DoCallRuntime(LCallRuntime* instr) {
}
void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) {
Register result = ToRegister(instr->result());
Register base = ToRegister(instr->base_object());
__ Addu(result, base, Operand(instr->offset()));
}
void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
Register object = ToRegister(instr->object());
Register value = ToRegister(instr->value());
......
......@@ -290,6 +290,13 @@ void LTypeofIsAndBranch::PrintDataTo(StringStream* stream) {
}
void LInnerAllocatedObject::PrintDataTo(StringStream* stream) {
stream->Add(" = ");
base_object()->PrintTo(stream);
stream->Add(" + %d", offset());
}
void LCallConstantFunction::PrintDataTo(StringStream* stream) {
stream->Add("#%d / ", arity());
}
......@@ -1020,6 +1027,15 @@ LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) {
}
LInstruction* LChunkBuilder::DoInnerAllocatedObject(
HInnerAllocatedObject* inner_object) {
LOperand* base_object = UseRegisterAtStart(inner_object->base_object());
LInnerAllocatedObject* result =
new(zone()) LInnerAllocatedObject(base_object);
return DefineAsRegister(result);
}
LInstruction* LChunkBuilder::DoThisFunction(HThisFunction* instr) {
return instr->HasNoUses()
? NULL
......
......@@ -188,7 +188,9 @@ class LCodeGen;
V(LoadFieldByIndex) \
V(DateField) \
V(WrapReceiver) \
V(Drop)
V(Drop) \
V(InnerAllocatedObject)
#define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \
virtual Opcode opcode() const { return LInstruction::k##type; } \
......@@ -1600,6 +1602,22 @@ class LDrop: public LTemplateInstruction<0, 0, 0> {
};
class LInnerAllocatedObject: public LTemplateInstruction<1, 1, 0> {
public:
explicit LInnerAllocatedObject(LOperand* base_object) {
inputs_[0] = base_object;
}
LOperand* base_object() { return inputs_[0]; }
int offset() { return hydrogen()->offset(); }
virtual void PrintDataTo(StringStream* stream);
DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject, "sub-allocated-object")
DECLARE_HYDROGEN_ACCESSOR(InnerAllocatedObject)
};
class LThisFunction: public LTemplateInstruction<1, 0, 0> {
public:
DECLARE_CONCRETE_INSTRUCTION(ThisFunction, "this-function")
......
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