OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1578 CmpInstanceType(map, type); | 1578 CmpInstanceType(map, type); |
1579 } | 1579 } |
1580 | 1580 |
1581 | 1581 |
1582 void MacroAssembler::CmpInstanceType(Register map, InstanceType type) { | 1582 void MacroAssembler::CmpInstanceType(Register map, InstanceType type) { |
1583 cmpb(FieldOperand(map, Map::kInstanceTypeOffset), | 1583 cmpb(FieldOperand(map, Map::kInstanceTypeOffset), |
1584 Immediate(static_cast<int8_t>(type))); | 1584 Immediate(static_cast<int8_t>(type))); |
1585 } | 1585 } |
1586 | 1586 |
1587 | 1587 |
| 1588 void MacroAssembler::CheckMap(Register obj, |
| 1589 Handle<Map> map, |
| 1590 Label* fail, |
| 1591 bool is_heap_object) { |
| 1592 if (!is_heap_object) { |
| 1593 JumpIfSmi(obj, fail); |
| 1594 } |
| 1595 Cmp(FieldOperand(obj, HeapObject::kMapOffset), map); |
| 1596 j(not_equal, fail); |
| 1597 } |
| 1598 |
| 1599 |
1588 Condition MacroAssembler::IsObjectStringType(Register heap_object, | 1600 Condition MacroAssembler::IsObjectStringType(Register heap_object, |
1589 Register map, | 1601 Register map, |
1590 Register instance_type) { | 1602 Register instance_type) { |
1591 movq(map, FieldOperand(heap_object, HeapObject::kMapOffset)); | 1603 movq(map, FieldOperand(heap_object, HeapObject::kMapOffset)); |
1592 movzxbl(instance_type, FieldOperand(map, Map::kInstanceTypeOffset)); | 1604 movzxbl(instance_type, FieldOperand(map, Map::kInstanceTypeOffset)); |
1593 ASSERT(kNotStringTag != 0); | 1605 ASSERT(kNotStringTag != 0); |
1594 testb(instance_type, Immediate(kIsNotStringMask)); | 1606 testb(instance_type, Immediate(kIsNotStringMask)); |
1595 return zero; | 1607 return zero; |
1596 } | 1608 } |
1597 | 1609 |
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2567 CodePatcher::~CodePatcher() { | 2579 CodePatcher::~CodePatcher() { |
2568 // Indicate that code has changed. | 2580 // Indicate that code has changed. |
2569 CPU::FlushICache(address_, size_); | 2581 CPU::FlushICache(address_, size_); |
2570 | 2582 |
2571 // Check that the code was patched as expected. | 2583 // Check that the code was patched as expected. |
2572 ASSERT(masm_.pc_ == address_ + size_); | 2584 ASSERT(masm_.pc_ == address_ + size_); |
2573 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2585 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
2574 } | 2586 } |
2575 | 2587 |
2576 } } // namespace v8::internal | 2588 } } // namespace v8::internal |
OLD | NEW |