Index: src/mips/builtins-mips.cc |
diff --git a/src/mips/builtins-mips.cc b/src/mips/builtins-mips.cc |
index f89dca926fc603353464ac5068940f375fa1c9ab..5609d5ee4a521141a1d9e243178af96efb20c416 100644 |
--- a/src/mips/builtins-mips.cc |
+++ b/src/mips/builtins-mips.cc |
@@ -770,20 +770,23 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm, |
__ sll(t0, a3, kPointerSizeLog2); |
__ addu(t6, t4, t0); // End of object. |
ASSERT_EQ(3 * kPointerSize, JSObject::kHeaderSize); |
- { Label loop, entry; |
- if (count_constructions) { |
- // To allow for truncation. |
- __ LoadRoot(t7, Heap::kOnePointerFillerMapRootIndex); |
- } else { |
- __ LoadRoot(t7, Heap::kUndefinedValueRootIndex); |
+ __ LoadRoot(t7, Heap::kUndefinedValueRootIndex); |
+ if (count_constructions) { |
+ __ lw(a0, FieldMemOperand(a2, Map::kInstanceSizesOffset)); |
+ __ Ext(a0, a0, Map::kPreAllocatedPropertyFieldsByte * kBitsPerByte, |
+ kBitsPerByte); |
+ __ sll(t0, a0, kPointerSizeLog2); |
+ __ addu(a0, t5, t0); |
+ // a0: offset of first field after pre-allocated fields |
+ if (FLAG_debug_code) { |
+ __ Assert(le, "Unexpected number of pre-allocated property fields.", |
+ a0, Operand(t6)); |
} |
- __ jmp(&entry); |
- __ bind(&loop); |
- __ sw(t7, MemOperand(t5, 0)); |
- __ addiu(t5, t5, kPointerSize); |
- __ bind(&entry); |
- __ Branch(&loop, Uless, t5, Operand(t6)); |
+ __ InitializeFieldsWithFiller(t5, a0, t7); |
+ // To allow for truncation. |
+ __ LoadRoot(t7, Heap::kOnePointerFillerMapRootIndex); |
} |
+ __ InitializeFieldsWithFiller(t5, t6, t7); |
// Add the object tag to make the JSObject real, so that we can continue |
// and jump into the continuation code at any time from now on. Any |
@@ -800,14 +803,12 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm, |
// The field instance sizes contains both pre-allocated property fields |
// and in-object properties. |
__ lw(a0, FieldMemOperand(a2, Map::kInstanceSizesOffset)); |
- __ And(t6, |
- a0, |
- Operand(0x000000FF << Map::kPreAllocatedPropertyFieldsByte * 8)); |
- __ srl(t0, t6, Map::kPreAllocatedPropertyFieldsByte * 8); |
- __ Addu(a3, a3, Operand(t0)); |
- __ And(t6, a0, Operand(0x000000FF << Map::kInObjectPropertiesByte * 8)); |
- __ srl(t0, t6, Map::kInObjectPropertiesByte * 8); |
- __ subu(a3, a3, t0); |
+ __ Ext(t6, a0, Map::kPreAllocatedPropertyFieldsByte * kBitsPerByte, |
+ kBitsPerByte); |
+ __ Addu(a3, a3, Operand(t6)); |
+ __ Ext(t6, a0, Map::kInObjectPropertiesByte * kBitsPerByte, |
+ kBitsPerByte); |
+ __ subu(a3, a3, t6); |
// Done if no extra properties are to be allocated. |
__ Branch(&allocated, eq, a3, Operand(zero_reg)); |
@@ -1392,7 +1393,8 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) { |
const int kFunctionOffset = 4 * kPointerSize; |
{ |
- FrameScope frame_scope(masm, StackFrame::INTERNAL); |
+ FrameScope scope(masm, StackFrame::INTERNAL); |
+ |
__ lw(a0, MemOperand(fp, kFunctionOffset)); // Get the function. |
__ push(a0); |
__ lw(a0, MemOperand(fp, kArgsOffset)); // Get the args array. |
@@ -1526,7 +1528,8 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) { |
__ InvokeFunction(a1, actual, CALL_FUNCTION, |
NullCallWrapper(), CALL_AS_METHOD); |
- frame_scope.GenerateLeaveFrame(); |
+ scope.GenerateLeaveFrame(); |
+ |
__ Ret(USE_DELAY_SLOT); |
__ Addu(sp, sp, Operand(3 * kPointerSize)); // In delay slot. |
@@ -1539,7 +1542,6 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) { |
__ GetBuiltinEntry(a3, Builtins::CALL_FUNCTION_PROXY); |
__ Call(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), |
RelocInfo::CODE_TARGET); |
- |
// Tear down the internal frame and remove function, receiver and args. |
} |