OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1457 bind(&skip); | 1457 bind(&skip); |
1458 } | 1458 } |
1459 } | 1459 } |
1460 | 1460 |
1461 | 1461 |
1462 void MacroAssembler::Assert(Condition cc, const char* msg) { | 1462 void MacroAssembler::Assert(Condition cc, const char* msg) { |
1463 if (FLAG_debug_code) Check(cc, msg); | 1463 if (FLAG_debug_code) Check(cc, msg); |
1464 } | 1464 } |
1465 | 1465 |
1466 | 1466 |
| 1467 void MacroAssembler::AssertFastElements(Register elements) { |
| 1468 if (FLAG_debug_code) { |
| 1469 Label ok; |
| 1470 cmp(FieldOperand(elements, HeapObject::kMapOffset), |
| 1471 Immediate(Factory::fixed_array_map())); |
| 1472 j(equal, &ok); |
| 1473 cmp(FieldOperand(elements, HeapObject::kMapOffset), |
| 1474 Immediate(Factory::fixed_cow_array_map())); |
| 1475 j(equal, &ok); |
| 1476 Abort("JSObject with fast elements map has slow elements"); |
| 1477 bind(&ok); |
| 1478 } |
| 1479 } |
| 1480 |
| 1481 |
1467 void MacroAssembler::Check(Condition cc, const char* msg) { | 1482 void MacroAssembler::Check(Condition cc, const char* msg) { |
1468 Label L; | 1483 Label L; |
1469 j(cc, &L, taken); | 1484 j(cc, &L, taken); |
1470 Abort(msg); | 1485 Abort(msg); |
1471 // will not return here | 1486 // will not return here |
1472 bind(&L); | 1487 bind(&L); |
1473 } | 1488 } |
1474 | 1489 |
1475 | 1490 |
1476 void MacroAssembler::CheckStackAlignment() { | 1491 void MacroAssembler::CheckStackAlignment() { |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1671 | 1686 |
1672 // Check that the code was patched as expected. | 1687 // Check that the code was patched as expected. |
1673 ASSERT(masm_.pc_ == address_ + size_); | 1688 ASSERT(masm_.pc_ == address_ + size_); |
1674 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 1689 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
1675 } | 1690 } |
1676 | 1691 |
1677 | 1692 |
1678 } } // namespace v8::internal | 1693 } } // namespace v8::internal |
1679 | 1694 |
1680 #endif // V8_TARGET_ARCH_IA32 | 1695 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |