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 1950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1961 } | 1961 } |
1962 | 1962 |
1963 | 1963 |
1964 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { | 1964 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { |
1965 Register result = ToRegister(instr->result()); | 1965 Register result = ToRegister(instr->result()); |
1966 Register map = ToRegister(instr->value()); | 1966 Register map = ToRegister(instr->value()); |
1967 __ EnumLength(result, map); | 1967 __ EnumLength(result, map); |
1968 } | 1968 } |
1969 | 1969 |
1970 | 1970 |
1971 void LCodeGen::DoElementsKind(LElementsKind* instr) { | |
1972 Register result = ToRegister(instr->result()); | |
1973 Register input = ToRegister(instr->value()); | |
1974 | |
1975 // Load map into |result|. | |
1976 __ mov(result, FieldOperand(input, HeapObject::kMapOffset)); | |
1977 // Load the map's "bit field 2" into |result|. We only need the first byte, | |
1978 // but the following masking takes care of that anyway. | |
1979 __ mov(result, FieldOperand(result, Map::kBitField2Offset)); | |
1980 // Retrieve elements_kind from bit field 2. | |
1981 __ and_(result, Map::kElementsKindMask); | |
1982 __ shr(result, Map::kElementsKindShift); | |
1983 } | |
1984 | |
1985 | |
1986 void LCodeGen::DoValueOf(LValueOf* instr) { | 1971 void LCodeGen::DoValueOf(LValueOf* instr) { |
1987 Register input = ToRegister(instr->value()); | 1972 Register input = ToRegister(instr->value()); |
1988 Register result = ToRegister(instr->result()); | 1973 Register result = ToRegister(instr->result()); |
1989 Register map = ToRegister(instr->temp()); | 1974 Register map = ToRegister(instr->temp()); |
1990 ASSERT(input.is(result)); | 1975 ASSERT(input.is(result)); |
1991 | 1976 |
1992 Label done; | 1977 Label done; |
1993 | 1978 |
1994 if (!instr->hydrogen()->value()->IsHeapObject()) { | 1979 if (!instr->hydrogen()->value()->IsHeapObject()) { |
1995 // If the object is a smi return the object. | 1980 // If the object is a smi return the object. |
(...skipping 4323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6319 FixedArray::kHeaderSize - kPointerSize)); | 6304 FixedArray::kHeaderSize - kPointerSize)); |
6320 __ bind(&done); | 6305 __ bind(&done); |
6321 } | 6306 } |
6322 | 6307 |
6323 | 6308 |
6324 #undef __ | 6309 #undef __ |
6325 | 6310 |
6326 } } // namespace v8::internal | 6311 } } // namespace v8::internal |
6327 | 6312 |
6328 #endif // V8_TARGET_ARCH_IA32 | 6313 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |