• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #include "src/compiler/access-builder.h"
6 
7 #include "src/compiler/type-cache.h"
8 #include "src/execution/frames.h"
9 #include "src/handles/handles-inl.h"
10 #include "src/heap/heap.h"
11 #include "src/objects/arguments.h"
12 #include "src/objects/cell.h"
13 #include "src/objects/contexts.h"
14 #include "src/objects/heap-number.h"
15 #include "src/objects/js-collection.h"
16 #include "src/objects/js-generator.h"
17 #include "src/objects/objects-inl.h"
18 #include "src/objects/ordered-hash-table.h"
19 #include "src/objects/source-text-module.h"
20 
21 namespace v8 {
22 namespace internal {
23 namespace compiler {
24 
25 // static
ForExternalIntPtr()26 FieldAccess AccessBuilder::ForExternalIntPtr() {
27   FieldAccess access = {kUntaggedBase,      0,           MaybeHandle<Name>(),
28                         MaybeHandle<Map>(), Type::Any(), MachineType::IntPtr(),
29                         kNoWriteBarrier};
30   return access;
31 }
32 
33 // static
ForMap(WriteBarrierKind write_barrier)34 FieldAccess AccessBuilder::ForMap(WriteBarrierKind write_barrier) {
35   FieldAccess access = {kTaggedBase,           HeapObject::kMapOffset,
36                         MaybeHandle<Name>(),   MaybeHandle<Map>(),
37                         Type::OtherInternal(), MachineType::MapInHeader(),
38                         write_barrier};
39   return access;
40 }
41 
42 // static
ForHeapNumberValue()43 FieldAccess AccessBuilder::ForHeapNumberValue() {
44   FieldAccess access = {
45       kTaggedBase,        HeapNumber::kValueOffset,   MaybeHandle<Name>(),
46       MaybeHandle<Map>(), TypeCache::Get()->kFloat64, MachineType::Float64(),
47       kNoWriteBarrier};
48   return access;
49 }
50 
51 // static
ForBigIntBitfield()52 FieldAccess AccessBuilder::ForBigIntBitfield() {
53   FieldAccess access = {
54       kTaggedBase,        BigInt::kBitfieldOffset,  MaybeHandle<Name>(),
55       MaybeHandle<Map>(), TypeCache::Get()->kInt32, MachineType::Uint32(),
56       kNoWriteBarrier};
57   return access;
58 }
59 
60 // static
ForBigIntOptionalPadding()61 FieldAccess AccessBuilder::ForBigIntOptionalPadding() {
62   DCHECK_EQ(FIELD_SIZE(BigInt::kOptionalPaddingOffset), 4);
63   FieldAccess access = {
64       kTaggedBase,        BigInt::kOptionalPaddingOffset, MaybeHandle<Name>(),
65       MaybeHandle<Map>(), TypeCache::Get()->kInt32,       MachineType::Uint32(),
66       kNoWriteBarrier};
67   return access;
68 }
69 
70 // static
ForBigIntLeastSignificantDigit64()71 FieldAccess AccessBuilder::ForBigIntLeastSignificantDigit64() {
72   DCHECK_EQ(BigInt::SizeFor(1) - BigInt::SizeFor(0), 8);
73   FieldAccess access = {
74       kTaggedBase,        BigInt::kDigitsOffset,        MaybeHandle<Name>(),
75       MaybeHandle<Map>(), TypeCache::Get()->kBigUint64, MachineType::Uint64(),
76       kNoWriteBarrier};
77   return access;
78 }
79 
80 // static
ForJSObjectPropertiesOrHash()81 FieldAccess AccessBuilder::ForJSObjectPropertiesOrHash() {
82   FieldAccess access = {kTaggedBase,         JSObject::kPropertiesOrHashOffset,
83                         MaybeHandle<Name>(), MaybeHandle<Map>(),
84                         Type::Any(),         MachineType::AnyTagged(),
85                         kFullWriteBarrier};
86   return access;
87 }
88 
89 // static
ForJSObjectPropertiesOrHashKnownPointer()90 FieldAccess AccessBuilder::ForJSObjectPropertiesOrHashKnownPointer() {
91   FieldAccess access = {kTaggedBase,         JSObject::kPropertiesOrHashOffset,
92                         MaybeHandle<Name>(), MaybeHandle<Map>(),
93                         Type::Any(),         MachineType::TaggedPointer(),
94                         kPointerWriteBarrier};
95   return access;
96 }
97 
98 // static
ForJSObjectElements()99 FieldAccess AccessBuilder::ForJSObjectElements() {
100   FieldAccess access = {kTaggedBase,         JSObject::kElementsOffset,
101                         MaybeHandle<Name>(), MaybeHandle<Map>(),
102                         Type::Internal(),    MachineType::TaggedPointer(),
103                         kPointerWriteBarrier};
104   return access;
105 }
106 
107 // static
ForJSObjectInObjectProperty(const MapRef & map,int index,MachineType machine_type)108 FieldAccess AccessBuilder::ForJSObjectInObjectProperty(
109     const MapRef& map, int index, MachineType machine_type) {
110   int const offset = map.GetInObjectPropertyOffset(index);
111   FieldAccess access = {kTaggedBase,         offset,
112                         MaybeHandle<Name>(), MaybeHandle<Map>(),
113                         Type::NonInternal(), machine_type,
114                         kFullWriteBarrier};
115   return access;
116 }
117 
118 // static
ForJSObjectOffset(int offset,WriteBarrierKind write_barrier_kind)119 FieldAccess AccessBuilder::ForJSObjectOffset(
120     int offset, WriteBarrierKind write_barrier_kind) {
121   FieldAccess access = {kTaggedBase,         offset,
122                         MaybeHandle<Name>(), MaybeHandle<Map>(),
123                         Type::NonInternal(), MachineType::AnyTagged(),
124                         write_barrier_kind};
125   return access;
126 }
127 
128 // static
ForJSCollectionTable()129 FieldAccess AccessBuilder::ForJSCollectionTable() {
130   FieldAccess access = {kTaggedBase,           JSCollection::kTableOffset,
131                         MaybeHandle<Name>(),   MaybeHandle<Map>(),
132                         Type::OtherInternal(), MachineType::TaggedPointer(),
133                         kPointerWriteBarrier};
134   return access;
135 }
136 
137 // static
ForJSCollectionIteratorTable()138 FieldAccess AccessBuilder::ForJSCollectionIteratorTable() {
139   FieldAccess access = {
140       kTaggedBase,           JSCollectionIterator::kTableOffset,
141       MaybeHandle<Name>(),   MaybeHandle<Map>(),
142       Type::OtherInternal(), MachineType::TaggedPointer(),
143       kPointerWriteBarrier};
144   return access;
145 }
146 
147 // static
ForJSCollectionIteratorIndex()148 FieldAccess AccessBuilder::ForJSCollectionIteratorIndex() {
149   FieldAccess access = {kTaggedBase,
150                         JSCollectionIterator::kIndexOffset,
151                         MaybeHandle<Name>(),
152                         MaybeHandle<Map>(),
153                         TypeCache::Get()->kFixedArrayLengthType,
154                         MachineType::TaggedSigned(),
155                         kNoWriteBarrier};
156   return access;
157 }
158 
159 // static
ForJSFunctionPrototypeOrInitialMap()160 FieldAccess AccessBuilder::ForJSFunctionPrototypeOrInitialMap() {
161   FieldAccess access = {
162       kTaggedBase,         JSFunction::kPrototypeOrInitialMapOffset,
163       MaybeHandle<Name>(), MaybeHandle<Map>(),
164       Type::Any(),         MachineType::TaggedPointer(),
165       kPointerWriteBarrier};
166   return access;
167 }
168 
169 // static
ForJSFunctionContext()170 FieldAccess AccessBuilder::ForJSFunctionContext() {
171   FieldAccess access = {kTaggedBase,         JSFunction::kContextOffset,
172                         MaybeHandle<Name>(), MaybeHandle<Map>(),
173                         Type::Internal(),    MachineType::TaggedPointer(),
174                         kPointerWriteBarrier};
175   return access;
176 }
177 
178 // static
ForJSFunctionSharedFunctionInfo()179 FieldAccess AccessBuilder::ForJSFunctionSharedFunctionInfo() {
180   FieldAccess access = {
181       kTaggedBase,           JSFunction::kSharedFunctionInfoOffset,
182       Handle<Name>(),        MaybeHandle<Map>(),
183       Type::OtherInternal(), MachineType::TaggedPointer(),
184       kPointerWriteBarrier};
185   return access;
186 }
187 
188 // static
ForJSFunctionFeedbackCell()189 FieldAccess AccessBuilder::ForJSFunctionFeedbackCell() {
190   FieldAccess access = {kTaggedBase,         JSFunction::kFeedbackCellOffset,
191                         Handle<Name>(),      MaybeHandle<Map>(),
192                         Type::Internal(),    MachineType::TaggedPointer(),
193                         kPointerWriteBarrier};
194   return access;
195 }
196 
197 // static
ForJSFunctionCode()198 FieldAccess AccessBuilder::ForJSFunctionCode() {
199   FieldAccess access = {kTaggedBase,           JSFunction::kCodeOffset,
200                         Handle<Name>(),        MaybeHandle<Map>(),
201                         Type::OtherInternal(), MachineType::TaggedPointer(),
202                         kPointerWriteBarrier};
203   return access;
204 }
205 
206 // static
ForJSBoundFunctionBoundTargetFunction()207 FieldAccess AccessBuilder::ForJSBoundFunctionBoundTargetFunction() {
208   FieldAccess access = {
209       kTaggedBase,         JSBoundFunction::kBoundTargetFunctionOffset,
210       Handle<Name>(),      MaybeHandle<Map>(),
211       Type::Callable(),    MachineType::TaggedPointer(),
212       kPointerWriteBarrier};
213   return access;
214 }
215 
216 // static
ForJSBoundFunctionBoundThis()217 FieldAccess AccessBuilder::ForJSBoundFunctionBoundThis() {
218   FieldAccess access = {kTaggedBase,         JSBoundFunction::kBoundThisOffset,
219                         Handle<Name>(),      MaybeHandle<Map>(),
220                         Type::NonInternal(), MachineType::AnyTagged(),
221                         kFullWriteBarrier};
222   return access;
223 }
224 
225 // static
ForJSBoundFunctionBoundArguments()226 FieldAccess AccessBuilder::ForJSBoundFunctionBoundArguments() {
227   FieldAccess access = {
228       kTaggedBase,         JSBoundFunction::kBoundArgumentsOffset,
229       Handle<Name>(),      MaybeHandle<Map>(),
230       Type::Internal(),    MachineType::TaggedPointer(),
231       kPointerWriteBarrier};
232   return access;
233 }
234 
235 // static
ForJSGeneratorObjectContext()236 FieldAccess AccessBuilder::ForJSGeneratorObjectContext() {
237   FieldAccess access = {kTaggedBase,         JSGeneratorObject::kContextOffset,
238                         Handle<Name>(),      MaybeHandle<Map>(),
239                         Type::Internal(),    MachineType::TaggedPointer(),
240                         kPointerWriteBarrier};
241   return access;
242 }
243 
244 // static
ForJSGeneratorObjectFunction()245 FieldAccess AccessBuilder::ForJSGeneratorObjectFunction() {
246   FieldAccess access = {kTaggedBase,
247                         JSGeneratorObject::kFunctionOffset,
248                         Handle<Name>(),
249                         MaybeHandle<Map>(),
250                         Type::CallableFunction(),
251                         MachineType::TaggedPointer(),
252                         kPointerWriteBarrier};
253   return access;
254 }
255 
256 // static
ForJSGeneratorObjectReceiver()257 FieldAccess AccessBuilder::ForJSGeneratorObjectReceiver() {
258   FieldAccess access = {kTaggedBase,         JSGeneratorObject::kReceiverOffset,
259                         Handle<Name>(),      MaybeHandle<Map>(),
260                         Type::Internal(),    MachineType::TaggedPointer(),
261                         kPointerWriteBarrier};
262   return access;
263 }
264 
265 // static
ForJSGeneratorObjectContinuation()266 FieldAccess AccessBuilder::ForJSGeneratorObjectContinuation() {
267   FieldAccess access = {
268       kTaggedBase,         JSGeneratorObject::kContinuationOffset,
269       Handle<Name>(),      MaybeHandle<Map>(),
270       Type::SignedSmall(), MachineType::TaggedSigned(),
271       kNoWriteBarrier};
272   return access;
273 }
274 
275 // static
ForJSGeneratorObjectInputOrDebugPos()276 FieldAccess AccessBuilder::ForJSGeneratorObjectInputOrDebugPos() {
277   FieldAccess access = {
278       kTaggedBase,         JSGeneratorObject::kInputOrDebugPosOffset,
279       Handle<Name>(),      MaybeHandle<Map>(),
280       Type::NonInternal(), MachineType::AnyTagged(),
281       kFullWriteBarrier};
282   return access;
283 }
284 
285 // static
ForJSGeneratorObjectParametersAndRegisters()286 FieldAccess AccessBuilder::ForJSGeneratorObjectParametersAndRegisters() {
287   FieldAccess access = {
288       kTaggedBase,         JSGeneratorObject::kParametersAndRegistersOffset,
289       Handle<Name>(),      MaybeHandle<Map>(),
290       Type::Internal(),    MachineType::TaggedPointer(),
291       kPointerWriteBarrier};
292   return access;
293 }
294 
295 // static
ForJSGeneratorObjectResumeMode()296 FieldAccess AccessBuilder::ForJSGeneratorObjectResumeMode() {
297   FieldAccess access = {
298       kTaggedBase,         JSGeneratorObject::kResumeModeOffset,
299       Handle<Name>(),      MaybeHandle<Map>(),
300       Type::SignedSmall(), MachineType::TaggedSigned(),
301       kNoWriteBarrier};
302   return access;
303 }
304 
305 // static
ForJSAsyncFunctionObjectPromise()306 FieldAccess AccessBuilder::ForJSAsyncFunctionObjectPromise() {
307   FieldAccess access = {
308       kTaggedBase,         JSAsyncFunctionObject::kPromiseOffset,
309       Handle<Name>(),      MaybeHandle<Map>(),
310       Type::OtherObject(), MachineType::TaggedPointer(),
311       kPointerWriteBarrier};
312   return access;
313 }
314 
315 // static
ForJSAsyncGeneratorObjectQueue()316 FieldAccess AccessBuilder::ForJSAsyncGeneratorObjectQueue() {
317   FieldAccess access = {
318       kTaggedBase,         JSAsyncGeneratorObject::kQueueOffset,
319       Handle<Name>(),      MaybeHandle<Map>(),
320       Type::NonInternal(), MachineType::AnyTagged(),
321       kFullWriteBarrier};
322   return access;
323 }
324 
325 // static
ForJSAsyncGeneratorObjectIsAwaiting()326 FieldAccess AccessBuilder::ForJSAsyncGeneratorObjectIsAwaiting() {
327   FieldAccess access = {
328       kTaggedBase,         JSAsyncGeneratorObject::kIsAwaitingOffset,
329       Handle<Name>(),      MaybeHandle<Map>(),
330       Type::SignedSmall(), MachineType::TaggedSigned(),
331       kNoWriteBarrier};
332   return access;
333 }
334 
335 // static
ForJSArrayLength(ElementsKind elements_kind)336 FieldAccess AccessBuilder::ForJSArrayLength(ElementsKind elements_kind) {
337   TypeCache const* type_cache = TypeCache::Get();
338   FieldAccess access = {kTaggedBase,
339                         JSArray::kLengthOffset,
340                         Handle<Name>(),
341                         MaybeHandle<Map>(),
342                         type_cache->kJSArrayLengthType,
343                         MachineType::AnyTagged(),
344                         kFullWriteBarrier};
345   if (IsDoubleElementsKind(elements_kind)) {
346     access.type = type_cache->kFixedDoubleArrayLengthType;
347     access.machine_type = MachineType::TaggedSigned();
348     access.write_barrier_kind = kNoWriteBarrier;
349   } else if (IsFastElementsKind(elements_kind)) {
350     access.type = type_cache->kFixedArrayLengthType;
351     access.machine_type = MachineType::TaggedSigned();
352     access.write_barrier_kind = kNoWriteBarrier;
353   }
354   return access;
355 }
356 
357 // static
ForJSArrayBufferBitField()358 FieldAccess AccessBuilder::ForJSArrayBufferBitField() {
359   FieldAccess access = {
360       kTaggedBase,        JSArrayBuffer::kBitFieldOffset, MaybeHandle<Name>(),
361       MaybeHandle<Map>(), TypeCache::Get()->kUint8,       MachineType::Uint32(),
362       kNoWriteBarrier};
363   return access;
364 }
365 
366 // static
ForJSArrayBufferViewBuffer()367 FieldAccess AccessBuilder::ForJSArrayBufferViewBuffer() {
368   FieldAccess access = {kTaggedBase,           JSArrayBufferView::kBufferOffset,
369                         MaybeHandle<Name>(),   MaybeHandle<Map>(),
370                         Type::OtherInternal(), MachineType::TaggedPointer(),
371                         kPointerWriteBarrier};
372   return access;
373 }
374 
375 // static
ForJSArrayBufferViewByteLength()376 FieldAccess AccessBuilder::ForJSArrayBufferViewByteLength() {
377   FieldAccess access = {kTaggedBase,
378                         JSArrayBufferView::kByteLengthOffset,
379                         MaybeHandle<Name>(),
380                         MaybeHandle<Map>(),
381                         TypeCache::Get()->kJSArrayBufferViewByteLengthType,
382                         MachineType::UintPtr(),
383                         kNoWriteBarrier};
384   return access;
385 }
386 
387 // static
ForJSArrayBufferViewByteOffset()388 FieldAccess AccessBuilder::ForJSArrayBufferViewByteOffset() {
389   FieldAccess access = {kTaggedBase,
390                         JSArrayBufferView::kByteOffsetOffset,
391                         MaybeHandle<Name>(),
392                         MaybeHandle<Map>(),
393                         TypeCache::Get()->kJSArrayBufferViewByteOffsetType,
394                         MachineType::UintPtr(),
395                         kNoWriteBarrier};
396   return access;
397 }
398 
399 // static
ForJSTypedArrayLength()400 FieldAccess AccessBuilder::ForJSTypedArrayLength() {
401   FieldAccess access = {kTaggedBase,
402                         JSTypedArray::kLengthOffset,
403                         MaybeHandle<Name>(),
404                         MaybeHandle<Map>(),
405                         TypeCache::Get()->kJSTypedArrayLengthType,
406                         MachineType::UintPtr(),
407                         kNoWriteBarrier};
408   return access;
409 }
410 
411 // static
ForJSTypedArrayBasePointer()412 FieldAccess AccessBuilder::ForJSTypedArrayBasePointer() {
413   FieldAccess access = {kTaggedBase,           JSTypedArray::kBasePointerOffset,
414                         MaybeHandle<Name>(),   MaybeHandle<Map>(),
415                         Type::OtherInternal(), MachineType::AnyTagged(),
416                         kFullWriteBarrier};
417   return access;
418 }
419 
420 // static
ForJSTypedArrayExternalPointer()421 FieldAccess AccessBuilder::ForJSTypedArrayExternalPointer() {
422   FieldAccess access = {
423       kTaggedBase,
424       JSTypedArray::kExternalPointerOffset,
425       MaybeHandle<Name>(),
426       MaybeHandle<Map>(),
427 #ifdef V8_SANDBOXED_POINTERS
428       Type::SandboxedPointer(),
429       MachineType::SandboxedPointer(),
430 #else
431       Type::ExternalPointer(),
432       MachineType::Pointer(),
433 #endif
434       kNoWriteBarrier,
435       ConstFieldInfo::None(),
436       false,
437   };
438   return access;
439 }
440 
441 // static
ForJSDataViewDataPointer()442 FieldAccess AccessBuilder::ForJSDataViewDataPointer() {
443   FieldAccess access = {
444       kTaggedBase,
445       JSDataView::kDataPointerOffset,
446       MaybeHandle<Name>(),
447       MaybeHandle<Map>(),
448 #ifdef V8_SANDBOXED_POINTERS
449       Type::SandboxedPointer(),
450       MachineType::SandboxedPointer(),
451 #else
452       Type::ExternalPointer(),
453       MachineType::Pointer(),
454 #endif
455       kNoWriteBarrier,
456       ConstFieldInfo::None(),
457       false,
458   };
459   return access;
460 }
461 
462 // static
ForJSDateValue()463 FieldAccess AccessBuilder::ForJSDateValue() {
464   FieldAccess access = {kTaggedBase,
465                         JSDate::kValueOffset,
466                         MaybeHandle<Name>(),
467                         MaybeHandle<Map>(),
468                         TypeCache::Get()->kJSDateValueType,
469                         MachineType::AnyTagged(),
470                         kFullWriteBarrier};
471   return access;
472 }
473 
474 // static
ForJSDateField(JSDate::FieldIndex index)475 FieldAccess AccessBuilder::ForJSDateField(JSDate::FieldIndex index) {
476   FieldAccess access = {
477       kTaggedBase,         JSDate::kValueOffset + index * kTaggedSize,
478       MaybeHandle<Name>(), MaybeHandle<Map>(),
479       Type::Number(),      MachineType::AnyTagged(),
480       kFullWriteBarrier};
481   return access;
482 }
483 
484 // static
ForJSIteratorResultDone()485 FieldAccess AccessBuilder::ForJSIteratorResultDone() {
486   FieldAccess access = {kTaggedBase,         JSIteratorResult::kDoneOffset,
487                         MaybeHandle<Name>(), MaybeHandle<Map>(),
488                         Type::NonInternal(), MachineType::AnyTagged(),
489                         kFullWriteBarrier};
490   return access;
491 }
492 
493 // static
ForJSIteratorResultValue()494 FieldAccess AccessBuilder::ForJSIteratorResultValue() {
495   FieldAccess access = {kTaggedBase,         JSIteratorResult::kValueOffset,
496                         MaybeHandle<Name>(), MaybeHandle<Map>(),
497                         Type::NonInternal(), MachineType::AnyTagged(),
498                         kFullWriteBarrier};
499   return access;
500 }
501 
502 // static
ForJSRegExpData()503 FieldAccess AccessBuilder::ForJSRegExpData() {
504   FieldAccess access = {kTaggedBase,         JSRegExp::kDataOffset,
505                         MaybeHandle<Name>(), MaybeHandle<Map>(),
506                         Type::NonInternal(), MachineType::AnyTagged(),
507                         kFullWriteBarrier};
508   return access;
509 }
510 
511 // static
ForJSRegExpFlags()512 FieldAccess AccessBuilder::ForJSRegExpFlags() {
513   FieldAccess access = {kTaggedBase,         JSRegExp::kFlagsOffset,
514                         MaybeHandle<Name>(), MaybeHandle<Map>(),
515                         Type::NonInternal(), MachineType::AnyTagged(),
516                         kFullWriteBarrier};
517   return access;
518 }
519 
520 // static
ForJSRegExpLastIndex()521 FieldAccess AccessBuilder::ForJSRegExpLastIndex() {
522   FieldAccess access = {kTaggedBase,         JSRegExp::kLastIndexOffset,
523                         MaybeHandle<Name>(), MaybeHandle<Map>(),
524                         Type::NonInternal(), MachineType::AnyTagged(),
525                         kFullWriteBarrier};
526   return access;
527 }
528 
529 // static
ForJSRegExpSource()530 FieldAccess AccessBuilder::ForJSRegExpSource() {
531   FieldAccess access = {kTaggedBase,         JSRegExp::kSourceOffset,
532                         MaybeHandle<Name>(), MaybeHandle<Map>(),
533                         Type::NonInternal(), MachineType::AnyTagged(),
534                         kFullWriteBarrier};
535   return access;
536 }
537 
538 // static
ForFixedArrayLength()539 FieldAccess AccessBuilder::ForFixedArrayLength() {
540   FieldAccess access = {kTaggedBase,
541                         FixedArray::kLengthOffset,
542                         MaybeHandle<Name>(),
543                         MaybeHandle<Map>(),
544                         TypeCache::Get()->kFixedArrayLengthType,
545                         MachineType::TaggedSigned(),
546                         kNoWriteBarrier};
547   return access;
548 }
549 
550 // static
ForWeakFixedArrayLength()551 FieldAccess AccessBuilder::ForWeakFixedArrayLength() {
552   FieldAccess access = {kTaggedBase,
553                         WeakFixedArray::kLengthOffset,
554                         MaybeHandle<Name>(),
555                         MaybeHandle<Map>(),
556                         TypeCache::Get()->kWeakFixedArrayLengthType,
557                         MachineType::TaggedSigned(),
558                         kNoWriteBarrier};
559   return access;
560 }
561 
562 // static
ForSloppyArgumentsElementsContext()563 FieldAccess AccessBuilder::ForSloppyArgumentsElementsContext() {
564   FieldAccess access = {
565       kTaggedBase,         SloppyArgumentsElements::kContextOffset,
566       MaybeHandle<Name>(), MaybeHandle<Map>(),
567       Type::Any(),         MachineType::TaggedPointer(),
568       kPointerWriteBarrier};
569   return access;
570 }
571 
572 // static
ForSloppyArgumentsElementsArguments()573 FieldAccess AccessBuilder::ForSloppyArgumentsElementsArguments() {
574   FieldAccess access = {
575       kTaggedBase,         SloppyArgumentsElements::kArgumentsOffset,
576       MaybeHandle<Name>(), MaybeHandle<Map>(),
577       Type::Any(),         MachineType::TaggedPointer(),
578       kPointerWriteBarrier};
579   return access;
580 }
581 
582 // static
ForPropertyArrayLengthAndHash()583 FieldAccess AccessBuilder::ForPropertyArrayLengthAndHash() {
584   FieldAccess access = {
585       kTaggedBase,         PropertyArray::kLengthAndHashOffset,
586       MaybeHandle<Name>(), MaybeHandle<Map>(),
587       Type::SignedSmall(), MachineType::TaggedSigned(),
588       kNoWriteBarrier};
589   return access;
590 }
591 
592 // static
ForDescriptorArrayEnumCache()593 FieldAccess AccessBuilder::ForDescriptorArrayEnumCache() {
594   FieldAccess access = {
595       kTaggedBase,           DescriptorArray::kEnumCacheOffset,
596       Handle<Name>(),        MaybeHandle<Map>(),
597       Type::OtherInternal(), MachineType::TaggedPointer(),
598       kPointerWriteBarrier};
599   return access;
600 }
601 
602 // static
ForMapBitField()603 FieldAccess AccessBuilder::ForMapBitField() {
604   FieldAccess access = {
605       kTaggedBase,        Map::kBitFieldOffset,     Handle<Name>(),
606       MaybeHandle<Map>(), TypeCache::Get()->kUint8, MachineType::Uint8(),
607       kNoWriteBarrier};
608   return access;
609 }
610 
611 // static
ForMapBitField2()612 FieldAccess AccessBuilder::ForMapBitField2() {
613   FieldAccess access = {
614       kTaggedBase,        Map::kBitField2Offset,    Handle<Name>(),
615       MaybeHandle<Map>(), TypeCache::Get()->kUint8, MachineType::Uint8(),
616       kNoWriteBarrier};
617   return access;
618 }
619 
620 // static
ForMapBitField3()621 FieldAccess AccessBuilder::ForMapBitField3() {
622   FieldAccess access = {
623       kTaggedBase,        Map::kBitField3Offset,    Handle<Name>(),
624       MaybeHandle<Map>(), TypeCache::Get()->kInt32, MachineType::Int32(),
625       kNoWriteBarrier};
626   return access;
627 }
628 
629 // static
ForMapDescriptors()630 FieldAccess AccessBuilder::ForMapDescriptors() {
631   FieldAccess access = {kTaggedBase,           Map::kInstanceDescriptorsOffset,
632                         Handle<Name>(),        MaybeHandle<Map>(),
633                         Type::OtherInternal(), MachineType::TaggedPointer(),
634                         kPointerWriteBarrier};
635   return access;
636 }
637 
638 // static
ForMapInstanceType()639 FieldAccess AccessBuilder::ForMapInstanceType() {
640   FieldAccess access = {
641       kTaggedBase,        Map::kInstanceTypeOffset,  Handle<Name>(),
642       MaybeHandle<Map>(), TypeCache::Get()->kUint16, MachineType::Uint16(),
643       kNoWriteBarrier};
644   return access;
645 }
646 
647 // static
ForMapPrototype()648 FieldAccess AccessBuilder::ForMapPrototype() {
649   FieldAccess access = {kTaggedBase,         Map::kPrototypeOffset,
650                         Handle<Name>(),      MaybeHandle<Map>(),
651                         Type::Any(),         MachineType::TaggedPointer(),
652                         kPointerWriteBarrier};
653   return access;
654 }
655 
656 // static
ForMapNativeContext()657 FieldAccess AccessBuilder::ForMapNativeContext() {
658   FieldAccess access = {
659       kTaggedBase,         Map::kConstructorOrBackPointerOrNativeContextOffset,
660       Handle<Name>(),      MaybeHandle<Map>(),
661       Type::Any(),         MachineType::TaggedPointer(),
662       kPointerWriteBarrier};
663   return access;
664 }
665 
666 // static
ForModuleRegularExports()667 FieldAccess AccessBuilder::ForModuleRegularExports() {
668   FieldAccess access = {
669       kTaggedBase,           SourceTextModule::kRegularExportsOffset,
670       Handle<Name>(),        MaybeHandle<Map>(),
671       Type::OtherInternal(), MachineType::TaggedPointer(),
672       kPointerWriteBarrier};
673   return access;
674 }
675 
676 // static
ForModuleRegularImports()677 FieldAccess AccessBuilder::ForModuleRegularImports() {
678   FieldAccess access = {
679       kTaggedBase,           SourceTextModule::kRegularImportsOffset,
680       Handle<Name>(),        MaybeHandle<Map>(),
681       Type::OtherInternal(), MachineType::TaggedPointer(),
682       kPointerWriteBarrier};
683   return access;
684 }
685 
686 // static
ForNameRawHashField()687 FieldAccess AccessBuilder::ForNameRawHashField() {
688   FieldAccess access = {kTaggedBase,        Name::kRawHashFieldOffset,
689                         Handle<Name>(),     MaybeHandle<Map>(),
690                         Type::Unsigned32(), MachineType::Uint32(),
691                         kNoWriteBarrier};
692   return access;
693 }
694 
695 // static
ForStringLength()696 FieldAccess AccessBuilder::ForStringLength() {
697   FieldAccess access = {kTaggedBase,
698                         String::kLengthOffset,
699                         Handle<Name>(),
700                         MaybeHandle<Map>(),
701                         TypeCache::Get()->kStringLengthType,
702                         MachineType::Uint32(),
703                         kNoWriteBarrier};
704   return access;
705 }
706 
707 // static
ForConsStringFirst()708 FieldAccess AccessBuilder::ForConsStringFirst() {
709   FieldAccess access = {kTaggedBase,         ConsString::kFirstOffset,
710                         Handle<Name>(),      MaybeHandle<Map>(),
711                         Type::String(),      MachineType::TaggedPointer(),
712                         kPointerWriteBarrier};
713   return access;
714 }
715 
716 // static
ForConsStringSecond()717 FieldAccess AccessBuilder::ForConsStringSecond() {
718   FieldAccess access = {kTaggedBase,         ConsString::kSecondOffset,
719                         Handle<Name>(),      MaybeHandle<Map>(),
720                         Type::String(),      MachineType::TaggedPointer(),
721                         kPointerWriteBarrier};
722   return access;
723 }
724 
725 // static
ForThinStringActual()726 FieldAccess AccessBuilder::ForThinStringActual() {
727   FieldAccess access = {kTaggedBase,         ThinString::kActualOffset,
728                         Handle<Name>(),      MaybeHandle<Map>(),
729                         Type::String(),      MachineType::TaggedPointer(),
730                         kPointerWriteBarrier};
731   return access;
732 }
733 
734 // static
ForSlicedStringOffset()735 FieldAccess AccessBuilder::ForSlicedStringOffset() {
736   FieldAccess access = {kTaggedBase,         SlicedString::kOffsetOffset,
737                         Handle<Name>(),      MaybeHandle<Map>(),
738                         Type::SignedSmall(), MachineType::TaggedSigned(),
739                         kNoWriteBarrier};
740   return access;
741 }
742 
743 // static
ForSlicedStringParent()744 FieldAccess AccessBuilder::ForSlicedStringParent() {
745   FieldAccess access = {kTaggedBase,         SlicedString::kParentOffset,
746                         Handle<Name>(),      MaybeHandle<Map>(),
747                         Type::String(),      MachineType::TaggedPointer(),
748                         kPointerWriteBarrier};
749   return access;
750 }
751 
752 // static
ForExternalStringResourceData()753 FieldAccess AccessBuilder::ForExternalStringResourceData() {
754   FieldAccess access = {
755       kTaggedBase,
756       ExternalString::kResourceDataOffset,
757       Handle<Name>(),
758       MaybeHandle<Map>(),
759       Type::ExternalPointer(),
760       MachineType::Pointer(),
761       kNoWriteBarrier,
762       ConstFieldInfo::None(),
763       false,
764 #ifdef V8_SANDBOXED_EXTERNAL_POINTERS
765       kExternalStringResourceDataTag,
766 #endif
767   };
768   return access;
769 }
770 
771 // static
ForSeqOneByteStringCharacter()772 ElementAccess AccessBuilder::ForSeqOneByteStringCharacter() {
773   ElementAccess access = {kTaggedBase, SeqOneByteString::kHeaderSize,
774                           TypeCache::Get()->kUint8, MachineType::Uint8(),
775                           kNoWriteBarrier};
776   return access;
777 }
778 
779 // static
ForSeqTwoByteStringCharacter()780 ElementAccess AccessBuilder::ForSeqTwoByteStringCharacter() {
781   ElementAccess access = {kTaggedBase, SeqTwoByteString::kHeaderSize,
782                           TypeCache::Get()->kUint16, MachineType::Uint16(),
783                           kNoWriteBarrier};
784   return access;
785 }
786 
787 // static
ForJSGlobalProxyNativeContext()788 FieldAccess AccessBuilder::ForJSGlobalProxyNativeContext() {
789   FieldAccess access = {
790       kTaggedBase,         JSGlobalProxy::kNativeContextOffset,
791       Handle<Name>(),      MaybeHandle<Map>(),
792       Type::Internal(),    MachineType::TaggedPointer(),
793       kPointerWriteBarrier};
794   return access;
795 }
796 
797 // static
ForJSArrayIteratorIteratedObject()798 FieldAccess AccessBuilder::ForJSArrayIteratorIteratedObject() {
799   FieldAccess access = {
800       kTaggedBase,         JSArrayIterator::kIteratedObjectOffset,
801       Handle<Name>(),      MaybeHandle<Map>(),
802       Type::Receiver(),    MachineType::TaggedPointer(),
803       kPointerWriteBarrier};
804   return access;
805 }
806 
807 // static
ForJSArrayIteratorNextIndex()808 FieldAccess AccessBuilder::ForJSArrayIteratorNextIndex() {
809   // In generic case, cap to 2^53-1 (per ToLength() in spec) via
810   // kPositiveSafeInteger
811   FieldAccess access = {kTaggedBase,
812                         JSArrayIterator::kNextIndexOffset,
813                         Handle<Name>(),
814                         MaybeHandle<Map>(),
815                         TypeCache::Get()->kPositiveSafeInteger,
816                         MachineType::AnyTagged(),
817                         kFullWriteBarrier};
818   return access;
819 }
820 
821 // static
ForJSArrayIteratorKind()822 FieldAccess AccessBuilder::ForJSArrayIteratorKind() {
823   FieldAccess access = {kTaggedBase,
824                         JSArrayIterator::kKindOffset,
825                         Handle<Name>(),
826                         MaybeHandle<Map>(),
827                         TypeCache::Get()->kJSArrayIteratorKindType,
828                         MachineType::TaggedSigned(),
829                         kNoWriteBarrier};
830   return access;
831 }
832 
833 // static
ForJSStringIteratorString()834 FieldAccess AccessBuilder::ForJSStringIteratorString() {
835   FieldAccess access = {kTaggedBase,         JSStringIterator::kStringOffset,
836                         Handle<Name>(),      MaybeHandle<Map>(),
837                         Type::String(),      MachineType::TaggedPointer(),
838                         kPointerWriteBarrier};
839   return access;
840 }
841 
842 // static
ForJSStringIteratorIndex()843 FieldAccess AccessBuilder::ForJSStringIteratorIndex() {
844   FieldAccess access = {kTaggedBase,
845                         JSStringIterator::kIndexOffset,
846                         Handle<Name>(),
847                         MaybeHandle<Map>(),
848                         TypeCache::Get()->kStringLengthType,
849                         MachineType::TaggedSigned(),
850                         kNoWriteBarrier};
851   return access;
852 }
853 
854 // static
ForArgumentsLength()855 FieldAccess AccessBuilder::ForArgumentsLength() {
856   constexpr int offset = JSStrictArgumentsObject::kLengthOffset;
857   STATIC_ASSERT(offset == JSSloppyArgumentsObject::kLengthOffset);
858   FieldAccess access = {kTaggedBase,         offset,
859                         Handle<Name>(),      MaybeHandle<Map>(),
860                         Type::NonInternal(), MachineType::AnyTagged(),
861                         kFullWriteBarrier};
862   return access;
863 }
864 
865 // static
ForArgumentsCallee()866 FieldAccess AccessBuilder::ForArgumentsCallee() {
867   FieldAccess access = {
868       kTaggedBase,         JSSloppyArgumentsObject::kCalleeOffset,
869       Handle<Name>(),      MaybeHandle<Map>(),
870       Type::NonInternal(), MachineType::AnyTagged(),
871       kFullWriteBarrier};
872   return access;
873 }
874 
875 // static
ForFixedArraySlot(size_t index,WriteBarrierKind write_barrier_kind)876 FieldAccess AccessBuilder::ForFixedArraySlot(
877     size_t index, WriteBarrierKind write_barrier_kind) {
878   int offset = FixedArray::OffsetOfElementAt(static_cast<int>(index));
879   FieldAccess access = {kTaggedBase,       offset,
880                         Handle<Name>(),    MaybeHandle<Map>(),
881                         Type::Any(),       MachineType::AnyTagged(),
882                         write_barrier_kind};
883   return access;
884 }
885 
886 // static
ForFeedbackVectorSlot(int index)887 FieldAccess AccessBuilder::ForFeedbackVectorSlot(int index) {
888   int offset = FeedbackVector::OffsetOfElementAt(index);
889   FieldAccess access = {kTaggedBase,      offset,
890                         Handle<Name>(),   MaybeHandle<Map>(),
891                         Type::Any(),      MachineType::AnyTagged(),
892                         kFullWriteBarrier};
893   return access;
894 }
895 
896 // static
ForWeakFixedArraySlot(int index)897 FieldAccess AccessBuilder::ForWeakFixedArraySlot(int index) {
898   int offset = WeakFixedArray::OffsetOfElementAt(index);
899   FieldAccess access = {kTaggedBase,      offset,
900                         Handle<Name>(),   MaybeHandle<Map>(),
901                         Type::Any(),      MachineType::AnyTagged(),
902                         kFullWriteBarrier};
903   return access;
904 }
905 // static
ForCellValue()906 FieldAccess AccessBuilder::ForCellValue() {
907   FieldAccess access = {kTaggedBase,      Cell::kValueOffset,
908                         Handle<Name>(),   MaybeHandle<Map>(),
909                         Type::Any(),      MachineType::AnyTagged(),
910                         kFullWriteBarrier};
911   return access;
912 }
913 
914 // static
ForScopeInfoFlags()915 FieldAccess AccessBuilder::ForScopeInfoFlags() {
916   FieldAccess access = {kTaggedBase,         ScopeInfo::kFlagsOffset,
917                         MaybeHandle<Name>(), MaybeHandle<Map>(),
918                         Type::SignedSmall(), MachineType::TaggedSigned(),
919                         kNoWriteBarrier};
920   return access;
921 }
922 
923 // static
ForContextSlot(size_t index)924 FieldAccess AccessBuilder::ForContextSlot(size_t index) {
925   int offset = Context::OffsetOfElementAt(static_cast<int>(index));
926   DCHECK_EQ(offset,
927             Context::SlotOffset(static_cast<int>(index)) + kHeapObjectTag);
928   FieldAccess access = {kTaggedBase,      offset,
929                         Handle<Name>(),   MaybeHandle<Map>(),
930                         Type::Any(),      MachineType::AnyTagged(),
931                         kFullWriteBarrier};
932   return access;
933 }
934 
935 // static
ForContextSlotKnownPointer(size_t index)936 FieldAccess AccessBuilder::ForContextSlotKnownPointer(size_t index) {
937   int offset = Context::OffsetOfElementAt(static_cast<int>(index));
938   DCHECK_EQ(offset,
939             Context::SlotOffset(static_cast<int>(index)) + kHeapObjectTag);
940   FieldAccess access = {kTaggedBase,         offset,
941                         Handle<Name>(),      MaybeHandle<Map>(),
942                         Type::Any(),         MachineType::TaggedPointer(),
943                         kPointerWriteBarrier};
944   return access;
945 }
946 
947 // static
ForFixedArrayElement()948 ElementAccess AccessBuilder::ForFixedArrayElement() {
949   ElementAccess access = {kTaggedBase, FixedArray::kHeaderSize, Type::Any(),
950                           MachineType::AnyTagged(), kFullWriteBarrier};
951   return access;
952 }
953 
954 // static
ForWeakFixedArrayElement()955 ElementAccess AccessBuilder::ForWeakFixedArrayElement() {
956   ElementAccess const access = {kTaggedBase, WeakFixedArray::kHeaderSize,
957                                 Type::Any(), MachineType::AnyTagged(),
958                                 kFullWriteBarrier};
959   return access;
960 }
961 
962 // static
ForSloppyArgumentsElementsMappedEntry()963 ElementAccess AccessBuilder::ForSloppyArgumentsElementsMappedEntry() {
964   ElementAccess access = {
965       kTaggedBase, SloppyArgumentsElements::kMappedEntriesOffset, Type::Any(),
966       MachineType::AnyTagged(), kFullWriteBarrier};
967   return access;
968 }
969 
970 // statics
ForFixedArrayElement(ElementsKind kind)971 ElementAccess AccessBuilder::ForFixedArrayElement(ElementsKind kind) {
972   ElementAccess access = {kTaggedBase, FixedArray::kHeaderSize, Type::Any(),
973                           MachineType::AnyTagged(), kFullWriteBarrier};
974   switch (kind) {
975     case PACKED_SMI_ELEMENTS:
976       access.type = Type::SignedSmall();
977       access.machine_type = MachineType::TaggedSigned();
978       access.write_barrier_kind = kNoWriteBarrier;
979       break;
980     case HOLEY_SMI_ELEMENTS:
981       access.type = TypeCache::Get()->kHoleySmi;
982       break;
983     case PACKED_ELEMENTS:
984       access.type = Type::NonInternal();
985       break;
986     case HOLEY_ELEMENTS:
987       break;
988     case PACKED_DOUBLE_ELEMENTS:
989       access.type = Type::Number();
990       access.write_barrier_kind = kNoWriteBarrier;
991       access.machine_type = MachineType::Float64();
992       break;
993     case HOLEY_DOUBLE_ELEMENTS:
994       access.type = Type::NumberOrHole();
995       access.write_barrier_kind = kNoWriteBarrier;
996       access.machine_type = MachineType::Float64();
997       break;
998     default:
999       UNREACHABLE();
1000   }
1001   return access;
1002 }
1003 
1004 // static
ForStackArgument()1005 ElementAccess AccessBuilder::ForStackArgument() {
1006   ElementAccess access = {
1007       kUntaggedBase,
1008       CommonFrameConstants::kFixedFrameSizeAboveFp - kSystemPointerSize,
1009       Type::NonInternal(), MachineType::Pointer(),
1010       WriteBarrierKind::kNoWriteBarrier};
1011   return access;
1012 }
1013 
1014 // static
ForFixedDoubleArrayElement()1015 ElementAccess AccessBuilder::ForFixedDoubleArrayElement() {
1016   ElementAccess access = {kTaggedBase, FixedDoubleArray::kHeaderSize,
1017                           TypeCache::Get()->kFloat64, MachineType::Float64(),
1018                           kNoWriteBarrier};
1019   return access;
1020 }
1021 
1022 // static
ForEnumCacheKeys()1023 FieldAccess AccessBuilder::ForEnumCacheKeys() {
1024   FieldAccess access = {kTaggedBase,           EnumCache::kKeysOffset,
1025                         MaybeHandle<Name>(),   MaybeHandle<Map>(),
1026                         Type::OtherInternal(), MachineType::TaggedPointer(),
1027                         kPointerWriteBarrier};
1028   return access;
1029 }
1030 
1031 // static
ForEnumCacheIndices()1032 FieldAccess AccessBuilder::ForEnumCacheIndices() {
1033   FieldAccess access = {kTaggedBase,           EnumCache::kIndicesOffset,
1034                         MaybeHandle<Name>(),   MaybeHandle<Map>(),
1035                         Type::OtherInternal(), MachineType::TaggedPointer(),
1036                         kPointerWriteBarrier};
1037   return access;
1038 }
1039 
1040 // static
ForTypedArrayElement(ExternalArrayType type,bool is_external)1041 ElementAccess AccessBuilder::ForTypedArrayElement(ExternalArrayType type,
1042                                                   bool is_external) {
1043   BaseTaggedness taggedness = is_external ? kUntaggedBase : kTaggedBase;
1044   int header_size = is_external ? 0 : ByteArray::kHeaderSize;
1045   switch (type) {
1046     case kExternalInt8Array: {
1047       ElementAccess access = {taggedness, header_size, Type::Signed32(),
1048                               MachineType::Int8(), kNoWriteBarrier};
1049       return access;
1050     }
1051     case kExternalUint8Array:
1052     case kExternalUint8ClampedArray: {
1053       ElementAccess access = {taggedness, header_size, Type::Unsigned32(),
1054                               MachineType::Uint8(), kNoWriteBarrier};
1055       return access;
1056     }
1057     case kExternalInt16Array: {
1058       ElementAccess access = {taggedness, header_size, Type::Signed32(),
1059                               MachineType::Int16(), kNoWriteBarrier};
1060       return access;
1061     }
1062     case kExternalUint16Array: {
1063       ElementAccess access = {taggedness, header_size, Type::Unsigned32(),
1064                               MachineType::Uint16(), kNoWriteBarrier};
1065       return access;
1066     }
1067     case kExternalInt32Array: {
1068       ElementAccess access = {taggedness, header_size, Type::Signed32(),
1069                               MachineType::Int32(), kNoWriteBarrier};
1070       return access;
1071     }
1072     case kExternalUint32Array: {
1073       ElementAccess access = {taggedness, header_size, Type::Unsigned32(),
1074                               MachineType::Uint32(), kNoWriteBarrier};
1075       return access;
1076     }
1077     case kExternalFloat32Array: {
1078       ElementAccess access = {taggedness, header_size, Type::Number(),
1079                               MachineType::Float32(), kNoWriteBarrier};
1080       return access;
1081     }
1082     case kExternalFloat64Array: {
1083       ElementAccess access = {taggedness, header_size, Type::Number(),
1084                               MachineType::Float64(), kNoWriteBarrier};
1085       return access;
1086     }
1087     case kExternalBigInt64Array:
1088     case kExternalBigUint64Array:
1089       // TODO(neis/jkummerow): Define appropriate types.
1090       UNIMPLEMENTED();
1091   }
1092   UNREACHABLE();
1093 }
1094 
1095 // static
ForHashTableBaseNumberOfElements()1096 FieldAccess AccessBuilder::ForHashTableBaseNumberOfElements() {
1097   FieldAccess access = {
1098       kTaggedBase,
1099       FixedArray::OffsetOfElementAt(HashTableBase::kNumberOfElementsIndex),
1100       MaybeHandle<Name>(),
1101       MaybeHandle<Map>(),
1102       Type::SignedSmall(),
1103       MachineType::TaggedSigned(),
1104       kNoWriteBarrier};
1105   return access;
1106 }
1107 
1108 // static
ForHashTableBaseNumberOfDeletedElement()1109 FieldAccess AccessBuilder::ForHashTableBaseNumberOfDeletedElement() {
1110   FieldAccess access = {kTaggedBase,
1111                         FixedArray::OffsetOfElementAt(
1112                             HashTableBase::kNumberOfDeletedElementsIndex),
1113                         MaybeHandle<Name>(),
1114                         MaybeHandle<Map>(),
1115                         Type::SignedSmall(),
1116                         MachineType::TaggedSigned(),
1117                         kNoWriteBarrier};
1118   return access;
1119 }
1120 
1121 // static
ForHashTableBaseCapacity()1122 FieldAccess AccessBuilder::ForHashTableBaseCapacity() {
1123   FieldAccess access = {
1124       kTaggedBase,
1125       FixedArray::OffsetOfElementAt(HashTableBase::kCapacityIndex),
1126       MaybeHandle<Name>(),
1127       MaybeHandle<Map>(),
1128       Type::SignedSmall(),
1129       MachineType::TaggedSigned(),
1130       kNoWriteBarrier};
1131   return access;
1132 }
1133 
1134 // static
ForOrderedHashMapOrSetNextTable()1135 FieldAccess AccessBuilder::ForOrderedHashMapOrSetNextTable() {
1136   // TODO(turbofan): This will be redundant with the HashTableBase
1137   // methods above once the hash table unification is done.
1138   STATIC_ASSERT(OrderedHashMap::NextTableOffset() ==
1139                 OrderedHashSet::NextTableOffset());
1140   FieldAccess const access = {
1141       kTaggedBase,         OrderedHashMap::NextTableOffset(),
1142       MaybeHandle<Name>(), MaybeHandle<Map>(),
1143       Type::Any(),         MachineType::AnyTagged(),
1144       kFullWriteBarrier};
1145   return access;
1146 }
1147 
1148 // static
ForOrderedHashMapOrSetNumberOfBuckets()1149 FieldAccess AccessBuilder::ForOrderedHashMapOrSetNumberOfBuckets() {
1150   // TODO(turbofan): This will be redundant with the HashTableBase
1151   // methods above once the hash table unification is done.
1152   STATIC_ASSERT(OrderedHashMap::NumberOfBucketsOffset() ==
1153                 OrderedHashSet::NumberOfBucketsOffset());
1154   FieldAccess const access = {kTaggedBase,
1155                               OrderedHashMap::NumberOfBucketsOffset(),
1156                               MaybeHandle<Name>(),
1157                               MaybeHandle<Map>(),
1158                               TypeCache::Get()->kFixedArrayLengthType,
1159                               MachineType::TaggedSigned(),
1160                               kNoWriteBarrier};
1161   return access;
1162 }
1163 
1164 // static
ForOrderedHashMapOrSetNumberOfDeletedElements()1165 FieldAccess AccessBuilder::ForOrderedHashMapOrSetNumberOfDeletedElements() {
1166   // TODO(turbofan): This will be redundant with the HashTableBase
1167   // methods above once the hash table unification is done.
1168   STATIC_ASSERT(OrderedHashMap::NumberOfDeletedElementsOffset() ==
1169                 OrderedHashSet::NumberOfDeletedElementsOffset());
1170   FieldAccess const access = {kTaggedBase,
1171                               OrderedHashMap::NumberOfDeletedElementsOffset(),
1172                               MaybeHandle<Name>(),
1173                               MaybeHandle<Map>(),
1174                               TypeCache::Get()->kFixedArrayLengthType,
1175                               MachineType::TaggedSigned(),
1176                               kNoWriteBarrier};
1177   return access;
1178 }
1179 
1180 // static
ForOrderedHashMapOrSetNumberOfElements()1181 FieldAccess AccessBuilder::ForOrderedHashMapOrSetNumberOfElements() {
1182   // TODO(turbofan): This will be redundant with the HashTableBase
1183   // methods above once the hash table unification is done.
1184   STATIC_ASSERT(OrderedHashMap::NumberOfElementsOffset() ==
1185                 OrderedHashSet::NumberOfElementsOffset());
1186   FieldAccess const access = {kTaggedBase,
1187                               OrderedHashMap::NumberOfElementsOffset(),
1188                               MaybeHandle<Name>(),
1189                               MaybeHandle<Map>(),
1190                               TypeCache::Get()->kFixedArrayLengthType,
1191                               MachineType::TaggedSigned(),
1192                               kNoWriteBarrier};
1193   return access;
1194 }
1195 
1196 // static
ForOrderedHashMapEntryValue()1197 ElementAccess AccessBuilder::ForOrderedHashMapEntryValue() {
1198   ElementAccess const access = {kTaggedBase,
1199                                 OrderedHashMap::HashTableStartOffset() +
1200                                     OrderedHashMap::kValueOffset * kTaggedSize,
1201                                 Type::Any(), MachineType::AnyTagged(),
1202                                 kFullWriteBarrier};
1203   return access;
1204 }
1205 
1206 // static
ForDictionaryNextEnumerationIndex()1207 FieldAccess AccessBuilder::ForDictionaryNextEnumerationIndex() {
1208   FieldAccess access = {
1209       kTaggedBase,
1210       FixedArray::OffsetOfElementAt(NameDictionary::kNextEnumerationIndexIndex),
1211       MaybeHandle<Name>(),
1212       MaybeHandle<Map>(),
1213       Type::SignedSmall(),
1214       MachineType::TaggedSigned(),
1215       kNoWriteBarrier};
1216   return access;
1217 }
1218 
1219 // static
ForDictionaryObjectHashIndex()1220 FieldAccess AccessBuilder::ForDictionaryObjectHashIndex() {
1221   FieldAccess access = {
1222       kTaggedBase,
1223       FixedArray::OffsetOfElementAt(NameDictionary::kObjectHashIndex),
1224       MaybeHandle<Name>(),
1225       MaybeHandle<Map>(),
1226       Type::SignedSmall(),
1227       MachineType::TaggedSigned(),
1228       kNoWriteBarrier};
1229   return access;
1230 }
1231 
1232 // static
ForFeedbackCellInterruptBudget()1233 FieldAccess AccessBuilder::ForFeedbackCellInterruptBudget() {
1234   FieldAccess access = {kTaggedBase,
1235                         FeedbackCell::kInterruptBudgetOffset,
1236                         Handle<Name>(),
1237                         MaybeHandle<Map>(),
1238                         TypeCache::Get()->kInt32,
1239                         MachineType::Int32(),
1240                         kNoWriteBarrier};
1241   return access;
1242 }
1243 
1244 // static
ForFeedbackVectorInvocationCount()1245 FieldAccess AccessBuilder::ForFeedbackVectorInvocationCount() {
1246   FieldAccess access = {kTaggedBase,
1247                         FeedbackVector::kInvocationCountOffset,
1248                         Handle<Name>(),
1249                         MaybeHandle<Map>(),
1250                         TypeCache::Get()->kInt32,
1251                         MachineType::Int32(),
1252                         kNoWriteBarrier};
1253   return access;
1254 }
1255 
1256 // static
ForFeedbackVectorFlags()1257 FieldAccess AccessBuilder::ForFeedbackVectorFlags() {
1258   FieldAccess access = {
1259       kTaggedBase,        FeedbackVector::kFlagsOffset, Handle<Name>(),
1260       MaybeHandle<Map>(), TypeCache::Get()->kUint32,    MachineType::Uint32(),
1261       kNoWriteBarrier};
1262   return access;
1263 }
1264 
1265 // static
ForFeedbackVectorClosureFeedbackCellArray()1266 FieldAccess AccessBuilder::ForFeedbackVectorClosureFeedbackCellArray() {
1267   FieldAccess access = {
1268       kTaggedBase,      FeedbackVector::kClosureFeedbackCellArrayOffset,
1269       Handle<Name>(),   MaybeHandle<Map>(),
1270       Type::Any(),      MachineType::TaggedPointer(),
1271       kFullWriteBarrier};
1272   return access;
1273 }
1274 
1275 }  // namespace compiler
1276 }  // namespace internal
1277 }  // namespace v8
1278