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 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 if (can_overflow) { | 1118 if (can_overflow) { |
1119 DeoptimizeIf(overflow, instr->environment()); | 1119 DeoptimizeIf(overflow, instr->environment()); |
1120 } | 1120 } |
1121 | 1121 |
1122 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { | 1122 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
1123 // Bail out if the result is supposed to be negative zero. | 1123 // Bail out if the result is supposed to be negative zero. |
1124 Label done; | 1124 Label done; |
1125 __ testl(left, left); | 1125 __ testl(left, left); |
1126 __ j(not_zero, &done, Label::kNear); | 1126 __ j(not_zero, &done, Label::kNear); |
1127 if (right->IsConstantOperand()) { | 1127 if (right->IsConstantOperand()) { |
1128 if (ToInteger32(LConstantOperand::cast(right)) < 0) { | 1128 if (ToInteger32(LConstantOperand::cast(right)) <= 0) { |
1129 DeoptimizeIf(no_condition, instr->environment()); | 1129 DeoptimizeIf(no_condition, instr->environment()); |
1130 } else if (ToInteger32(LConstantOperand::cast(right)) == 0) { | |
1131 __ cmpl(kScratchRegister, Immediate(0)); | |
1132 DeoptimizeIf(less, instr->environment()); | |
1133 } | 1130 } |
1134 } else if (right->IsStackSlot()) { | 1131 } else if (right->IsStackSlot()) { |
1135 __ orl(kScratchRegister, ToOperand(right)); | 1132 __ orl(kScratchRegister, ToOperand(right)); |
1136 DeoptimizeIf(sign, instr->environment()); | 1133 DeoptimizeIf(sign, instr->environment()); |
1137 } else { | 1134 } else { |
1138 // Test the non-zero operand for negative sign. | 1135 // Test the non-zero operand for negative sign. |
1139 __ orl(kScratchRegister, ToRegister(right)); | 1136 __ orl(kScratchRegister, ToRegister(right)); |
1140 DeoptimizeIf(sign, instr->environment()); | 1137 DeoptimizeIf(sign, instr->environment()); |
1141 } | 1138 } |
1142 __ bind(&done); | 1139 __ bind(&done); |
(...skipping 2627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3770 } | 3767 } |
3771 } else { | 3768 } else { |
3772 Register reg2 = ToRegister(instr->index()); | 3769 Register reg2 = ToRegister(instr->index()); |
3773 if (FLAG_debug_code && | 3770 if (FLAG_debug_code && |
3774 !instr->hydrogen()->index()->representation().IsTagged()) { | 3771 !instr->hydrogen()->index()->representation().IsTagged()) { |
3775 __ AbortIfNotZeroExtended(reg2); | 3772 __ AbortIfNotZeroExtended(reg2); |
3776 } | 3773 } |
3777 __ cmpq(reg, reg2); | 3774 __ cmpq(reg, reg2); |
3778 } | 3775 } |
3779 } else { | 3776 } else { |
3780 Operand length = ToOperand(instr->length()); | |
3781 if (instr->index()->IsConstantOperand()) { | 3777 if (instr->index()->IsConstantOperand()) { |
3782 int constant_index = | 3778 __ cmpq(ToOperand(instr->length()), |
3783 ToInteger32(LConstantOperand::cast(instr->index())); | 3779 Immediate(ToInteger32(LConstantOperand::cast(instr->index())))); |
3784 if (instr->hydrogen()->length()->representation().IsTagged()) { | |
3785 __ Cmp(length, Smi::FromInt(constant_index)); | |
3786 } else { | |
3787 __ cmpq(length, Immediate(constant_index)); | |
3788 } | |
3789 } else { | 3780 } else { |
3790 __ cmpq(length, ToRegister(instr->index())); | 3781 __ cmpq(ToOperand(instr->length()), ToRegister(instr->index())); |
3791 } | 3782 } |
3792 } | 3783 } |
3793 DeoptimizeIf(below_equal, instr->environment()); | 3784 DeoptimizeIf(below_equal, instr->environment()); |
3794 } | 3785 } |
3795 | 3786 |
3796 | 3787 |
3797 void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) { | 3788 void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) { |
3798 Register value = ToRegister(instr->value()); | 3789 Register value = ToRegister(instr->value()); |
3799 Register elements = ToRegister(instr->object()); | 3790 Register elements = ToRegister(instr->object()); |
3800 LOperand* key = instr->key(); | 3791 LOperand* key = instr->key(); |
(...skipping 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5322 FixedArray::kHeaderSize - kPointerSize)); | 5313 FixedArray::kHeaderSize - kPointerSize)); |
5323 __ bind(&done); | 5314 __ bind(&done); |
5324 } | 5315 } |
5325 | 5316 |
5326 | 5317 |
5327 #undef __ | 5318 #undef __ |
5328 | 5319 |
5329 } } // namespace v8::internal | 5320 } } // namespace v8::internal |
5330 | 5321 |
5331 #endif // V8_TARGET_ARCH_X64 | 5322 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |