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 1570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1581 // Load map into |result|. | 1581 // Load map into |result|. |
1582 __ movp(result, FieldOperand(input, HeapObject::kMapOffset)); | 1582 __ movp(result, FieldOperand(input, HeapObject::kMapOffset)); |
1583 // Load the map's "bit field 2" into |result|. We only need the first byte. | 1583 // Load the map's "bit field 2" into |result|. We only need the first byte. |
1584 __ movzxbq(result, FieldOperand(result, Map::kBitField2Offset)); | 1584 __ movzxbq(result, FieldOperand(result, Map::kBitField2Offset)); |
1585 // Retrieve elements_kind from bit field 2. | 1585 // Retrieve elements_kind from bit field 2. |
1586 __ and_(result, Immediate(Map::kElementsKindMask)); | 1586 __ and_(result, Immediate(Map::kElementsKindMask)); |
1587 __ shr(result, Immediate(Map::kElementsKindShift)); | 1587 __ shr(result, Immediate(Map::kElementsKindShift)); |
1588 } | 1588 } |
1589 | 1589 |
1590 | 1590 |
1591 void LCodeGen::DoValueOf(LValueOf* instr) { | |
1592 Register input = ToRegister(instr->value()); | |
1593 Register result = ToRegister(instr->result()); | |
1594 ASSERT(input.is(result)); | |
1595 Label done; | |
1596 | |
1597 if (!instr->hydrogen()->value()->IsHeapObject()) { | |
1598 // If the object is a smi return the object. | |
1599 __ JumpIfSmi(input, &done, Label::kNear); | |
1600 } | |
1601 | |
1602 // If the object is not a value type, return the object. | |
1603 __ CmpObjectType(input, JS_VALUE_TYPE, kScratchRegister); | |
1604 __ j(not_equal, &done, Label::kNear); | |
1605 __ movp(result, FieldOperand(input, JSValue::kValueOffset)); | |
1606 | |
1607 __ bind(&done); | |
1608 } | |
1609 | |
1610 | |
1611 void LCodeGen::DoDateField(LDateField* instr) { | 1591 void LCodeGen::DoDateField(LDateField* instr) { |
1612 Register object = ToRegister(instr->date()); | 1592 Register object = ToRegister(instr->date()); |
1613 Register result = ToRegister(instr->result()); | 1593 Register result = ToRegister(instr->result()); |
1614 Smi* index = instr->index(); | 1594 Smi* index = instr->index(); |
1615 Label runtime, done, not_date_object; | 1595 Label runtime, done, not_date_object; |
1616 ASSERT(object.is(result)); | 1596 ASSERT(object.is(result)); |
1617 ASSERT(object.is(rax)); | 1597 ASSERT(object.is(rax)); |
1618 | 1598 |
1619 Condition cc = masm()->CheckSmi(object); | 1599 Condition cc = masm()->CheckSmi(object); |
1620 DeoptimizeIf(cc, instr->environment()); | 1600 DeoptimizeIf(cc, instr->environment()); |
(...skipping 3972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5593 FixedArray::kHeaderSize - kPointerSize)); | 5573 FixedArray::kHeaderSize - kPointerSize)); |
5594 __ bind(&done); | 5574 __ bind(&done); |
5595 } | 5575 } |
5596 | 5576 |
5597 | 5577 |
5598 #undef __ | 5578 #undef __ |
5599 | 5579 |
5600 } } // namespace v8::internal | 5580 } } // namespace v8::internal |
5601 | 5581 |
5602 #endif // V8_TARGET_ARCH_X64 | 5582 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |