MIPS: optimize Lithium Allocate.

Port r21968 (f6c757c)

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21988 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 83ee3477
...@@ -5291,33 +5291,26 @@ void LCodeGen::DoAllocate(LAllocate* instr) { ...@@ -5291,33 +5291,26 @@ void LCodeGen::DoAllocate(LAllocate* instr) {
} }
} else { } else {
Register size = ToRegister(instr->size()); Register size = ToRegister(instr->size());
__ Allocate(size, __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags);
result,
scratch,
scratch2,
deferred->entry(),
flags);
} }
__ bind(deferred->exit()); __ bind(deferred->exit());
if (instr->hydrogen()->MustPrefillWithFiller()) { if (instr->hydrogen()->MustPrefillWithFiller()) {
STATIC_ASSERT(kHeapObjectTag == 1);
if (instr->size()->IsConstantOperand()) { if (instr->size()->IsConstantOperand()) {
int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
__ li(scratch, Operand(size)); __ li(scratch, Operand(size - kHeapObjectTag));
} else { } else {
scratch = ToRegister(instr->size()); __ Subu(scratch, ToRegister(instr->size()), Operand(kHeapObjectTag));
} }
__ Subu(scratch, scratch, Operand(kPointerSize)); __ li(scratch2, Operand(isolate()->factory()->one_pointer_filler_map()));
__ Subu(result, result, Operand(kHeapObjectTag));
Label loop; Label loop;
__ bind(&loop); __ bind(&loop);
__ li(scratch2, Operand(isolate()->factory()->one_pointer_filler_map())); __ Subu(scratch, scratch, Operand(kPointerSize));
__ Addu(at, result, Operand(scratch)); __ Addu(at, result, Operand(scratch));
__ sw(scratch2, MemOperand(at)); __ sw(scratch2, MemOperand(at));
__ Subu(scratch, scratch, Operand(kPointerSize));
__ Branch(&loop, ge, scratch, Operand(zero_reg)); __ Branch(&loop, ge, scratch, Operand(zero_reg));
__ Addu(result, result, Operand(kHeapObjectTag));
} }
} }
......
...@@ -2315,9 +2315,7 @@ LInstruction* LChunkBuilder::DoStringCharFromCode(HStringCharFromCode* instr) { ...@@ -2315,9 +2315,7 @@ LInstruction* LChunkBuilder::DoStringCharFromCode(HStringCharFromCode* instr) {
LInstruction* LChunkBuilder::DoAllocate(HAllocate* instr) { LInstruction* LChunkBuilder::DoAllocate(HAllocate* instr) {
info()->MarkAsDeferredCalling(); info()->MarkAsDeferredCalling();
LOperand* context = UseAny(instr->context()); LOperand* context = UseAny(instr->context());
LOperand* size = instr->size()->IsConstant() LOperand* size = UseRegisterOrConstant(instr->size());
? UseConstant(instr->size())
: UseTempRegister(instr->size());
LOperand* temp1 = TempRegister(); LOperand* temp1 = TempRegister();
LOperand* temp2 = TempRegister(); LOperand* temp2 = TempRegister();
LAllocate* result = new(zone()) LAllocate(context, size, temp1, temp2); LAllocate* result = new(zone()) LAllocate(context, size, temp1, temp2);
......
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