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 17 matching lines...) Expand all Loading... |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
30 #if defined(V8_TARGET_ARCH_X64) | 30 #if defined(V8_TARGET_ARCH_X64) |
31 | 31 |
32 #include "bootstrapper.h" | 32 #include "bootstrapper.h" |
33 #include "codegen-inl.h" | 33 #include "codegen-inl.h" |
34 #include "assembler-x64.h" | 34 #include "assembler-x64.h" |
35 #include "macro-assembler-x64.h" | 35 #include "macro-assembler-x64.h" |
36 #include "serialize.h" | 36 #include "serialize.h" |
37 #include "debug.h" | 37 #include "debug.h" |
| 38 #include "heap.h" |
38 | 39 |
39 namespace v8 { | 40 namespace v8 { |
40 namespace internal { | 41 namespace internal { |
41 | 42 |
42 MacroAssembler::MacroAssembler(void* buffer, int size) | 43 MacroAssembler::MacroAssembler(void* buffer, int size) |
43 : Assembler(buffer, size), | 44 : Assembler(buffer, size), |
44 generating_stub_(false), | 45 generating_stub_(false), |
45 allow_stub_calls_(true), | 46 allow_stub_calls_(true), |
46 code_object_(Heap::undefined_value()) { | 47 code_object_(Heap::undefined_value()) { |
47 } | 48 } |
(...skipping 1676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1724 } | 1725 } |
1725 | 1726 |
1726 | 1727 |
1727 void MacroAssembler::AbortIfNotSmi(Register object) { | 1728 void MacroAssembler::AbortIfNotSmi(Register object) { |
1728 Label ok; | 1729 Label ok; |
1729 Condition is_smi = CheckSmi(object); | 1730 Condition is_smi = CheckSmi(object); |
1730 Assert(is_smi, "Operand not a smi"); | 1731 Assert(is_smi, "Operand not a smi"); |
1731 } | 1732 } |
1732 | 1733 |
1733 | 1734 |
| 1735 void MacroAssembler::AbortIfNotRootValue(Register src, |
| 1736 Heap::RootListIndex root_value_index, |
| 1737 const char* message) { |
| 1738 ASSERT(!src.is(kScratchRegister)); |
| 1739 LoadRoot(kScratchRegister, root_value_index); |
| 1740 cmpq(src, kScratchRegister); |
| 1741 Check(equal, message); |
| 1742 } |
| 1743 |
| 1744 |
| 1745 |
1734 Condition MacroAssembler::IsObjectStringType(Register heap_object, | 1746 Condition MacroAssembler::IsObjectStringType(Register heap_object, |
1735 Register map, | 1747 Register map, |
1736 Register instance_type) { | 1748 Register instance_type) { |
1737 movq(map, FieldOperand(heap_object, HeapObject::kMapOffset)); | 1749 movq(map, FieldOperand(heap_object, HeapObject::kMapOffset)); |
1738 movzxbl(instance_type, FieldOperand(map, Map::kInstanceTypeOffset)); | 1750 movzxbl(instance_type, FieldOperand(map, Map::kInstanceTypeOffset)); |
1739 ASSERT(kNotStringTag != 0); | 1751 ASSERT(kNotStringTag != 0); |
1740 testb(instance_type, Immediate(kIsNotStringMask)); | 1752 testb(instance_type, Immediate(kIsNotStringMask)); |
1741 return zero; | 1753 return zero; |
1742 } | 1754 } |
1743 | 1755 |
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2749 CPU::FlushICache(address_, size_); | 2761 CPU::FlushICache(address_, size_); |
2750 | 2762 |
2751 // Check that the code was patched as expected. | 2763 // Check that the code was patched as expected. |
2752 ASSERT(masm_.pc_ == address_ + size_); | 2764 ASSERT(masm_.pc_ == address_ + size_); |
2753 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2765 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
2754 } | 2766 } |
2755 | 2767 |
2756 } } // namespace v8::internal | 2768 } } // namespace v8::internal |
2757 | 2769 |
2758 #endif // V8_TARGET_ARCH_X64 | 2770 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |