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

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

Issue 1943323002: Reland of [turbofan] Restore basic write barrier elimination. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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') | src/compiler/change-lowering.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/contexts.h" 7 #include "src/contexts.h"
8 #include "src/frames.h" 8 #include "src/frames.h"
9 #include "src/handles-inl.h" 9 #include "src/handles-inl.h"
10 #include "src/heap/heap.h" 10 #include "src/heap/heap.h"
11 #include "src/type-cache.h" 11 #include "src/type-cache.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace internal {
15 namespace compiler { 15 namespace compiler {
16 16
17 // static 17 // static
18 FieldAccess AccessBuilder::ForMap() { 18 FieldAccess AccessBuilder::ForMap() {
19 FieldAccess access = {kTaggedBase, HeapObject::kMapOffset, 19 FieldAccess access = {
20 MaybeHandle<Name>(), Type::Any(), 20 kTaggedBase, HeapObject::kMapOffset, MaybeHandle<Name>(),
21 MachineType::AnyTagged()}; 21 Type::Any(), MachineType::AnyTagged(), kMapWriteBarrier};
22 return access; 22 return access;
23 } 23 }
24 24
25 25
26 // static 26 // static
27 FieldAccess AccessBuilder::ForHeapNumberValue() { 27 FieldAccess AccessBuilder::ForHeapNumberValue() {
28 FieldAccess access = {kTaggedBase, HeapNumber::kValueOffset, 28 FieldAccess access = {kTaggedBase,
29 MaybeHandle<Name>(), TypeCache::Get().kFloat64, 29 HeapNumber::kValueOffset,
30 MachineType::Float64()}; 30 MaybeHandle<Name>(),
31 TypeCache::Get().kFloat64,
32 MachineType::Float64(),
33 kNoWriteBarrier};
31 return access; 34 return access;
32 } 35 }
33 36
34 37
35 // static 38 // static
36 FieldAccess AccessBuilder::ForJSObjectProperties() { 39 FieldAccess AccessBuilder::ForJSObjectProperties() {
37 FieldAccess access = {kTaggedBase, JSObject::kPropertiesOffset, 40 FieldAccess access = {
38 MaybeHandle<Name>(), Type::Internal(), 41 kTaggedBase, JSObject::kPropertiesOffset, MaybeHandle<Name>(),
39 MachineType::AnyTagged()}; 42 Type::Internal(), MachineType::AnyTagged(), kPointerWriteBarrier};
40 return access; 43 return access;
41 } 44 }
42 45
43 46
44 // static 47 // static
45 FieldAccess AccessBuilder::ForJSObjectElements() { 48 FieldAccess AccessBuilder::ForJSObjectElements() {
46 FieldAccess access = {kTaggedBase, JSObject::kElementsOffset, 49 FieldAccess access = {
47 MaybeHandle<Name>(), Type::Internal(), 50 kTaggedBase, JSObject::kElementsOffset, MaybeHandle<Name>(),
48 MachineType::AnyTagged()}; 51 Type::Internal(), MachineType::AnyTagged(), kPointerWriteBarrier};
49 return access; 52 return access;
50 } 53 }
51 54
52 55
53 // static 56 // static
54 FieldAccess AccessBuilder::ForJSObjectInObjectProperty(Handle<Map> map, 57 FieldAccess AccessBuilder::ForJSObjectInObjectProperty(Handle<Map> map,
55 int index) { 58 int index) {
56 int const offset = map->GetInObjectPropertyOffset(index); 59 int const offset = map->GetInObjectPropertyOffset(index);
57 FieldAccess access = {kTaggedBase, offset, MaybeHandle<Name>(), 60 FieldAccess access = {kTaggedBase,
58 Type::Tagged(), MachineType::AnyTagged()}; 61 offset,
62 MaybeHandle<Name>(),
63 Type::Tagged(),
64 MachineType::AnyTagged(),
65 kFullWriteBarrier};
59 return access; 66 return access;
60 } 67 }
61 68
62 69
63 // static 70 // static
64 FieldAccess AccessBuilder::ForJSFunctionPrototypeOrInitialMap() { 71 FieldAccess AccessBuilder::ForJSFunctionPrototypeOrInitialMap() {
65 FieldAccess access = {kTaggedBase, JSFunction::kPrototypeOrInitialMapOffset, 72 FieldAccess access = {kTaggedBase,
66 MaybeHandle<Name>(), Type::Any(), 73 JSFunction::kPrototypeOrInitialMapOffset,
67 MachineType::AnyTagged()}; 74 MaybeHandle<Name>(),
75 Type::Any(),
76 MachineType::AnyTagged(),
77 kFullWriteBarrier};
68 return access; 78 return access;
69 } 79 }
70 80
71 // static 81 // static
72 FieldAccess AccessBuilder::ForJSFunctionContext() { 82 FieldAccess AccessBuilder::ForJSFunctionContext() {
73 FieldAccess access = {kTaggedBase, JSFunction::kContextOffset, 83 FieldAccess access = {
74 MaybeHandle<Name>(), Type::Internal(), 84 kTaggedBase, JSFunction::kContextOffset, MaybeHandle<Name>(),
75 MachineType::AnyTagged()}; 85 Type::Internal(), MachineType::AnyTagged(), kPointerWriteBarrier};
76 return access; 86 return access;
77 } 87 }
78 88
79 89
80 // static 90 // static
81 FieldAccess AccessBuilder::ForJSFunctionSharedFunctionInfo() { 91 FieldAccess AccessBuilder::ForJSFunctionSharedFunctionInfo() {
82 FieldAccess access = {kTaggedBase, JSFunction::kSharedFunctionInfoOffset, 92 FieldAccess access = {kTaggedBase,
83 Handle<Name>(), Type::Any(), MachineType::AnyTagged()}; 93 JSFunction::kSharedFunctionInfoOffset,
94 Handle<Name>(),
95 Type::Any(),
96 MachineType::AnyTagged(),
97 kPointerWriteBarrier};
84 return access; 98 return access;
85 } 99 }
86 100
87 101
88 // static 102 // static
89 FieldAccess AccessBuilder::ForJSFunctionLiterals() { 103 FieldAccess AccessBuilder::ForJSFunctionLiterals() {
90 FieldAccess access = {kTaggedBase, JSFunction::kLiteralsOffset, 104 FieldAccess access = {
91 Handle<Name>(), Type::Internal(), 105 kTaggedBase, JSFunction::kLiteralsOffset, Handle<Name>(),
92 MachineType::AnyTagged()}; 106 Type::Internal(), MachineType::AnyTagged(), kPointerWriteBarrier};
93 return access; 107 return access;
94 } 108 }
95 109
96 // static 110 // static
97 FieldAccess AccessBuilder::ForJSFunctionCodeEntry() { 111 FieldAccess AccessBuilder::ForJSFunctionCodeEntry() {
98 FieldAccess access = {kTaggedBase, JSFunction::kCodeEntryOffset, 112 FieldAccess access = {kTaggedBase,
99 Handle<Name>(), Type::UntaggedPointer(), 113 JSFunction::kCodeEntryOffset,
100 MachineType::Pointer()}; 114 Handle<Name>(),
115 Type::UntaggedPointer(),
116 MachineType::Pointer(),
117 kNoWriteBarrier};
101 return access; 118 return access;
102 } 119 }
103 120
104 // static 121 // static
105 FieldAccess AccessBuilder::ForJSFunctionNextFunctionLink() { 122 FieldAccess AccessBuilder::ForJSFunctionNextFunctionLink() {
106 FieldAccess access = {kTaggedBase, JSFunction::kNextFunctionLinkOffset, 123 FieldAccess access = {kTaggedBase,
107 Handle<Name>(), Type::Any(), MachineType::AnyTagged()}; 124 JSFunction::kNextFunctionLinkOffset,
125 Handle<Name>(),
126 Type::Any(),
127 MachineType::AnyTagged(),
128 kPointerWriteBarrier};
108 return access; 129 return access;
109 } 130 }
110 131
111 // static 132 // static
112 FieldAccess AccessBuilder::ForJSArrayLength(ElementsKind elements_kind) { 133 FieldAccess AccessBuilder::ForJSArrayLength(ElementsKind elements_kind) {
113 TypeCache const& type_cache = TypeCache::Get(); 134 TypeCache const& type_cache = TypeCache::Get();
114 FieldAccess access = {kTaggedBase, JSArray::kLengthOffset, Handle<Name>(), 135 FieldAccess access = {kTaggedBase,
136 JSArray::kLengthOffset,
137 Handle<Name>(),
115 type_cache.kJSArrayLengthType, 138 type_cache.kJSArrayLengthType,
116 MachineType::AnyTagged()}; 139 MachineType::AnyTagged(),
140 kFullWriteBarrier};
117 if (IsFastDoubleElementsKind(elements_kind)) { 141 if (IsFastDoubleElementsKind(elements_kind)) {
118 access.type = type_cache.kFixedDoubleArrayLengthType; 142 access.type = type_cache.kFixedDoubleArrayLengthType;
143 access.write_barrier_kind = kNoWriteBarrier;
119 } else if (IsFastElementsKind(elements_kind)) { 144 } else if (IsFastElementsKind(elements_kind)) {
120 access.type = type_cache.kFixedArrayLengthType; 145 access.type = type_cache.kFixedArrayLengthType;
146 access.write_barrier_kind = kNoWriteBarrier;
121 } 147 }
122 return access; 148 return access;
123 } 149 }
124 150
125 151
126 // static 152 // static
127 FieldAccess AccessBuilder::ForJSArrayBufferBackingStore() { 153 FieldAccess AccessBuilder::ForJSArrayBufferBackingStore() {
128 FieldAccess access = {kTaggedBase, JSArrayBuffer::kBackingStoreOffset, 154 FieldAccess access = {kTaggedBase,
129 MaybeHandle<Name>(), Type::UntaggedPointer(), 155 JSArrayBuffer::kBackingStoreOffset,
130 MachineType::Pointer()}; 156 MaybeHandle<Name>(),
157 Type::UntaggedPointer(),
158 MachineType::Pointer(),
159 kNoWriteBarrier};
131 return access; 160 return access;
132 } 161 }
133 162
134 163
135 // static 164 // static
136 FieldAccess AccessBuilder::ForJSArrayBufferBitField() { 165 FieldAccess AccessBuilder::ForJSArrayBufferBitField() {
137 FieldAccess access = {kTaggedBase, JSArrayBuffer::kBitFieldOffset, 166 FieldAccess access = {kTaggedBase, JSArrayBuffer::kBitFieldOffset,
138 MaybeHandle<Name>(), TypeCache::Get().kInt8, 167 MaybeHandle<Name>(), TypeCache::Get().kInt8,
139 MachineType::Int8()}; 168 MachineType::Int8(), kNoWriteBarrier};
140 return access; 169 return access;
141 } 170 }
142 171
143 172
144 // static 173 // static
145 FieldAccess AccessBuilder::ForJSArrayBufferViewBuffer() { 174 FieldAccess AccessBuilder::ForJSArrayBufferViewBuffer() {
146 FieldAccess access = {kTaggedBase, JSArrayBufferView::kBufferOffset, 175 FieldAccess access = {kTaggedBase,
147 MaybeHandle<Name>(), Type::TaggedPointer(), 176 JSArrayBufferView::kBufferOffset,
148 MachineType::AnyTagged()}; 177 MaybeHandle<Name>(),
178 Type::TaggedPointer(),
179 MachineType::AnyTagged(),
180 kPointerWriteBarrier};
149 return access; 181 return access;
150 } 182 }
151 183
152 184
153 // static 185 // static
154 FieldAccess AccessBuilder::ForJSDateField(JSDate::FieldIndex index) { 186 FieldAccess AccessBuilder::ForJSDateField(JSDate::FieldIndex index) {
155 FieldAccess access = { 187 FieldAccess access = {kTaggedBase,
156 kTaggedBase, JSDate::kValueOffset + index * kPointerSize, 188 JSDate::kValueOffset + index * kPointerSize,
157 MaybeHandle<Name>(), Type::Number(), MachineType::AnyTagged()}; 189 MaybeHandle<Name>(),
190 Type::Number(),
191 MachineType::AnyTagged(),
192 kFullWriteBarrier};
158 return access; 193 return access;
159 } 194 }
160 195
161 196
162 // static 197 // static
163 FieldAccess AccessBuilder::ForJSIteratorResultDone() { 198 FieldAccess AccessBuilder::ForJSIteratorResultDone() {
164 FieldAccess access = {kTaggedBase, JSIteratorResult::kDoneOffset, 199 FieldAccess access = {
165 MaybeHandle<Name>(), Type::Any(), 200 kTaggedBase, JSIteratorResult::kDoneOffset, MaybeHandle<Name>(),
166 MachineType::AnyTagged()}; 201 Type::Any(), MachineType::AnyTagged(), kFullWriteBarrier};
167 return access; 202 return access;
168 } 203 }
169 204
170 205
171 // static 206 // static
172 FieldAccess AccessBuilder::ForJSIteratorResultValue() { 207 FieldAccess AccessBuilder::ForJSIteratorResultValue() {
173 FieldAccess access = {kTaggedBase, JSIteratorResult::kValueOffset, 208 FieldAccess access = {
174 MaybeHandle<Name>(), Type::Any(), 209 kTaggedBase, JSIteratorResult::kValueOffset, MaybeHandle<Name>(),
175 MachineType::AnyTagged()}; 210 Type::Any(), MachineType::AnyTagged(), kFullWriteBarrier};
176 return access; 211 return access;
177 } 212 }
178 213
179 214
180 // static 215 // static
181 FieldAccess AccessBuilder::ForJSRegExpFlags() { 216 FieldAccess AccessBuilder::ForJSRegExpFlags() {
182 FieldAccess access = {kTaggedBase, JSRegExp::kFlagsOffset, 217 FieldAccess access = {
183 MaybeHandle<Name>(), Type::Tagged(), 218 kTaggedBase, JSRegExp::kFlagsOffset, MaybeHandle<Name>(),
184 MachineType::AnyTagged()}; 219 Type::Tagged(), MachineType::AnyTagged(), kFullWriteBarrier};
185 return access; 220 return access;
186 } 221 }
187 222
188 223
189 // static 224 // static
190 FieldAccess AccessBuilder::ForJSRegExpSource() { 225 FieldAccess AccessBuilder::ForJSRegExpSource() {
191 FieldAccess access = {kTaggedBase, JSRegExp::kSourceOffset, 226 FieldAccess access = {
192 MaybeHandle<Name>(), Type::Tagged(), 227 kTaggedBase, JSRegExp::kSourceOffset, MaybeHandle<Name>(),
193 MachineType::AnyTagged()}; 228 Type::Tagged(), MachineType::AnyTagged(), kFullWriteBarrier};
194 return access; 229 return access;
195 } 230 }
196 231
197 232
198 // static 233 // static
199 FieldAccess AccessBuilder::ForFixedArrayLength() { 234 FieldAccess AccessBuilder::ForFixedArrayLength() {
200 FieldAccess access = { 235 FieldAccess access = {kTaggedBase,
201 kTaggedBase, FixedArray::kLengthOffset, MaybeHandle<Name>(), 236 FixedArray::kLengthOffset,
202 TypeCache::Get().kFixedArrayLengthType, MachineType::AnyTagged()}; 237 MaybeHandle<Name>(),
238 TypeCache::Get().kFixedArrayLengthType,
239 MachineType::AnyTagged(),
240 kNoWriteBarrier};
203 return access; 241 return access;
204 } 242 }
205 243
206 244
207 // static 245 // static
208 FieldAccess AccessBuilder::ForDescriptorArrayEnumCache() { 246 FieldAccess AccessBuilder::ForDescriptorArrayEnumCache() {
209 FieldAccess access = {kTaggedBase, DescriptorArray::kEnumCacheOffset, 247 FieldAccess access = {kTaggedBase,
210 Handle<Name>(), Type::TaggedPointer(), 248 DescriptorArray::kEnumCacheOffset,
211 MachineType::AnyTagged()}; 249 Handle<Name>(),
250 Type::TaggedPointer(),
251 MachineType::AnyTagged(),
252 kPointerWriteBarrier};
212 return access; 253 return access;
213 } 254 }
214 255
215 256
216 // static 257 // static
217 FieldAccess AccessBuilder::ForDescriptorArrayEnumCacheBridgeCache() { 258 FieldAccess AccessBuilder::ForDescriptorArrayEnumCacheBridgeCache() {
218 FieldAccess access = { 259 FieldAccess access = {kTaggedBase,
219 kTaggedBase, DescriptorArray::kEnumCacheBridgeCacheOffset, Handle<Name>(), 260 DescriptorArray::kEnumCacheBridgeCacheOffset,
220 Type::TaggedPointer(), MachineType::AnyTagged()}; 261 Handle<Name>(),
262 Type::TaggedPointer(),
263 MachineType::AnyTagged(),
264 kPointerWriteBarrier};
221 return access; 265 return access;
222 } 266 }
223 267
224 268
225 // static 269 // static
226 FieldAccess AccessBuilder::ForMapBitField() { 270 FieldAccess AccessBuilder::ForMapBitField() {
227 FieldAccess access = {kTaggedBase, Map::kBitFieldOffset, Handle<Name>(), 271 FieldAccess access = {kTaggedBase, Map::kBitFieldOffset,
228 TypeCache::Get().kUint8, MachineType::Uint8()}; 272 Handle<Name>(), TypeCache::Get().kUint8,
273 MachineType::Uint8(), kNoWriteBarrier};
229 return access; 274 return access;
230 } 275 }
231 276
232 277
233 // static 278 // static
234 FieldAccess AccessBuilder::ForMapBitField3() { 279 FieldAccess AccessBuilder::ForMapBitField3() {
235 FieldAccess access = {kTaggedBase, Map::kBitField3Offset, Handle<Name>(), 280 FieldAccess access = {kTaggedBase, Map::kBitField3Offset,
236 TypeCache::Get().kInt32, MachineType::Int32()}; 281 Handle<Name>(), TypeCache::Get().kInt32,
282 MachineType::Int32(), kNoWriteBarrier};
237 return access; 283 return access;
238 } 284 }
239 285
240 286
241 // static 287 // static
242 FieldAccess AccessBuilder::ForMapDescriptors() { 288 FieldAccess AccessBuilder::ForMapDescriptors() {
243 FieldAccess access = {kTaggedBase, Map::kDescriptorsOffset, Handle<Name>(), 289 FieldAccess access = {
244 Type::TaggedPointer(), MachineType::AnyTagged()}; 290 kTaggedBase, Map::kDescriptorsOffset, Handle<Name>(),
291 Type::TaggedPointer(), MachineType::AnyTagged(), kPointerWriteBarrier};
245 return access; 292 return access;
246 } 293 }
247 294
248 295
249 // static 296 // static
250 FieldAccess AccessBuilder::ForMapInstanceType() { 297 FieldAccess AccessBuilder::ForMapInstanceType() {
251 FieldAccess access = {kTaggedBase, Map::kInstanceTypeOffset, Handle<Name>(), 298 FieldAccess access = {kTaggedBase, Map::kInstanceTypeOffset,
252 TypeCache::Get().kUint8, MachineType::Uint8()}; 299 Handle<Name>(), TypeCache::Get().kUint8,
300 MachineType::Uint8(), kNoWriteBarrier};
253 return access; 301 return access;
254 } 302 }
255 303
256 304
257 // static 305 // static
258 FieldAccess AccessBuilder::ForMapPrototype() { 306 FieldAccess AccessBuilder::ForMapPrototype() {
259 FieldAccess access = {kTaggedBase, Map::kPrototypeOffset, Handle<Name>(), 307 FieldAccess access = {
260 Type::TaggedPointer(), MachineType::AnyTagged()}; 308 kTaggedBase, Map::kPrototypeOffset, Handle<Name>(),
309 Type::TaggedPointer(), MachineType::AnyTagged(), kPointerWriteBarrier};
261 return access; 310 return access;
262 } 311 }
263 312
264 313
265 // static 314 // static
266 FieldAccess AccessBuilder::ForStringLength() { 315 FieldAccess AccessBuilder::ForStringLength() {
267 FieldAccess access = {kTaggedBase, String::kLengthOffset, Handle<Name>(), 316 FieldAccess access = {kTaggedBase,
317 String::kLengthOffset,
318 Handle<Name>(),
268 TypeCache::Get().kStringLengthType, 319 TypeCache::Get().kStringLengthType,
269 MachineType::AnyTagged()}; 320 MachineType::AnyTagged(),
321 kNoWriteBarrier};
270 return access; 322 return access;
271 } 323 }
272 324
273 325
274 // static 326 // static
275 FieldAccess AccessBuilder::ForJSGlobalObjectGlobalProxy() { 327 FieldAccess AccessBuilder::ForJSGlobalObjectGlobalProxy() {
276 FieldAccess access = {kTaggedBase, JSGlobalObject::kGlobalProxyOffset, 328 FieldAccess access = {kTaggedBase,
277 Handle<Name>(), Type::Receiver(), 329 JSGlobalObject::kGlobalProxyOffset,
278 MachineType::AnyTagged()}; 330 Handle<Name>(),
331 Type::Receiver(),
332 MachineType::AnyTagged(),
333 kPointerWriteBarrier};
279 return access; 334 return access;
280 } 335 }
281 336
282 337
283 // static 338 // static
284 FieldAccess AccessBuilder::ForJSGlobalObjectNativeContext() { 339 FieldAccess AccessBuilder::ForJSGlobalObjectNativeContext() {
285 FieldAccess access = {kTaggedBase, JSGlobalObject::kNativeContextOffset, 340 FieldAccess access = {kTaggedBase,
286 Handle<Name>(), Type::Internal(), 341 JSGlobalObject::kNativeContextOffset,
287 MachineType::AnyTagged()}; 342 Handle<Name>(),
343 Type::Internal(),
344 MachineType::AnyTagged(),
345 kPointerWriteBarrier};
288 return access; 346 return access;
289 } 347 }
290 348
291 349
292 // static 350 // static
293 FieldAccess AccessBuilder::ForValue() { 351 FieldAccess AccessBuilder::ForValue() {
294 FieldAccess access = {kTaggedBase, JSValue::kValueOffset, Handle<Name>(), 352 FieldAccess access = {
295 Type::Any(), MachineType::AnyTagged()}; 353 kTaggedBase, JSValue::kValueOffset, Handle<Name>(),
354 Type::Any(), MachineType::AnyTagged(), kFullWriteBarrier};
296 return access; 355 return access;
297 } 356 }
298 357
299 358
300 // static 359 // static
301 FieldAccess AccessBuilder::ForArgumentsLength() { 360 FieldAccess AccessBuilder::ForArgumentsLength() {
302 FieldAccess access = {kTaggedBase, JSArgumentsObject::kLengthOffset, 361 FieldAccess access = {
303 Handle<Name>(), Type::Any(), MachineType::AnyTagged()}; 362 kTaggedBase, JSArgumentsObject::kLengthOffset, Handle<Name>(),
363 Type::Any(), MachineType::AnyTagged(), kFullWriteBarrier};
304 return access; 364 return access;
305 } 365 }
306 366
307 367
308 // static 368 // static
309 FieldAccess AccessBuilder::ForArgumentsCallee() { 369 FieldAccess AccessBuilder::ForArgumentsCallee() {
310 FieldAccess access = {kTaggedBase, JSSloppyArgumentsObject::kCalleeOffset, 370 FieldAccess access = {kTaggedBase,
311 Handle<Name>(), Type::Any(), MachineType::AnyTagged()}; 371 JSSloppyArgumentsObject::kCalleeOffset,
312 return access; 372 Handle<Name>(),
313 } 373 Type::Any(),
314 374 MachineType::AnyTagged(),
375 kPointerWriteBarrier};
376 return access;
377 }
378
315 379
316 // static 380 // static
317 FieldAccess AccessBuilder::ForFixedArraySlot(size_t index) { 381 FieldAccess AccessBuilder::ForFixedArraySlot(size_t index) {
318 int offset = FixedArray::OffsetOfElementAt(static_cast<int>(index)); 382 int offset = FixedArray::OffsetOfElementAt(static_cast<int>(index));
319 FieldAccess access = {kTaggedBase, offset, Handle<Name>(), Type::Any(), 383 FieldAccess access = {kTaggedBase,
320 MachineType::AnyTagged()}; 384 offset,
385 Handle<Name>(),
386 Type::Any(),
387 MachineType::AnyTagged(),
388 kFullWriteBarrier};
321 return access; 389 return access;
322 } 390 }
323 391
324 392
325 // static 393 // static
326 FieldAccess AccessBuilder::ForContextSlot(size_t index) { 394 FieldAccess AccessBuilder::ForContextSlot(size_t index) {
327 int offset = Context::kHeaderSize + static_cast<int>(index) * kPointerSize; 395 int offset = Context::kHeaderSize + static_cast<int>(index) * kPointerSize;
328 DCHECK_EQ(offset, 396 DCHECK_EQ(offset,
329 Context::SlotOffset(static_cast<int>(index)) + kHeapObjectTag); 397 Context::SlotOffset(static_cast<int>(index)) + kHeapObjectTag);
330 FieldAccess access = {kTaggedBase, offset, Handle<Name>(), Type::Any(), 398 FieldAccess access = {kTaggedBase,
331 MachineType::AnyTagged()}; 399 offset,
400 Handle<Name>(),
401 Type::Any(),
402 MachineType::AnyTagged(),
403 kFullWriteBarrier};
332 return access; 404 return access;
333 } 405 }
334 406
335 407
336 // static 408 // static
337 FieldAccess AccessBuilder::ForPropertyCellValue() { 409 FieldAccess AccessBuilder::ForPropertyCellValue() {
338 return ForPropertyCellValue(Type::Tagged()); 410 return ForPropertyCellValue(Type::Tagged());
339 } 411 }
340 412
341 413
342 // static 414 // static
343 FieldAccess AccessBuilder::ForPropertyCellValue(Type* type) { 415 FieldAccess AccessBuilder::ForPropertyCellValue(Type* type) {
344 FieldAccess access = {kTaggedBase, PropertyCell::kValueOffset, Handle<Name>(), 416 FieldAccess access = {
345 type, MachineType::AnyTagged()}; 417 kTaggedBase, PropertyCell::kValueOffset, Handle<Name>(),
418 type, MachineType::AnyTagged(), kFullWriteBarrier};
346 return access; 419 return access;
347 } 420 }
348 421
349 422
350 // static 423 // static
351 FieldAccess AccessBuilder::ForSharedFunctionInfoTypeFeedbackVector() { 424 FieldAccess AccessBuilder::ForSharedFunctionInfoTypeFeedbackVector() {
352 FieldAccess access = {kTaggedBase, SharedFunctionInfo::kFeedbackVectorOffset, 425 FieldAccess access = {kTaggedBase,
353 Handle<Name>(), Type::Any(), MachineType::AnyTagged()}; 426 SharedFunctionInfo::kFeedbackVectorOffset,
427 Handle<Name>(),
428 Type::Any(),
429 MachineType::AnyTagged(),
430 kPointerWriteBarrier};
354 return access; 431 return access;
355 } 432 }
356 433
357 434
358 // static 435 // static
359 ElementAccess AccessBuilder::ForFixedArrayElement() { 436 ElementAccess AccessBuilder::ForFixedArrayElement() {
360 ElementAccess access = {kTaggedBase, FixedArray::kHeaderSize, Type::Tagged(), 437 ElementAccess access = {kTaggedBase, FixedArray::kHeaderSize, Type::Tagged(),
361 MachineType::AnyTagged()}; 438 MachineType::AnyTagged(), kFullWriteBarrier};
362 return access; 439 return access;
363 } 440 }
364 441
365 442
366 // static 443 // static
367 ElementAccess AccessBuilder::ForFixedDoubleArrayElement() { 444 ElementAccess AccessBuilder::ForFixedDoubleArrayElement() {
368 ElementAccess access = {kTaggedBase, FixedDoubleArray::kHeaderSize, 445 ElementAccess access = {kTaggedBase, FixedDoubleArray::kHeaderSize,
369 TypeCache::Get().kFloat64, MachineType::Float64()}; 446 TypeCache::Get().kFloat64, MachineType::Float64(),
447 kNoWriteBarrier};
370 return access; 448 return access;
371 } 449 }
372 450
373 451
374 // static 452 // static
375 ElementAccess AccessBuilder::ForTypedArrayElement(ExternalArrayType type, 453 ElementAccess AccessBuilder::ForTypedArrayElement(ExternalArrayType type,
376 bool is_external) { 454 bool is_external) {
377 BaseTaggedness taggedness = is_external ? kUntaggedBase : kTaggedBase; 455 BaseTaggedness taggedness = is_external ? kUntaggedBase : kTaggedBase;
378 int header_size = is_external ? 0 : FixedTypedArrayBase::kDataOffset; 456 int header_size = is_external ? 0 : FixedTypedArrayBase::kDataOffset;
379 switch (type) { 457 switch (type) {
380 case kExternalInt8Array: { 458 case kExternalInt8Array: {
381 ElementAccess access = {taggedness, header_size, Type::Signed32(), 459 ElementAccess access = {taggedness, header_size, Type::Signed32(),
382 MachineType::Int8()}; 460 MachineType::Int8(), kNoWriteBarrier};
383 return access; 461 return access;
384 } 462 }
385 case kExternalUint8Array: 463 case kExternalUint8Array:
386 case kExternalUint8ClampedArray: { 464 case kExternalUint8ClampedArray: {
387 ElementAccess access = {taggedness, header_size, Type::Unsigned32(), 465 ElementAccess access = {taggedness, header_size, Type::Unsigned32(),
388 MachineType::Uint8()}; 466 MachineType::Uint8(), kNoWriteBarrier};
389 return access; 467 return access;
390 } 468 }
391 case kExternalInt16Array: { 469 case kExternalInt16Array: {
392 ElementAccess access = {taggedness, header_size, Type::Signed32(), 470 ElementAccess access = {taggedness, header_size, Type::Signed32(),
393 MachineType::Int16()}; 471 MachineType::Int16(), kNoWriteBarrier};
394 return access; 472 return access;
395 } 473 }
396 case kExternalUint16Array: { 474 case kExternalUint16Array: {
397 ElementAccess access = {taggedness, header_size, Type::Unsigned32(), 475 ElementAccess access = {taggedness, header_size, Type::Unsigned32(),
398 MachineType::Uint16()}; 476 MachineType::Uint16(), kNoWriteBarrier};
399 return access; 477 return access;
400 } 478 }
401 case kExternalInt32Array: { 479 case kExternalInt32Array: {
402 ElementAccess access = {taggedness, header_size, Type::Signed32(), 480 ElementAccess access = {taggedness, header_size, Type::Signed32(),
403 MachineType::Int32()}; 481 MachineType::Int32(), kNoWriteBarrier};
404 return access; 482 return access;
405 } 483 }
406 case kExternalUint32Array: { 484 case kExternalUint32Array: {
407 ElementAccess access = {taggedness, header_size, Type::Unsigned32(), 485 ElementAccess access = {taggedness, header_size, Type::Unsigned32(),
408 MachineType::Uint32()}; 486 MachineType::Uint32(), kNoWriteBarrier};
409 return access; 487 return access;
410 } 488 }
411 case kExternalFloat32Array: { 489 case kExternalFloat32Array: {
412 ElementAccess access = {taggedness, header_size, Type::Number(), 490 ElementAccess access = {taggedness, header_size, Type::Number(),
413 MachineType::Float32()}; 491 MachineType::Float32(), kNoWriteBarrier};
414 return access; 492 return access;
415 } 493 }
416 case kExternalFloat64Array: { 494 case kExternalFloat64Array: {
417 ElementAccess access = {taggedness, header_size, Type::Number(), 495 ElementAccess access = {taggedness, header_size, Type::Number(),
418 MachineType::Float64()}; 496 MachineType::Float64(), kNoWriteBarrier};
419 return access; 497 return access;
420 } 498 }
421 } 499 }
422 UNREACHABLE(); 500 UNREACHABLE();
423 ElementAccess access = {kUntaggedBase, 0, Type::None(), MachineType::None()}; 501 ElementAccess access = {kUntaggedBase, 0, Type::None(), MachineType::None(),
502 kNoWriteBarrier};
424 return access; 503 return access;
425 } 504 }
426 505
427
428 // static
429 FieldAccess AccessBuilder::ForStatsCounter() {
430 FieldAccess access = {kUntaggedBase, 0, MaybeHandle<Name>(),
431 TypeCache::Get().kInt32, MachineType::Int32()};
432 return access;
433 }
434
435 } // namespace compiler 506 } // namespace compiler
436 } // namespace internal 507 } // namespace internal
437 } // namespace v8 508 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/access-builder.h ('k') | src/compiler/change-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698