Chromium Code Reviews| Index: src/x64/macro-assembler-x64.cc |
| diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
| index 075f07cc353e991fd7969a49725599cb5fcfd45b..8f16f54e1b5b4a7d1df3e4022056fca2290a86c2 100644 |
| --- a/src/x64/macro-assembler-x64.cc |
| +++ b/src/x64/macro-assembler-x64.cc |
| @@ -4967,6 +4967,31 @@ void MacroAssembler::RecordObjectAllocation(Isolate* isolate, |
| PopSafepointRegisters(); |
| } |
|
danno
2013/11/04 17:44:44
nit: two lines between functions
mvstanton
2013/11/05 09:06:51
Done.
|
| +void MacroAssembler::JumpIfDictionaryInPrototypeChain( |
| + Register object, |
| + Register scratch0, |
| + Register scratch1, |
| + Label* found) { |
| + ASSERT(!(scratch0.is(kScratchRegister) && scratch1.is(kScratchRegister))); |
| + ASSERT(!scratch1.is(scratch0)); |
| + Register current = scratch0; |
| + Label loop_again; |
| + |
| + movq(current, object); |
| + |
| + // Loop based on the map going up the prototype chain. |
| + bind(&loop_again); |
| + movq(current, FieldOperand(current, HeapObject::kMapOffset)); |
| + movq(scratch1, FieldOperand(current, Map::kBitField2Offset)); |
| + and_(scratch1, Immediate(Map::kElementsKindMask)); |
| + shr(scratch1, Immediate(Map::kElementsKindShift)); |
| + cmpq(scratch1, Immediate(DICTIONARY_ELEMENTS)); |
| + j(equal, found); |
| + movq(current, FieldOperand(current, Map::kPrototypeOffset)); |
| + CompareRoot(current, Heap::kNullValueRootIndex); |
| + j(not_equal, &loop_again); |
| +} |
| + |
| } } // namespace v8::internal |