| 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 1860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1871 // Load map into |result|. | 1871 // Load map into |result|. |
| 1872 __ ldr(result, FieldMemOperand(input, HeapObject::kMapOffset)); | 1872 __ ldr(result, FieldMemOperand(input, HeapObject::kMapOffset)); |
| 1873 // Load the map's "bit field 2" into |result|. We only need the first byte, | 1873 // Load the map's "bit field 2" into |result|. We only need the first byte, |
| 1874 // but the following bit field extraction takes care of that anyway. | 1874 // but the following bit field extraction takes care of that anyway. |
| 1875 __ ldr(result, FieldMemOperand(result, Map::kBitField2Offset)); | 1875 __ ldr(result, FieldMemOperand(result, Map::kBitField2Offset)); |
| 1876 // Retrieve elements_kind from bit field 2. | 1876 // Retrieve elements_kind from bit field 2. |
| 1877 __ ubfx(result, result, Map::kElementsKindShift, Map::kElementsKindBitCount); | 1877 __ ubfx(result, result, Map::kElementsKindShift, Map::kElementsKindBitCount); |
| 1878 } | 1878 } |
| 1879 | 1879 |
| 1880 | 1880 |
| 1881 void LCodeGen::DoValueOf(LValueOf* instr) { | |
| 1882 Register input = ToRegister(instr->value()); | |
| 1883 Register result = ToRegister(instr->result()); | |
| 1884 Register map = ToRegister(instr->temp()); | |
| 1885 Label done; | |
| 1886 | |
| 1887 if (!instr->hydrogen()->value()->IsHeapObject()) { | |
| 1888 // If the object is a smi return the object. | |
| 1889 __ SmiTst(input); | |
| 1890 __ Move(result, input, eq); | |
| 1891 __ b(eq, &done); | |
| 1892 } | |
| 1893 | |
| 1894 // If the object is not a value type, return the object. | |
| 1895 __ CompareObjectType(input, map, map, JS_VALUE_TYPE); | |
| 1896 __ Move(result, input, ne); | |
| 1897 __ ldr(result, FieldMemOperand(input, JSValue::kValueOffset), eq); | |
| 1898 | |
| 1899 __ bind(&done); | |
| 1900 } | |
| 1901 | |
| 1902 | |
| 1903 void LCodeGen::DoDateField(LDateField* instr) { | 1881 void LCodeGen::DoDateField(LDateField* instr) { |
| 1904 Register object = ToRegister(instr->date()); | 1882 Register object = ToRegister(instr->date()); |
| 1905 Register result = ToRegister(instr->result()); | 1883 Register result = ToRegister(instr->result()); |
| 1906 Register scratch = ToRegister(instr->temp()); | 1884 Register scratch = ToRegister(instr->temp()); |
| 1907 Smi* index = instr->index(); | 1885 Smi* index = instr->index(); |
| 1908 Label runtime, done; | 1886 Label runtime, done; |
| 1909 ASSERT(object.is(result)); | 1887 ASSERT(object.is(result)); |
| 1910 ASSERT(object.is(r0)); | 1888 ASSERT(object.is(r0)); |
| 1911 ASSERT(!scratch.is(scratch0())); | 1889 ASSERT(!scratch.is(scratch0())); |
| 1912 ASSERT(!scratch.is(object)); | 1890 ASSERT(!scratch.is(object)); |
| (...skipping 3877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5790 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5768 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
| 5791 __ ldr(result, FieldMemOperand(scratch, | 5769 __ ldr(result, FieldMemOperand(scratch, |
| 5792 FixedArray::kHeaderSize - kPointerSize)); | 5770 FixedArray::kHeaderSize - kPointerSize)); |
| 5793 __ bind(&done); | 5771 __ bind(&done); |
| 5794 } | 5772 } |
| 5795 | 5773 |
| 5796 | 5774 |
| 5797 #undef __ | 5775 #undef __ |
| 5798 | 5776 |
| 5799 } } // namespace v8::internal | 5777 } } // namespace v8::internal |
| OLD | NEW |