| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1601 } | 1601 } |
| 1602 | 1602 |
| 1603 | 1603 |
| 1604 void MacroAssembler::AbortIfNotSmi(Register object) { | 1604 void MacroAssembler::AbortIfNotSmi(Register object) { |
| 1605 NearLabel ok; | 1605 NearLabel ok; |
| 1606 Condition is_smi = CheckSmi(object); | 1606 Condition is_smi = CheckSmi(object); |
| 1607 Assert(is_smi, "Operand is not a smi"); | 1607 Assert(is_smi, "Operand is not a smi"); |
| 1608 } | 1608 } |
| 1609 | 1609 |
| 1610 | 1610 |
| 1611 void MacroAssembler::AbortIfNotString(Register object) { |
| 1612 testb(object, Immediate(kSmiTagMask)); |
| 1613 Assert(not_equal, "Operand is not a string"); |
| 1614 push(object); |
| 1615 movq(object, FieldOperand(object, HeapObject::kMapOffset)); |
| 1616 CmpInstanceType(object, FIRST_NONSTRING_TYPE); |
| 1617 pop(object); |
| 1618 Assert(below, "Operand is not a string"); |
| 1619 } |
| 1620 |
| 1621 |
| 1611 void MacroAssembler::AbortIfNotRootValue(Register src, | 1622 void MacroAssembler::AbortIfNotRootValue(Register src, |
| 1612 Heap::RootListIndex root_value_index, | 1623 Heap::RootListIndex root_value_index, |
| 1613 const char* message) { | 1624 const char* message) { |
| 1614 ASSERT(!src.is(kScratchRegister)); | 1625 ASSERT(!src.is(kScratchRegister)); |
| 1615 LoadRoot(kScratchRegister, root_value_index); | 1626 LoadRoot(kScratchRegister, root_value_index); |
| 1616 cmpq(src, kScratchRegister); | 1627 cmpq(src, kScratchRegister); |
| 1617 Check(equal, message); | 1628 Check(equal, message); |
| 1618 } | 1629 } |
| 1619 | 1630 |
| 1620 | 1631 |
| (...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2488 CPU::FlushICache(address_, size_); | 2499 CPU::FlushICache(address_, size_); |
| 2489 | 2500 |
| 2490 // Check that the code was patched as expected. | 2501 // Check that the code was patched as expected. |
| 2491 ASSERT(masm_.pc_ == address_ + size_); | 2502 ASSERT(masm_.pc_ == address_ + size_); |
| 2492 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2503 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
| 2493 } | 2504 } |
| 2494 | 2505 |
| 2495 } } // namespace v8::internal | 2506 } } // namespace v8::internal |
| 2496 | 2507 |
| 2497 #endif // V8_TARGET_ARCH_X64 | 2508 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |