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

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

Issue 7639020: Perform TODO(gc) cleanup for TODO-lockdown. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 4 months 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 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 PrintF(" / %x]\n", reinterpret_cast<uint32_t>(function)); 214 PrintF(" / %x]\n", reinterpret_cast<uint32_t>(function));
215 #ifdef DEBUG 215 #ifdef DEBUG
216 if (FLAG_print_code) { 216 if (FLAG_print_code) {
217 code->PrintLn(); 217 code->PrintLn();
218 } 218 }
219 #endif 219 #endif
220 } 220 }
221 } 221 }
222 222
223 223
224 // TODO(gc) make use of unoptimized_code when supporting incremental marking.
225 void Deoptimizer::PatchStackCheckCodeAt(Code* unoptimized_code, 224 void Deoptimizer::PatchStackCheckCodeAt(Code* unoptimized_code,
226 Address pc_after, 225 Address pc_after,
227 Code* check_code, 226 Code* check_code,
228 Code* replacement_code) { 227 Code* replacement_code) {
229 Address call_target_address = pc_after - kIntSize; 228 Address call_target_address = pc_after - kIntSize;
230 ASSERT(check_code->entry() == 229 ASSERT(check_code->entry() ==
231 Assembler::target_address_at(call_target_address)); 230 Assembler::target_address_at(call_target_address));
232 // The stack check code matches the pattern: 231 // The stack check code matches the pattern:
233 // 232 //
234 // cmp esp, <limit> 233 // cmp esp, <limit>
(...skipping 11 matching lines...) Expand all
246 // test eax, <loop nesting depth> 245 // test eax, <loop nesting depth>
247 // ok: 246 // ok:
248 ASSERT(*(call_target_address - 3) == 0x73 && // jae 247 ASSERT(*(call_target_address - 3) == 0x73 && // jae
249 *(call_target_address - 2) == 0x07 && // offset 248 *(call_target_address - 2) == 0x07 && // offset
250 *(call_target_address - 1) == 0xe8); // call 249 *(call_target_address - 1) == 0xe8); // call
251 *(call_target_address - 3) = 0x90; // nop 250 *(call_target_address - 3) = 0x90; // nop
252 *(call_target_address - 2) = 0x90; // nop 251 *(call_target_address - 2) = 0x90; // nop
253 Assembler::set_target_address_at(call_target_address, 252 Assembler::set_target_address_at(call_target_address,
254 replacement_code->entry()); 253 replacement_code->entry());
255 254
256 // TODO(gc) we are not compacting code space. 255 // TODO(1550) We are passing NULL as a slot because code can never be on
256 // evacuation candidate.
257 unoptimized_code->GetHeap()->incremental_marking()->RecordWrite( 257 unoptimized_code->GetHeap()->incremental_marking()->RecordWrite(
258 unoptimized_code, NULL, replacement_code); 258 unoptimized_code, NULL, replacement_code);
259 } 259 }
260 260
261 261
262 void Deoptimizer::RevertStackCheckCodeAt(Address pc_after, 262 void Deoptimizer::RevertStackCheckCodeAt(Address pc_after,
263 Code* check_code, 263 Code* check_code,
264 Code* replacement_code) { 264 Code* replacement_code) {
265 Address call_target_address = pc_after - kIntSize; 265 Address call_target_address = pc_after - kIntSize;
266 ASSERT(replacement_code->entry() == 266 ASSERT(replacement_code->entry() ==
267 Assembler::target_address_at(call_target_address)); 267 Assembler::target_address_at(call_target_address));
268 // Replace the nops from patching (Deoptimizer::PatchStackCheckCode) to 268 // Replace the nops from patching (Deoptimizer::PatchStackCheckCode) to
269 // restore the conditional branch. 269 // restore the conditional branch.
270 ASSERT(*(call_target_address - 3) == 0x90 && // nop 270 ASSERT(*(call_target_address - 3) == 0x90 && // nop
271 *(call_target_address - 2) == 0x90 && // nop 271 *(call_target_address - 2) == 0x90 && // nop
272 *(call_target_address - 1) == 0xe8); // call 272 *(call_target_address - 1) == 0xe8); // call
273 *(call_target_address - 3) = 0x73; // jae 273 *(call_target_address - 3) = 0x73; // jae
274 *(call_target_address - 2) = 0x07; // offset 274 *(call_target_address - 2) = 0x07; // offset
275 Assembler::set_target_address_at(call_target_address, 275 Assembler::set_target_address_at(call_target_address,
276 check_code->entry()); 276 check_code->entry());
277 // TODO(gc) ISOLATES MERGE 277 check_code->GetHeap()->incremental_marking()->RecordWriteOf(check_code);
278 HEAP->incremental_marking()->RecordWriteOf(check_code);
279 } 278 }
280 279
281 280
282 static int LookupBailoutId(DeoptimizationInputData* data, unsigned ast_id) { 281 static int LookupBailoutId(DeoptimizationInputData* data, unsigned ast_id) {
283 ByteArray* translations = data->TranslationByteArray(); 282 ByteArray* translations = data->TranslationByteArray();
284 int length = data->DeoptCount(); 283 int length = data->DeoptCount();
285 for (int i = 0; i < length; i++) { 284 for (int i = 0; i < length; i++) {
286 if (static_cast<unsigned>(data->AstId(i)->value()) == ast_id) { 285 if (static_cast<unsigned>(data->AstId(i)->value()) == ast_id) {
287 TranslationIterator it(translations, data->TranslationIndex(i)->value()); 286 TranslationIterator it(translations, data->TranslationIndex(i)->value());
288 int value = it.Next(); 287 int value = it.Next();
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 } 797 }
799 __ bind(&done); 798 __ bind(&done);
800 } 799 }
801 800
802 #undef __ 801 #undef __
803 802
804 803
805 } } // namespace v8::internal 804 } } // namespace v8::internal
806 805
807 #endif // V8_TARGET_ARCH_IA32 806 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698