Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(364)

Side by Side Diff: src/x64/macro-assembler-x64.h

Issue 5736008: Provide baseline for experimental GC implementation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 void LoadRoot(Register destination, Heap::RootListIndex index); 75 void LoadRoot(Register destination, Heap::RootListIndex index);
76 void CompareRoot(Register with, Heap::RootListIndex index); 76 void CompareRoot(Register with, Heap::RootListIndex index);
77 void CompareRoot(Operand with, Heap::RootListIndex index); 77 void CompareRoot(Operand with, Heap::RootListIndex index);
78 void PushRoot(Heap::RootListIndex index); 78 void PushRoot(Heap::RootListIndex index);
79 void StoreRoot(Register source, Heap::RootListIndex index); 79 void StoreRoot(Register source, Heap::RootListIndex index);
80 80
81 // --------------------------------------------------------------------------- 81 // ---------------------------------------------------------------------------
82 // GC Support 82 // GC Support
83 83
84 #ifdef ENABLE_CARDMARKING_WRITE_BARRIER
84 // For page containing |object| mark region covering |addr| dirty. 85 // For page containing |object| mark region covering |addr| dirty.
85 // RecordWriteHelper only works if the object is not in new 86 // RecordWriteHelper only works if the object is not in new
86 // space. 87 // space.
87 void RecordWriteHelper(Register object, 88 void RecordWriteHelper(Register object,
88 Register addr, 89 Register addr,
89 Register scratch); 90 Register scratch);
90 91
91 // Check if object is in new space. The condition cc can be equal or 92 // Check if object is in new space. The condition cc can be equal or
92 // not_equal. If it is equal a jump will be done if the object is on new 93 // not_equal. If it is equal a jump will be done if the object is on new
93 // space. The register scratch can be object itself, but it will be clobbered. 94 // space. The register scratch can be object itself, but it will be clobbered.
(...skipping 27 matching lines...) Expand all
121 // For page containing |object| mark region covering [object+offset] dirty. 122 // For page containing |object| mark region covering [object+offset] dirty.
122 // The value is known to not be a smi. 123 // The value is known to not be a smi.
123 // object is the object being stored into, value is the object being stored. 124 // object is the object being stored into, value is the object being stored.
124 // If offset is zero, then the scratch register contains the array index into 125 // If offset is zero, then the scratch register contains the array index into
125 // the elements array represented as an untagged 32-bit integer. 126 // the elements array represented as an untagged 32-bit integer.
126 // All registers are clobbered by the operation. 127 // All registers are clobbered by the operation.
127 void RecordWriteNonSmi(Register object, 128 void RecordWriteNonSmi(Register object,
128 int offset, 129 int offset,
129 Register value, 130 Register value,
130 Register scratch); 131 Register scratch);
132 #endif
131 133
132 #ifdef ENABLE_DEBUGGER_SUPPORT 134 #ifdef ENABLE_DEBUGGER_SUPPORT
133 // --------------------------------------------------------------------------- 135 // ---------------------------------------------------------------------------
134 // Debugger Support 136 // Debugger Support
135 137
136 void DebugBreak(); 138 void DebugBreak();
137 #endif 139 #endif
138 140
139 // --------------------------------------------------------------------------- 141 // ---------------------------------------------------------------------------
140 // Activation frames 142 // Activation frames
(...skipping 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after
1641 andl(scratch2, Immediate(kFlatAsciiStringMask)); 1643 andl(scratch2, Immediate(kFlatAsciiStringMask));
1642 // Interleave the bits to check both scratch1 and scratch2 in one test. 1644 // Interleave the bits to check both scratch1 and scratch2 in one test.
1643 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3)); 1645 ASSERT_EQ(0, kFlatAsciiStringMask & (kFlatAsciiStringMask << 3));
1644 lea(scratch1, Operand(scratch1, scratch2, times_8, 0)); 1646 lea(scratch1, Operand(scratch1, scratch2, times_8, 0));
1645 cmpl(scratch1, 1647 cmpl(scratch1,
1646 Immediate(kFlatAsciiStringTag + (kFlatAsciiStringTag << 3))); 1648 Immediate(kFlatAsciiStringTag + (kFlatAsciiStringTag << 3)));
1647 j(not_equal, on_fail); 1649 j(not_equal, on_fail);
1648 } 1650 }
1649 1651
1650 1652
1653 #ifdef ENABLE_CARDMARKING_WRITE_BARRIER
1651 template <typename LabelType> 1654 template <typename LabelType>
1652 void MacroAssembler::InNewSpace(Register object, 1655 void MacroAssembler::InNewSpace(Register object,
1653 Register scratch, 1656 Register scratch,
1654 Condition cc, 1657 Condition cc,
1655 LabelType* branch) { 1658 LabelType* branch) {
1656 if (Serializer::enabled()) { 1659 if (Serializer::enabled()) {
1657 // Can't do arithmetic on external references if it might get serialized. 1660 // Can't do arithmetic on external references if it might get serialized.
1658 // The mask isn't really an address. We load it as an external reference in 1661 // The mask isn't really an address. We load it as an external reference in
1659 // case the size of the new space is different between the snapshot maker 1662 // case the size of the new space is different between the snapshot maker
1660 // and the running system. 1663 // and the running system.
(...skipping 14 matching lines...) Expand all
1675 movq(kScratchRegister, -new_space_start, RelocInfo::NONE); 1678 movq(kScratchRegister, -new_space_start, RelocInfo::NONE);
1676 if (scratch.is(object)) { 1679 if (scratch.is(object)) {
1677 addq(scratch, kScratchRegister); 1680 addq(scratch, kScratchRegister);
1678 } else { 1681 } else {
1679 lea(scratch, Operand(object, kScratchRegister, times_1, 0)); 1682 lea(scratch, Operand(object, kScratchRegister, times_1, 0));
1680 } 1683 }
1681 and_(scratch, Immediate(static_cast<int32_t>(Heap::NewSpaceMask()))); 1684 and_(scratch, Immediate(static_cast<int32_t>(Heap::NewSpaceMask())));
1682 j(cc, branch); 1685 j(cc, branch);
1683 } 1686 }
1684 } 1687 }
1685 1688 #endif
1686 1689
1687 template <typename LabelType> 1690 template <typename LabelType>
1688 void MacroAssembler::InvokePrologue(const ParameterCount& expected, 1691 void MacroAssembler::InvokePrologue(const ParameterCount& expected,
1689 const ParameterCount& actual, 1692 const ParameterCount& actual,
1690 Handle<Code> code_constant, 1693 Handle<Code> code_constant,
1691 Register code_register, 1694 Register code_register,
1692 LabelType* done, 1695 LabelType* done,
1693 InvokeFlag flag) { 1696 InvokeFlag flag) {
1694 bool definitely_matches = false; 1697 bool definitely_matches = false;
1695 NearLabel invoke; 1698 NearLabel invoke;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1746 Jump(adaptor, RelocInfo::CODE_TARGET); 1749 Jump(adaptor, RelocInfo::CODE_TARGET);
1747 } 1750 }
1748 bind(&invoke); 1751 bind(&invoke);
1749 } 1752 }
1750 } 1753 }
1751 1754
1752 1755
1753 } } // namespace v8::internal 1756 } } // namespace v8::internal
1754 1757
1755 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ 1758 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_
OLDNEW
« src/globals.h ('K') | « src/x64/ic-x64.cc ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698