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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/spaces.h » ('j') | src/spaces.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/macro-assembler-ia32-inl.h
diff --git a/src/ia32/macro-assembler-ia32-inl.h b/src/ia32/macro-assembler-ia32-inl.h
index fe207adaa8f0b21ba165b9984deadc9575656e3f..6caa06ed7500cbb313f0aa799147afe0548ecca0 100644
--- a/src/ia32/macro-assembler-ia32-inl.h
+++ b/src/ia32/macro-assembler-ia32-inl.h
@@ -58,6 +58,31 @@ void MacroAssembler::CheckPageFlag(
template<typename LabelType>
+void MacroAssembler::InNewSpace(
+ Register object,
+ Register scratch,
+ Condition cc,
+ LabelType* condition_met) {
+ ASSERT(cc == equal || cc == not_equal);
+ if (scratch.is(object)) {
+ and_(scratch, Immediate(~Page::kPageAlignmentMask));
+ } else {
+ mov(scratch, Immediate(~Page::kPageAlignmentMask));
+ and_(scratch, Operand(object));
+ }
+ // Check that we can use a test_b.
+ ASSERT(MemoryChunk::IN_FROM_SPACE < 8);
+ ASSERT(MemoryChunk::IN_TO_SPACE < 8);
+ int mask = (1 << MemoryChunk::IN_FROM_SPACE)
+ | (1 << MemoryChunk::IN_TO_SPACE);
+ // If non-zero, the page belongs to new-space.
+ test_b(Operand(scratch, MemoryChunk::kFlagsOffset),
+ static_cast<uint8_t>(mask));
+ j(NegateCondition(cc), condition_met);
+}
+
+
+template<typename LabelType>
void MacroAssembler::InOldSpaceIsBlack(Register object,
Register scratch0,
Register scratch1,
« 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