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