OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/access-builder.h" | 5 #include "src/compiler/access-builder.h" |
6 | 6 |
7 #include "src/contexts.h" | 7 #include "src/contexts.h" |
8 #include "src/frames.h" | 8 #include "src/frames.h" |
9 #include "src/handles-inl.h" | 9 #include "src/handles-inl.h" |
10 #include "src/heap/heap.h" | 10 #include "src/heap/heap.h" |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 FieldAccess AccessBuilder::ForStringLength() { | 379 FieldAccess AccessBuilder::ForStringLength() { |
380 FieldAccess access = {kTaggedBase, | 380 FieldAccess access = {kTaggedBase, |
381 String::kLengthOffset, | 381 String::kLengthOffset, |
382 Handle<Name>(), | 382 Handle<Name>(), |
383 TypeCache::Get().kStringLengthType, | 383 TypeCache::Get().kStringLengthType, |
384 MachineType::AnyTagged(), | 384 MachineType::AnyTagged(), |
385 kNoWriteBarrier}; | 385 kNoWriteBarrier}; |
386 return access; | 386 return access; |
387 } | 387 } |
388 | 388 |
| 389 // static |
| 390 FieldAccess AccessBuilder::ForConsStringFirst() { |
| 391 FieldAccess access = { |
| 392 kTaggedBase, ConsString::kFirstOffset, Handle<Name>(), |
| 393 Type::String(), MachineType::AnyTagged(), kPointerWriteBarrier}; |
| 394 return access; |
| 395 } |
| 396 |
| 397 // static |
| 398 FieldAccess AccessBuilder::ForConsStringSecond() { |
| 399 FieldAccess access = { |
| 400 kTaggedBase, ConsString::kSecondOffset, Handle<Name>(), |
| 401 Type::String(), MachineType::AnyTagged(), kPointerWriteBarrier}; |
| 402 return access; |
| 403 } |
| 404 |
| 405 // static |
| 406 FieldAccess AccessBuilder::ForSlicedStringOffset() { |
| 407 FieldAccess access = { |
| 408 kTaggedBase, SlicedString::kOffsetOffset, Handle<Name>(), |
| 409 Type::SignedSmall(), MachineType::AnyTagged(), kNoWriteBarrier}; |
| 410 return access; |
| 411 } |
| 412 |
| 413 // static |
| 414 FieldAccess AccessBuilder::ForSlicedStringParent() { |
| 415 FieldAccess access = { |
| 416 kTaggedBase, SlicedString::kParentOffset, Handle<Name>(), |
| 417 Type::String(), MachineType::AnyTagged(), kPointerWriteBarrier}; |
| 418 return access; |
| 419 } |
| 420 |
| 421 // static |
| 422 FieldAccess AccessBuilder::ForExternalStringResourceData() { |
| 423 FieldAccess access = {kTaggedBase, |
| 424 ExternalString::kResourceDataOffset, |
| 425 Handle<Name>(), |
| 426 Type::UntaggedPointer(), |
| 427 MachineType::Pointer(), |
| 428 kNoWriteBarrier}; |
| 429 return access; |
| 430 } |
| 431 |
| 432 // static |
| 433 ElementAccess AccessBuilder::ForExternalOneByteStringCharacter() { |
| 434 ElementAccess access = {kUntaggedBase, 0, TypeCache::Get().kUint8, |
| 435 MachineType::Uint8(), kNoWriteBarrier}; |
| 436 return access; |
| 437 } |
| 438 |
| 439 // static |
| 440 ElementAccess AccessBuilder::ForExternalTwoByteStringCharacter() { |
| 441 ElementAccess access = {kUntaggedBase, 0, TypeCache::Get().kUint16, |
| 442 MachineType::Uint16(), kNoWriteBarrier}; |
| 443 return access; |
| 444 } |
| 445 |
| 446 // static |
| 447 ElementAccess AccessBuilder::ForSeqOneByteStringCharacter() { |
| 448 ElementAccess access = {kTaggedBase, SeqOneByteString::kHeaderSize, |
| 449 TypeCache::Get().kUint8, MachineType::Uint8(), |
| 450 kNoWriteBarrier}; |
| 451 return access; |
| 452 } |
| 453 |
| 454 // static |
| 455 ElementAccess AccessBuilder::ForSeqTwoByteStringCharacter() { |
| 456 ElementAccess access = {kTaggedBase, SeqTwoByteString::kHeaderSize, |
| 457 TypeCache::Get().kUint16, MachineType::Uint16(), |
| 458 kNoWriteBarrier}; |
| 459 return access; |
| 460 } |
389 | 461 |
390 // static | 462 // static |
391 FieldAccess AccessBuilder::ForJSGlobalObjectGlobalProxy() { | 463 FieldAccess AccessBuilder::ForJSGlobalObjectGlobalProxy() { |
392 FieldAccess access = {kTaggedBase, | 464 FieldAccess access = {kTaggedBase, |
393 JSGlobalObject::kGlobalProxyOffset, | 465 JSGlobalObject::kGlobalProxyOffset, |
394 Handle<Name>(), | 466 Handle<Name>(), |
395 Type::Receiver(), | 467 Type::Receiver(), |
396 MachineType::AnyTagged(), | 468 MachineType::AnyTagged(), |
397 kPointerWriteBarrier}; | 469 kPointerWriteBarrier}; |
398 return access; | 470 return access; |
399 } | 471 } |
400 | 472 |
401 | |
402 // static | 473 // static |
403 FieldAccess AccessBuilder::ForJSGlobalObjectNativeContext() { | 474 FieldAccess AccessBuilder::ForJSGlobalObjectNativeContext() { |
404 FieldAccess access = {kTaggedBase, | 475 FieldAccess access = {kTaggedBase, |
405 JSGlobalObject::kNativeContextOffset, | 476 JSGlobalObject::kNativeContextOffset, |
406 Handle<Name>(), | 477 Handle<Name>(), |
407 Type::Internal(), | 478 Type::Internal(), |
408 MachineType::AnyTagged(), | 479 MachineType::AnyTagged(), |
409 kPointerWriteBarrier}; | 480 kPointerWriteBarrier}; |
410 return access; | 481 return access; |
411 } | 482 } |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 } | 621 } |
551 UNREACHABLE(); | 622 UNREACHABLE(); |
552 ElementAccess access = {kUntaggedBase, 0, Type::None(), MachineType::None(), | 623 ElementAccess access = {kUntaggedBase, 0, Type::None(), MachineType::None(), |
553 kNoWriteBarrier}; | 624 kNoWriteBarrier}; |
554 return access; | 625 return access; |
555 } | 626 } |
556 | 627 |
557 } // namespace compiler | 628 } // namespace compiler |
558 } // namespace internal | 629 } // namespace internal |
559 } // namespace v8 | 630 } // namespace v8 |
OLD | NEW |