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

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 14794007: Preserve optimized code map during GCs weakly. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Hannes Payer. Created 7 years, 7 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
« no previous file with comments | « src/objects-visiting-inl.h ('k') | test/cctest/test-heap.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 280
281 __ bind(&check_optimized); 281 __ bind(&check_optimized);
282 282
283 __ IncrementCounter(counters->fast_new_closure_try_optimized(), 1); 283 __ IncrementCounter(counters->fast_new_closure_try_optimized(), 1);
284 284
285 // rcx holds native context, ebx points to fixed array of 3-element entries 285 // rcx holds native context, ebx points to fixed array of 3-element entries
286 // (native context, optimized code, literals). 286 // (native context, optimized code, literals).
287 // The optimized code map must never be empty, so check the first elements. 287 // The optimized code map must never be empty, so check the first elements.
288 Label install_optimized; 288 Label install_optimized;
289 // Speculatively move code object into edx. 289 // Speculatively move code object into edx.
290 __ movq(rdx, FieldOperand(rbx, FixedArray::kHeaderSize + kPointerSize)); 290 __ movq(rdx, FieldOperand(rbx, SharedFunctionInfo::kFirstCodeSlot));
291 __ cmpq(rcx, FieldOperand(rbx, FixedArray::kHeaderSize)); 291 __ cmpq(rcx, FieldOperand(rbx, SharedFunctionInfo::kFirstContextSlot));
292 __ j(equal, &install_optimized); 292 __ j(equal, &install_optimized);
293 293
294 // Iterate through the rest of map backwards. rdx holds an index. 294 // Iterate through the rest of map backwards. rdx holds an index.
295 Label loop; 295 Label loop;
296 Label restore; 296 Label restore;
297 __ movq(rdx, FieldOperand(rbx, FixedArray::kLengthOffset)); 297 __ movq(rdx, FieldOperand(rbx, FixedArray::kLengthOffset));
298 __ SmiToInteger32(rdx, rdx); 298 __ SmiToInteger32(rdx, rdx);
299 __ bind(&loop); 299 __ bind(&loop);
300 // Do not double check first entry. 300 // Do not double check first entry.
301 __ cmpq(rdx, Immediate(SharedFunctionInfo::kEntryLength)); 301 __ cmpq(rdx, Immediate(SharedFunctionInfo::kSecondEntryIndex));
302 __ j(equal, &restore); 302 __ j(equal, &restore);
303 __ subq(rdx, Immediate(SharedFunctionInfo::kEntryLength)); // Skip an entry. 303 __ subq(rdx, Immediate(SharedFunctionInfo::kEntryLength));
304 __ cmpq(rcx, FieldOperand(rbx, 304 __ cmpq(rcx, FieldOperand(rbx,
305 rdx, 305 rdx,
306 times_pointer_size, 306 times_pointer_size,
307 FixedArray::kHeaderSize)); 307 FixedArray::kHeaderSize));
308 __ j(not_equal, &loop, Label::kNear); 308 __ j(not_equal, &loop, Label::kNear);
309 // Hit: fetch the optimized code. 309 // Hit: fetch the optimized code.
310 __ movq(rdx, FieldOperand(rbx, 310 __ movq(rdx, FieldOperand(rbx,
311 rdx, 311 rdx,
312 times_pointer_size, 312 times_pointer_size,
313 FixedArray::kHeaderSize + 1 * kPointerSize)); 313 FixedArray::kHeaderSize + 1 * kPointerSize));
(...skipping 6678 matching lines...) Expand 10 before | Expand all | Expand 10 after
6992 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); 6992 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET);
6993 } 6993 }
6994 } 6994 }
6995 6995
6996 6996
6997 #undef __ 6997 #undef __
6998 6998
6999 } } // namespace v8::internal 6999 } } // namespace v8::internal
7000 7000
7001 #endif // V8_TARGET_ARCH_X64 7001 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/objects-visiting-inl.h ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698