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

Side by Side Diff: src/x64/deoptimizer-x64.cc

Issue 8773039: Clean up multi byte nop support on x64 to more closely match IA32. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 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
« no previous file with comments | « src/x64/debug-x64.cc ('k') | src/x64/disasm-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 // cmp rsp, <limit> ;; Not changed 131 // cmp rsp, <limit> ;; Not changed
132 // nop 132 // nop
133 // nop 133 // nop
134 // call <on-stack replacment> 134 // call <on-stack replacment>
135 // test rax, <loop nesting depth> 135 // test rax, <loop nesting depth>
136 // ok: 136 // ok:
137 // 137 //
138 ASSERT(*(call_target_address - 3) == 0x73 && // jae 138 ASSERT(*(call_target_address - 3) == 0x73 && // jae
139 *(call_target_address - 2) == 0x07 && // offset 139 *(call_target_address - 2) == 0x07 && // offset
140 *(call_target_address - 1) == 0xe8); // call 140 *(call_target_address - 1) == 0xe8); // call
141 *(call_target_address - 3) = 0x90; // nop 141 *(call_target_address - 3) = 0x66; // 2 byte nop part 1
142 *(call_target_address - 2) = 0x90; // nop 142 *(call_target_address - 2) = 0x90; // 2 byte nop part 2
143 Assembler::set_target_address_at(call_target_address, 143 Assembler::set_target_address_at(call_target_address,
144 replacement_code->entry()); 144 replacement_code->entry());
145 145
146 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( 146 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch(
147 unoptimized_code, call_target_address, replacement_code); 147 unoptimized_code, call_target_address, replacement_code);
148 } 148 }
149 149
150 150
151 void Deoptimizer::RevertStackCheckCodeAt(Code* unoptimized_code, 151 void Deoptimizer::RevertStackCheckCodeAt(Code* unoptimized_code,
152 Address pc_after, 152 Address pc_after,
153 Code* check_code, 153 Code* check_code,
154 Code* replacement_code) { 154 Code* replacement_code) {
155 Address call_target_address = pc_after - kIntSize; 155 Address call_target_address = pc_after - kIntSize;
156 ASSERT(replacement_code->entry() == 156 ASSERT(replacement_code->entry() ==
157 Assembler::target_address_at(call_target_address)); 157 Assembler::target_address_at(call_target_address));
158 // Replace the nops from patching (Deoptimizer::PatchStackCheckCode) to 158 // Replace the nops from patching (Deoptimizer::PatchStackCheckCode) to
159 // restore the conditional branch. 159 // restore the conditional branch.
160 ASSERT(*(call_target_address - 3) == 0x90 && // nop 160 ASSERT(*(call_target_address - 3) == 0x66 && // 2 byte nop part 1
161 *(call_target_address - 2) == 0x90 && // nop 161 *(call_target_address - 2) == 0x90 && // 2 byte nop part 2
162 *(call_target_address - 1) == 0xe8); // call 162 *(call_target_address - 1) == 0xe8); // call
163 *(call_target_address - 3) = 0x73; // jae 163 *(call_target_address - 3) = 0x73; // jae
164 *(call_target_address - 2) = 0x07; // offset 164 *(call_target_address - 2) = 0x07; // offset
165 Assembler::set_target_address_at(call_target_address, 165 Assembler::set_target_address_at(call_target_address,
166 check_code->entry()); 166 check_code->entry());
167 167
168 check_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( 168 check_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch(
169 unoptimized_code, call_target_address, check_code); 169 unoptimized_code, call_target_address, check_code);
170 } 170 }
171 171
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 } 743 }
744 __ bind(&done); 744 __ bind(&done);
745 } 745 }
746 746
747 #undef __ 747 #undef __
748 748
749 749
750 } } // namespace v8::internal 750 } } // namespace v8::internal
751 751
752 #endif // V8_TARGET_ARCH_X64 752 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/debug-x64.cc ('k') | src/x64/disasm-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698