Index: src/arm/macro-assembler-arm.cc |
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc |
index c4b153f82e441c229b32519fc32f27a044d4ea1a..a79f8e042dbea46899b69d9967056997249fa5de 100644 |
--- a/src/arm/macro-assembler-arm.cc |
+++ b/src/arm/macro-assembler-arm.cc |
@@ -250,63 +250,21 @@ void MacroAssembler::RecordWriteHelper(Register object, |
bind(¬_in_new_space); |
} |
- // This is how much we shift the remembered set bit offset to get the |
- // offset of the word in the remembered set. We divide by kBitsPerInt (32, |
- // shift right 5) and then multiply by kIntSize (4, shift left 2). |
- const int kRSetWordShift = 3; |
- |
- Label fast; |
- |
- // Compute the bit offset in the remembered set. |
- // object: heap object pointer (with tag) |
- // offset: offset to store location from the object |
- mov(ip, Operand(Page::kPageAlignmentMask)); // load mask only once |
- and_(scratch, object, Operand(ip)); // offset into page of the object |
- add(offset, scratch, Operand(offset)); // add offset into the object |
- mov(offset, Operand(offset, LSR, kObjectAlignmentBits)); |
- |
- // Compute the page address from the heap object pointer. |
- // object: heap object pointer (with tag) |
- // offset: bit offset of store position in the remembered set |
+ mov(ip, Operand(Page::kPageAlignmentMask)); // Load mask only once. |
+ |
+ // Calculate region number. |
+ add(offset, object, Operand(offset)); // Add offset into the object. |
+ and_(offset, offset, Operand(ip)); // Offset into page of the object. |
+ mov(offset, Operand(offset, LSR, Page::kRegionSizeLog2)); |
+ |
+ // Calculate page address. |
bic(object, object, Operand(ip)); |
- // If the bit offset lies beyond the normal remembered set range, it is in |
- // the extra remembered set area of a large object. |
- // object: page start |
- // offset: bit offset of store position in the remembered set |
- cmp(offset, Operand(Page::kPageSize / kPointerSize)); |
- b(lt, &fast); |
- |
- // Adjust the bit offset to be relative to the start of the extra |
- // remembered set and the start address to be the address of the extra |
- // remembered set. |
- sub(offset, offset, Operand(Page::kPageSize / kPointerSize)); |
- // Load the array length into 'scratch' and multiply by four to get the |
- // size in bytes of the elements. |
- ldr(scratch, MemOperand(object, Page::kObjectStartOffset |
- + FixedArray::kLengthOffset)); |
- mov(scratch, Operand(scratch, LSL, kObjectAlignmentBits)); |
- // Add the page header (including remembered set), array header, and array |
- // body size to the page address. |
- add(object, object, Operand(Page::kObjectStartOffset |
- + FixedArray::kHeaderSize)); |
- add(object, object, Operand(scratch)); |
- |
- bind(&fast); |
- // Get address of the rset word. |
- // object: start of the remembered set (page start for the fast case) |
- // offset: bit offset of store position in the remembered set |
- bic(scratch, offset, Operand(kBitsPerInt - 1)); // clear the bit offset |
- add(object, object, Operand(scratch, LSR, kRSetWordShift)); |
- // Get bit offset in the rset word. |
- // object: address of remembered set word |
- // offset: bit offset of store position |
- and_(offset, offset, Operand(kBitsPerInt - 1)); |
- |
- ldr(scratch, MemOperand(object)); |
+ // Mark region dirty. |
+ ldr(scratch, MemOperand(object, Page::kDirtyFlagOffset)); |
mov(ip, Operand(1)); |
orr(scratch, scratch, Operand(ip, LSL, offset)); |
- str(scratch, MemOperand(object)); |
+ str(scratch, MemOperand(object, Page::kDirtyFlagOffset)); |
} |
@@ -334,7 +292,7 @@ void MacroAssembler::RecordWrite(Register object, Register offset, |
Label done; |
// First, test that the object is not in the new space. We cannot set |
- // remembered set bits in the new space. |
+ // region marks for new space pages. |
InNewSpace(object, scratch, eq, &done); |
// Record the actual write. |
@@ -617,6 +575,7 @@ void MacroAssembler::InvokeFunction(Register fun, |
ldr(expected_reg, |
FieldMemOperand(code_reg, |
SharedFunctionInfo::kFormalParameterCountOffset)); |
+ mov(expected_reg, Operand(expected_reg, ASR, kSmiTagSize)); |
ldr(code_reg, |
MemOperand(code_reg, SharedFunctionInfo::kCodeOffset - kHeapObjectTag)); |
add(code_reg, code_reg, Operand(Code::kHeaderSize - kHeapObjectTag)); |