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 1556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1567 } | 1567 } |
1568 | 1568 |
1569 | 1569 |
1570 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { | 1570 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { |
1571 Register result = ToRegister(instr->result()); | 1571 Register result = ToRegister(instr->result()); |
1572 Register map = ToRegister(instr->value()); | 1572 Register map = ToRegister(instr->value()); |
1573 __ EnumLength(result, map); | 1573 __ EnumLength(result, map); |
1574 } | 1574 } |
1575 | 1575 |
1576 | 1576 |
1577 void LCodeGen::DoElementsKind(LElementsKind* instr) { | |
1578 Register result = ToRegister(instr->result()); | |
1579 Register input = ToRegister(instr->value()); | |
1580 | |
1581 // Load map into |result|. | |
1582 __ movp(result, FieldOperand(input, HeapObject::kMapOffset)); | |
1583 // Load the map's "bit field 2" into |result|. We only need the first byte. | |
1584 __ movzxbq(result, FieldOperand(result, Map::kBitField2Offset)); | |
1585 // Retrieve elements_kind from bit field 2. | |
1586 __ and_(result, Immediate(Map::kElementsKindMask)); | |
1587 __ shr(result, Immediate(Map::kElementsKindShift)); | |
1588 } | |
1589 | |
1590 | |
1591 void LCodeGen::DoValueOf(LValueOf* instr) { | 1577 void LCodeGen::DoValueOf(LValueOf* instr) { |
1592 Register input = ToRegister(instr->value()); | 1578 Register input = ToRegister(instr->value()); |
1593 Register result = ToRegister(instr->result()); | 1579 Register result = ToRegister(instr->result()); |
1594 ASSERT(input.is(result)); | 1580 ASSERT(input.is(result)); |
1595 Label done; | 1581 Label done; |
1596 | 1582 |
1597 if (!instr->hydrogen()->value()->IsHeapObject()) { | 1583 if (!instr->hydrogen()->value()->IsHeapObject()) { |
1598 // If the object is a smi return the object. | 1584 // If the object is a smi return the object. |
1599 __ JumpIfSmi(input, &done, Label::kNear); | 1585 __ JumpIfSmi(input, &done, Label::kNear); |
1600 } | 1586 } |
(...skipping 3992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5593 FixedArray::kHeaderSize - kPointerSize)); | 5579 FixedArray::kHeaderSize - kPointerSize)); |
5594 __ bind(&done); | 5580 __ bind(&done); |
5595 } | 5581 } |
5596 | 5582 |
5597 | 5583 |
5598 #undef __ | 5584 #undef __ |
5599 | 5585 |
5600 } } // namespace v8::internal | 5586 } } // namespace v8::internal |
5601 | 5587 |
5602 #endif // V8_TARGET_ARCH_X64 | 5588 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |