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/x64/macro-assembler-x64.cc

Issue 19956002: Support double allocations when folding allocation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 3839 matching lines...) Expand 10 before | Expand all | Expand 10 after
3850 } 3850 }
3851 } 3851 }
3852 jmp(gc_required); 3852 jmp(gc_required);
3853 return; 3853 return;
3854 } 3854 }
3855 ASSERT(!result.is(result_end)); 3855 ASSERT(!result.is(result_end));
3856 3856
3857 // Load address of new object into result. 3857 // Load address of new object into result.
3858 LoadAllocationTopHelper(result, scratch, flags); 3858 LoadAllocationTopHelper(result, scratch, flags);
3859 3859
3860 // Align the next allocation. Storing the filler map without checking top is 3860 // On X64 each allocation has to be double aligned.
3861 // always safe because the limit of the heap is always aligned.
3862 if (((flags & DOUBLE_ALIGNMENT) != 0) && FLAG_debug_code) { 3861 if (((flags & DOUBLE_ALIGNMENT) != 0) && FLAG_debug_code) {
3863 testq(result, Immediate(kDoubleAlignmentMask)); 3862 testq(result, Immediate(kDoubleAlignmentMask));
3864 Check(zero, "Allocation is not double aligned"); 3863 Check(zero, "Allocation is not double aligned");
3865 } 3864 }
3866 3865
3867 // Calculate new top and bail out if new space is exhausted. 3866 // Calculate new top and bail out if new space is exhausted.
3868 ExternalReference allocation_limit = 3867 ExternalReference allocation_limit =
3869 AllocationUtils::GetAllocationLimitReference(isolate(), flags); 3868 AllocationUtils::GetAllocationLimitReference(isolate(), flags);
3870 3869
3871 Register top_reg = result_end.is_valid() ? result_end : result; 3870 Register top_reg = result_end.is_valid() ? result_end : result;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
3929 // object_size is left unchanged by this function. 3928 // object_size is left unchanged by this function.
3930 } 3929 }
3931 jmp(gc_required); 3930 jmp(gc_required);
3932 return; 3931 return;
3933 } 3932 }
3934 ASSERT(!result.is(result_end)); 3933 ASSERT(!result.is(result_end));
3935 3934
3936 // Load address of new object into result. 3935 // Load address of new object into result.
3937 LoadAllocationTopHelper(result, scratch, flags); 3936 LoadAllocationTopHelper(result, scratch, flags);
3938 3937
3939 // Align the next allocation. Storing the filler map without checking top is 3938 // On X64 each allocation has to be double aligned.
3940 // always safe because the limit of the heap is always aligned.
3941 if (((flags & DOUBLE_ALIGNMENT) != 0) && FLAG_debug_code) { 3939 if (((flags & DOUBLE_ALIGNMENT) != 0) && FLAG_debug_code) {
3942 testq(result, Immediate(kDoubleAlignmentMask)); 3940 testq(result, Immediate(kDoubleAlignmentMask));
3943 Check(zero, "Allocation is not double aligned"); 3941 Check(zero, "Allocation is not double aligned");
3944 } 3942 }
3945 3943
3946 // Calculate new top and bail out if new space is exhausted. 3944 // Calculate new top and bail out if new space is exhausted.
3947 ExternalReference allocation_limit = 3945 ExternalReference allocation_limit =
3948 AllocationUtils::GetAllocationLimitReference(isolate(), flags); 3946 AllocationUtils::GetAllocationLimitReference(isolate(), flags);
3949 if (!object_size.is(result_end)) { 3947 if (!object_size.is(result_end)) {
3950 movq(result_end, object_size); 3948 movq(result_end, object_size);
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
4693 j(greater, &no_memento_available); 4691 j(greater, &no_memento_available);
4694 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize), 4692 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize),
4695 Heap::kAllocationMementoMapRootIndex); 4693 Heap::kAllocationMementoMapRootIndex);
4696 bind(&no_memento_available); 4694 bind(&no_memento_available);
4697 } 4695 }
4698 4696
4699 4697
4700 } } // namespace v8::internal 4698 } } // namespace v8::internal
4701 4699
4702 #endif // V8_TARGET_ARCH_X64 4700 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698