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

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

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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 test_b(Operand(scratch, MemoryChunk::kFlagsOffset), 51 test_b(Operand(scratch, MemoryChunk::kFlagsOffset),
52 static_cast<uint8_t>(1u << flag)); 52 static_cast<uint8_t>(1u << flag));
53 } else { 53 } else {
54 test(Operand(scratch, MemoryChunk::kFlagsOffset), Immediate(1 << flag)); 54 test(Operand(scratch, MemoryChunk::kFlagsOffset), Immediate(1 << flag));
55 } 55 }
56 j(cc, condition_met); 56 j(cc, condition_met);
57 } 57 }
58 58
59 59
60 template<typename LabelType> 60 template<typename LabelType>
61 void MacroAssembler::InNewSpace(
62 Register object,
63 Register scratch,
64 Condition cc,
65 LabelType* condition_met) {
66 ASSERT(cc == equal || cc == not_equal);
67 if (scratch.is(object)) {
68 and_(scratch, Immediate(~Page::kPageAlignmentMask));
69 } else {
70 mov(scratch, Immediate(~Page::kPageAlignmentMask));
71 and_(scratch, Operand(object));
72 }
73 // Check that we can use a test_b.
74 ASSERT(MemoryChunk::IN_FROM_SPACE < 8);
75 ASSERT(MemoryChunk::IN_TO_SPACE < 8);
76 int mask = (1 << MemoryChunk::IN_FROM_SPACE)
77 | (1 << MemoryChunk::IN_TO_SPACE);
78 // If non-zero, the page belongs to new-space.
79 test_b(Operand(scratch, MemoryChunk::kFlagsOffset),
80 static_cast<uint8_t>(mask));
81 j(NegateCondition(cc), condition_met);
82 }
83
84
85 template<typename LabelType>
61 void MacroAssembler::InOldSpaceIsBlack(Register object, 86 void MacroAssembler::InOldSpaceIsBlack(Register object,
62 Register scratch0, 87 Register scratch0,
63 Register scratch1, 88 Register scratch1,
64 LabelType* is_black) { 89 LabelType* is_black) {
65 HasColour(object, scratch0, scratch1, 90 HasColour(object, scratch0, scratch1,
66 is_black, 91 is_black,
67 1, 0); // kBlackBitPattern. 92 1, 0); // kBlackBitPattern.
68 ASSERT(strcmp(Marking::kBlackBitPattern, "10") == 0); 93 ASSERT(strcmp(Marking::kBlackBitPattern, "10") == 0);
69 } 94 }
70 95
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 226
202 // Value is a data object, and it is white. Mark it black. Since we know 227 // Value is a data object, and it is white. Mark it black. Since we know
203 // that the object is white we can make it black by flipping one bit. 228 // that the object is white we can make it black by flipping one bit.
204 or_(Operand(bitmap_scratch, MemoryChunk::kHeaderSize), mask_scratch); 229 or_(Operand(bitmap_scratch, MemoryChunk::kHeaderSize), mask_scratch);
205 bind(&done); 230 bind(&done);
206 } 231 }
207 232
208 } } // namespace v8::internal 233 } } // namespace v8::internal
209 234
210 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_INL_H_ 235 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_INL_H_
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/spaces.h » ('j') | src/spaces.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698