OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 2739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2750 | 2750 |
2751 | 2751 |
2752 void LCodeGen::DoDoubleToIntOrSmi(LDoubleToIntOrSmi* instr) { | 2752 void LCodeGen::DoDoubleToIntOrSmi(LDoubleToIntOrSmi* instr) { |
2753 DoubleRegister input = ToDoubleRegister(instr->value()); | 2753 DoubleRegister input = ToDoubleRegister(instr->value()); |
2754 Register result = ToRegister32(instr->result()); | 2754 Register result = ToRegister32(instr->result()); |
2755 | 2755 |
2756 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { | 2756 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
2757 DeoptimizeIfMinusZero(input, instr->environment()); | 2757 DeoptimizeIfMinusZero(input, instr->environment()); |
2758 } | 2758 } |
2759 | 2759 |
2760 __ TryConvertDoubleToInt32(result, input, double_scratch()); | 2760 __ TryRepresentDoubleAsInt32(result, input, double_scratch()); |
2761 DeoptimizeIf(ne, instr->environment()); | 2761 DeoptimizeIf(ne, instr->environment()); |
2762 | 2762 |
2763 if (instr->tag_result()) { | 2763 if (instr->tag_result()) { |
2764 __ SmiTag(result.X()); | 2764 __ SmiTag(result.X()); |
2765 } | 2765 } |
2766 } | 2766 } |
2767 | 2767 |
2768 | 2768 |
2769 void LCodeGen::DoDrop(LDrop* instr) { | 2769 void LCodeGen::DoDrop(LDrop* instr) { |
2770 __ Drop(instr->count()); | 2770 __ Drop(instr->count()); |
(...skipping 2730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5501 | 5501 |
5502 DoubleRegister dbl_scratch2 = ToDoubleRegister(temp2); | 5502 DoubleRegister dbl_scratch2 = ToDoubleRegister(temp2); |
5503 | 5503 |
5504 // Deoptimized if it's not a heap number. | 5504 // Deoptimized if it's not a heap number. |
5505 DeoptimizeIfNotRoot(scratch1, Heap::kHeapNumberMapRootIndex, | 5505 DeoptimizeIfNotRoot(scratch1, Heap::kHeapNumberMapRootIndex, |
5506 instr->environment()); | 5506 instr->environment()); |
5507 | 5507 |
5508 // A heap number: load value and convert to int32 using non-truncating | 5508 // A heap number: load value and convert to int32 using non-truncating |
5509 // function. If the result is out of range, branch to deoptimize. | 5509 // function. If the result is out of range, branch to deoptimize. |
5510 __ Ldr(dbl_scratch1, FieldMemOperand(input, HeapNumber::kValueOffset)); | 5510 __ Ldr(dbl_scratch1, FieldMemOperand(input, HeapNumber::kValueOffset)); |
5511 __ TryConvertDoubleToInt32(output, dbl_scratch1, dbl_scratch2); | 5511 __ TryRepresentDoubleAsInt32(output, dbl_scratch1, dbl_scratch2); |
5512 DeoptimizeIf(ne, instr->environment()); | 5512 DeoptimizeIf(ne, instr->environment()); |
5513 | 5513 |
5514 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { | 5514 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
5515 __ Cmp(output, 0); | 5515 __ Cmp(output, 0); |
5516 __ B(ne, &done); | 5516 __ B(ne, &done); |
5517 __ Fmov(scratch1, dbl_scratch1); | 5517 __ Fmov(scratch1, dbl_scratch1); |
5518 DeoptimizeIfNegative(scratch1, instr->environment()); | 5518 DeoptimizeIfNegative(scratch1, instr->environment()); |
5519 } | 5519 } |
5520 } | 5520 } |
5521 __ Bind(&done); | 5521 __ Bind(&done); |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5899 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5899 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
5900 // Index is equal to negated out of object property index plus 1. | 5900 // Index is equal to negated out of object property index plus 1. |
5901 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5901 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
5902 __ Ldr(result, FieldMemOperand(result, | 5902 __ Ldr(result, FieldMemOperand(result, |
5903 FixedArray::kHeaderSize - kPointerSize)); | 5903 FixedArray::kHeaderSize - kPointerSize)); |
5904 __ Bind(deferred->exit()); | 5904 __ Bind(deferred->exit()); |
5905 __ Bind(&done); | 5905 __ Bind(&done); |
5906 } | 5906 } |
5907 | 5907 |
5908 } } // namespace v8::internal | 5908 } } // namespace v8::internal |
OLD | NEW |