Index: src/full-codegen/mips64/full-codegen-mips64.cc |
diff --git a/src/full-codegen/mips64/full-codegen-mips64.cc b/src/full-codegen/mips64/full-codegen-mips64.cc |
index 26921d640da0d51cdf0eb204bf583a9e2cee770b..55e3aece676e06f5e644c37f8956c8f947ce261d 100644 |
--- a/src/full-codegen/mips64/full-codegen-mips64.cc |
+++ b/src/full-codegen/mips64/full-codegen-mips64.cc |
@@ -2264,41 +2264,28 @@ void FullCodeGenerator::EmitGeneratorResume(Expression *generator, |
void FullCodeGenerator::EmitCreateIteratorResult(bool done) { |
- Label gc_required; |
- Label allocated; |
+ Label allocate, done_allocate; |
- const int instance_size = 5 * kPointerSize; |
- DCHECK_EQ(isolate()->native_context()->iterator_result_map()->instance_size(), |
- instance_size); |
+ __ Allocate(JSIteratorResult::kSize, v0, a2, a3, &allocate, TAG_OBJECT); |
+ __ jmp(&done_allocate); |
- __ Allocate(instance_size, v0, a2, a3, &gc_required, TAG_OBJECT); |
- __ jmp(&allocated); |
- |
- __ bind(&gc_required); |
- __ Push(Smi::FromInt(instance_size)); |
+ __ bind(&allocate); |
+ __ Push(Smi::FromInt(JSIteratorResult::kSize)); |
__ CallRuntime(Runtime::kAllocateInNewSpace, 1); |
- __ ld(context_register(), |
- MemOperand(fp, StandardFrameConstants::kContextOffset)); |
- __ bind(&allocated); |
+ __ bind(&done_allocate); |
__ ld(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
__ ld(a1, FieldMemOperand(a1, GlobalObject::kNativeContextOffset)); |
__ ld(a1, ContextOperand(a1, Context::ITERATOR_RESULT_MAP_INDEX)); |
__ pop(a2); |
__ li(a3, Operand(isolate()->factory()->ToBoolean(done))); |
- __ li(a4, Operand(isolate()->factory()->empty_fixed_array())); |
+ __ li(t0, Operand(isolate()->factory()->empty_fixed_array())); |
__ sd(a1, FieldMemOperand(v0, HeapObject::kMapOffset)); |
- __ sd(a4, FieldMemOperand(v0, JSObject::kPropertiesOffset)); |
- __ sd(a4, FieldMemOperand(v0, JSObject::kElementsOffset)); |
- __ sd(a2, |
- FieldMemOperand(v0, JSGeneratorObject::kResultValuePropertyOffset)); |
- __ sd(a3, |
- FieldMemOperand(v0, JSGeneratorObject::kResultDonePropertyOffset)); |
- |
- // Only the value field needs a write barrier, as the other values are in the |
- // root set. |
- __ RecordWriteField(v0, JSGeneratorObject::kResultValuePropertyOffset, |
- a2, a3, kRAHasBeenSaved, kDontSaveFPRegs); |
+ __ sd(t0, FieldMemOperand(v0, JSObject::kPropertiesOffset)); |
+ __ sd(t0, FieldMemOperand(v0, JSObject::kElementsOffset)); |
+ __ sd(a2, FieldMemOperand(v0, JSIteratorResult::kValueOffset)); |
+ __ sd(a3, FieldMemOperand(v0, JSIteratorResult::kDoneOffset)); |
+ STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize); |
} |
@@ -4503,6 +4490,37 @@ void FullCodeGenerator::EmitDebugIsActive(CallRuntime* expr) { |
} |
+void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) { |
+ ZoneList<Expression*>* args = expr->arguments(); |
+ DCHECK_EQ(2, args->length()); |
+ VisitForStackValue(args->at(0)); |
+ VisitForStackValue(args->at(1)); |
+ |
+ Label runtime, done; |
+ |
+ __ Allocate(JSIteratorResult::kSize, v0, a2, a3, &runtime, TAG_OBJECT); |
+ __ ld(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
+ __ ld(a1, FieldMemOperand(a1, GlobalObject::kNativeContextOffset)); |
+ __ ld(a1, ContextOperand(a1, Context::ITERATOR_RESULT_MAP_INDEX)); |
+ __ pop(a3); |
+ __ pop(a2); |
+ __ li(t0, Operand(isolate()->factory()->empty_fixed_array())); |
+ __ sd(a1, FieldMemOperand(v0, HeapObject::kMapOffset)); |
+ __ sd(t0, FieldMemOperand(v0, JSObject::kPropertiesOffset)); |
+ __ sd(t0, FieldMemOperand(v0, JSObject::kElementsOffset)); |
+ __ sd(a2, FieldMemOperand(v0, JSIteratorResult::kValueOffset)); |
+ __ sd(a3, FieldMemOperand(v0, JSIteratorResult::kDoneOffset)); |
+ STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize); |
+ __ jmp(&done); |
+ |
+ __ bind(&runtime); |
+ __ CallRuntime(Runtime::kCreateIterResultObject, 2); |
+ |
+ __ bind(&done); |
+ context()->Plug(v0); |
+} |
+ |
+ |
void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) { |
// Push undefined as the receiver. |
__ LoadRoot(v0, Heap::kUndefinedValueRootIndex); |