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

Side by Side Diff: src/compiler/access-builder.cc

Issue 2484003002: [builtins] implement JSBuiltinReducer for ArrayIteratorNext() (Closed)
Patch Set: Remove whitespace change that snuck in Created 4 years, 1 month 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
OLDNEW
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
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::Receiver(),
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::kIteratedObjectOffset,
567 Handle<Name>(),
568 TypeCache::Get().kPositiveSafeInteger,
Benedikt Meurer 2016/11/08 05:29:48 Actually it can be any positive integer, not only
caitp 2016/11/08 06:37:36 I think `ToLength(<array length>)` should restrict
569 MachineType::TaggedSigned(),
Benedikt Meurer 2016/11/08 05:29:48 The general type is MachineType::AnyTagged()
caitp 2016/11/08 06:37:36 Acknowledged.
570 kFullWriteBarrier};
571 if (instance_type == JS_ARRAY_TYPE) {
572 if (IsFastDoubleElementsKind(elements_kind)) {
573 access.type = TypeCache::Get().kFixedDoubleArrayLengthType;
574 access.write_barrier_kind = kNoWriteBarrier;
Benedikt Meurer 2016/11/08 05:29:48 Set access.machine_type = MachineType::TaggedSigne
caitp 2016/11/08 06:37:35 Acknowledged.
575 } else if (IsFastElementsKind(elements_kind)) {
576 access.type = TypeCache::Get().kFixedArrayLengthType;
577 access.write_barrier_kind = kNoWriteBarrier;
Benedikt Meurer 2016/11/08 05:29:48 Set access.machine_type = MachineType::TaggedSigne
caitp 2016/11/08 06:37:36 Acknowledged.
578 } else {
579 access.type = TypeCache::Get().kJSArrayLengthType;
580 }
581 } else if (instance_type == JS_TYPED_ARRAY_TYPE) {
582 access.type = TypeCache::Get().kJSTypedArrayLengthType;
Benedikt Meurer 2016/11/08 05:29:48 Set access.machine_type = MachineType::TaggedSigne
caitp 2016/11/08 06:37:36 Acknowledged.
583 access.write_barrier_kind = kNoWriteBarrier;
584 }
585 return access;
586 }
587
588 // static
589 FieldAccess AccessBuilder::ForJSArrayIteratorObjectMap() {
590 FieldAccess access = {kTaggedBase,
591 JSArrayIterator::kIteratedObjectMapOffset,
592 Handle<Name>(),
593 Type::OtherInternal(),
594 MachineType::TaggedPointer(),
595 kPointerWriteBarrier};
596 return access;
597 }
598
599 // static
552 FieldAccess AccessBuilder::ForJSStringIteratorString() { 600 FieldAccess AccessBuilder::ForJSStringIteratorString() {
553 FieldAccess access = { 601 FieldAccess access = {
554 kTaggedBase, JSStringIterator::kStringOffset, Handle<Name>(), 602 kTaggedBase, JSStringIterator::kStringOffset, Handle<Name>(),
555 Type::String(), MachineType::TaggedPointer(), kPointerWriteBarrier}; 603 Type::String(), MachineType::TaggedPointer(), kPointerWriteBarrier};
556 return access; 604 return access;
557 } 605 }
558 606
559 // static 607 // static
560 FieldAccess AccessBuilder::ForJSStringIteratorIndex() { 608 FieldAccess AccessBuilder::ForJSStringIteratorIndex() {
561 FieldAccess access = {kTaggedBase, 609 FieldAccess access = {kTaggedBase,
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 } 792 }
745 UNREACHABLE(); 793 UNREACHABLE();
746 ElementAccess access = {kUntaggedBase, 0, Type::None(), MachineType::None(), 794 ElementAccess access = {kUntaggedBase, 0, Type::None(), MachineType::None(),
747 kNoWriteBarrier}; 795 kNoWriteBarrier};
748 return access; 796 return access;
749 } 797 }
750 798
751 } // namespace compiler 799 } // namespace compiler
752 } // namespace internal 800 } // namespace internal
753 } // namespace v8 801 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698