| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 5998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6009 __ mov(value_, Operand(address_, 0)); | 6009 __ mov(value_, Operand(address_, 0)); |
| 6010 GenerateIncremental(masm); | 6010 GenerateIncremental(masm); |
| 6011 } | 6011 } |
| 6012 | 6012 |
| 6013 | 6013 |
| 6014 void RecordWriteStub::GenerateIncremental(MacroAssembler* masm) { | 6014 void RecordWriteStub::GenerateIncremental(MacroAssembler* masm) { |
| 6015 regs_.Save(masm); | 6015 regs_.Save(masm); |
| 6016 | 6016 |
| 6017 Label value_in_old_space; | 6017 Label value_in_old_space; |
| 6018 | 6018 |
| 6019 __ InNewSpace(value_, regs_.scratch0(), not_equal, &value_in_old_space); | 6019 __ CheckPageFlag(value_, regs_.scratch0(), |
| 6020 MemoryChunk::IN_NEW_SPACE, zero, |
| 6021 &value_in_old_space); |
| 6020 // After this point the value_ register may have been overwritten since it is | 6022 // After this point the value_ register may have been overwritten since it is |
| 6021 // also one of the scratch registers. | 6023 // also one of the scratch registers. |
| 6022 | 6024 |
| 6023 GenerateIncrementalValueIsInNewSpace(masm); | 6025 GenerateIncrementalValueIsInNewSpace(masm); |
| 6024 | 6026 |
| 6025 __ bind(&value_in_old_space); | 6027 __ bind(&value_in_old_space); |
| 6026 GenerateIncrementalValueIsInOldSpace(masm); | 6028 GenerateIncrementalValueIsInOldSpace(masm); |
| 6027 | 6029 |
| 6028 __ bind(&slow_); | 6030 __ bind(&slow_); |
| 6029 // Inform the incremental marker, but don't bother with the remembered set. | 6031 // Inform the incremental marker, but don't bother with the remembered set. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 6048 __ ret(0); | 6050 __ ret(0); |
| 6049 } | 6051 } |
| 6050 | 6052 |
| 6051 | 6053 |
| 6052 void RecordWriteStub::GenerateIncrementalValueIsInNewSpace( | 6054 void RecordWriteStub::GenerateIncrementalValueIsInNewSpace( |
| 6053 MacroAssembler* masm) { | 6055 MacroAssembler* masm) { |
| 6054 Label both_in_new_space; | 6056 Label both_in_new_space; |
| 6055 Label value_in_new_space_object_is_black_no_remembered_set; | 6057 Label value_in_new_space_object_is_black_no_remembered_set; |
| 6056 | 6058 |
| 6057 // The value is in new space. Check the object. | 6059 // The value is in new space. Check the object. |
| 6058 __ InNewSpace(regs_.object(), regs_.scratch0(), equal, &both_in_new_space); | 6060 __ CheckPageFlag(regs_.object(), regs_.scratch0(), |
| 6061 MemoryChunk::IN_NEW_SPACE, not_zero, |
| 6062 &both_in_new_space); |
| 6059 | 6063 |
| 6060 // Value is in new space, object is in old space. Could we be lucky and find | 6064 // Value is in new space, object is in old space. Could we be lucky and find |
| 6061 // the scan_on_scavenge flag on the object's page? | 6065 // the scan_on_scavenge flag on the object's page? |
| 6062 if (emit_remembered_set_ == EMIT_REMEMBERED_SET) { | 6066 if (emit_remembered_set_ == EMIT_REMEMBERED_SET) { |
| 6063 Label scan_on_scavenge; | 6067 Label scan_on_scavenge; |
| 6064 __ CheckPageFlag(regs_.object(), | 6068 __ CheckPageFlag(regs_.object(), |
| 6065 regs_.scratch0(), | 6069 regs_.scratch0(), |
| 6066 MemoryChunk::SCAN_ON_SCAVENGE, | 6070 MemoryChunk::SCAN_ON_SCAVENGE, |
| 6067 not_zero, | 6071 not_zero, |
| 6068 &scan_on_scavenge); | 6072 &scan_on_scavenge); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6193 &value_is_white, | 6197 &value_is_white, |
| 6194 false); // In old space. | 6198 false); // In old space. |
| 6195 __ pop(regs_.object()); | 6199 __ pop(regs_.object()); |
| 6196 regs_.Restore(masm); | 6200 regs_.Restore(masm); |
| 6197 __ ret(0); | 6201 __ ret(0); |
| 6198 | 6202 |
| 6199 // The value is in old space and white. We have to find out which space the | 6203 // The value is in old space and white. We have to find out which space the |
| 6200 // object is in in order to find its colour. | 6204 // object is in in order to find its colour. |
| 6201 __ bind(&value_is_white); | 6205 __ bind(&value_is_white); |
| 6202 __ pop(regs_.object()); | 6206 __ pop(regs_.object()); |
| 6203 __ InNewSpace(regs_.object(), | 6207 __ CheckPageFlag(regs_.object(), regs_.scratch0(), |
| 6204 regs_.scratch0(), | 6208 MemoryChunk::IN_NEW_SPACE, not_zero, |
| 6205 equal, | 6209 &value_in_old_space_and_white_object_in_new_space); |
| 6206 &value_in_old_space_and_white_object_in_new_space); | |
| 6207 | 6210 |
| 6208 // Both in old space, value is white and can't be marked. | 6211 // Both in old space, value is white and can't be marked. |
| 6209 __ InOldSpaceIsBlack(regs_.object(), | 6212 __ InOldSpaceIsBlack(regs_.object(), |
| 6210 regs_.scratch0(), | 6213 regs_.scratch0(), |
| 6211 regs_.scratch1(), | 6214 regs_.scratch1(), |
| 6212 &slow_); | 6215 &slow_); |
| 6213 regs_.Restore(masm); | 6216 regs_.Restore(masm); |
| 6214 __ ret(0); | 6217 __ ret(0); |
| 6215 | 6218 |
| 6216 // Object in new space, value in old space and white and can't be marked. | 6219 // Object in new space, value in old space and white and can't be marked. |
| 6217 __ bind(&value_in_old_space_and_white_object_in_new_space); | 6220 __ bind(&value_in_old_space_and_white_object_in_new_space); |
| 6218 __ InNewSpaceIsBlack(regs_.object(), | 6221 __ InNewSpaceIsBlack(regs_.object(), |
| 6219 regs_.scratch0(), | 6222 regs_.scratch0(), |
| 6220 regs_.scratch1(), | 6223 regs_.scratch1(), |
| 6221 &slow_); | 6224 &slow_); |
| 6222 regs_.Restore(masm); | 6225 regs_.Restore(masm); |
| 6223 __ ret(0); | 6226 __ ret(0); |
| 6224 } | 6227 } |
| 6225 | 6228 |
| 6226 | 6229 |
| 6227 #undef __ | 6230 #undef __ |
| 6228 | 6231 |
| 6229 } } // namespace v8::internal | 6232 } } // namespace v8::internal |
| 6230 | 6233 |
| 6231 #endif // V8_TARGET_ARCH_IA32 | 6234 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |