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

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

Issue 11663005: Adapt Danno's Track Allocation Info idea to fast literals. When allocating a literal array, (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Ported to other platforms Created 7 years, 11 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 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 // ----------- S t a t e ------------- 276 // ----------- S t a t e -------------
277 // -- rax : value 277 // -- rax : value
278 // -- rbx : target map 278 // -- rbx : target map
279 // -- rcx : key 279 // -- rcx : key
280 // -- rdx : receiver 280 // -- rdx : receiver
281 // -- rsp[0] : return address 281 // -- rsp[0] : return address
282 // ----------------------------------- 282 // -----------------------------------
283 // The fail label is not actually used since we do not allocate. 283 // The fail label is not actually used since we do not allocate.
284 Label allocated, new_backing_store, only_change_map, done; 284 Label allocated, new_backing_store, only_change_map, done;
285 285
286 if (FLAG_use_allocation_site_info) {
287 masm->PerformAllocationSiteInfoCheck(fail);
288 }
289
286 // Check for empty arrays, which only require a map transition and no changes 290 // Check for empty arrays, which only require a map transition and no changes
287 // to the backing store. 291 // to the backing store.
288 __ movq(r8, FieldOperand(rdx, JSObject::kElementsOffset)); 292 __ movq(r8, FieldOperand(rdx, JSObject::kElementsOffset));
289 __ CompareRoot(r8, Heap::kEmptyFixedArrayRootIndex); 293 __ CompareRoot(r8, Heap::kEmptyFixedArrayRootIndex);
290 __ j(equal, &only_change_map); 294 __ j(equal, &only_change_map);
291 295
292 // Check backing store for COW-ness. For COW arrays we have to 296 // Check backing store for COW-ness. For COW arrays we have to
293 // allocate a new backing store. 297 // allocate a new backing store.
294 __ SmiToInteger32(r9, FieldOperand(r8, FixedDoubleArray::kLengthOffset)); 298 __ SmiToInteger32(r9, FieldOperand(r8, FixedDoubleArray::kLengthOffset));
295 __ CompareRoot(FieldOperand(r8, HeapObject::kMapOffset), 299 __ CompareRoot(FieldOperand(r8, HeapObject::kMapOffset),
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 MacroAssembler* masm, Label* fail) { 401 MacroAssembler* masm, Label* fail) {
398 // ----------- S t a t e ------------- 402 // ----------- S t a t e -------------
399 // -- rax : value 403 // -- rax : value
400 // -- rbx : target map 404 // -- rbx : target map
401 // -- rcx : key 405 // -- rcx : key
402 // -- rdx : receiver 406 // -- rdx : receiver
403 // -- rsp[0] : return address 407 // -- rsp[0] : return address
404 // ----------------------------------- 408 // -----------------------------------
405 Label loop, entry, convert_hole, gc_required, only_change_map; 409 Label loop, entry, convert_hole, gc_required, only_change_map;
406 410
411 // TODO(mvstanton): let's not pre-transition for the double->object case.
412 // if (FLAG_use_allocation_site_info) {
413 // masm->PerformAllocationSiteInfoCheck(fail);
414 // }
danno 2013/01/04 08:50:55 Remove
415
407 // Check for empty arrays, which only require a map transition and no changes 416 // Check for empty arrays, which only require a map transition and no changes
408 // to the backing store. 417 // to the backing store.
409 __ movq(r8, FieldOperand(rdx, JSObject::kElementsOffset)); 418 __ movq(r8, FieldOperand(rdx, JSObject::kElementsOffset));
410 __ CompareRoot(r8, Heap::kEmptyFixedArrayRootIndex); 419 __ CompareRoot(r8, Heap::kEmptyFixedArrayRootIndex);
411 __ j(equal, &only_change_map); 420 __ j(equal, &only_change_map);
412 421
413 __ push(rax); 422 __ push(rax);
414 423
415 __ movq(r8, FieldOperand(rdx, JSObject::kElementsOffset)); 424 __ movq(r8, FieldOperand(rdx, JSObject::kElementsOffset));
416 __ SmiToInteger32(r9, FieldOperand(r8, FixedDoubleArray::kLengthOffset)); 425 __ SmiToInteger32(r9, FieldOperand(r8, FixedDoubleArray::kLengthOffset));
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 CodePatcher patcher(sequence, young_length); 767 CodePatcher patcher(sequence, young_length);
759 patcher.masm()->call(stub->instruction_start()); 768 patcher.masm()->call(stub->instruction_start());
760 patcher.masm()->nop(); 769 patcher.masm()->nop();
761 } 770 }
762 } 771 }
763 772
764 773
765 } } // namespace v8::internal 774 } } // namespace v8::internal
766 775
767 #endif // V8_TARGET_ARCH_X64 776 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698