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

Side by Side Diff: src/code-stub-assembler.cc

Issue 2605043002: [csa] micro-optimization of Allocation (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | 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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 #include "src/code-stub-assembler.h" 4 #include "src/code-stub-assembler.h"
5 #include "src/code-factory.h" 5 #include "src/code-factory.h"
6 #include "src/frames-inl.h" 6 #include "src/frames-inl.h"
7 #include "src/frames.h" 7 #include "src/frames.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 return address.value(); 889 return address.value();
890 } 890 }
891 891
892 Node* CodeStubAssembler::Allocate(Node* size_in_bytes, AllocationFlags flags) { 892 Node* CodeStubAssembler::Allocate(Node* size_in_bytes, AllocationFlags flags) {
893 Comment("Allocate"); 893 Comment("Allocate");
894 bool const new_space = !(flags & kPretenured); 894 bool const new_space = !(flags & kPretenured);
895 Node* top_address = ExternalConstant( 895 Node* top_address = ExternalConstant(
896 new_space 896 new_space
897 ? ExternalReference::new_space_allocation_top_address(isolate()) 897 ? ExternalReference::new_space_allocation_top_address(isolate())
898 : ExternalReference::old_space_allocation_top_address(isolate())); 898 : ExternalReference::old_space_allocation_top_address(isolate()));
899 Node* limit_address = ExternalConstant( 899 DCHECK_EQ(kPointerSize,
900 new_space 900 ExternalReference::new_space_allocation_limit_address(isolate())
901 ? ExternalReference::new_space_allocation_limit_address(isolate()) 901 .address() -
902 : ExternalReference::old_space_allocation_limit_address(isolate())); 902 ExternalReference::new_space_allocation_top_address(isolate())
903 .address());
904 DCHECK_EQ(kPointerSize,
905 ExternalReference::old_space_allocation_limit_address(isolate())
906 .address() -
907 ExternalReference::old_space_allocation_top_address(isolate())
908 .address());
909 Node* limit_address = IntPtrAdd(top_address, IntPtrConstant(kPointerSize));
903 910
904 #ifdef V8_HOST_ARCH_32_BIT 911 #ifdef V8_HOST_ARCH_32_BIT
905 if (flags & kDoubleAlignment) { 912 if (flags & kDoubleAlignment) {
906 return AllocateRawAligned(size_in_bytes, flags, top_address, limit_address); 913 return AllocateRawAligned(size_in_bytes, flags, top_address, limit_address);
907 } 914 }
908 #endif 915 #endif
909 916
910 return AllocateRawUnaligned(size_in_bytes, flags, top_address, limit_address); 917 return AllocateRawUnaligned(size_in_bytes, flags, top_address, limit_address);
911 } 918 }
912 919
(...skipping 7455 matching lines...) Expand 10 before | Expand all | Expand 10 after
8368 Heap::kUndefinedValueRootIndex); 8375 Heap::kUndefinedValueRootIndex);
8369 StoreObjectFieldRoot(result, PromiseReactionJobInfo::kDebugNameOffset, 8376 StoreObjectFieldRoot(result, PromiseReactionJobInfo::kDebugNameOffset,
8370 Heap::kUndefinedValueRootIndex); 8377 Heap::kUndefinedValueRootIndex);
8371 StoreObjectFieldNoWriteBarrier(result, PromiseReactionJobInfo::kContextOffset, 8378 StoreObjectFieldNoWriteBarrier(result, PromiseReactionJobInfo::kContextOffset,
8372 context); 8379 context);
8373 return result; 8380 return result;
8374 } 8381 }
8375 8382
8376 } // namespace internal 8383 } // namespace internal
8377 } // namespace v8 8384 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698