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 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1497 } | 1497 } |
1498 | 1498 |
1499 | 1499 |
1500 void MacroAssembler::AbortIfNotSmi(Register object) { | 1500 void MacroAssembler::AbortIfNotSmi(Register object) { |
1501 NearLabel ok; | 1501 NearLabel ok; |
1502 Condition is_smi = CheckSmi(object); | 1502 Condition is_smi = CheckSmi(object); |
1503 Assert(is_smi, "Operand is not a smi"); | 1503 Assert(is_smi, "Operand is not a smi"); |
1504 } | 1504 } |
1505 | 1505 |
1506 | 1506 |
| 1507 void MacroAssembler::AbortIfNotString(Register object) { |
| 1508 testb(object, Immediate(kSmiTagMask)); |
| 1509 Assert(not_equal, "Operand is not a string"); |
| 1510 push(object); |
| 1511 movq(object, FieldOperand(object, HeapObject::kMapOffset)); |
| 1512 CmpInstanceType(object, FIRST_NONSTRING_TYPE); |
| 1513 pop(object); |
| 1514 Assert(below, "Operand is not a string"); |
| 1515 } |
| 1516 |
| 1517 |
1507 void MacroAssembler::AbortIfNotRootValue(Register src, | 1518 void MacroAssembler::AbortIfNotRootValue(Register src, |
1508 Heap::RootListIndex root_value_index, | 1519 Heap::RootListIndex root_value_index, |
1509 const char* message) { | 1520 const char* message) { |
1510 ASSERT(!src.is(kScratchRegister)); | 1521 ASSERT(!src.is(kScratchRegister)); |
1511 LoadRoot(kScratchRegister, root_value_index); | 1522 LoadRoot(kScratchRegister, root_value_index); |
1512 cmpq(src, kScratchRegister); | 1523 cmpq(src, kScratchRegister); |
1513 Check(equal, message); | 1524 Check(equal, message); |
1514 } | 1525 } |
1515 | 1526 |
1516 | 1527 |
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2327 CPU::FlushICache(address_, size_); | 2338 CPU::FlushICache(address_, size_); |
2328 | 2339 |
2329 // Check that the code was patched as expected. | 2340 // Check that the code was patched as expected. |
2330 ASSERT(masm_.pc_ == address_ + size_); | 2341 ASSERT(masm_.pc_ == address_ + size_); |
2331 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2342 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
2332 } | 2343 } |
2333 | 2344 |
2334 } } // namespace v8::internal | 2345 } } // namespace v8::internal |
2335 | 2346 |
2336 #endif // V8_TARGET_ARCH_X64 | 2347 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |