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

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

Issue 1827523005: [turbofan] Reduce boilerplate around HeapNumber allocation in stubs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 | « src/compiler/code-stub-assembler.h ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 4
5 #include "src/compiler/code-stub-assembler.h" 5 #include "src/compiler/code-stub-assembler.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/compiler/graph.h" 10 #include "src/compiler/graph.h"
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 if (flags & kDoubleAlignment) { 431 if (flags & kDoubleAlignment) {
432 return AllocateRawAligned(IntPtrConstant(size_in_bytes), flags, top_address, 432 return AllocateRawAligned(IntPtrConstant(size_in_bytes), flags, top_address,
433 limit_address); 433 limit_address);
434 } 434 }
435 #endif 435 #endif
436 436
437 return AllocateRawUnaligned(IntPtrConstant(size_in_bytes), flags, top_address, 437 return AllocateRawUnaligned(IntPtrConstant(size_in_bytes), flags, top_address,
438 limit_address); 438 limit_address);
439 } 439 }
440 440
441 Node* CodeStubAssembler::AllocateHeapNumber() {
442 Node* result = Allocate(HeapNumber::kSize, kNone);
443 StoreMapNoWriteBarrier(result, HeapNumberMapConstant());
444 return result;
445 }
446
447 Node* CodeStubAssembler::AllocateHeapNumberWithValue(Node* value) {
448 Node* result = AllocateHeapNumber();
449 StoreHeapNumberValue(result, value);
450 return result;
451 }
452
441 Node* CodeStubAssembler::Load(MachineType rep, Node* base) { 453 Node* CodeStubAssembler::Load(MachineType rep, Node* base) {
442 return raw_assembler_->Load(rep, base); 454 return raw_assembler_->Load(rep, base);
443 } 455 }
444 456
445 Node* CodeStubAssembler::Load(MachineType rep, Node* base, Node* index) { 457 Node* CodeStubAssembler::Load(MachineType rep, Node* base, Node* index) {
446 return raw_assembler_->Load(rep, base, index); 458 return raw_assembler_->Load(rep, base, index);
447 } 459 }
448 460
449 Node* CodeStubAssembler::Store(MachineRepresentation rep, Node* base, 461 Node* CodeStubAssembler::Store(MachineRepresentation rep, Node* base,
450 Node* value) { 462 Node* value) {
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 } 915 }
904 } 916 }
905 } 917 }
906 918
907 bound_ = true; 919 bound_ = true;
908 } 920 }
909 921
910 } // namespace compiler 922 } // namespace compiler
911 } // namespace internal 923 } // namespace internal
912 } // namespace v8 924 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/code-stub-assembler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698