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 2866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2877 | 2877 |
2878 void LCodeGen::EmitIntegerMathAbs(LUnaryMathOperation* instr) { | 2878 void LCodeGen::EmitIntegerMathAbs(LUnaryMathOperation* instr) { |
2879 Register input = ToRegister(instr->InputAt(0)); | 2879 Register input = ToRegister(instr->InputAt(0)); |
2880 Register result = ToRegister(instr->result()); | 2880 Register result = ToRegister(instr->result()); |
2881 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); | 2881 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); |
2882 Label done; | 2882 Label done; |
2883 __ Branch(USE_DELAY_SLOT, &done, ge, input, Operand(zero_reg)); | 2883 __ Branch(USE_DELAY_SLOT, &done, ge, input, Operand(zero_reg)); |
2884 __ mov(result, input); | 2884 __ mov(result, input); |
2885 ASSERT_EQ(2, masm()->InstructionsGeneratedSince(&done)); | 2885 ASSERT_EQ(2, masm()->InstructionsGeneratedSince(&done)); |
2886 __ subu(result, zero_reg, input); | 2886 __ subu(result, zero_reg, input); |
2887 // Overflow if result is still negative, ie 0x80000000. | 2887 // Overflow if result is still negative, i.e. 0x80000000. |
2888 DeoptimizeIf(lt, instr->environment(), result, Operand(zero_reg)); | 2888 DeoptimizeIf(lt, instr->environment(), result, Operand(zero_reg)); |
2889 __ bind(&done); | 2889 __ bind(&done); |
2890 } | 2890 } |
2891 | 2891 |
2892 | 2892 |
2893 void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) { | 2893 void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) { |
2894 // Class for deferred case. | 2894 // Class for deferred case. |
2895 class DeferredMathAbsTaggedHeapNumber: public LDeferredCode { | 2895 class DeferredMathAbsTaggedHeapNumber: public LDeferredCode { |
2896 public: | 2896 public: |
2897 DeferredMathAbsTaggedHeapNumber(LCodeGen* codegen, | 2897 DeferredMathAbsTaggedHeapNumber(LCodeGen* codegen, |
(...skipping 1808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4706 ASSERT(!environment->HasBeenRegistered()); | 4706 ASSERT(!environment->HasBeenRegistered()); |
4707 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 4707 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
4708 ASSERT(osr_pc_offset_ == -1); | 4708 ASSERT(osr_pc_offset_ == -1); |
4709 osr_pc_offset_ = masm()->pc_offset(); | 4709 osr_pc_offset_ = masm()->pc_offset(); |
4710 } | 4710 } |
4711 | 4711 |
4712 | 4712 |
4713 #undef __ | 4713 #undef __ |
4714 | 4714 |
4715 } } // namespace v8::internal | 4715 } } // namespace v8::internal |
OLD | NEW |