Chromium Code Reviews| Index: src/mips/lithium-codegen-mips.cc | 
| diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc | 
| index c05df82cdf8bbc1a0900a389083bb13af05b0d4f..fcb1c397d5e2f437cd0c4e0a241b17cec5ac05ee 100644 | 
| --- a/src/mips/lithium-codegen-mips.cc | 
| +++ b/src/mips/lithium-codegen-mips.cc | 
| @@ -4217,6 +4217,44 @@ void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { | 
| } | 
| +void LCodeGen::DoAllocateObject(LAllocateObject* instr) { | 
| + class DeferredAllocateObject: public LDeferredCode { | 
| + public: | 
| + DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr) | 
| + : LDeferredCode(codegen), instr_(instr) { } | 
| + virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); } | 
| + virtual LInstruction* instr() { return instr_; } | 
| + private: | 
| + LAllocateObject* instr_; | 
| + }; | 
| + | 
| + DeferredAllocateObject* deferred = new DeferredAllocateObject(this, instr); | 
| + | 
| + // TODO(mstarzinger): Implement inlined version instead of jumping to | 
| + // deferred runtime call. | 
| + __ jmp(deferred->entry()); | 
| + | 
| + __ bind(deferred->exit()); | 
| +} | 
| + | 
| + | 
| +void LCodeGen::DoDeferredAllocateObject(LAllocateObject* instr) { | 
| + Register result = ToRegister(instr->result()); | 
| + Handle<JSFunction> constructor = instr->hydrogen()->constructor(); | 
| + | 
| + // TODO(3095996): Get rid of this. For now, we need to make the | 
| + // result register contain a valid pointer because it is already | 
| + // contained in the register pointer map. | 
| + __ mov(result, zero_reg); | 
| + | 
| + PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); | 
| + __ li(a0, Operand(constructor)); | 
| 
 
Vyacheslav Egorov (Chromium)
2012/02/27 15:06:02
consider using LoadHeapObject/PushHeapObject just
 
Michael Starzinger
2012/02/28 09:07:10
Done (on ARM and MIPS).
 
 | 
| + __ push(a0); | 
| + CallRuntimeFromDeferred(Runtime::kNewObject, 1, instr); | 
| + __ StoreToSafepointRegisterSlot(v0, result); | 
| +} | 
| + | 
| + | 
| void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { | 
| Heap* heap = isolate()->heap(); | 
| ElementsKind boilerplate_elements_kind = |