| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/access-builder.h" | 5 #include "src/compiler/access-builder.h" |
| 6 | 6 |
| 7 #include "src/compiler/type-cache.h" | 7 #include "src/compiler/type-cache.h" |
| 8 #include "src/contexts.h" | 8 #include "src/contexts.h" |
| 9 #include "src/frames.h" | 9 #include "src/frames.h" |
| 10 #include "src/handles-inl.h" | 10 #include "src/handles-inl.h" |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 FieldAccess access = {kTaggedBase, | 542 FieldAccess access = {kTaggedBase, |
| 543 JSGlobalObject::kNativeContextOffset, | 543 JSGlobalObject::kNativeContextOffset, |
| 544 Handle<Name>(), | 544 Handle<Name>(), |
| 545 Type::Internal(), | 545 Type::Internal(), |
| 546 MachineType::TaggedPointer(), | 546 MachineType::TaggedPointer(), |
| 547 kPointerWriteBarrier}; | 547 kPointerWriteBarrier}; |
| 548 return access; | 548 return access; |
| 549 } | 549 } |
| 550 | 550 |
| 551 // static | 551 // static |
| 552 FieldAccess AccessBuilder::ForJSArrayIteratorObject() { |
| 553 FieldAccess access = {kTaggedBase, |
| 554 JSArrayIterator::kIteratedObjectOffset, |
| 555 Handle<Name>(), |
| 556 Type::ReceiverOrUndefined(), |
| 557 MachineType::TaggedPointer(), |
| 558 kPointerWriteBarrier}; |
| 559 return access; |
| 560 } |
| 561 |
| 562 // static |
| 563 FieldAccess AccessBuilder::ForJSArrayIteratorIndex(InstanceType instance_type, |
| 564 ElementsKind elements_kind) { |
| 565 FieldAccess access = {kTaggedBase, |
| 566 JSArrayIterator::kNextIndexOffset, |
| 567 Handle<Name>(), |
| 568 TypeCache::Get().kPositiveSafeInteger, |
| 569 MachineType::AnyTagged(), |
| 570 kFullWriteBarrier}; |
| 571 if (instance_type == JS_ARRAY_TYPE) { |
| 572 if (IsFastDoubleElementsKind(elements_kind)) { |
| 573 access.type = TypeCache::Get().kFixedDoubleArrayLengthType; |
| 574 access.machine_type = MachineType::TaggedSigned(); |
| 575 access.write_barrier_kind = kNoWriteBarrier; |
| 576 } else if (IsFastElementsKind(elements_kind)) { |
| 577 access.type = TypeCache::Get().kFixedArrayLengthType; |
| 578 access.machine_type = MachineType::TaggedSigned(); |
| 579 access.write_barrier_kind = kNoWriteBarrier; |
| 580 } else { |
| 581 access.type = TypeCache::Get().kJSArrayLengthType; |
| 582 } |
| 583 } else if (instance_type == JS_TYPED_ARRAY_TYPE) { |
| 584 access.type = TypeCache::Get().kJSTypedArrayLengthType; |
| 585 access.machine_type = MachineType::TaggedSigned(); |
| 586 access.write_barrier_kind = kNoWriteBarrier; |
| 587 } |
| 588 return access; |
| 589 } |
| 590 |
| 591 // static |
| 592 FieldAccess AccessBuilder::ForJSArrayIteratorObjectMap() { |
| 593 FieldAccess access = {kTaggedBase, |
| 594 JSArrayIterator::kIteratedObjectMapOffset, |
| 595 Handle<Name>(), |
| 596 Type::OtherInternal(), |
| 597 MachineType::TaggedPointer(), |
| 598 kPointerWriteBarrier}; |
| 599 return access; |
| 600 } |
| 601 |
| 602 // static |
| 552 FieldAccess AccessBuilder::ForJSStringIteratorString() { | 603 FieldAccess AccessBuilder::ForJSStringIteratorString() { |
| 553 FieldAccess access = { | 604 FieldAccess access = { |
| 554 kTaggedBase, JSStringIterator::kStringOffset, Handle<Name>(), | 605 kTaggedBase, JSStringIterator::kStringOffset, Handle<Name>(), |
| 555 Type::String(), MachineType::TaggedPointer(), kPointerWriteBarrier}; | 606 Type::String(), MachineType::TaggedPointer(), kPointerWriteBarrier}; |
| 556 return access; | 607 return access; |
| 557 } | 608 } |
| 558 | 609 |
| 559 // static | 610 // static |
| 560 FieldAccess AccessBuilder::ForJSStringIteratorIndex() { | 611 FieldAccess AccessBuilder::ForJSStringIteratorIndex() { |
| 561 FieldAccess access = {kTaggedBase, | 612 FieldAccess access = {kTaggedBase, |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 } | 795 } |
| 745 UNREACHABLE(); | 796 UNREACHABLE(); |
| 746 ElementAccess access = {kUntaggedBase, 0, Type::None(), MachineType::None(), | 797 ElementAccess access = {kUntaggedBase, 0, Type::None(), MachineType::None(), |
| 747 kNoWriteBarrier}; | 798 kNoWriteBarrier}; |
| 748 return access; | 799 return access; |
| 749 } | 800 } |
| 750 | 801 |
| 751 } // namespace compiler | 802 } // namespace compiler |
| 752 } // namespace internal | 803 } // namespace internal |
| 753 } // namespace v8 | 804 } // namespace v8 |
| OLD | NEW |