| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 generating_stub_(false), | 46 generating_stub_(false), |
| 47 allow_stub_calls_(true), | 47 allow_stub_calls_(true), |
| 48 has_frame_(false) { | 48 has_frame_(false) { |
| 49 if (isolate() != NULL) { | 49 if (isolate() != NULL) { |
| 50 code_object_ = Handle<Object>(isolate()->heap()->undefined_value(), | 50 code_object_ = Handle<Object>(isolate()->heap()->undefined_value(), |
| 51 isolate()); | 51 isolate()); |
| 52 } | 52 } |
| 53 } | 53 } |
| 54 | 54 |
| 55 | 55 |
| 56 void MacroAssembler::Load(Register dst, |
| 57 const MemOperand& src, |
| 58 Representation r) { |
| 59 ASSERT(!r.IsDouble()); |
| 60 if (r.IsInteger8()) { |
| 61 lb(dst, src); |
| 62 } else if (r.IsUInteger8()) { |
| 63 lbu(dst, src); |
| 64 } else if (r.IsInteger16()) { |
| 65 lh(dst, src); |
| 66 } else if (r.IsUInteger16()) { |
| 67 lhu(dst, src); |
| 68 } else { |
| 69 lw(dst, src); |
| 70 } |
| 71 } |
| 72 |
| 73 |
| 74 void MacroAssembler::Store(Register src, |
| 75 const MemOperand& dst, |
| 76 Representation r) { |
| 77 ASSERT(!r.IsDouble()); |
| 78 if (r.IsInteger8() || r.IsUInteger8()) { |
| 79 sb(src, dst); |
| 80 } else if (r.IsInteger16() || r.IsUInteger16()) { |
| 81 sh(src, dst); |
| 82 } else { |
| 83 sw(src, dst); |
| 84 } |
| 85 } |
| 86 |
| 87 |
| 56 void MacroAssembler::LoadRoot(Register destination, | 88 void MacroAssembler::LoadRoot(Register destination, |
| 57 Heap::RootListIndex index) { | 89 Heap::RootListIndex index) { |
| 58 lw(destination, MemOperand(s6, index << kPointerSizeLog2)); | 90 lw(destination, MemOperand(s6, index << kPointerSizeLog2)); |
| 59 } | 91 } |
| 60 | 92 |
| 61 | 93 |
| 62 void MacroAssembler::LoadRoot(Register destination, | 94 void MacroAssembler::LoadRoot(Register destination, |
| 63 Heap::RootListIndex index, | 95 Heap::RootListIndex index, |
| 64 Condition cond, | 96 Condition cond, |
| 65 Register src1, const Operand& src2) { | 97 Register src1, const Operand& src2) { |
| (...skipping 5581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5647 for (int i = 0; i < Register::NumAllocatableRegisters(); i++) { | 5679 for (int i = 0; i < Register::NumAllocatableRegisters(); i++) { |
| 5648 Register candidate = Register::FromAllocationIndex(i); | 5680 Register candidate = Register::FromAllocationIndex(i); |
| 5649 if (regs & candidate.bit()) continue; | 5681 if (regs & candidate.bit()) continue; |
| 5650 return candidate; | 5682 return candidate; |
| 5651 } | 5683 } |
| 5652 UNREACHABLE(); | 5684 UNREACHABLE(); |
| 5653 return no_reg; | 5685 return no_reg; |
| 5654 } | 5686 } |
| 5655 | 5687 |
| 5656 | 5688 |
| 5689 void MacroAssembler::JumpIfDictionaryInPrototypeChain( |
| 5690 Register object, |
| 5691 Register scratch0, |
| 5692 Register scratch1, |
| 5693 Label* found) { |
| 5694 ASSERT(!scratch1.is(scratch0)); |
| 5695 Factory* factory = isolate()->factory(); |
| 5696 Register current = scratch0; |
| 5697 Label loop_again; |
| 5698 |
| 5699 // Scratch contained elements pointer. |
| 5700 Move(current, object); |
| 5701 |
| 5702 // Loop based on the map going up the prototype chain. |
| 5703 bind(&loop_again); |
| 5704 lw(current, FieldMemOperand(current, HeapObject::kMapOffset)); |
| 5705 lb(scratch1, FieldMemOperand(current, Map::kBitField2Offset)); |
| 5706 Ext(scratch1, scratch1, Map::kElementsKindShift, Map::kElementsKindBitCount); |
| 5707 Branch(found, eq, scratch1, Operand(DICTIONARY_ELEMENTS)); |
| 5708 lw(current, FieldMemOperand(current, Map::kPrototypeOffset)); |
| 5709 Branch(&loop_again, ne, current, Operand(factory->null_value())); |
| 5710 } |
| 5711 |
| 5712 |
| 5657 bool AreAliased(Register r1, Register r2, Register r3, Register r4) { | 5713 bool AreAliased(Register r1, Register r2, Register r3, Register r4) { |
| 5658 if (r1.is(r2)) return true; | 5714 if (r1.is(r2)) return true; |
| 5659 if (r1.is(r3)) return true; | 5715 if (r1.is(r3)) return true; |
| 5660 if (r1.is(r4)) return true; | 5716 if (r1.is(r4)) return true; |
| 5661 if (r2.is(r3)) return true; | 5717 if (r2.is(r3)) return true; |
| 5662 if (r2.is(r4)) return true; | 5718 if (r2.is(r4)) return true; |
| 5663 if (r3.is(r4)) return true; | 5719 if (r3.is(r4)) return true; |
| 5664 return false; | 5720 return false; |
| 5665 } | 5721 } |
| 5666 | 5722 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5714 opcode == BGTZL); | 5770 opcode == BGTZL); |
| 5715 opcode = (cond == eq) ? BEQ : BNE; | 5771 opcode = (cond == eq) ? BEQ : BNE; |
| 5716 instr = (instr & ~kOpcodeMask) | opcode; | 5772 instr = (instr & ~kOpcodeMask) | opcode; |
| 5717 masm_.emit(instr); | 5773 masm_.emit(instr); |
| 5718 } | 5774 } |
| 5719 | 5775 |
| 5720 | 5776 |
| 5721 } } // namespace v8::internal | 5777 } } // namespace v8::internal |
| 5722 | 5778 |
| 5723 #endif // V8_TARGET_ARCH_MIPS | 5779 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |