Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
| 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 4782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4793 // Heap number map check. | 4793 // Heap number map check. |
| 4794 __ lw(scratch1, FieldMemOperand(input_reg, HeapObject::kMapOffset)); | 4794 __ lw(scratch1, FieldMemOperand(input_reg, HeapObject::kMapOffset)); |
| 4795 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); | 4795 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); |
| 4796 // This 'at' value and scratch1 map value are used for tests in both clauses | 4796 // This 'at' value and scratch1 map value are used for tests in both clauses |
| 4797 // of the if. | 4797 // of the if. |
| 4798 | 4798 |
| 4799 if (instr->truncating()) { | 4799 if (instr->truncating()) { |
| 4800 // Performs a truncating conversion of a floating point number as used by | 4800 // Performs a truncating conversion of a floating point number as used by |
| 4801 // the JS bitwise operations. | 4801 // the JS bitwise operations. |
| 4802 Label no_heap_number, check_bools, check_false; | 4802 Label no_heap_number, check_bools, check_false; |
| 4803 __ Branch(&no_heap_number, ne, scratch1, Operand(at)); // HeapNumber map? | 4803 // Check HeapNumber map. |
| 4804 __ Branch(USE_DELAY_SLOT, &no_heap_number, ne, scratch1, Operand(at)); | |
| 4804 __ mov(scratch2, input_reg); | 4805 __ mov(scratch2, input_reg); |
|
Paul Lind
2014/01/31 18:54:40
nit: we should add '// In delay slot.' here, to st
| |
| 4805 __ TruncateHeapNumberToI(input_reg, scratch2); | 4806 __ TruncateHeapNumberToI(input_reg, scratch2); |
| 4806 __ Branch(&done); | 4807 __ Branch(&done); |
| 4807 | 4808 |
| 4808 // Check for Oddballs. Undefined/False is converted to zero and True to one | 4809 // Check for Oddballs. Undefined/False is converted to zero and True to one |
| 4809 // for truncating conversions. | 4810 // for truncating conversions. |
| 4810 __ bind(&no_heap_number); | 4811 __ bind(&no_heap_number); |
| 4811 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 4812 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
| 4812 __ Branch(&check_bools, ne, input_reg, Operand(at)); | 4813 __ Branch(&check_bools, ne, input_reg, Operand(at)); |
| 4813 ASSERT(ToRegister(instr->result()).is(input_reg)); | 4814 ASSERT(ToRegister(instr->result()).is(input_reg)); |
| 4814 __ Branch(USE_DELAY_SLOT, &done); | 4815 __ Branch(USE_DELAY_SLOT, &done); |
| (...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5736 __ Subu(scratch, result, scratch); | 5737 __ Subu(scratch, result, scratch); |
| 5737 __ lw(result, FieldMemOperand(scratch, | 5738 __ lw(result, FieldMemOperand(scratch, |
| 5738 FixedArray::kHeaderSize - kPointerSize)); | 5739 FixedArray::kHeaderSize - kPointerSize)); |
| 5739 __ bind(&done); | 5740 __ bind(&done); |
| 5740 } | 5741 } |
| 5741 | 5742 |
| 5742 | 5743 |
| 5743 #undef __ | 5744 #undef __ |
| 5744 | 5745 |
| 5745 } } // namespace v8::internal | 5746 } } // namespace v8::internal |
| OLD | NEW |