OLD | NEW |
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 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 Node* header_size = IntPtrConstant(additional_offset + | 516 Node* header_size = IntPtrConstant(additional_offset + |
517 FixedArray::kHeaderSize - kHeapObjectTag); | 517 FixedArray::kHeaderSize - kHeapObjectTag); |
518 if (raw_assembler_->machine()->Is64()) { | 518 if (raw_assembler_->machine()->Is64()) { |
519 index = ChangeInt32ToInt64(index); | 519 index = ChangeInt32ToInt64(index); |
520 } | 520 } |
521 Node* scaled_index = WordShl(index, IntPtrConstant(kPointerSizeLog2)); | 521 Node* scaled_index = WordShl(index, IntPtrConstant(kPointerSizeLog2)); |
522 Node* offset = IntPtrAdd(scaled_index, header_size); | 522 Node* offset = IntPtrAdd(scaled_index, header_size); |
523 return Load(MachineType::AnyTagged(), object, offset); | 523 return Load(MachineType::AnyTagged(), object, offset); |
524 } | 524 } |
525 | 525 |
| 526 Node* CodeStubAssembler::LoadMapInstanceSize(Node* map) { |
| 527 return Load(MachineType::Uint8(), map, |
| 528 IntPtrConstant(Map::kInstanceSizeOffset - kHeapObjectTag)); |
| 529 } |
| 530 |
526 Node* CodeStubAssembler::LoadFixedArrayElementSmiIndex(Node* object, | 531 Node* CodeStubAssembler::LoadFixedArrayElementSmiIndex(Node* object, |
527 Node* smi_index, | 532 Node* smi_index, |
528 int additional_offset) { | 533 int additional_offset) { |
529 int const kSmiShiftBits = kSmiShiftSize + kSmiTagSize; | 534 int const kSmiShiftBits = kSmiShiftSize + kSmiTagSize; |
530 Node* header_size = IntPtrConstant(additional_offset + | 535 Node* header_size = IntPtrConstant(additional_offset + |
531 FixedArray::kHeaderSize - kHeapObjectTag); | 536 FixedArray::kHeaderSize - kHeapObjectTag); |
532 Node* scaled_index = | 537 Node* scaled_index = |
533 (kSmiShiftBits > kPointerSizeLog2) | 538 (kSmiShiftBits > kPointerSizeLog2) |
534 ? WordSar(smi_index, IntPtrConstant(kSmiShiftBits - kPointerSizeLog2)) | 539 ? WordSar(smi_index, IntPtrConstant(kSmiShiftBits - kPointerSizeLog2)) |
535 : WordShl(smi_index, | 540 : WordShl(smi_index, |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 if (flags & kDoubleAlignment) { | 702 if (flags & kDoubleAlignment) { |
698 return AllocateRawAligned(IntPtrConstant(size_in_bytes), flags, top_address, | 703 return AllocateRawAligned(IntPtrConstant(size_in_bytes), flags, top_address, |
699 limit_address); | 704 limit_address); |
700 } | 705 } |
701 #endif | 706 #endif |
702 | 707 |
703 return AllocateRawUnaligned(IntPtrConstant(size_in_bytes), flags, top_address, | 708 return AllocateRawUnaligned(IntPtrConstant(size_in_bytes), flags, top_address, |
704 limit_address); | 709 limit_address); |
705 } | 710 } |
706 | 711 |
| 712 Node* CodeStubAssembler::InnerAllocate(Node* previous, int offset) { |
| 713 return IntPtrAdd(previous, IntPtrConstant(offset)); |
| 714 } |
| 715 |
707 Node* CodeStubAssembler::AllocateHeapNumber() { | 716 Node* CodeStubAssembler::AllocateHeapNumber() { |
708 Node* result = Allocate(HeapNumber::kSize, kNone); | 717 Node* result = Allocate(HeapNumber::kSize, kNone); |
709 StoreMapNoWriteBarrier(result, HeapNumberMapConstant()); | 718 StoreMapNoWriteBarrier(result, HeapNumberMapConstant()); |
710 return result; | 719 return result; |
711 } | 720 } |
712 | 721 |
713 Node* CodeStubAssembler::AllocateHeapNumberWithValue(Node* value) { | 722 Node* CodeStubAssembler::AllocateHeapNumberWithValue(Node* value) { |
714 Node* result = AllocateHeapNumber(); | 723 Node* result = AllocateHeapNumber(); |
715 StoreHeapNumberValue(result, value); | 724 StoreHeapNumberValue(result, value); |
716 return result; | 725 return result; |
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1752 } | 1761 } |
1753 } | 1762 } |
1754 } | 1763 } |
1755 | 1764 |
1756 bound_ = true; | 1765 bound_ = true; |
1757 } | 1766 } |
1758 | 1767 |
1759 } // namespace compiler | 1768 } // namespace compiler |
1760 } // namespace internal | 1769 } // namespace internal |
1761 } // namespace v8 | 1770 } // namespace v8 |
OLD | NEW |