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