Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 7058009: Make InToSpace/InFromSpace use the page header. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Addressed review comments. Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 __ CheckPageFlag(value_, regs_.scratch0(), 6019 __ InNewSpace(value_, regs_.scratch0(), not_equal, &value_in_old_space);
6020 MemoryChunk::IN_NEW_SPACE, zero,
6021 &value_in_old_space);
6022 // After this point the value_ register may have been overwritten since it is 6020 // After this point the value_ register may have been overwritten since it is
6023 // also one of the scratch registers. 6021 // also one of the scratch registers.
6024 6022
6025 GenerateIncrementalValueIsInNewSpace(masm); 6023 GenerateIncrementalValueIsInNewSpace(masm);
6026 6024
6027 __ bind(&value_in_old_space); 6025 __ bind(&value_in_old_space);
6028 GenerateIncrementalValueIsInOldSpace(masm); 6026 GenerateIncrementalValueIsInOldSpace(masm);
6029 6027
6030 __ bind(&slow_); 6028 __ bind(&slow_);
6031 // Inform the incremental marker, but don't bother with the remembered set. 6029 // Inform the incremental marker, but don't bother with the remembered set.
(...skipping 18 matching lines...) Expand all
6050 __ ret(0); 6048 __ ret(0);
6051 } 6049 }
6052 6050
6053 6051
6054 void RecordWriteStub::GenerateIncrementalValueIsInNewSpace( 6052 void RecordWriteStub::GenerateIncrementalValueIsInNewSpace(
6055 MacroAssembler* masm) { 6053 MacroAssembler* masm) {
6056 Label both_in_new_space; 6054 Label both_in_new_space;
6057 Label value_in_new_space_object_is_black_no_remembered_set; 6055 Label value_in_new_space_object_is_black_no_remembered_set;
6058 6056
6059 // The value is in new space. Check the object. 6057 // The value is in new space. Check the object.
6060 __ CheckPageFlag(regs_.object(), regs_.scratch0(), 6058 __ InNewSpace(regs_.object(), regs_.scratch0(), equal, &both_in_new_space);
6061 MemoryChunk::IN_NEW_SPACE, not_zero,
6062 &both_in_new_space);
6063 6059
6064 // Value is in new space, object is in old space. Could we be lucky and find 6060 // Value is in new space, object is in old space. Could we be lucky and find
6065 // the scan_on_scavenge flag on the object's page? 6061 // the scan_on_scavenge flag on the object's page?
6066 if (emit_remembered_set_ == EMIT_REMEMBERED_SET) { 6062 if (emit_remembered_set_ == EMIT_REMEMBERED_SET) {
6067 Label scan_on_scavenge; 6063 Label scan_on_scavenge;
6068 __ CheckPageFlag(regs_.object(), 6064 __ CheckPageFlag(regs_.object(),
6069 regs_.scratch0(), 6065 regs_.scratch0(),
6070 MemoryChunk::SCAN_ON_SCAVENGE, 6066 MemoryChunk::SCAN_ON_SCAVENGE,
6071 not_zero, 6067 not_zero,
6072 &scan_on_scavenge); 6068 &scan_on_scavenge);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
6197 &value_is_white, 6193 &value_is_white,
6198 false); // In old space. 6194 false); // In old space.
6199 __ pop(regs_.object()); 6195 __ pop(regs_.object());
6200 regs_.Restore(masm); 6196 regs_.Restore(masm);
6201 __ ret(0); 6197 __ ret(0);
6202 6198
6203 // The value is in old space and white. We have to find out which space the 6199 // The value is in old space and white. We have to find out which space the
6204 // object is in in order to find its colour. 6200 // object is in in order to find its colour.
6205 __ bind(&value_is_white); 6201 __ bind(&value_is_white);
6206 __ pop(regs_.object()); 6202 __ pop(regs_.object());
6207 __ CheckPageFlag(regs_.object(), regs_.scratch0(), 6203 __ InNewSpace(regs_.object(), regs_.scratch0(), equal,
6208 MemoryChunk::IN_NEW_SPACE, not_zero, 6204 &value_in_old_space_and_white_object_in_new_space);
6209 &value_in_old_space_and_white_object_in_new_space);
6210 6205
6211 // Both in old space, value is white and can't be marked. 6206 // Both in old space, value is white and can't be marked.
6212 __ InOldSpaceIsBlack(regs_.object(), 6207 __ InOldSpaceIsBlack(regs_.object(),
6213 regs_.scratch0(), 6208 regs_.scratch0(),
6214 regs_.scratch1(), 6209 regs_.scratch1(),
6215 &slow_); 6210 &slow_);
6216 regs_.Restore(masm); 6211 regs_.Restore(masm);
6217 __ ret(0); 6212 __ ret(0);
6218 6213
6219 // Object in new space, value in old space and white and can't be marked. 6214 // Object in new space, value in old space and white and can't be marked.
6220 __ bind(&value_in_old_space_and_white_object_in_new_space); 6215 __ bind(&value_in_old_space_and_white_object_in_new_space);
6221 __ InNewSpaceIsBlack(regs_.object(), 6216 __ InNewSpaceIsBlack(regs_.object(),
6222 regs_.scratch0(), 6217 regs_.scratch0(),
6223 regs_.scratch1(), 6218 regs_.scratch1(),
6224 &slow_); 6219 &slow_);
6225 regs_.Restore(masm); 6220 regs_.Restore(masm);
6226 __ ret(0); 6221 __ ret(0);
6227 } 6222 }
6228 6223
6229 6224
6230 #undef __ 6225 #undef __
6231 6226
6232 } } // namespace v8::internal 6227 } } // namespace v8::internal
6233 6228
6234 #endif // V8_TARGET_ARCH_IA32 6229 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/heap-inl.h ('k') | src/ia32/macro-assembler-ia32.h » ('j') | src/spaces.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698