OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 Abort("Unimplemented: %s", "DoBitNotI"); | 859 Abort("Unimplemented: %s", "DoBitNotI"); |
860 } | 860 } |
861 | 861 |
862 | 862 |
863 void LCodeGen::DoThrow(LThrow* instr) { | 863 void LCodeGen::DoThrow(LThrow* instr) { |
864 Abort("Unimplemented: %s", "DoThrow"); | 864 Abort("Unimplemented: %s", "DoThrow"); |
865 } | 865 } |
866 | 866 |
867 | 867 |
868 void LCodeGen::DoAddI(LAddI* instr) { | 868 void LCodeGen::DoAddI(LAddI* instr) { |
869 Abort("Unimplemented: %s", "DoAddI"); | 869 LOperand* left = instr->InputAt(0); |
| 870 LOperand* right = instr->InputAt(1); |
| 871 ASSERT(left->Equals(instr->result())); |
| 872 |
| 873 if (right->IsConstantOperand()) { |
| 874 __ addl(ToRegister(left), |
| 875 » Immediate(ToInteger32(LConstantOperand::cast(right)))); |
| 876 } else if (right->IsRegister()) { |
| 877 __ addl(ToRegister(left), ToRegister(right)); |
| 878 } else { |
| 879 __ addl(ToRegister(left), ToOperand(right)); |
| 880 } |
| 881 |
| 882 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { |
| 883 DeoptimizeIf(overflow, instr->environment()); |
| 884 } |
870 } | 885 } |
871 | 886 |
872 | 887 |
873 void LCodeGen::DoArithmeticD(LArithmeticD* instr) { | 888 void LCodeGen::DoArithmeticD(LArithmeticD* instr) { |
874 Abort("Unimplemented: %s", "DoArithmeticD"); | 889 Abort("Unimplemented: %s", "DoArithmeticD"); |
875 } | 890 } |
876 | 891 |
877 | 892 |
878 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { | 893 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { |
879 Abort("Unimplemented: %s", "DoArithmeticT"); | 894 ASSERT(ToRegister(instr->InputAt(0)).is(rdx)); |
| 895 ASSERT(ToRegister(instr->InputAt(1)).is(rax)); |
| 896 ASSERT(ToRegister(instr->result()).is(rax)); |
| 897 |
| 898 GenericBinaryOpStub stub(instr->op(), NO_OVERWRITE, NO_GENERIC_BINARY_FLAGS); |
| 899 stub.SetArgsInRegisters(); |
| 900 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
880 } | 901 } |
881 | 902 |
882 | 903 |
883 int LCodeGen::GetNextEmittedBlock(int block) { | 904 int LCodeGen::GetNextEmittedBlock(int block) { |
884 for (int i = block + 1; i < graph()->blocks()->length(); ++i) { | 905 for (int i = block + 1; i < graph()->blocks()->length(); ++i) { |
885 LLabel* label = chunk_->GetLabel(i); | 906 LLabel* label = chunk_->GetLabel(i); |
886 if (!label->HasReplacement()) return i; | 907 if (!label->HasReplacement()) return i; |
887 } | 908 } |
888 return -1; | 909 return -1; |
889 } | 910 } |
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1519 | 1540 |
1520 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 1541 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
1521 Abort("Unimplemented: %s", "DoOsrEntry"); | 1542 Abort("Unimplemented: %s", "DoOsrEntry"); |
1522 } | 1543 } |
1523 | 1544 |
1524 #undef __ | 1545 #undef __ |
1525 | 1546 |
1526 } } // namespace v8::internal | 1547 } } // namespace v8::internal |
1527 | 1548 |
1528 #endif // V8_TARGET_ARCH_X64 | 1549 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |