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 3291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3302 return MemOperand(base, | 3302 return MemOperand(base, |
3303 base_offset + (constant_key << element_size)); | 3303 base_offset + (constant_key << element_size)); |
3304 } | 3304 } |
3305 | 3305 |
3306 if (additional_offset != 0) { | 3306 if (additional_offset != 0) { |
3307 __ mov(scratch0(), Operand(base_offset)); | 3307 __ mov(scratch0(), Operand(base_offset)); |
3308 if (shift_size >= 0) { | 3308 if (shift_size >= 0) { |
3309 __ add(scratch0(), scratch0(), Operand(key, LSL, shift_size)); | 3309 __ add(scratch0(), scratch0(), Operand(key, LSL, shift_size)); |
3310 } else { | 3310 } else { |
3311 ASSERT_EQ(-1, shift_size); | 3311 ASSERT_EQ(-1, shift_size); |
3312 __ add(scratch0(), scratch0(), Operand(key, LSR, 1)); | 3312 // key can be negative, so using ASR here. |
| 3313 __ add(scratch0(), scratch0(), Operand(key, ASR, 1)); |
3313 } | 3314 } |
3314 return MemOperand(base, scratch0()); | 3315 return MemOperand(base, scratch0()); |
3315 } | 3316 } |
3316 | 3317 |
3317 if (additional_index != 0) { | 3318 if (additional_index != 0) { |
3318 additional_index *= 1 << (element_size - shift_size); | 3319 additional_index *= 1 << (element_size - shift_size); |
3319 __ add(scratch0(), key, Operand(additional_index)); | 3320 __ add(scratch0(), key, Operand(additional_index)); |
3320 } | 3321 } |
3321 | 3322 |
3322 if (additional_index == 0) { | 3323 if (additional_index == 0) { |
(...skipping 2415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5738 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5739 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5739 __ ldr(result, FieldMemOperand(scratch, | 5740 __ ldr(result, FieldMemOperand(scratch, |
5740 FixedArray::kHeaderSize - kPointerSize)); | 5741 FixedArray::kHeaderSize - kPointerSize)); |
5741 __ bind(&done); | 5742 __ bind(&done); |
5742 } | 5743 } |
5743 | 5744 |
5744 | 5745 |
5745 #undef __ | 5746 #undef __ |
5746 | 5747 |
5747 } } // namespace v8::internal | 5748 } } // namespace v8::internal |
OLD | NEW |