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

Side by Side Diff: src/ia32/macro-assembler-ia32.cc

Issue 1646008: Fix constant offset check for inlined write barrier to work in cases when off... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 8 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/x64/macro-assembler-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // for the remembered set bits. 136 // for the remembered set bits.
137 Label done; 137 Label done;
138 138
139 // Skip barrier if writing a smi. 139 // Skip barrier if writing a smi.
140 ASSERT_EQ(0, kSmiTag); 140 ASSERT_EQ(0, kSmiTag);
141 test(value, Immediate(kSmiTagMask)); 141 test(value, Immediate(kSmiTagMask));
142 j(zero, &done); 142 j(zero, &done);
143 143
144 InNewSpace(object, value, equal, &done); 144 InNewSpace(object, value, equal, &done);
145 145
146 if ((offset > 0) && (offset < Page::kMaxHeapObjectSize)) { 146 // The offset is relative to a tagged or untagged HeapObject pointer,
147 // so either offset or offset + kHeapObjectTag must be a
148 // multiple of kPointerSize.
149 ASSERT(IsAligned(offset, kPointerSize) ||
150 IsAligned(offset + kHeapObjectTag, kPointerSize));
151
152 // We use optimized write barrier code if the word being written to is not in
153 // a large object chunk or is in the first page of a large object chunk.
154 // We make sure that an offset is inside the right limits whether it is
155 // tagged or untagged.
156 if ((offset > 0) && (offset < Page::kMaxHeapObjectSize - kHeapObjectTag)) {
147 // Compute the bit offset in the remembered set, leave it in 'value'. 157 // Compute the bit offset in the remembered set, leave it in 'value'.
148 lea(value, Operand(object, offset)); 158 lea(value, Operand(object, offset));
149 and_(value, Page::kPageAlignmentMask); 159 and_(value, Page::kPageAlignmentMask);
150 shr(value, kPointerSizeLog2); 160 shr(value, kPointerSizeLog2);
151 161
152 // Compute the page address from the heap object pointer, leave it in 162 // Compute the page address from the heap object pointer, leave it in
153 // 'object'. 163 // 'object'.
154 and_(object, ~Page::kPageAlignmentMask); 164 and_(object, ~Page::kPageAlignmentMask);
155 165
156 // NOTE: For now, we use the bit-test-and-set (bts) x86 instruction 166 // NOTE: For now, we use the bit-test-and-set (bts) x86 instruction
(...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after
1676 // Indicate that code has changed. 1686 // Indicate that code has changed.
1677 CPU::FlushICache(address_, size_); 1687 CPU::FlushICache(address_, size_);
1678 1688
1679 // Check that the code was patched as expected. 1689 // Check that the code was patched as expected.
1680 ASSERT(masm_.pc_ == address_ + size_); 1690 ASSERT(masm_.pc_ == address_ + size_);
1681 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); 1691 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
1682 } 1692 }
1683 1693
1684 1694
1685 } } // namespace v8::internal 1695 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698