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

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

Issue 1178103002: [turbofan] Structure AccessBuilder interface a bit. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_trycatch-enable
Patch Set: Created 5 years, 6 months 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 | « src/compiler/access-builder.h ('k') | no next file » | 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 #include "src/types-inl.h" 6 #include "src/types-inl.h"
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 namespace compiler { 10 namespace compiler {
(...skipping 20 matching lines...) Expand all
31 31
32 32
33 // static 33 // static
34 FieldAccess AccessBuilder::ForJSFunctionContext() { 34 FieldAccess AccessBuilder::ForJSFunctionContext() {
35 return {kTaggedBase, JSFunction::kContextOffset, MaybeHandle<Name>(), 35 return {kTaggedBase, JSFunction::kContextOffset, MaybeHandle<Name>(),
36 Type::Internal(), kMachAnyTagged}; 36 Type::Internal(), kMachAnyTagged};
37 } 37 }
38 38
39 39
40 // static 40 // static
41 FieldAccess AccessBuilder::ForJSFunctionSharedFunctionInfo() {
42 return {kTaggedBase, JSFunction::kSharedFunctionInfoOffset, Handle<Name>(),
43 Type::Any(), kMachAnyTagged};
44 }
45
46
47 // static
41 FieldAccess AccessBuilder::ForJSArrayBufferBackingStore() { 48 FieldAccess AccessBuilder::ForJSArrayBufferBackingStore() {
42 return {kTaggedBase, JSArrayBuffer::kBackingStoreOffset, MaybeHandle<Name>(), 49 return {kTaggedBase, JSArrayBuffer::kBackingStoreOffset, MaybeHandle<Name>(),
43 Type::UntaggedPointer(), kMachPtr}; 50 Type::UntaggedPointer(), kMachPtr};
44 } 51 }
45 52
46 53
47 // static 54 // static
48 FieldAccess AccessBuilder::ForJSDateField(JSDate::FieldIndex index) { 55 FieldAccess AccessBuilder::ForJSDateField(JSDate::FieldIndex index) {
49 return {kTaggedBase, JSDate::kValueOffset + index * kPointerSize, 56 return {kTaggedBase, JSDate::kValueOffset + index * kPointerSize,
50 MaybeHandle<Name>(), Type::Number(), kMachAnyTagged}; 57 MaybeHandle<Name>(), Type::Number(), kMachAnyTagged};
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // static 129 // static
123 FieldAccess AccessBuilder::ForContextSlot(size_t index) { 130 FieldAccess AccessBuilder::ForContextSlot(size_t index) {
124 int offset = Context::kHeaderSize + static_cast<int>(index) * kPointerSize; 131 int offset = Context::kHeaderSize + static_cast<int>(index) * kPointerSize;
125 DCHECK_EQ(offset, 132 DCHECK_EQ(offset,
126 Context::SlotOffset(static_cast<int>(index)) + kHeapObjectTag); 133 Context::SlotOffset(static_cast<int>(index)) + kHeapObjectTag);
127 return {kTaggedBase, offset, Handle<Name>(), Type::Any(), kMachAnyTagged}; 134 return {kTaggedBase, offset, Handle<Name>(), Type::Any(), kMachAnyTagged};
128 } 135 }
129 136
130 137
131 // static 138 // static
132 FieldAccess AccessBuilder::ForStatsCounter() {
133 return {kUntaggedBase, 0, MaybeHandle<Name>(), Type::Signed32(), kMachInt32};
134 }
135
136
137 // static
138 FieldAccess AccessBuilder::ForPropertyCellValue() { 139 FieldAccess AccessBuilder::ForPropertyCellValue() {
139 return {kTaggedBase, PropertyCell::kValueOffset, Handle<Name>(), Type::Any(), 140 return {kTaggedBase, PropertyCell::kValueOffset, Handle<Name>(), Type::Any(),
140 kMachAnyTagged}; 141 kMachAnyTagged};
141 } 142 }
142 143
143 144
145 // static
146 FieldAccess AccessBuilder::ForSharedFunctionInfoTypeFeedbackVector() {
147 return {kTaggedBase, SharedFunctionInfo::kFeedbackVectorOffset,
148 Handle<Name>(), Type::Any(), kMachAnyTagged};
149 }
150
151
144 // static 152 // static
145 ElementAccess AccessBuilder::ForFixedArrayElement() { 153 ElementAccess AccessBuilder::ForFixedArrayElement() {
146 return {kTaggedBase, FixedArray::kHeaderSize, Type::Any(), kMachAnyTagged}; 154 return {kTaggedBase, FixedArray::kHeaderSize, Type::Any(), kMachAnyTagged};
147 } 155 }
148 156
149 157
150 // static 158 // static
151 ElementAccess AccessBuilder::ForTypedArrayElement(ExternalArrayType type, 159 ElementAccess AccessBuilder::ForTypedArrayElement(ExternalArrayType type,
152 bool is_external) { 160 bool is_external) {
153 BaseTaggedness taggedness = is_external ? kUntaggedBase : kTaggedBase; 161 BaseTaggedness taggedness = is_external ? kUntaggedBase : kTaggedBase;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 case String::TWO_BYTE_ENCODING: 193 case String::TWO_BYTE_ENCODING:
186 return {kTaggedBase, SeqString::kHeaderSize, Type::Unsigned32(), 194 return {kTaggedBase, SeqString::kHeaderSize, Type::Unsigned32(),
187 kMachUint16}; 195 kMachUint16};
188 } 196 }
189 UNREACHABLE(); 197 UNREACHABLE();
190 return {kUntaggedBase, 0, Type::None(), kMachNone}; 198 return {kUntaggedBase, 0, Type::None(), kMachNone};
191 } 199 }
192 200
193 201
194 // static 202 // static
195 FieldAccess AccessBuilder::ForJSFunctionSharedFunctionInfo() { 203 FieldAccess AccessBuilder::ForStatsCounter() {
196 return {kTaggedBase, JSFunction::kSharedFunctionInfoOffset, Handle<Name>(), 204 return {kUntaggedBase, 0, MaybeHandle<Name>(), Type::Signed32(), kMachInt32};
197 Type::Any(), kMachAnyTagged};
198 } 205 }
199 206
200 207
201 // static
202 FieldAccess AccessBuilder::ForSharedFunctionInfoTypeFeedbackVector() {
203 return {kTaggedBase, SharedFunctionInfo::kFeedbackVectorOffset,
204 Handle<Name>(), Type::Any(), kMachAnyTagged};
205 }
206
207
208 // static 208 // static
209 FieldAccess AccessBuilder::ForFrameCallerFramePtr() { 209 FieldAccess AccessBuilder::ForFrameCallerFramePtr() {
210 return {kUntaggedBase, StandardFrameConstants::kCallerFPOffset, 210 return {kUntaggedBase, StandardFrameConstants::kCallerFPOffset,
211 MaybeHandle<Name>(), Type::Internal(), kMachPtr}; 211 MaybeHandle<Name>(), Type::Internal(), kMachPtr};
212 } 212 }
213 213
214 214
215 // static 215 // static
216 FieldAccess AccessBuilder::ForFrameMarker() { 216 FieldAccess AccessBuilder::ForFrameMarker() {
217 return {kUntaggedBase, StandardFrameConstants::kMarkerOffset, 217 return {kUntaggedBase, StandardFrameConstants::kMarkerOffset,
218 MaybeHandle<Name>(), Type::Tagged(), kMachAnyTagged}; 218 MaybeHandle<Name>(), Type::Tagged(), kMachAnyTagged};
219 } 219 }
220 220
221 } // namespace compiler 221 } // namespace compiler
222 } // namespace internal 222 } // namespace internal
223 } // namespace v8 223 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/access-builder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698