OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1397 LGap::InnerPosition inner_pos = static_cast<LGap::InnerPosition>(i); | 1397 LGap::InnerPosition inner_pos = static_cast<LGap::InnerPosition>(i); |
1398 LParallelMove* move = gap->GetParallelMove(inner_pos); | 1398 LParallelMove* move = gap->GetParallelMove(inner_pos); |
1399 if (move != NULL) { | 1399 if (move != NULL) { |
1400 resolver_.Resolve(move); | 1400 resolver_.Resolve(move); |
1401 } | 1401 } |
1402 } | 1402 } |
1403 } | 1403 } |
1404 | 1404 |
1405 | 1405 |
1406 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { | 1406 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { |
1407 // TODO(all): Try to improve this, like ARM r17925. | |
1408 Register arguments = ToRegister(instr->arguments()); | 1407 Register arguments = ToRegister(instr->arguments()); |
1409 Register result = ToRegister(instr->result()); | 1408 Register result = ToRegister(instr->result()); |
1410 | 1409 |
| 1410 // The pointer to the arguments array come from DoArgumentsElements. |
| 1411 // It does not point directly to the arguments and there is an offest of |
| 1412 // two words that we must take into account when accessing an argument. |
| 1413 // Subtracting the index from length accounts for one, so we add one more. |
| 1414 |
1411 if (instr->length()->IsConstantOperand() && | 1415 if (instr->length()->IsConstantOperand() && |
1412 instr->index()->IsConstantOperand()) { | 1416 instr->index()->IsConstantOperand()) { |
1413 ASSERT(instr->temp() == NULL); | |
1414 int index = ToInteger32(LConstantOperand::cast(instr->index())); | 1417 int index = ToInteger32(LConstantOperand::cast(instr->index())); |
1415 int length = ToInteger32(LConstantOperand::cast(instr->length())); | 1418 int length = ToInteger32(LConstantOperand::cast(instr->length())); |
1416 int offset = ((length - index) + 1) * kPointerSize; | 1419 int offset = ((length - index) + 1) * kPointerSize; |
1417 __ Ldr(result, MemOperand(arguments, offset)); | 1420 __ Ldr(result, MemOperand(arguments, offset)); |
| 1421 } else if (instr->index()->IsConstantOperand()) { |
| 1422 Register length = ToRegister32(instr->length()); |
| 1423 int index = ToInteger32(LConstantOperand::cast(instr->index())); |
| 1424 int loc = index - 1; |
| 1425 if (loc != 0) { |
| 1426 __ Sub(result.W(), length, loc); |
| 1427 __ Ldr(result, MemOperand(arguments, result, UXTW, kPointerSizeLog2)); |
| 1428 } else { |
| 1429 __ Ldr(result, MemOperand(arguments, length, UXTW, kPointerSizeLog2)); |
| 1430 } |
1418 } else { | 1431 } else { |
1419 ASSERT(instr->temp() != NULL); | |
1420 Register temp = ToRegister32(instr->temp()); | |
1421 Register length = ToRegister32(instr->length()); | 1432 Register length = ToRegister32(instr->length()); |
1422 Operand index = ToOperand32I(instr->index()); | 1433 Operand index = ToOperand32I(instr->index()); |
1423 // There are two words between the frame pointer and the last arguments. | 1434 __ Sub(result.W(), length, index); |
1424 // Subtracting from length accounts for only one, so we add one more. | 1435 __ Add(result.W(), result.W(), 1); |
1425 __ Sub(temp, length, index); | 1436 __ Ldr(result, MemOperand(arguments, result, UXTW, kPointerSizeLog2)); |
1426 __ Add(temp, temp, 1); | |
1427 __ Ldr(result, MemOperand(arguments, temp, UXTW, kPointerSizeLog2)); | |
1428 } | 1437 } |
1429 } | 1438 } |
1430 | 1439 |
1431 | 1440 |
1432 void LCodeGen::DoAddE(LAddE* instr) { | 1441 void LCodeGen::DoAddE(LAddE* instr) { |
1433 Register result = ToRegister(instr->result()); | 1442 Register result = ToRegister(instr->result()); |
1434 Register left = ToRegister(instr->left()); | 1443 Register left = ToRegister(instr->left()); |
1435 Operand right = (instr->right()->IsConstantOperand()) | 1444 Operand right = (instr->right()->IsConstantOperand()) |
1436 ? ToInteger32(LConstantOperand::cast(instr->right())) | 1445 ? ToInteger32(LConstantOperand::cast(instr->right())) |
1437 : Operand(ToRegister32(instr->right()), SXTW); | 1446 : Operand(ToRegister32(instr->right()), SXTW); |
(...skipping 4252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5690 __ Bind(&out_of_object); | 5699 __ Bind(&out_of_object); |
5691 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5700 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
5692 // Index is equal to negated out of object property index plus 1. | 5701 // Index is equal to negated out of object property index plus 1. |
5693 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5702 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
5694 __ Ldr(result, FieldMemOperand(result, | 5703 __ Ldr(result, FieldMemOperand(result, |
5695 FixedArray::kHeaderSize - kPointerSize)); | 5704 FixedArray::kHeaderSize - kPointerSize)); |
5696 __ Bind(&done); | 5705 __ Bind(&done); |
5697 } | 5706 } |
5698 | 5707 |
5699 } } // namespace v8::internal | 5708 } } // namespace v8::internal |
OLD | NEW |