access-builder.cc 43.6 KB
Newer Older
1 2 3 4 5
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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
#include "torque-generated/exported-class-definitions-tq.h"
21 22 23 24 25

namespace v8 {
namespace internal {
namespace compiler {

26
// static
27 28 29
FieldAccess AccessBuilder::ForExternalIntPtr() {
  FieldAccess access = {kUntaggedBase,      0,           MaybeHandle<Name>(),
                        MaybeHandle<Map>(), Type::Any(), MachineType::IntPtr(),
30
                        kNoWriteBarrier};
31 32 33
  return access;
}

34 35
// static
FieldAccess AccessBuilder::ForMap() {
36 37 38 39
  FieldAccess access = {kTaggedBase,           HeapObject::kMapOffset,
                        MaybeHandle<Name>(),   MaybeHandle<Map>(),
                        Type::OtherInternal(), MachineType::TaggedPointer(),
                        kMapWriteBarrier};
40
  return access;
41 42
}

43 44
// static
FieldAccess AccessBuilder::ForHeapNumberValue() {
45
  FieldAccess access = {
46 47
      kTaggedBase,        HeapNumber::kValueOffset,   MaybeHandle<Name>(),
      MaybeHandle<Map>(), TypeCache::Get()->kFloat64, MachineType::Float64(),
48
      kNoWriteBarrier};
49 50 51
  return access;
}

52 53 54
// static
FieldAccess AccessBuilder::ForBigIntBitfield() {
  FieldAccess access = {
55 56
      kTaggedBase,        BigInt::kBitfieldOffset,  MaybeHandle<Name>(),
      MaybeHandle<Map>(), TypeCache::Get()->kInt32, MachineType::Uint32(),
57 58 59
      kNoWriteBarrier};
  return access;
}
60

61 62 63 64 65 66 67 68 69 70
// static
FieldAccess AccessBuilder::ForBigIntOptionalPadding() {
  DCHECK_EQ(FIELD_SIZE(BigInt::kOptionalPaddingOffset), 4);
  FieldAccess access = {
      kTaggedBase,        BigInt::kOptionalPaddingOffset, MaybeHandle<Name>(),
      MaybeHandle<Map>(), TypeCache::Get()->kInt32,       MachineType::Uint32(),
      kNoWriteBarrier};
  return access;
}

71 72
// static
FieldAccess AccessBuilder::ForBigIntLeastSignificantDigit64() {
73
  DCHECK_EQ(BigInt::SizeFor(1) - BigInt::SizeFor(0), 8);
74 75 76 77 78 79 80
  FieldAccess access = {
      kTaggedBase,        BigInt::kDigitsOffset,        MaybeHandle<Name>(),
      MaybeHandle<Map>(), TypeCache::Get()->kBigUint64, MachineType::Uint64(),
      kNoWriteBarrier};
  return access;
}

81
// static
82
FieldAccess AccessBuilder::ForJSObjectPropertiesOrHash() {
83 84 85 86
  FieldAccess access = {kTaggedBase,         JSObject::kPropertiesOrHashOffset,
                        MaybeHandle<Name>(), MaybeHandle<Map>(),
                        Type::Any(),         MachineType::AnyTagged(),
                        kFullWriteBarrier,   LoadSensitivity::kCritical};
87
  return access;
88 89
}

90 91
// static
FieldAccess AccessBuilder::ForJSObjectPropertiesOrHashKnownPointer() {
92 93 94 95
  FieldAccess access = {kTaggedBase,          JSObject::kPropertiesOrHashOffset,
                        MaybeHandle<Name>(),  MaybeHandle<Map>(),
                        Type::Any(),          MachineType::TaggedPointer(),
                        kPointerWriteBarrier, LoadSensitivity::kCritical};
96 97 98
  return access;
}

99 100
// static
FieldAccess AccessBuilder::ForJSObjectElements() {
101 102 103 104
  FieldAccess access = {kTaggedBase,          JSObject::kElementsOffset,
                        MaybeHandle<Name>(),  MaybeHandle<Map>(),
                        Type::Internal(),     MachineType::TaggedPointer(),
                        kPointerWriteBarrier, LoadSensitivity::kCritical};
105
  return access;
106 107
}

108
// static
109
FieldAccess AccessBuilder::ForJSObjectInObjectProperty(const MapRef& map,
110
                                                       int index) {
111
  int const offset = map.GetInObjectPropertyOffset(index);
112 113 114 115
  FieldAccess access = {kTaggedBase,         offset,
                        MaybeHandle<Name>(), MaybeHandle<Map>(),
                        Type::NonInternal(), MachineType::AnyTagged(),
                        kFullWriteBarrier};
116 117 118
  return access;
}

119 120 121
// static
FieldAccess AccessBuilder::ForJSObjectOffset(
    int offset, WriteBarrierKind write_barrier_kind) {
122 123 124 125
  FieldAccess access = {kTaggedBase,         offset,
                        MaybeHandle<Name>(), MaybeHandle<Map>(),
                        Type::NonInternal(), MachineType::AnyTagged(),
                        write_barrier_kind};
126 127
  return access;
}
128

129 130
// static
FieldAccess AccessBuilder::ForJSCollectionTable() {
131 132 133 134
  FieldAccess access = {kTaggedBase,           JSCollection::kTableOffset,
                        MaybeHandle<Name>(),   MaybeHandle<Map>(),
                        Type::OtherInternal(), MachineType::TaggedPointer(),
                        kPointerWriteBarrier};
135 136 137
  return access;
}

138 139 140 141 142
// static
FieldAccess AccessBuilder::ForJSCollectionIteratorTable() {
  FieldAccess access = {
      kTaggedBase,           JSCollectionIterator::kTableOffset,
      MaybeHandle<Name>(),   MaybeHandle<Map>(),
143
      Type::OtherInternal(), MachineType::TaggedPointer(),
144 145 146 147 148 149 150 151 152 153
      kPointerWriteBarrier};
  return access;
}

// static
FieldAccess AccessBuilder::ForJSCollectionIteratorIndex() {
  FieldAccess access = {kTaggedBase,
                        JSCollectionIterator::kIndexOffset,
                        MaybeHandle<Name>(),
                        MaybeHandle<Map>(),
154
                        TypeCache::Get()->kFixedArrayLengthType,
155
                        MachineType::TaggedSigned(),
156 157 158 159
                        kNoWriteBarrier};
  return access;
}

160 161
// static
FieldAccess AccessBuilder::ForJSFunctionPrototypeOrInitialMap() {
162 163 164
  FieldAccess access = {
      kTaggedBase,         JSFunction::kPrototypeOrInitialMapOffset,
      MaybeHandle<Name>(), MaybeHandle<Map>(),
165
      Type::Any(),         MachineType::TaggedPointer(),
166
      kPointerWriteBarrier};
167 168 169
  return access;
}

170 171
// static
FieldAccess AccessBuilder::ForJSFunctionContext() {
172 173 174 175
  FieldAccess access = {kTaggedBase,         JSFunction::kContextOffset,
                        MaybeHandle<Name>(), MaybeHandle<Map>(),
                        Type::Internal(),    MachineType::TaggedPointer(),
                        kPointerWriteBarrier};
176
  return access;
177 178
}

179 180
// static
FieldAccess AccessBuilder::ForJSFunctionSharedFunctionInfo() {
181 182 183
  FieldAccess access = {
      kTaggedBase,           JSFunction::kSharedFunctionInfoOffset,
      Handle<Name>(),        MaybeHandle<Map>(),
184
      Type::OtherInternal(), MachineType::TaggedPointer(),
185
      kPointerWriteBarrier};
186
  return access;
187 188
}

189
// static
190
FieldAccess AccessBuilder::ForJSFunctionFeedbackCell() {
191 192 193 194
  FieldAccess access = {kTaggedBase,         JSFunction::kFeedbackCellOffset,
                        Handle<Name>(),      MaybeHandle<Map>(),
                        Type::Internal(),    MachineType::TaggedPointer(),
                        kPointerWriteBarrier};
195 196 197 198
  return access;
}

// static
199
FieldAccess AccessBuilder::ForJSFunctionCode() {
200 201 202 203
  FieldAccess access = {kTaggedBase,           JSFunction::kCodeOffset,
                        Handle<Name>(),        MaybeHandle<Map>(),
                        Type::OtherInternal(), MachineType::TaggedPointer(),
                        kPointerWriteBarrier};
204 205 206
  return access;
}

207 208 209 210 211
// static
FieldAccess AccessBuilder::ForJSBoundFunctionBoundTargetFunction() {
  FieldAccess access = {
      kTaggedBase,         JSBoundFunction::kBoundTargetFunctionOffset,
      Handle<Name>(),      MaybeHandle<Map>(),
212
      Type::Callable(),    MachineType::TaggedPointer(),
213 214 215 216 217 218
      kPointerWriteBarrier};
  return access;
}

// static
FieldAccess AccessBuilder::ForJSBoundFunctionBoundThis() {
219 220 221 222
  FieldAccess access = {kTaggedBase,         JSBoundFunction::kBoundThisOffset,
                        Handle<Name>(),      MaybeHandle<Map>(),
                        Type::NonInternal(), MachineType::AnyTagged(),
                        kFullWriteBarrier};
223 224 225 226 227 228 229 230
  return access;
}

// static
FieldAccess AccessBuilder::ForJSBoundFunctionBoundArguments() {
  FieldAccess access = {
      kTaggedBase,         JSBoundFunction::kBoundArgumentsOffset,
      Handle<Name>(),      MaybeHandle<Map>(),
231
      Type::Internal(),    MachineType::TaggedPointer(),
232 233 234 235
      kPointerWriteBarrier};
  return access;
}

236 237
// static
FieldAccess AccessBuilder::ForJSGeneratorObjectContext() {
238 239 240 241
  FieldAccess access = {kTaggedBase,         JSGeneratorObject::kContextOffset,
                        Handle<Name>(),      MaybeHandle<Map>(),
                        Type::Internal(),    MachineType::TaggedPointer(),
                        kPointerWriteBarrier};
242 243 244
  return access;
}

245 246
// static
FieldAccess AccessBuilder::ForJSGeneratorObjectFunction() {
247 248 249 250
  FieldAccess access = {kTaggedBase,         JSGeneratorObject::kFunctionOffset,
                        Handle<Name>(),      MaybeHandle<Map>(),
                        Type::Function(),    MachineType::TaggedPointer(),
                        kPointerWriteBarrier};
251 252 253 254 255
  return access;
}

// static
FieldAccess AccessBuilder::ForJSGeneratorObjectReceiver() {
256 257 258 259
  FieldAccess access = {kTaggedBase,         JSGeneratorObject::kReceiverOffset,
                        Handle<Name>(),      MaybeHandle<Map>(),
                        Type::Internal(),    MachineType::TaggedPointer(),
                        kPointerWriteBarrier};
260 261 262
  return access;
}

263 264
// static
FieldAccess AccessBuilder::ForJSGeneratorObjectContinuation() {
265 266 267
  FieldAccess access = {
      kTaggedBase,         JSGeneratorObject::kContinuationOffset,
      Handle<Name>(),      MaybeHandle<Map>(),
268
      Type::SignedSmall(), MachineType::TaggedSigned(),
269
      kNoWriteBarrier};
270 271 272
  return access;
}

273
// static
274
FieldAccess AccessBuilder::ForJSGeneratorObjectInputOrDebugPos() {
275 276 277
  FieldAccess access = {
      kTaggedBase,         JSGeneratorObject::kInputOrDebugPosOffset,
      Handle<Name>(),      MaybeHandle<Map>(),
278
      Type::NonInternal(), MachineType::AnyTagged(),
279
      kFullWriteBarrier};
280 281 282
  return access;
}

283
// static
284
FieldAccess AccessBuilder::ForJSGeneratorObjectParametersAndRegisters() {
285
  FieldAccess access = {
286
      kTaggedBase,         JSGeneratorObject::kParametersAndRegistersOffset,
287
      Handle<Name>(),      MaybeHandle<Map>(),
288
      Type::Internal(),    MachineType::TaggedPointer(),
289
      kPointerWriteBarrier};
290 291 292
  return access;
}

293 294
// static
FieldAccess AccessBuilder::ForJSGeneratorObjectResumeMode() {
295 296 297
  FieldAccess access = {
      kTaggedBase,         JSGeneratorObject::kResumeModeOffset,
      Handle<Name>(),      MaybeHandle<Map>(),
298
      Type::SignedSmall(), MachineType::TaggedSigned(),
299
      kNoWriteBarrier};
300 301 302
  return access;
}

303 304 305 306 307
// static
FieldAccess AccessBuilder::ForJSAsyncFunctionObjectPromise() {
  FieldAccess access = {
      kTaggedBase,         JSAsyncFunctionObject::kPromiseOffset,
      Handle<Name>(),      MaybeHandle<Map>(),
308
      Type::OtherObject(), MachineType::TaggedPointer(),
309
      kPointerWriteBarrier};
310 311 312
  return access;
}

313 314 315 316 317
// static
FieldAccess AccessBuilder::ForJSAsyncGeneratorObjectQueue() {
  FieldAccess access = {
      kTaggedBase,         JSAsyncGeneratorObject::kQueueOffset,
      Handle<Name>(),      MaybeHandle<Map>(),
318
      Type::NonInternal(), MachineType::AnyTagged(),
319 320 321 322 323
      kFullWriteBarrier};
  return access;
}

// static
324
FieldAccess AccessBuilder::ForJSAsyncGeneratorObjectIsAwaiting() {
325
  FieldAccess access = {
326
      kTaggedBase,         JSAsyncGeneratorObject::kIsAwaitingOffset,
327
      Handle<Name>(),      MaybeHandle<Map>(),
328
      Type::SignedSmall(), MachineType::TaggedSigned(),
329
      kNoWriteBarrier};
330 331 332
  return access;
}

333 334
// static
FieldAccess AccessBuilder::ForJSArrayLength(ElementsKind elements_kind) {
335
  TypeCache const* type_cache = TypeCache::Get();
336 337 338
  FieldAccess access = {kTaggedBase,
                        JSArray::kLengthOffset,
                        Handle<Name>(),
339
                        MaybeHandle<Map>(),
340
                        type_cache->kJSArrayLengthType,
341
                        MachineType::AnyTagged(),
342
                        kFullWriteBarrier};
343
  if (IsDoubleElementsKind(elements_kind)) {
344
    access.type = type_cache->kFixedDoubleArrayLengthType;
345
    access.machine_type = MachineType::TaggedSigned();
346
    access.write_barrier_kind = kNoWriteBarrier;
347
  } else if (IsFastElementsKind(elements_kind)) {
348
    access.type = type_cache->kFixedArrayLengthType;
349
    access.machine_type = MachineType::TaggedSigned();
350
    access.write_barrier_kind = kNoWriteBarrier;
351 352 353 354
  }
  return access;
}

355 356
// static
FieldAccess AccessBuilder::ForJSArrayBufferBitField() {
357 358
  FieldAccess access = {
      kTaggedBase,        JSArrayBuffer::kBitFieldOffset, MaybeHandle<Name>(),
359
      MaybeHandle<Map>(), TypeCache::Get()->kUint8,       MachineType::Uint32(),
360
      kNoWriteBarrier};
361 362 363 364 365
  return access;
}

// static
FieldAccess AccessBuilder::ForJSArrayBufferViewBuffer() {
366 367 368 369
  FieldAccess access = {kTaggedBase,           JSArrayBufferView::kBufferOffset,
                        MaybeHandle<Name>(),   MaybeHandle<Map>(),
                        Type::OtherInternal(), MachineType::TaggedPointer(),
                        kPointerWriteBarrier};
370 371 372
  return access;
}

373 374 375 376 377
// static
FieldAccess AccessBuilder::ForJSArrayBufferViewByteLength() {
  FieldAccess access = {kTaggedBase,
                        JSArrayBufferView::kByteLengthOffset,
                        MaybeHandle<Name>(),
378
                        MaybeHandle<Map>(),
379
                        TypeCache::Get()->kJSArrayBufferViewByteLengthType,
380 381
                        MachineType::UintPtr(),
                        kNoWriteBarrier};
382 383 384 385 386 387 388 389
  return access;
}

// static
FieldAccess AccessBuilder::ForJSArrayBufferViewByteOffset() {
  FieldAccess access = {kTaggedBase,
                        JSArrayBufferView::kByteOffsetOffset,
                        MaybeHandle<Name>(),
390
                        MaybeHandle<Map>(),
391
                        TypeCache::Get()->kJSArrayBufferViewByteOffsetType,
392 393
                        MachineType::UintPtr(),
                        kNoWriteBarrier};
394 395 396 397 398 399 400 401
  return access;
}

// static
FieldAccess AccessBuilder::ForJSTypedArrayLength() {
  FieldAccess access = {kTaggedBase,
                        JSTypedArray::kLengthOffset,
                        MaybeHandle<Name>(),
402
                        MaybeHandle<Map>(),
403
                        TypeCache::Get()->kJSTypedArrayLengthType,
404
                        MachineType::UintPtr(),
405 406
                        kNoWriteBarrier};
  return access;
407 408
}

409 410
// static
FieldAccess AccessBuilder::ForJSTypedArrayBasePointer() {
411 412 413 414
  FieldAccess access = {kTaggedBase,           JSTypedArray::kBasePointerOffset,
                        MaybeHandle<Name>(),   MaybeHandle<Map>(),
                        Type::OtherInternal(), MachineType::AnyTagged(),
                        kFullWriteBarrier,     LoadSensitivity::kCritical};
415 416 417 418 419 420 421 422 423
  return access;
}

// static
FieldAccess AccessBuilder::ForJSTypedArrayExternalPointer() {
  FieldAccess access = {kTaggedBase,
                        JSTypedArray::kExternalPointerOffset,
                        MaybeHandle<Name>(),
                        MaybeHandle<Map>(),
424 425
                        V8_HEAP_SANDBOX_BOOL ? Type::SandboxedExternalPointer()
                                             : Type::ExternalPointer(),
426 427 428 429 430 431
                        MachineType::Pointer(),
                        kNoWriteBarrier,
                        LoadSensitivity::kCritical};
  return access;
}

432 433
// static
FieldAccess AccessBuilder::ForJSDataViewDataPointer() {
434 435 436 437 438 439 440
  FieldAccess access = {kTaggedBase,
                        JSDataView::kDataPointerOffset,
                        MaybeHandle<Name>(),
                        MaybeHandle<Map>(),
                        V8_HEAP_SANDBOX_BOOL ? Type::SandboxedExternalPointer()
                                             : Type::ExternalPointer(),
                        MachineType::Pointer(),
441 442 443 444
                        kNoWriteBarrier};
  return access;
}

445 446 447 448 449
// static
FieldAccess AccessBuilder::ForJSDateValue() {
  FieldAccess access = {kTaggedBase,
                        JSDate::kValueOffset,
                        MaybeHandle<Name>(),
450
                        MaybeHandle<Map>(),
451
                        TypeCache::Get()->kJSDateValueType,
452
                        MachineType::AnyTagged(),
453 454
                        kFullWriteBarrier};
  return access;
455
}
456

457 458
// static
FieldAccess AccessBuilder::ForJSDateField(JSDate::FieldIndex index) {
459
  FieldAccess access = {
460
      kTaggedBase,         JSDate::kValueOffset + index * kTaggedSize,
461
      MaybeHandle<Name>(), MaybeHandle<Map>(),
462
      Type::Number(),      MachineType::AnyTagged(),
463
      kFullWriteBarrier};
464
  return access;
465 466
}

467 468
// static
FieldAccess AccessBuilder::ForJSIteratorResultDone() {
469 470 471 472
  FieldAccess access = {kTaggedBase,         JSIteratorResult::kDoneOffset,
                        MaybeHandle<Name>(), MaybeHandle<Map>(),
                        Type::NonInternal(), MachineType::AnyTagged(),
                        kFullWriteBarrier};
473 474 475 476 477
  return access;
}

// static
FieldAccess AccessBuilder::ForJSIteratorResultValue() {
478 479 480 481
  FieldAccess access = {kTaggedBase,         JSIteratorResult::kValueOffset,
                        MaybeHandle<Name>(), MaybeHandle<Map>(),
                        Type::NonInternal(), MachineType::AnyTagged(),
                        kFullWriteBarrier};
482 483 484
  return access;
}

485 486
// static
FieldAccess AccessBuilder::ForJSRegExpData() {
487 488 489 490
  FieldAccess access = {kTaggedBase,         JSRegExp::kDataOffset,
                        MaybeHandle<Name>(), MaybeHandle<Map>(),
                        Type::NonInternal(), MachineType::AnyTagged(),
                        kFullWriteBarrier};
491 492
  return access;
}
493

494 495
// static
FieldAccess AccessBuilder::ForJSRegExpFlags() {
496 497 498 499
  FieldAccess access = {kTaggedBase,         JSRegExp::kFlagsOffset,
                        MaybeHandle<Name>(), MaybeHandle<Map>(),
                        Type::NonInternal(), MachineType::AnyTagged(),
                        kFullWriteBarrier};
500 501 502
  return access;
}

503 504
// static
FieldAccess AccessBuilder::ForJSRegExpLastIndex() {
505 506 507 508
  FieldAccess access = {kTaggedBase,         JSRegExp::kLastIndexOffset,
                        MaybeHandle<Name>(), MaybeHandle<Map>(),
                        Type::NonInternal(), MachineType::AnyTagged(),
                        kFullWriteBarrier};
509 510
  return access;
}
511 512 513

// static
FieldAccess AccessBuilder::ForJSRegExpSource() {
514 515 516 517
  FieldAccess access = {kTaggedBase,         JSRegExp::kSourceOffset,
                        MaybeHandle<Name>(), MaybeHandle<Map>(),
                        Type::NonInternal(), MachineType::AnyTagged(),
                        kFullWriteBarrier};
518 519 520
  return access;
}

521
// static
522
FieldAccess AccessBuilder::ForFixedArrayLength() {
523 524 525
  FieldAccess access = {kTaggedBase,
                        FixedArray::kLengthOffset,
                        MaybeHandle<Name>(),
526
                        MaybeHandle<Map>(),
527
                        TypeCache::Get()->kFixedArrayLengthType,
528
                        MachineType::TaggedSigned(),
529
                        kNoWriteBarrier};
530
  return access;
531 532
}

533 534 535 536 537 538 539 540 541 542 543 544
// static
FieldAccess AccessBuilder::ForWeakFixedArrayLength() {
  FieldAccess access = {kTaggedBase,
                        WeakFixedArray::kLengthOffset,
                        MaybeHandle<Name>(),
                        MaybeHandle<Map>(),
                        TypeCache::Get()->kWeakFixedArrayLengthType,
                        MachineType::TaggedSigned(),
                        kNoWriteBarrier};
  return access;
}

545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564
// static
FieldAccess AccessBuilder::ForSloppyArgumentsElementsContext() {
  FieldAccess access = {
      kTaggedBase,         SloppyArgumentsElements::kContextOffset,
      MaybeHandle<Name>(), MaybeHandle<Map>(),
      Type::Any(),         MachineType::TaggedPointer(),
      kPointerWriteBarrier};
  return access;
}

// static
FieldAccess AccessBuilder::ForSloppyArgumentsElementsArguments() {
  FieldAccess access = {
      kTaggedBase,         SloppyArgumentsElements::kArgumentsOffset,
      MaybeHandle<Name>(), MaybeHandle<Map>(),
      Type::Any(),         MachineType::TaggedPointer(),
      kPointerWriteBarrier};
  return access;
}

565
// static
566 567 568 569
FieldAccess AccessBuilder::ForPropertyArrayLengthAndHash() {
  FieldAccess access = {
      kTaggedBase,         PropertyArray::kLengthAndHashOffset,
      MaybeHandle<Name>(), MaybeHandle<Map>(),
570
      Type::SignedSmall(), MachineType::TaggedSigned(),
571
      kNoWriteBarrier};
572 573 574
  return access;
}

575
// static
576
FieldAccess AccessBuilder::ForDescriptorArrayEnumCache() {
577
  FieldAccess access = {
578
      kTaggedBase,           DescriptorArray::kEnumCacheOffset,
579
      Handle<Name>(),        MaybeHandle<Map>(),
580
      Type::OtherInternal(), MachineType::TaggedPointer(),
581
      kPointerWriteBarrier};
582
  return access;
583 584
}

585 586
// static
FieldAccess AccessBuilder::ForMapBitField() {
587
  FieldAccess access = {
588 589
      kTaggedBase,        Map::kBitFieldOffset,     Handle<Name>(),
      MaybeHandle<Map>(), TypeCache::Get()->kUint8, MachineType::Uint8(),
590
      kNoWriteBarrier};
591 592 593
  return access;
}

594 595 596
// static
FieldAccess AccessBuilder::ForMapBitField2() {
  FieldAccess access = {
597 598
      kTaggedBase,        Map::kBitField2Offset,    Handle<Name>(),
      MaybeHandle<Map>(), TypeCache::Get()->kUint8, MachineType::Uint8(),
599 600 601
      kNoWriteBarrier};
  return access;
}
602

603
// static
604
FieldAccess AccessBuilder::ForMapBitField3() {
605
  FieldAccess access = {
606 607
      kTaggedBase,        Map::kBitField3Offset,    Handle<Name>(),
      MaybeHandle<Map>(), TypeCache::Get()->kInt32, MachineType::Int32(),
608
      kNoWriteBarrier};
609
  return access;
610 611 612 613
}

// static
FieldAccess AccessBuilder::ForMapDescriptors() {
614 615 616 617
  FieldAccess access = {kTaggedBase,           Map::kInstanceDescriptorsOffset,
                        Handle<Name>(),        MaybeHandle<Map>(),
                        Type::OtherInternal(), MachineType::TaggedPointer(),
                        kPointerWriteBarrier};
618
  return access;
619 620
}

621 622
// static
FieldAccess AccessBuilder::ForMapInstanceType() {
623
  FieldAccess access = {
624 625
      kTaggedBase,        Map::kInstanceTypeOffset,  Handle<Name>(),
      MaybeHandle<Map>(), TypeCache::Get()->kUint16, MachineType::Uint16(),
626
      kNoWriteBarrier};
627
  return access;
628 629
}

630 631
// static
FieldAccess AccessBuilder::ForMapPrototype() {
632 633 634 635
  FieldAccess access = {kTaggedBase,         Map::kPrototypeOffset,
                        Handle<Name>(),      MaybeHandle<Map>(),
                        Type::Any(),         MachineType::TaggedPointer(),
                        kPointerWriteBarrier};
636 637 638
  return access;
}

639 640 641 642 643 644 645 646 647 648
// static
FieldAccess AccessBuilder::ForMapNativeContext() {
  FieldAccess access = {
      kTaggedBase,         Map::kConstructorOrBackPointerOrNativeContextOffset,
      Handle<Name>(),      MaybeHandle<Map>(),
      Type::Any(),         MachineType::TaggedPointer(),
      kPointerWriteBarrier};
  return access;
}

649 650
// static
FieldAccess AccessBuilder::ForModuleRegularExports() {
651
  FieldAccess access = {
652
      kTaggedBase,           SourceTextModule::kRegularExportsOffset,
653
      Handle<Name>(),        MaybeHandle<Map>(),
654
      Type::OtherInternal(), MachineType::TaggedPointer(),
655
      kPointerWriteBarrier};
656 657 658 659 660
  return access;
}

// static
FieldAccess AccessBuilder::ForModuleRegularImports() {
661
  FieldAccess access = {
662
      kTaggedBase,           SourceTextModule::kRegularImportsOffset,
663
      Handle<Name>(),        MaybeHandle<Map>(),
664
      Type::OtherInternal(), MachineType::TaggedPointer(),
665
      kPointerWriteBarrier};
666 667
  return access;
}
668

669 670
// static
FieldAccess AccessBuilder::ForNameHashField() {
671 672 673
  FieldAccess access = {kTaggedBase,        Name::kHashFieldOffset,
                        Handle<Name>(),     MaybeHandle<Map>(),
                        Type::Unsigned32(), MachineType::Uint32(),
674
                        kNoWriteBarrier};
675 676 677
  return access;
}

678
// static
679
FieldAccess AccessBuilder::ForStringLength() {
680 681 682
  FieldAccess access = {kTaggedBase,
                        String::kLengthOffset,
                        Handle<Name>(),
683
                        MaybeHandle<Map>(),
684
                        TypeCache::Get()->kStringLengthType,
685
                        MachineType::Uint32(),
686
                        kNoWriteBarrier};
687
  return access;
688 689
}

690 691
// static
FieldAccess AccessBuilder::ForConsStringFirst() {
692 693 694 695
  FieldAccess access = {kTaggedBase,         ConsString::kFirstOffset,
                        Handle<Name>(),      MaybeHandle<Map>(),
                        Type::String(),      MachineType::TaggedPointer(),
                        kPointerWriteBarrier};
696 697 698 699 700
  return access;
}

// static
FieldAccess AccessBuilder::ForConsStringSecond() {
701 702 703 704
  FieldAccess access = {kTaggedBase,         ConsString::kSecondOffset,
                        Handle<Name>(),      MaybeHandle<Map>(),
                        Type::String(),      MachineType::TaggedPointer(),
                        kPointerWriteBarrier};
705 706 707 708 709
  return access;
}

// static
FieldAccess AccessBuilder::ForThinStringActual() {
710 711 712 713
  FieldAccess access = {kTaggedBase,         ThinString::kActualOffset,
                        Handle<Name>(),      MaybeHandle<Map>(),
                        Type::String(),      MachineType::TaggedPointer(),
                        kPointerWriteBarrier};
714 715 716 717 718
  return access;
}

// static
FieldAccess AccessBuilder::ForSlicedStringOffset() {
719 720 721 722
  FieldAccess access = {kTaggedBase,         SlicedString::kOffsetOffset,
                        Handle<Name>(),      MaybeHandle<Map>(),
                        Type::SignedSmall(), MachineType::TaggedSigned(),
                        kNoWriteBarrier};
723 724 725 726 727
  return access;
}

// static
FieldAccess AccessBuilder::ForSlicedStringParent() {
728 729 730 731
  FieldAccess access = {kTaggedBase,         SlicedString::kParentOffset,
                        Handle<Name>(),      MaybeHandle<Map>(),
                        Type::String(),      MachineType::TaggedPointer(),
                        kPointerWriteBarrier};
732 733 734 735 736 737 738 739
  return access;
}

// static
FieldAccess AccessBuilder::ForExternalStringResourceData() {
  FieldAccess access = {kTaggedBase,
                        ExternalString::kResourceDataOffset,
                        Handle<Name>(),
740
                        MaybeHandle<Map>(),
741 742
                        V8_HEAP_SANDBOX_BOOL ? Type::SandboxedExternalPointer()
                                             : Type::ExternalPointer(),
743 744 745 746 747 748 749 750
                        MachineType::Pointer(),
                        kNoWriteBarrier};
  return access;
}

// static
ElementAccess AccessBuilder::ForSeqOneByteStringCharacter() {
  ElementAccess access = {kTaggedBase, SeqOneByteString::kHeaderSize,
751
                          TypeCache::Get()->kUint8, MachineType::Uint8(),
752 753 754 755 756 757 758
                          kNoWriteBarrier};
  return access;
}

// static
ElementAccess AccessBuilder::ForSeqTwoByteStringCharacter() {
  ElementAccess access = {kTaggedBase, SeqTwoByteString::kHeaderSize,
759
                          TypeCache::Get()->kUint16, MachineType::Uint16(),
760 761 762
                          kNoWriteBarrier};
  return access;
}
763

764 765 766 767 768
// static
FieldAccess AccessBuilder::ForJSGlobalProxyNativeContext() {
  FieldAccess access = {
      kTaggedBase,         JSGlobalProxy::kNativeContextOffset,
      Handle<Name>(),      MaybeHandle<Map>(),
769
      Type::Internal(),    MachineType::TaggedPointer(),
770 771 772 773
      kPointerWriteBarrier};
  return access;
}

774
// static
775
FieldAccess AccessBuilder::ForJSArrayIteratorIteratedObject() {
776 777 778
  FieldAccess access = {
      kTaggedBase,         JSArrayIterator::kIteratedObjectOffset,
      Handle<Name>(),      MaybeHandle<Map>(),
779
      Type::Receiver(),    MachineType::TaggedPointer(),
780
      kPointerWriteBarrier};
781 782 783 784
  return access;
}

// static
785
FieldAccess AccessBuilder::ForJSArrayIteratorNextIndex() {
786 787 788 789 790
  // In generic case, cap to 2^53-1 (per ToLength() in spec) via
  // kPositiveSafeInteger
  FieldAccess access = {kTaggedBase,
                        JSArrayIterator::kNextIndexOffset,
                        Handle<Name>(),
791
                        MaybeHandle<Map>(),
792
                        TypeCache::Get()->kPositiveSafeInteger,
793
                        MachineType::AnyTagged(),
794 795 796 797 798
                        kFullWriteBarrier};
  return access;
}

// static
799 800 801 802 803
FieldAccess AccessBuilder::ForJSArrayIteratorKind() {
  FieldAccess access = {kTaggedBase,
                        JSArrayIterator::kKindOffset,
                        Handle<Name>(),
                        MaybeHandle<Map>(),
804
                        TypeCache::Get()->kJSArrayIteratorKindType,
805
                        MachineType::TaggedSigned(),
806
                        kNoWriteBarrier};
807 808 809
  return access;
}

810 811
// static
FieldAccess AccessBuilder::ForJSStringIteratorString() {
812 813 814 815
  FieldAccess access = {kTaggedBase,         JSStringIterator::kStringOffset,
                        Handle<Name>(),      MaybeHandle<Map>(),
                        Type::String(),      MachineType::TaggedPointer(),
                        kPointerWriteBarrier};
816 817 818 819 820 821
  return access;
}

// static
FieldAccess AccessBuilder::ForJSStringIteratorIndex() {
  FieldAccess access = {kTaggedBase,
822
                        JSStringIterator::kIndexOffset,
823
                        Handle<Name>(),
824
                        MaybeHandle<Map>(),
825
                        TypeCache::Get()->kStringLengthType,
826
                        MachineType::TaggedSigned(),
827 828 829
                        kNoWriteBarrier};
  return access;
}
830 831 832

// static
FieldAccess AccessBuilder::ForArgumentsLength() {
833 834 835 836 837 838
  constexpr int offset = JSStrictArgumentsObject::kLengthOffset;
  STATIC_ASSERT(offset == JSSloppyArgumentsObject::kLengthOffset);
  FieldAccess access = {kTaggedBase,         offset,
                        Handle<Name>(),      MaybeHandle<Map>(),
                        Type::NonInternal(), MachineType::AnyTagged(),
                        kFullWriteBarrier};
839 840 841
  return access;
}

842 843
// static
FieldAccess AccessBuilder::ForArgumentsCallee() {
844 845 846
  FieldAccess access = {
      kTaggedBase,         JSSloppyArgumentsObject::kCalleeOffset,
      Handle<Name>(),      MaybeHandle<Map>(),
847
      Type::NonInternal(), MachineType::AnyTagged(),
848
      kFullWriteBarrier};
849 850 851
  return access;
}

852
// static
853 854
FieldAccess AccessBuilder::ForFixedArraySlot(
    size_t index, WriteBarrierKind write_barrier_kind) {
855
  int offset = FixedArray::OffsetOfElementAt(static_cast<int>(index));
856 857
  FieldAccess access = {kTaggedBase,       offset,
                        Handle<Name>(),    MaybeHandle<Map>(),
858
                        Type::Any(),       MachineType::AnyTagged(),
859
                        write_barrier_kind};
860 861 862
  return access;
}

863 864 865 866 867 868 869 870 871 872
// static
FieldAccess AccessBuilder::ForFeedbackVectorSlot(int index) {
  int offset = FeedbackVector::OffsetOfElementAt(index);
  FieldAccess access = {kTaggedBase,      offset,
                        Handle<Name>(),   MaybeHandle<Map>(),
                        Type::Any(),      MachineType::AnyTagged(),
                        kFullWriteBarrier};
  return access;
}

873 874
// static
FieldAccess AccessBuilder::ForCellValue() {
875 876
  FieldAccess access = {kTaggedBase,       Cell::kValueOffset,
                        Handle<Name>(),    MaybeHandle<Map>(),
877
                        Type::Any(),       MachineType::AnyTagged(),
878
                        kFullWriteBarrier, LoadSensitivity::kCritical};
879 880 881
  return access;
}

882 883
// static
FieldAccess AccessBuilder::ForScopeInfoFlags() {
884 885 886 887
  FieldAccess access = {kTaggedBase,         ScopeInfo::kFlagsOffset,
                        MaybeHandle<Name>(), MaybeHandle<Map>(),
                        Type::SignedSmall(), MachineType::TaggedSigned(),
                        kNoWriteBarrier};
888 889 890
  return access;
}

891 892
// static
FieldAccess AccessBuilder::ForContextSlot(size_t index) {
893
  int offset = Context::OffsetOfElementAt(static_cast<int>(index));
894 895
  DCHECK_EQ(offset,
            Context::SlotOffset(static_cast<int>(index)) + kHeapObjectTag);
896 897
  FieldAccess access = {kTaggedBase,      offset,
                        Handle<Name>(),   MaybeHandle<Map>(),
898
                        Type::Any(),      MachineType::AnyTagged(),
899
                        kFullWriteBarrier};
900
  return access;
901 902
}

903 904 905 906 907
// static
FieldAccess AccessBuilder::ForContextSlotKnownPointer(size_t index) {
  int offset = Context::OffsetOfElementAt(static_cast<int>(index));
  DCHECK_EQ(offset,
            Context::SlotOffset(static_cast<int>(index)) + kHeapObjectTag);
908 909 910 911
  FieldAccess access = {kTaggedBase,         offset,
                        Handle<Name>(),      MaybeHandle<Map>(),
                        Type::Any(),         MachineType::TaggedPointer(),
                        kPointerWriteBarrier};
912 913 914
  return access;
}

915 916
// static
ElementAccess AccessBuilder::ForFixedArrayElement() {
917
  ElementAccess access = {kTaggedBase, FixedArray::kHeaderSize, Type::Any(),
918
                          MachineType::AnyTagged(), kFullWriteBarrier};
919
  return access;
920 921
}

922 923 924 925 926 927 928 929
// static
ElementAccess AccessBuilder::ForWeakFixedArrayElement() {
  ElementAccess const access = {kTaggedBase, WeakFixedArray::kHeaderSize,
                                Type::Any(), MachineType::AnyTagged(),
                                kFullWriteBarrier};
  return access;
}

930
// static
931 932 933 934 935 936 937 938
ElementAccess AccessBuilder::ForSloppyArgumentsElementsMappedEntry() {
  ElementAccess access = {
      kTaggedBase, SloppyArgumentsElements::kMappedEntriesOffset, Type::Any(),
      MachineType::AnyTagged(), kFullWriteBarrier};
  return access;
}

// statics
939 940
ElementAccess AccessBuilder::ForFixedArrayElement(
    ElementsKind kind, LoadSensitivity load_sensitivity) {
941 942 943
  ElementAccess access = {kTaggedBase,       FixedArray::kHeaderSize,
                          Type::Any(),       MachineType::AnyTagged(),
                          kFullWriteBarrier, load_sensitivity};
944
  switch (kind) {
945
    case PACKED_SMI_ELEMENTS:
946
      access.type = Type::SignedSmall();
947
      access.machine_type = MachineType::TaggedSigned();
948 949
      access.write_barrier_kind = kNoWriteBarrier;
      break;
950
    case HOLEY_SMI_ELEMENTS:
951
      access.type = TypeCache::Get()->kHoleySmi;
952
      break;
953
    case PACKED_ELEMENTS:
954 955
      access.type = Type::NonInternal();
      break;
956
    case HOLEY_ELEMENTS:
957
      break;
958
    case PACKED_DOUBLE_ELEMENTS:
959 960 961 962
      access.type = Type::Number();
      access.write_barrier_kind = kNoWriteBarrier;
      access.machine_type = MachineType::Float64();
      break;
963
    case HOLEY_DOUBLE_ELEMENTS:
964
      access.type = Type::NumberOrHole();
965 966 967
      access.write_barrier_kind = kNoWriteBarrier;
      access.machine_type = MachineType::Float64();
      break;
968 969 970 971 972
    default:
      UNREACHABLE();
  }
  return access;
}
973

974 975 976 977 978
// static
ElementAccess AccessBuilder::ForStackArgument() {
  ElementAccess access = {
      kUntaggedBase,
      CommonFrameConstants::kFixedFrameSizeAboveFp - kSystemPointerSize,
979
      Type::NonInternal(), MachineType::Pointer(),
980 981 982 983
      WriteBarrierKind::kNoWriteBarrier};
  return access;
}

984 985 986
// static
ElementAccess AccessBuilder::ForFixedDoubleArrayElement() {
  ElementAccess access = {kTaggedBase, FixedDoubleArray::kHeaderSize,
987
                          TypeCache::Get()->kFloat64, MachineType::Float64(),
988
                          kNoWriteBarrier};
989 990 991
  return access;
}

992
// static
993
FieldAccess AccessBuilder::ForEnumCacheKeys() {
994 995 996 997
  FieldAccess access = {kTaggedBase,           EnumCache::kKeysOffset,
                        MaybeHandle<Name>(),   MaybeHandle<Map>(),
                        Type::OtherInternal(), MachineType::TaggedPointer(),
                        kPointerWriteBarrier};
998 999 1000 1001 1002
  return access;
}

// static
FieldAccess AccessBuilder::ForEnumCacheIndices() {
1003 1004 1005 1006
  FieldAccess access = {kTaggedBase,           EnumCache::kIndicesOffset,
                        MaybeHandle<Name>(),   MaybeHandle<Map>(),
                        Type::OtherInternal(), MachineType::TaggedPointer(),
                        kPointerWriteBarrier};
1007 1008
  return access;
}
1009

1010
// static
1011 1012 1013
ElementAccess AccessBuilder::ForTypedArrayElement(
    ExternalArrayType type, bool is_external,
    LoadSensitivity load_sensitivity) {
1014
  BaseTaggedness taggedness = is_external ? kUntaggedBase : kTaggedBase;
1015
  int header_size = is_external ? 0 : ByteArray::kHeaderSize;
1016
  switch (type) {
1017
    case kExternalInt8Array: {
1018 1019 1020
      ElementAccess access = {taggedness,       header_size,
                              Type::Signed32(), MachineType::Int8(),
                              kNoWriteBarrier,  load_sensitivity};
1021 1022
      return access;
    }
1023
    case kExternalUint8Array:
1024
    case kExternalUint8ClampedArray: {
1025 1026 1027
      ElementAccess access = {taggedness,         header_size,
                              Type::Unsigned32(), MachineType::Uint8(),
                              kNoWriteBarrier,    load_sensitivity};
1028 1029 1030
      return access;
    }
    case kExternalInt16Array: {
1031 1032 1033
      ElementAccess access = {taggedness,       header_size,
                              Type::Signed32(), MachineType::Int16(),
                              kNoWriteBarrier,  load_sensitivity};
1034 1035 1036
      return access;
    }
    case kExternalUint16Array: {
1037 1038 1039
      ElementAccess access = {taggedness,         header_size,
                              Type::Unsigned32(), MachineType::Uint16(),
                              kNoWriteBarrier,    load_sensitivity};
1040 1041 1042
      return access;
    }
    case kExternalInt32Array: {
1043 1044 1045
      ElementAccess access = {taggedness,       header_size,
                              Type::Signed32(), MachineType::Int32(),
                              kNoWriteBarrier,  load_sensitivity};
1046 1047 1048
      return access;
    }
    case kExternalUint32Array: {
1049 1050 1051
      ElementAccess access = {taggedness,         header_size,
                              Type::Unsigned32(), MachineType::Uint32(),
                              kNoWriteBarrier,    load_sensitivity};
1052 1053 1054
      return access;
    }
    case kExternalFloat32Array: {
1055 1056 1057
      ElementAccess access = {taggedness,      header_size,
                              Type::Number(),  MachineType::Float32(),
                              kNoWriteBarrier, load_sensitivity};
1058 1059 1060
      return access;
    }
    case kExternalFloat64Array: {
1061 1062 1063
      ElementAccess access = {taggedness,      header_size,
                              Type::Number(),  MachineType::Float64(),
                              kNoWriteBarrier, load_sensitivity};
1064 1065
      return access;
    }
1066 1067 1068 1069
    case kExternalBigInt64Array:
    case kExternalBigUint64Array:
      // TODO(neis/jkummerow): Define appropriate types.
      UNIMPLEMENTED();
1070 1071
  }
  UNREACHABLE();
1072 1073
}

1074 1075 1076 1077 1078 1079 1080 1081
// static
FieldAccess AccessBuilder::ForHashTableBaseNumberOfElements() {
  FieldAccess access = {
      kTaggedBase,
      FixedArray::OffsetOfElementAt(HashTableBase::kNumberOfElementsIndex),
      MaybeHandle<Name>(),
      MaybeHandle<Map>(),
      Type::SignedSmall(),
1082
      MachineType::TaggedSigned(),
1083 1084 1085 1086 1087 1088
      kNoWriteBarrier};
  return access;
}

// static
FieldAccess AccessBuilder::ForHashTableBaseNumberOfDeletedElement() {
1089 1090 1091 1092 1093 1094
  FieldAccess access = {kTaggedBase,
                        FixedArray::OffsetOfElementAt(
                            HashTableBase::kNumberOfDeletedElementsIndex),
                        MaybeHandle<Name>(),
                        MaybeHandle<Map>(),
                        Type::SignedSmall(),
1095
                        MachineType::TaggedSigned(),
1096
                        kNoWriteBarrier};
1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107
  return access;
}

// static
FieldAccess AccessBuilder::ForHashTableBaseCapacity() {
  FieldAccess access = {
      kTaggedBase,
      FixedArray::OffsetOfElementAt(HashTableBase::kCapacityIndex),
      MaybeHandle<Name>(),
      MaybeHandle<Map>(),
      Type::SignedSmall(),
1108
      MachineType::TaggedSigned(),
1109 1110 1111 1112
      kNoWriteBarrier};
  return access;
}

1113
// static
1114
FieldAccess AccessBuilder::ForOrderedHashMapOrSetNextTable() {
1115 1116
  // TODO(turbofan): This will be redundant with the HashTableBase
  // methods above once the hash table unification is done.
1117 1118
  STATIC_ASSERT(OrderedHashMap::NextTableOffset() ==
                OrderedHashSet::NextTableOffset());
1119
  FieldAccess const access = {
1120
      kTaggedBase,         OrderedHashMap::NextTableOffset(),
1121
      MaybeHandle<Name>(), MaybeHandle<Map>(),
1122
      Type::Any(),         MachineType::AnyTagged(),
1123 1124 1125 1126 1127
      kFullWriteBarrier};
  return access;
}

// static
1128
FieldAccess AccessBuilder::ForOrderedHashMapOrSetNumberOfBuckets() {
1129 1130
  // TODO(turbofan): This will be redundant with the HashTableBase
  // methods above once the hash table unification is done.
1131 1132
  STATIC_ASSERT(OrderedHashMap::NumberOfBucketsOffset() ==
                OrderedHashSet::NumberOfBucketsOffset());
1133
  FieldAccess const access = {kTaggedBase,
1134
                              OrderedHashMap::NumberOfBucketsOffset(),
1135 1136
                              MaybeHandle<Name>(),
                              MaybeHandle<Map>(),
1137
                              TypeCache::Get()->kFixedArrayLengthType,
1138
                              MachineType::TaggedSigned(),
1139
                              kNoWriteBarrier};
1140 1141 1142 1143
  return access;
}

// static
1144
FieldAccess AccessBuilder::ForOrderedHashMapOrSetNumberOfDeletedElements() {
1145 1146
  // TODO(turbofan): This will be redundant with the HashTableBase
  // methods above once the hash table unification is done.
1147 1148
  STATIC_ASSERT(OrderedHashMap::NumberOfDeletedElementsOffset() ==
                OrderedHashSet::NumberOfDeletedElementsOffset());
1149
  FieldAccess const access = {kTaggedBase,
1150
                              OrderedHashMap::NumberOfDeletedElementsOffset(),
1151 1152
                              MaybeHandle<Name>(),
                              MaybeHandle<Map>(),
1153
                              TypeCache::Get()->kFixedArrayLengthType,
1154
                              MachineType::TaggedSigned(),
1155
                              kNoWriteBarrier};
1156 1157 1158
  return access;
}

1159
// static
1160
FieldAccess AccessBuilder::ForOrderedHashMapOrSetNumberOfElements() {
1161 1162
  // TODO(turbofan): This will be redundant with the HashTableBase
  // methods above once the hash table unification is done.
1163 1164
  STATIC_ASSERT(OrderedHashMap::NumberOfElementsOffset() ==
                OrderedHashSet::NumberOfElementsOffset());
1165
  FieldAccess const access = {kTaggedBase,
1166
                              OrderedHashMap::NumberOfElementsOffset(),
1167 1168
                              MaybeHandle<Name>(),
                              MaybeHandle<Map>(),
1169
                              TypeCache::Get()->kFixedArrayLengthType,
1170
                              MachineType::TaggedSigned(),
1171 1172 1173 1174
                              kNoWriteBarrier};
  return access;
}

1175 1176
// static
ElementAccess AccessBuilder::ForOrderedHashMapEntryValue() {
1177 1178 1179 1180 1181
  ElementAccess const access = {kTaggedBase,
                                OrderedHashMap::HashTableStartOffset() +
                                    OrderedHashMap::kValueOffset * kTaggedSize,
                                Type::Any(), MachineType::AnyTagged(),
                                kFullWriteBarrier};
1182 1183 1184
  return access;
}

1185 1186 1187 1188 1189 1190 1191 1192
// static
FieldAccess AccessBuilder::ForDictionaryNextEnumerationIndex() {
  FieldAccess access = {
      kTaggedBase,
      FixedArray::OffsetOfElementAt(NameDictionary::kNextEnumerationIndexIndex),
      MaybeHandle<Name>(),
      MaybeHandle<Map>(),
      Type::SignedSmall(),
1193
      MachineType::TaggedSigned(),
1194 1195 1196 1197
      kNoWriteBarrier};
  return access;
}

1198 1199 1200 1201 1202 1203 1204 1205
// static
FieldAccess AccessBuilder::ForDictionaryObjectHashIndex() {
  FieldAccess access = {
      kTaggedBase,
      FixedArray::OffsetOfElementAt(NameDictionary::kObjectHashIndex),
      MaybeHandle<Name>(),
      MaybeHandle<Map>(),
      Type::SignedSmall(),
1206
      MachineType::TaggedSigned(),
1207 1208 1209 1210
      kNoWriteBarrier};
  return access;
}

1211 1212 1213 1214 1215 1216 1217 1218 1219
// static
FieldAccess AccessBuilder::ForFeedbackCellValue() {
  FieldAccess access = {kTaggedBase,      FeedbackCell::kValueOffset,
                        Handle<Name>(),   MaybeHandle<Map>(),
                        Type::Any(),      MachineType::TaggedPointer(),
                        kFullWriteBarrier};
  return access;
}

1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231
// static
FieldAccess AccessBuilder::ForFeedbackCellInterruptBudget() {
  FieldAccess access = {kTaggedBase,
                        FeedbackCell::kInterruptBudgetOffset,
                        Handle<Name>(),
                        MaybeHandle<Map>(),
                        TypeCache::Get()->kInt32,
                        MachineType::Int32(),
                        kNoWriteBarrier};
  return access;
}

1232 1233 1234 1235 1236 1237 1238 1239 1240 1241
// static
FieldAccess AccessBuilder::ForFeedbackVectorClosureFeedbackCellArray() {
  FieldAccess access = {
      kTaggedBase,      FeedbackVector::kClosureFeedbackCellArrayOffset,
      Handle<Name>(),   MaybeHandle<Map>(),
      Type::Any(),      MachineType::TaggedPointer(),
      kFullWriteBarrier};
  return access;
}

1242 1243 1244
}  // namespace compiler
}  // namespace internal
}  // namespace v8