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 3910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3921 for (int i = 0; i < Register::NumAllocatableRegisters(); i++) { | 3921 for (int i = 0; i < Register::NumAllocatableRegisters(); i++) { |
3922 Register candidate = Register::FromAllocationIndex(i); | 3922 Register candidate = Register::FromAllocationIndex(i); |
3923 if (regs & candidate.bit()) continue; | 3923 if (regs & candidate.bit()) continue; |
3924 return candidate; | 3924 return candidate; |
3925 } | 3925 } |
3926 UNREACHABLE(); | 3926 UNREACHABLE(); |
3927 return no_reg; | 3927 return no_reg; |
3928 } | 3928 } |
3929 | 3929 |
3930 | 3930 |
| 3931 void MacroAssembler::JumpIfDictionaryInPrototypeChain( |
| 3932 Register object, |
| 3933 Register scratch0, |
| 3934 Register scratch1, |
| 3935 Label* found) { |
| 3936 ASSERT(!scratch1.is(scratch0)); |
| 3937 Factory* factory = isolate()->factory(); |
| 3938 Register current = scratch0; |
| 3939 Label loop_again; |
| 3940 |
| 3941 // scratch contained elements pointer. |
| 3942 mov(current, object); |
| 3943 |
| 3944 // Loop based on the map going up the prototype chain. |
| 3945 bind(&loop_again); |
| 3946 ldr(current, FieldMemOperand(current, HeapObject::kMapOffset)); |
| 3947 ldr(scratch1, FieldMemOperand(current, Map::kBitField2Offset)); |
| 3948 Ubfx(scratch1, scratch1, Map::kElementsKindShift, Map::kElementsKindBitCount); |
| 3949 cmp(scratch1, Operand(DICTIONARY_ELEMENTS)); |
| 3950 b(eq, found); |
| 3951 ldr(current, FieldMemOperand(current, Map::kPrototypeOffset)); |
| 3952 cmp(current, Operand(factory->null_value())); |
| 3953 b(ne, &loop_again); |
| 3954 } |
| 3955 |
| 3956 |
3931 #ifdef DEBUG | 3957 #ifdef DEBUG |
3932 bool AreAliased(Register reg1, | 3958 bool AreAliased(Register reg1, |
3933 Register reg2, | 3959 Register reg2, |
3934 Register reg3, | 3960 Register reg3, |
3935 Register reg4, | 3961 Register reg4, |
3936 Register reg5, | 3962 Register reg5, |
3937 Register reg6) { | 3963 Register reg6) { |
3938 int n_of_valid_regs = reg1.is_valid() + reg2.is_valid() + | 3964 int n_of_valid_regs = reg1.is_valid() + reg2.is_valid() + |
3939 reg3.is_valid() + reg4.is_valid() + reg5.is_valid() + reg6.is_valid(); | 3965 reg3.is_valid() + reg4.is_valid() + reg5.is_valid() + reg6.is_valid(); |
3940 | 3966 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3991 void CodePatcher::EmitCondition(Condition cond) { | 4017 void CodePatcher::EmitCondition(Condition cond) { |
3992 Instr instr = Assembler::instr_at(masm_.pc_); | 4018 Instr instr = Assembler::instr_at(masm_.pc_); |
3993 instr = (instr & ~kCondMask) | cond; | 4019 instr = (instr & ~kCondMask) | cond; |
3994 masm_.emit(instr); | 4020 masm_.emit(instr); |
3995 } | 4021 } |
3996 | 4022 |
3997 | 4023 |
3998 } } // namespace v8::internal | 4024 } } // namespace v8::internal |
3999 | 4025 |
4000 #endif // V8_TARGET_ARCH_ARM | 4026 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |