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

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 23242006: Fix invalid out-of-bounds store in MacroAssembler::Allocate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix typo for MIPS. Created 7 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
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | no next file » | 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 3841 matching lines...) Expand 10 before | Expand all | Expand 10 after
3852 } 3852 }
3853 jmp(gc_required); 3853 jmp(gc_required);
3854 return; 3854 return;
3855 } 3855 }
3856 ASSERT(!result.is(result_end)); 3856 ASSERT(!result.is(result_end));
3857 3857
3858 // Load address of new object into result. 3858 // Load address of new object into result.
3859 LoadAllocationTopHelper(result, scratch, flags); 3859 LoadAllocationTopHelper(result, scratch, flags);
3860 3860
3861 // Align the next allocation. Storing the filler map without checking top is 3861 // Align the next allocation. Storing the filler map without checking top is
3862 // always safe because the limit of the heap is always aligned. 3862 // safe in new-space because the limit of the heap is aligned there.
3863 if (((flags & DOUBLE_ALIGNMENT) != 0) && FLAG_debug_code) { 3863 if (((flags & DOUBLE_ALIGNMENT) != 0) && FLAG_debug_code) {
3864 testq(result, Immediate(kDoubleAlignmentMask)); 3864 testq(result, Immediate(kDoubleAlignmentMask));
3865 Check(zero, kAllocationIsNotDoubleAligned); 3865 Check(zero, kAllocationIsNotDoubleAligned);
3866 } 3866 }
3867 3867
3868 // Calculate new top and bail out if new space is exhausted. 3868 // Calculate new top and bail out if new space is exhausted.
3869 ExternalReference allocation_limit = 3869 ExternalReference allocation_limit =
3870 AllocationUtils::GetAllocationLimitReference(isolate(), flags); 3870 AllocationUtils::GetAllocationLimitReference(isolate(), flags);
3871 3871
3872 Register top_reg = result_end.is_valid() ? result_end : result; 3872 Register top_reg = result_end.is_valid() ? result_end : result;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
3931 } 3931 }
3932 jmp(gc_required); 3932 jmp(gc_required);
3933 return; 3933 return;
3934 } 3934 }
3935 ASSERT(!result.is(result_end)); 3935 ASSERT(!result.is(result_end));
3936 3936
3937 // Load address of new object into result. 3937 // Load address of new object into result.
3938 LoadAllocationTopHelper(result, scratch, flags); 3938 LoadAllocationTopHelper(result, scratch, flags);
3939 3939
3940 // Align the next allocation. Storing the filler map without checking top is 3940 // Align the next allocation. Storing the filler map without checking top is
3941 // always safe because the limit of the heap is always aligned. 3941 // safe in new-space because the limit of the heap is aligned there.
3942 if (((flags & DOUBLE_ALIGNMENT) != 0) && FLAG_debug_code) { 3942 if (((flags & DOUBLE_ALIGNMENT) != 0) && FLAG_debug_code) {
3943 testq(result, Immediate(kDoubleAlignmentMask)); 3943 testq(result, Immediate(kDoubleAlignmentMask));
3944 Check(zero, kAllocationIsNotDoubleAligned); 3944 Check(zero, kAllocationIsNotDoubleAligned);
3945 } 3945 }
3946 3946
3947 // Calculate new top and bail out if new space is exhausted. 3947 // Calculate new top and bail out if new space is exhausted.
3948 ExternalReference allocation_limit = 3948 ExternalReference allocation_limit =
3949 AllocationUtils::GetAllocationLimitReference(isolate(), flags); 3949 AllocationUtils::GetAllocationLimitReference(isolate(), flags);
3950 if (!object_size.is(result_end)) { 3950 if (!object_size.is(result_end)) {
3951 movq(result_end, object_size); 3951 movq(result_end, object_size);
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
4694 j(greater, &no_memento_available); 4694 j(greater, &no_memento_available);
4695 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize), 4695 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize),
4696 Heap::kAllocationMementoMapRootIndex); 4696 Heap::kAllocationMementoMapRootIndex);
4697 bind(&no_memento_available); 4697 bind(&no_memento_available);
4698 } 4698 }
4699 4699
4700 4700
4701 } } // namespace v8::internal 4701 } } // namespace v8::internal
4702 4702
4703 #endif // V8_TARGET_ARCH_X64 4703 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698