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 1800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1811 } | 1811 } |
1812 } | 1812 } |
1813 } | 1813 } |
1814 | 1814 |
1815 | 1815 |
1816 void LCodeGen::DoSubI(LSubI* instr) { | 1816 void LCodeGen::DoSubI(LSubI* instr) { |
1817 LOperand* left = instr->left(); | 1817 LOperand* left = instr->left(); |
1818 LOperand* right = instr->right(); | 1818 LOperand* right = instr->right(); |
1819 LOperand* result = instr->result(); | 1819 LOperand* result = instr->result(); |
1820 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); | 1820 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); |
1821 SBit set_cond = can_overflow ? SetCC : LeaveCC; | 1821 SBitMode set_cond = can_overflow ? SetCC : DontCareCC; |
1822 | 1822 |
1823 if (right->IsStackSlot() || right->IsArgument()) { | 1823 if (right->IsStackSlot() || right->IsArgument()) { |
1824 Register right_reg = EmitLoadRegister(right, ip); | 1824 Register right_reg = EmitLoadRegister(right, ip); |
1825 __ sub(ToRegister(result), ToRegister(left), Operand(right_reg), set_cond); | 1825 __ sub(ToRegister(result), ToRegister(left), Operand(right_reg), set_cond); |
1826 } else { | 1826 } else { |
1827 ASSERT(right->IsRegister() || right->IsConstantOperand()); | 1827 ASSERT(right->IsRegister() || right->IsConstantOperand()); |
1828 __ sub(ToRegister(result), ToRegister(left), ToOperand(right), set_cond); | 1828 __ sub(ToRegister(result), ToRegister(left), ToOperand(right), set_cond); |
1829 } | 1829 } |
1830 | 1830 |
1831 if (can_overflow) { | 1831 if (can_overflow) { |
1832 DeoptimizeIf(vs, instr->environment()); | 1832 DeoptimizeIf(vs, instr->environment()); |
1833 } | 1833 } |
1834 } | 1834 } |
1835 | 1835 |
1836 | 1836 |
1837 void LCodeGen::DoRSubI(LRSubI* instr) { | 1837 void LCodeGen::DoRSubI(LRSubI* instr) { |
1838 LOperand* left = instr->left(); | 1838 LOperand* left = instr->left(); |
1839 LOperand* right = instr->right(); | 1839 LOperand* right = instr->right(); |
1840 LOperand* result = instr->result(); | 1840 LOperand* result = instr->result(); |
1841 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); | 1841 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); |
1842 SBit set_cond = can_overflow ? SetCC : LeaveCC; | 1842 SBitMode set_cond = can_overflow ? SetCC : DontCareCC; |
1843 | 1843 |
1844 if (right->IsStackSlot() || right->IsArgument()) { | 1844 if (right->IsStackSlot() || right->IsArgument()) { |
1845 Register right_reg = EmitLoadRegister(right, ip); | 1845 Register right_reg = EmitLoadRegister(right, ip); |
1846 __ rsb(ToRegister(result), ToRegister(left), Operand(right_reg), set_cond); | 1846 __ rsb(ToRegister(result), ToRegister(left), Operand(right_reg), set_cond); |
1847 } else { | 1847 } else { |
1848 ASSERT(right->IsRegister() || right->IsConstantOperand()); | 1848 ASSERT(right->IsRegister() || right->IsConstantOperand()); |
1849 __ rsb(ToRegister(result), ToRegister(left), ToOperand(right), set_cond); | 1849 __ rsb(ToRegister(result), ToRegister(left), ToOperand(right), set_cond); |
1850 } | 1850 } |
1851 | 1851 |
1852 if (can_overflow) { | 1852 if (can_overflow) { |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2009 __ stop("Unreachable code."); | 2009 __ stop("Unreachable code."); |
2010 } | 2010 } |
2011 } | 2011 } |
2012 | 2012 |
2013 | 2013 |
2014 void LCodeGen::DoAddI(LAddI* instr) { | 2014 void LCodeGen::DoAddI(LAddI* instr) { |
2015 LOperand* left = instr->left(); | 2015 LOperand* left = instr->left(); |
2016 LOperand* right = instr->right(); | 2016 LOperand* right = instr->right(); |
2017 LOperand* result = instr->result(); | 2017 LOperand* result = instr->result(); |
2018 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); | 2018 bool can_overflow = instr->hydrogen()->CheckFlag(HValue::kCanOverflow); |
2019 SBit set_cond = can_overflow ? SetCC : LeaveCC; | 2019 SBitMode set_cond = can_overflow ? SetCC : DontCareCC; |
2020 | 2020 |
2021 if (right->IsStackSlot() || right->IsArgument()) { | 2021 if (right->IsStackSlot() || right->IsArgument()) { |
2022 Register right_reg = EmitLoadRegister(right, ip); | 2022 Register right_reg = EmitLoadRegister(right, ip); |
2023 __ add(ToRegister(result), ToRegister(left), Operand(right_reg), set_cond); | 2023 __ add(ToRegister(result), ToRegister(left), Operand(right_reg), set_cond); |
2024 } else { | 2024 } else { |
2025 ASSERT(right->IsRegister() || right->IsConstantOperand()); | 2025 ASSERT(right->IsRegister() || right->IsConstantOperand()); |
2026 __ add(ToRegister(result), ToRegister(left), ToOperand(right), set_cond); | 2026 __ add(ToRegister(result), ToRegister(left), ToOperand(right), set_cond); |
2027 } | 2027 } |
2028 | 2028 |
2029 if (can_overflow) { | 2029 if (can_overflow) { |
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2856 __ LoadHeapObject(InstanceofStub::right(), instr->function()); | 2856 __ LoadHeapObject(InstanceofStub::right(), instr->function()); |
2857 static const int kAdditionalDelta = 5; | 2857 static const int kAdditionalDelta = 5; |
2858 static const int kAdditionalSizeDelta = 20; | 2858 static const int kAdditionalSizeDelta = 20; |
2859 // Make sure that code size is predicable, since we use specific constants | 2859 // Make sure that code size is predicable, since we use specific constants |
2860 // offsets in the code to find embedded values.. | 2860 // offsets in the code to find embedded values.. |
2861 PredictableCodeSizeScope predictable(masm_, 6 * Assembler::kInstrSize); | 2861 PredictableCodeSizeScope predictable(masm_, 6 * Assembler::kInstrSize); |
2862 int delta = masm_->SizeOfCodeGeneratedSince(map_check) + kAdditionalSizeDelta; | 2862 int delta = masm_->SizeOfCodeGeneratedSince(map_check) + kAdditionalSizeDelta; |
2863 Label before_push_delta; | 2863 Label before_push_delta; |
2864 __ bind(&before_push_delta); | 2864 __ bind(&before_push_delta); |
2865 __ BlockConstPoolFor(kAdditionalDelta); | 2865 __ BlockConstPoolFor(kAdditionalDelta); |
2866 __ mov(temp, Operand(delta)); | 2866 __ movw(temp, delta); |
2867 // The mov above can generate one or two instructions. The delta was computed | 2867 // The mov above can generate one or two instructions. The delta was computed |
2868 // for two instructions, so we need to pad here in case of one instruction. | 2868 // for two instructions, so we need to pad here in case of one instruction. |
2869 if (masm_->SizeOfCodeGeneratedSince(&before_push_delta) != 8) { | 2869 if (masm_->SizeOfCodeGeneratedSince(&before_push_delta) != 8) { |
2870 ASSERT_EQ(1, masm_->InstructionsGeneratedSince(&before_push_delta)); | 2870 ASSERT_EQ(1, masm_->InstructionsGeneratedSince(&before_push_delta)); |
2871 __ nop(); | 2871 __ nop(); |
2872 if (masm_->is_thumb_mode()) { | 2872 if (masm_->is_thumb_mode()) { |
2873 __ nop(); | 2873 __ nop(); |
2874 } | 2874 } |
2875 } | 2875 } |
2876 __ StoreToSafepointRegisterSlot(temp, temp); | 2876 __ StoreToSafepointRegisterSlot(temp, temp); |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3418 | 3418 |
3419 | 3419 |
3420 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { | 3420 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { |
3421 Register elem = ToRegister(instr->elements()); | 3421 Register elem = ToRegister(instr->elements()); |
3422 Register result = ToRegister(instr->result()); | 3422 Register result = ToRegister(instr->result()); |
3423 | 3423 |
3424 Label done; | 3424 Label done; |
3425 | 3425 |
3426 // If no arguments adaptor frame the number of arguments is fixed. | 3426 // If no arguments adaptor frame the number of arguments is fixed. |
3427 __ cmp(fp, elem); | 3427 __ cmp(fp, elem); |
3428 __ mov(result, Operand(scope()->num_parameters())); | 3428 __ mov(result, Operand(scope()->num_parameters()), LeaveCC); |
3429 __ b(eq, &done); | 3429 __ b(eq, &done); |
3430 | 3430 |
3431 // Arguments adaptor frame present. Get argument length from there. | 3431 // Arguments adaptor frame present. Get argument length from there. |
3432 __ ldr(result, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 3432 __ ldr(result, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
3433 __ ldr(result, | 3433 __ ldr(result, |
3434 MemOperand(result, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 3434 MemOperand(result, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
3435 __ SmiUntag(result); | 3435 __ SmiUntag(result); |
3436 | 3436 |
3437 // Argument length is in result register. | 3437 // Argument length is in result register. |
3438 __ bind(&done); | 3438 __ bind(&done); |
(...skipping 2356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5795 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5795 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5796 __ ldr(result, FieldMemOperand(scratch, | 5796 __ ldr(result, FieldMemOperand(scratch, |
5797 FixedArray::kHeaderSize - kPointerSize)); | 5797 FixedArray::kHeaderSize - kPointerSize)); |
5798 __ bind(&done); | 5798 __ bind(&done); |
5799 } | 5799 } |
5800 | 5800 |
5801 | 5801 |
5802 #undef __ | 5802 #undef __ |
5803 | 5803 |
5804 } } // namespace v8::internal | 5804 } } // namespace v8::internal |
OLD | NEW |