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

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

Issue 2488183002: [turbofan] Address a couple of Type-related TODOs. (Closed)
Patch Set: Now with green bots. 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
« no previous file with comments | « no previous file | src/compiler/access-info.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 JSGeneratorObject::kContextOffset, 139 JSGeneratorObject::kContextOffset,
140 Handle<Name>(), 140 Handle<Name>(),
141 Type::Internal(), 141 Type::Internal(),
142 MachineType::TaggedPointer(), 142 MachineType::TaggedPointer(),
143 kPointerWriteBarrier}; 143 kPointerWriteBarrier};
144 return access; 144 return access;
145 } 145 }
146 146
147 // static 147 // static
148 FieldAccess AccessBuilder::ForJSGeneratorObjectContinuation() { 148 FieldAccess AccessBuilder::ForJSGeneratorObjectContinuation() {
149 TypeCache const& type_cache = TypeCache::Get();
150 FieldAccess access = {kTaggedBase, 149 FieldAccess access = {kTaggedBase,
151 JSGeneratorObject::kContinuationOffset, 150 JSGeneratorObject::kContinuationOffset,
152 Handle<Name>(), 151 Handle<Name>(),
153 type_cache.kSmi, 152 Type::SignedSmall(),
154 MachineType::TaggedSigned(), 153 MachineType::TaggedSigned(),
155 kNoWriteBarrier}; 154 kNoWriteBarrier};
156 return access; 155 return access;
157 } 156 }
158 157
159 // static 158 // static
160 FieldAccess AccessBuilder::ForJSGeneratorObjectInputOrDebugPos() { 159 FieldAccess AccessBuilder::ForJSGeneratorObjectInputOrDebugPos() {
161 FieldAccess access = {kTaggedBase, 160 FieldAccess access = {kTaggedBase,
162 JSGeneratorObject::kInputOrDebugPosOffset, 161 JSGeneratorObject::kInputOrDebugPosOffset,
163 Handle<Name>(), 162 Handle<Name>(),
164 Type::NonInternal(), 163 Type::NonInternal(),
165 MachineType::AnyTagged(), 164 MachineType::AnyTagged(),
166 kFullWriteBarrier}; 165 kFullWriteBarrier};
167 return access; 166 return access;
168 } 167 }
169 168
170 // static 169 // static
171 FieldAccess AccessBuilder::ForJSGeneratorObjectOperandStack() { 170 FieldAccess AccessBuilder::ForJSGeneratorObjectOperandStack() {
172 FieldAccess access = {kTaggedBase, 171 FieldAccess access = {kTaggedBase,
173 JSGeneratorObject::kOperandStackOffset, 172 JSGeneratorObject::kOperandStackOffset,
174 Handle<Name>(), 173 Handle<Name>(),
175 Type::Internal(), 174 Type::Internal(),
176 MachineType::AnyTagged(), 175 MachineType::AnyTagged(),
177 kPointerWriteBarrier}; 176 kPointerWriteBarrier};
178 return access; 177 return access;
179 } 178 }
180 179
181 // static 180 // static
182 FieldAccess AccessBuilder::ForJSGeneratorObjectResumeMode() { 181 FieldAccess AccessBuilder::ForJSGeneratorObjectResumeMode() {
183 TypeCache const& type_cache = TypeCache::Get(); 182 FieldAccess access = {kTaggedBase,
184 FieldAccess access = { 183 JSGeneratorObject::kResumeModeOffset,
185 kTaggedBase, JSGeneratorObject::kResumeModeOffset, Handle<Name>(), 184 Handle<Name>(),
186 type_cache.kSmi, MachineType::TaggedSigned(), kNoWriteBarrier}; 185 Type::SignedSmall(),
186 MachineType::TaggedSigned(),
187 kNoWriteBarrier};
187 return access; 188 return access;
188 } 189 }
189 190
190 // static 191 // static
191 FieldAccess AccessBuilder::ForJSArrayLength(ElementsKind elements_kind) { 192 FieldAccess AccessBuilder::ForJSArrayLength(ElementsKind elements_kind) {
192 TypeCache const& type_cache = TypeCache::Get(); 193 TypeCache const& type_cache = TypeCache::Get();
193 FieldAccess access = {kTaggedBase, 194 FieldAccess access = {kTaggedBase,
194 JSArray::kLengthOffset, 195 JSArray::kLengthOffset,
195 Handle<Name>(), 196 Handle<Name>(),
196 type_cache.kJSArrayLengthType, 197 type_cache.kJSArrayLengthType,
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 MachineType::AnyTagged(), kFullWriteBarrier}; 650 MachineType::AnyTagged(), kFullWriteBarrier};
650 return access; 651 return access;
651 } 652 }
652 653
653 // static 654 // static
654 ElementAccess AccessBuilder::ForFixedArrayElement(ElementsKind kind) { 655 ElementAccess AccessBuilder::ForFixedArrayElement(ElementsKind kind) {
655 ElementAccess access = {kTaggedBase, FixedArray::kHeaderSize, Type::Any(), 656 ElementAccess access = {kTaggedBase, FixedArray::kHeaderSize, Type::Any(),
656 MachineType::AnyTagged(), kFullWriteBarrier}; 657 MachineType::AnyTagged(), kFullWriteBarrier};
657 switch (kind) { 658 switch (kind) {
658 case FAST_SMI_ELEMENTS: 659 case FAST_SMI_ELEMENTS:
659 access.type = TypeCache::Get().kSmi; 660 access.type = Type::SignedSmall();
660 access.machine_type = MachineType::TaggedSigned(); 661 access.machine_type = MachineType::TaggedSigned();
661 access.write_barrier_kind = kNoWriteBarrier; 662 access.write_barrier_kind = kNoWriteBarrier;
662 break; 663 break;
663 case FAST_HOLEY_SMI_ELEMENTS: 664 case FAST_HOLEY_SMI_ELEMENTS:
664 access.type = TypeCache::Get().kHoleySmi; 665 access.type = TypeCache::Get().kHoleySmi;
665 break; 666 break;
666 case FAST_ELEMENTS: 667 case FAST_ELEMENTS:
667 access.type = Type::NonInternal(); 668 access.type = Type::NonInternal();
668 break; 669 break;
669 case FAST_HOLEY_ELEMENTS: 670 case FAST_HOLEY_ELEMENTS:
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 } 745 }
745 UNREACHABLE(); 746 UNREACHABLE();
746 ElementAccess access = {kUntaggedBase, 0, Type::None(), MachineType::None(), 747 ElementAccess access = {kUntaggedBase, 0, Type::None(), MachineType::None(),
747 kNoWriteBarrier}; 748 kNoWriteBarrier};
748 return access; 749 return access;
749 } 750 }
750 751
751 } // namespace compiler 752 } // namespace compiler
752 } // namespace internal 753 } // namespace internal
753 } // namespace v8 754 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/access-info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698