OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 __ sub(ToRegister(left), ToOperand(right)); | 933 __ sub(ToRegister(left), ToOperand(right)); |
934 } | 934 } |
935 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { | 935 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { |
936 DeoptimizeIf(overflow, instr->environment()); | 936 DeoptimizeIf(overflow, instr->environment()); |
937 } | 937 } |
938 } | 938 } |
939 | 939 |
940 | 940 |
941 void LCodeGen::DoConstantI(LConstantI* instr) { | 941 void LCodeGen::DoConstantI(LConstantI* instr) { |
942 ASSERT(instr->result()->IsRegister()); | 942 ASSERT(instr->result()->IsRegister()); |
943 __ mov(ToRegister(instr->result()), instr->value()); | 943 __ Set(ToRegister(instr->result()), Immediate(instr->value())); |
944 } | 944 } |
945 | 945 |
946 | 946 |
947 void LCodeGen::DoConstantD(LConstantD* instr) { | 947 void LCodeGen::DoConstantD(LConstantD* instr) { |
948 ASSERT(instr->result()->IsDoubleRegister()); | 948 ASSERT(instr->result()->IsDoubleRegister()); |
949 XMMRegister res = ToDoubleRegister(instr->result()); | 949 XMMRegister res = ToDoubleRegister(instr->result()); |
950 double v = instr->value(); | 950 double v = instr->value(); |
951 // Use xor to produce +0.0 in a fast and compact way, but avoid to | 951 // Use xor to produce +0.0 in a fast and compact way, but avoid to |
952 // do so if the constant is -0.0. | 952 // do so if the constant is -0.0. |
953 if (BitCast<uint64_t, double>(v) == 0) { | 953 if (BitCast<uint64_t, double>(v) == 0) { |
(...skipping 12 matching lines...) Expand all Loading... |
966 __ push_imm32(lower); | 966 __ push_imm32(lower); |
967 __ movdbl(res, Operand(esp, 0)); | 967 __ movdbl(res, Operand(esp, 0)); |
968 __ add(Operand(esp), Immediate(2 * kPointerSize)); | 968 __ add(Operand(esp), Immediate(2 * kPointerSize)); |
969 } | 969 } |
970 } | 970 } |
971 } | 971 } |
972 | 972 |
973 | 973 |
974 void LCodeGen::DoConstantT(LConstantT* instr) { | 974 void LCodeGen::DoConstantT(LConstantT* instr) { |
975 ASSERT(instr->result()->IsRegister()); | 975 ASSERT(instr->result()->IsRegister()); |
976 __ mov(ToRegister(instr->result()), Immediate(instr->value())); | 976 __ Set(ToRegister(instr->result()), Immediate(instr->value())); |
977 } | 977 } |
978 | 978 |
979 | 979 |
980 void LCodeGen::DoArrayLength(LArrayLength* instr) { | 980 void LCodeGen::DoArrayLength(LArrayLength* instr) { |
981 Register result = ToRegister(instr->result()); | 981 Register result = ToRegister(instr->result()); |
982 | 982 |
983 if (instr->hydrogen()->value()->IsLoadElements()) { | 983 if (instr->hydrogen()->value()->IsLoadElements()) { |
984 // We load the length directly from the elements array. | 984 // We load the length directly from the elements array. |
985 Register elements = ToRegister(instr->input()); | 985 Register elements = ToRegister(instr->input()); |
986 __ mov(result, FieldOperand(elements, FixedArray::kLengthOffset)); | 986 __ mov(result, FieldOperand(elements, FixedArray::kLengthOffset)); |
(...skipping 2280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3267 ASSERT(!environment->HasBeenRegistered()); | 3267 ASSERT(!environment->HasBeenRegistered()); |
3268 RegisterEnvironmentForDeoptimization(environment); | 3268 RegisterEnvironmentForDeoptimization(environment); |
3269 ASSERT(osr_pc_offset_ == -1); | 3269 ASSERT(osr_pc_offset_ == -1); |
3270 osr_pc_offset_ = masm()->pc_offset(); | 3270 osr_pc_offset_ = masm()->pc_offset(); |
3271 } | 3271 } |
3272 | 3272 |
3273 | 3273 |
3274 #undef __ | 3274 #undef __ |
3275 | 3275 |
3276 } } // namespace v8::internal | 3276 } } // namespace v8::internal |
OLD | NEW |