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

Side by Side Diff: src/ia32/macro-assembler-ia32-inl.h

Issue 7029030: Use page header information to test for InNewSpace. (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
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/objects.h » ('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 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 15 matching lines...) Expand all
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 #ifndef V8_IA32_MACRO_ASSEMBLER_IA32_INL_H_ 28 #ifndef V8_IA32_MACRO_ASSEMBLER_IA32_INL_H_
29 #define V8_IA32_MACRO_ASSEMBLER_IA32_INL_H_ 29 #define V8_IA32_MACRO_ASSEMBLER_IA32_INL_H_
30 30
31 #include "macro-assembler.h" 31 #include "macro-assembler.h"
32 32
33 namespace v8 { 33 namespace v8 {
34 namespace internal { 34 namespace internal {
35 35
36
37 template<typename LabelType> 36 template<typename LabelType>
38 void MacroAssembler::CheckPageFlag( 37 void MacroAssembler::CheckPageFlag(
39 Register object, 38 Register object,
40 Register scratch, 39 Register scratch,
41 MemoryChunk::MemoryChunkFlags flag, 40 MemoryChunk::MemoryChunkFlags flag,
42 Condition cc, 41 Condition cc,
43 LabelType* condition_met) { 42 LabelType* condition_met) {
44 Move(scratch, object); 43 ASSERT(cc == zero || cc == not_zero);
45 and_(scratch, ~Page::kPageAlignmentMask); 44 if (scratch.is(object)) {
46 test(Operand(scratch, MemoryChunk::kFlagsOffset), Immediate(1 << flag)); 45 and_(scratch, Immediate(~Page::kPageAlignmentMask));
46 } else {
47 mov(scratch, Immediate(~Page::kPageAlignmentMask));
48 and_(scratch, Operand(object));
49 }
50 if (flag < kBitsPerByte) {
51 test_b(Operand(scratch, MemoryChunk::kFlagsOffset),
52 static_cast<uint8_t>(1u << flag));
53 } else {
54 test(Operand(scratch, MemoryChunk::kFlagsOffset), Immediate(1 << flag));
55 }
47 j(cc, condition_met); 56 j(cc, condition_met);
48 } 57 }
49 58
50 59
51 template<typename LabelType> 60 template<typename LabelType>
52 void MacroAssembler::InOldSpaceIsBlack(Register object, 61 void MacroAssembler::InOldSpaceIsBlack(Register object,
53 Register scratch0, 62 Register scratch0,
54 Register scratch1, 63 Register scratch1,
55 LabelType* is_black) { 64 LabelType* is_black) {
56 HasColour(object, scratch0, scratch1, 65 HasColour(object, scratch0, scratch1,
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 201
193 // Value is a data object, and it is white. Mark it black. Since we know 202 // Value is a data object, and it is white. Mark it black. Since we know
194 // that the object is white we can make it black by flipping one bit. 203 // that the object is white we can make it black by flipping one bit.
195 or_(Operand(bitmap_scratch, MemoryChunk::kHeaderSize), mask_scratch); 204 or_(Operand(bitmap_scratch, MemoryChunk::kHeaderSize), mask_scratch);
196 bind(&done); 205 bind(&done);
197 } 206 }
198 207
199 } } // namespace v8::internal 208 } } // namespace v8::internal
200 209
201 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_INL_H_ 210 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_INL_H_
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698