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

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

Issue 7000023: Do inline object filtering (via page flags) before call to RecordWriteStub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: 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
« no previous file with comments | « no previous file | src/ia32/full-codegen-ia32.cc » ('j') | src/ia32/macro-assembler-ia32.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5970 matching lines...) Expand 10 before | Expand all | Expand 10 after
5981 // we keep the GC informed. The word in the object where the value has been 5981 // we keep the GC informed. The word in the object where the value has been
5982 // written is in the address register. 5982 // written is in the address register.
5983 void RecordWriteStub::Generate(MacroAssembler* masm) { 5983 void RecordWriteStub::Generate(MacroAssembler* masm) {
5984 NearLabel skip_non_incremental_part; 5984 NearLabel skip_non_incremental_part;
5985 __ jmp(&skip_non_incremental_part); 5985 __ jmp(&skip_non_incremental_part);
5986 if (!HEAP->incremental_marking()->IsMarking()) { 5986 if (!HEAP->incremental_marking()->IsMarking()) {
5987 ASSERT(masm->get_opcode(-2) == kSkipNonIncrementalPartInstruction); 5987 ASSERT(masm->get_opcode(-2) == kSkipNonIncrementalPartInstruction);
5988 masm->set_opcode(-2, kTwoByteNopInstruction); 5988 masm->set_opcode(-2, kTwoByteNopInstruction);
5989 } 5989 }
5990 5990
5991 if (FLAG_debug_code) {
5992 NearLabel ok;
5993 __ cmp(value_, Operand(address_, 0));
5994 __ j(equal, &ok);
5995 __ Abort("Registers did not match in write barrier");
5996 __ bind(&ok);
5997 }
5998
5999 if (emit_remembered_set_ == EMIT_REMEMBERED_SET) { 5991 if (emit_remembered_set_ == EMIT_REMEMBERED_SET) {
6000 NearLabel skip; 5992 NearLabel skip;
6001 __ HasScanOnScavenge(object_, value_, &skip);
6002 __ RememberedSetHelper(address_, value_, save_fp_regs_mode_); 5993 __ RememberedSetHelper(address_, value_, save_fp_regs_mode_);
6003 __ bind(&skip); 5994 __ bind(&skip);
6004 } 5995 }
6005 __ ret(0); 5996 __ ret(0);
6006 5997
6007 __ bind(&skip_non_incremental_part); 5998 __ bind(&skip_non_incremental_part);
6008 5999 __ mov(value_, Operand(address_, 0));
6009 GenerateIncremental(masm); 6000 GenerateIncremental(masm);
6010 } 6001 }
6011 6002
6012 6003
6013 void RecordWriteStub::GenerateIncremental(MacroAssembler* masm) { 6004 void RecordWriteStub::GenerateIncremental(MacroAssembler* masm) {
6014 regs_.Save(masm); 6005 regs_.Save(masm);
6015 6006
6016 Label value_in_old_space; 6007 Label value_in_old_space;
6017 6008
6018 __ InNewSpace(value_, regs_.scratch0(), not_equal, &value_in_old_space); 6009 __ InNewSpace(value_, regs_.scratch0(), not_equal, &value_in_old_space);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
6053 Label both_in_new_space; 6044 Label both_in_new_space;
6054 Label value_in_new_space_object_is_black_no_remembered_set; 6045 Label value_in_new_space_object_is_black_no_remembered_set;
6055 6046
6056 // The value is in new space. Check the object. 6047 // The value is in new space. Check the object.
6057 __ InNewSpace(regs_.object(), regs_.scratch0(), equal, &both_in_new_space); 6048 __ InNewSpace(regs_.object(), regs_.scratch0(), equal, &both_in_new_space);
6058 6049
6059 // Value is in new space, object is in old space. Could we be lucky and find 6050 // Value is in new space, object is in old space. Could we be lucky and find
6060 // the scan_on_scavenge flag on the object's page? 6051 // the scan_on_scavenge flag on the object's page?
6061 if (emit_remembered_set_ == EMIT_REMEMBERED_SET) { 6052 if (emit_remembered_set_ == EMIT_REMEMBERED_SET) {
6062 Label scan_on_scavenge; 6053 Label scan_on_scavenge;
6063 __ HasScanOnScavenge(regs_.object(), regs_.scratch0(), &scan_on_scavenge); 6054 __ CheckPageFlag(regs_.object(),
6055 regs_.scratch0(),
6056 MemoryChunk::SCAN_ON_SCAVENGE,
6057 not_zero,
6058 &scan_on_scavenge);
6064 GenerateIncrementalValueIsInNewSpaceObjectIsInOldSpaceRememberedSet(masm); 6059 GenerateIncrementalValueIsInNewSpaceObjectIsInOldSpaceRememberedSet(masm);
6065 __ bind(&scan_on_scavenge); 6060 __ bind(&scan_on_scavenge);
6066 } 6061 }
6067 // This function will also bind the label. 6062 // This function will also bind the label.
6068 GenerateIncrementalValueIsInNewSpaceObjectIsInOldSpaceNoRememberedSet( 6063 GenerateIncrementalValueIsInNewSpaceObjectIsInOldSpaceNoRememberedSet(
6069 masm, &value_in_new_space_object_is_black_no_remembered_set); 6064 masm, &value_in_new_space_object_is_black_no_remembered_set);
6070 6065
6071 __ bind(&both_in_new_space); 6066 __ bind(&both_in_new_space);
6072 __ InNewSpaceIsBlack(regs_.object(), 6067 __ InNewSpaceIsBlack(regs_.object(),
6073 regs_.scratch0(), 6068 regs_.scratch0(),
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
6217 regs_.Restore(masm); 6212 regs_.Restore(masm);
6218 __ ret(0); 6213 __ ret(0);
6219 } 6214 }
6220 6215
6221 6216
6222 #undef __ 6217 #undef __
6223 6218
6224 } } // namespace v8::internal 6219 } } // namespace v8::internal
6225 6220
6226 #endif // V8_TARGET_ARCH_IA32 6221 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | src/ia32/full-codegen-ia32.cc » ('j') | src/ia32/macro-assembler-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698