Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 template <typename LabelType> | |
| 37 void MacroAssembler::InNewSpace(Register object, | |
|
Erik Corry
2011/05/19 07:22:32
Seems like you can just use CheckPageFlag instead
Lasse Reichstein
2011/05/19 08:40:40
Merged this with CheckPageFlag (accept object and
| |
| 38 Register scratch, | |
| 39 Condition cc, | |
| 40 LabelType* branch) { | |
| 41 ASSERT(cc == equal || cc == not_equal); | |
| 42 if (scratch.is(object)) { | |
| 43 and_(scratch, Immediate(~Page::kPageAlignmentMask)); | |
| 44 } else { | |
| 45 mov(scratch, Immediate(~Page::kPageAlignmentMask)); | |
| 46 and_(scratch, Operand(object)); | |
| 47 } | |
| 48 // Ensure that flag is in the first byte of flags field. | |
| 49 ASSERT(MemoryChunk::IN_NEW_SPACE < kBitsPerByte); | |
| 50 test_b(Operand(scratch, MemoryChunk::kFlagsOffset), | |
| 51 1 << MemoryChunk::IN_NEW_SPACE); | |
| 52 j(NegateCondition(cc), branch); | |
| 53 } | |
| 54 | |
| 36 | 55 |
| 37 template<typename LabelType> | 56 template<typename LabelType> |
| 38 void MacroAssembler::CheckPageFlag( | 57 void MacroAssembler::CheckPageFlag( |
| 39 Register object, | 58 Register object, |
| 40 Register scratch, | 59 Register scratch, |
| 41 MemoryChunk::MemoryChunkFlags flag, | 60 MemoryChunk::MemoryChunkFlags flag, |
| 42 Condition cc, | 61 Condition cc, |
| 43 LabelType* condition_met) { | 62 LabelType* condition_met) { |
| 44 Move(scratch, object); | 63 Move(scratch, object); |
| 45 and_(scratch, ~Page::kPageAlignmentMask); | 64 and_(scratch, ~Page::kPageAlignmentMask); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 192 | 211 |
| 193 // Value is a data object, and it is white. Mark it black. Since we know | 212 // 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. | 213 // that the object is white we can make it black by flipping one bit. |
| 195 or_(Operand(bitmap_scratch, MemoryChunk::kHeaderSize), mask_scratch); | 214 or_(Operand(bitmap_scratch, MemoryChunk::kHeaderSize), mask_scratch); |
| 196 bind(&done); | 215 bind(&done); |
| 197 } | 216 } |
| 198 | 217 |
| 199 } } // namespace v8::internal | 218 } } // namespace v8::internal |
| 200 | 219 |
| 201 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_INL_H_ | 220 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_INL_H_ |
| OLD | NEW |