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" |
11 #include "src/type-cache.h" | 11 #include "src/type-cache.h" |
12 | 12 |
13 namespace v8 { | 13 namespace v8 { |
14 namespace internal { | 14 namespace internal { |
15 namespace compiler { | 15 namespace compiler { |
16 | 16 |
17 // static | 17 // static |
18 FieldAccess AccessBuilder::ForMap() { | 18 FieldAccess AccessBuilder::ForMap() { |
19 FieldAccess access = { | 19 FieldAccess access = { |
20 kTaggedBase, HeapObject::kMapOffset, MaybeHandle<Name>(), | 20 kTaggedBase, HeapObject::kMapOffset, MaybeHandle<Name>(), |
21 Type::Any(), MachineType::AnyTagged(), kMapWriteBarrier}; | 21 Type::OtherInternal(), MachineType::AnyTagged(), kMapWriteBarrier}; |
22 return access; | 22 return access; |
23 } | 23 } |
24 | 24 |
25 | 25 |
26 // static | 26 // static |
27 FieldAccess AccessBuilder::ForHeapNumberValue() { | 27 FieldAccess AccessBuilder::ForHeapNumberValue() { |
28 FieldAccess access = {kTaggedBase, | 28 FieldAccess access = {kTaggedBase, |
29 HeapNumber::kValueOffset, | 29 HeapNumber::kValueOffset, |
30 MaybeHandle<Name>(), | 30 MaybeHandle<Name>(), |
31 TypeCache::Get().kFloat64, | 31 TypeCache::Get().kFloat64, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 Type::Internal(), MachineType::AnyTagged(), kPointerWriteBarrier}; | 85 Type::Internal(), MachineType::AnyTagged(), kPointerWriteBarrier}; |
86 return access; | 86 return access; |
87 } | 87 } |
88 | 88 |
89 | 89 |
90 // static | 90 // static |
91 FieldAccess AccessBuilder::ForJSFunctionSharedFunctionInfo() { | 91 FieldAccess AccessBuilder::ForJSFunctionSharedFunctionInfo() { |
92 FieldAccess access = {kTaggedBase, | 92 FieldAccess access = {kTaggedBase, |
93 JSFunction::kSharedFunctionInfoOffset, | 93 JSFunction::kSharedFunctionInfoOffset, |
94 Handle<Name>(), | 94 Handle<Name>(), |
95 Type::Any(), | 95 Type::OtherInternal(), |
96 MachineType::AnyTagged(), | 96 MachineType::AnyTagged(), |
97 kPointerWriteBarrier}; | 97 kPointerWriteBarrier}; |
98 return access; | 98 return access; |
99 } | 99 } |
100 | 100 |
101 // static | 101 // static |
102 FieldAccess AccessBuilder::ForJSFunctionLiterals() { | 102 FieldAccess AccessBuilder::ForJSFunctionLiterals() { |
103 FieldAccess access = { | 103 FieldAccess access = { |
104 kTaggedBase, JSFunction::kLiteralsOffset, Handle<Name>(), | 104 kTaggedBase, JSFunction::kLiteralsOffset, Handle<Name>(), |
105 Type::Internal(), MachineType::AnyTagged(), kPointerWriteBarrier}; | 105 Type::Internal(), MachineType::AnyTagged(), kPointerWriteBarrier}; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 MachineType::AnyTagged(), | 149 MachineType::AnyTagged(), |
150 kNoWriteBarrier}; | 150 kNoWriteBarrier}; |
151 return access; | 151 return access; |
152 } | 152 } |
153 | 153 |
154 // static | 154 // static |
155 FieldAccess AccessBuilder::ForJSGeneratorObjectInputOrDebugPos() { | 155 FieldAccess AccessBuilder::ForJSGeneratorObjectInputOrDebugPos() { |
156 FieldAccess access = {kTaggedBase, | 156 FieldAccess access = {kTaggedBase, |
157 JSGeneratorObject::kInputOrDebugPosOffset, | 157 JSGeneratorObject::kInputOrDebugPosOffset, |
158 Handle<Name>(), | 158 Handle<Name>(), |
159 Type::Any(), | 159 Type::NonInternal(), |
160 MachineType::AnyTagged(), | 160 MachineType::AnyTagged(), |
161 kFullWriteBarrier}; | 161 kFullWriteBarrier}; |
162 return access; | 162 return access; |
163 } | 163 } |
164 | 164 |
165 // static | 165 // static |
166 FieldAccess AccessBuilder::ForJSGeneratorObjectOperandStack() { | 166 FieldAccess AccessBuilder::ForJSGeneratorObjectOperandStack() { |
167 FieldAccess access = {kTaggedBase, | 167 FieldAccess access = {kTaggedBase, |
168 JSGeneratorObject::kOperandStackOffset, | 168 JSGeneratorObject::kOperandStackOffset, |
169 Handle<Name>(), | 169 Handle<Name>(), |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 Type::Number(), | 276 Type::Number(), |
277 MachineType::AnyTagged(), | 277 MachineType::AnyTagged(), |
278 kFullWriteBarrier}; | 278 kFullWriteBarrier}; |
279 return access; | 279 return access; |
280 } | 280 } |
281 | 281 |
282 | 282 |
283 // static | 283 // static |
284 FieldAccess AccessBuilder::ForJSIteratorResultDone() { | 284 FieldAccess AccessBuilder::ForJSIteratorResultDone() { |
285 FieldAccess access = { | 285 FieldAccess access = { |
286 kTaggedBase, JSIteratorResult::kDoneOffset, MaybeHandle<Name>(), | 286 kTaggedBase, JSIteratorResult::kDoneOffset, MaybeHandle<Name>(), |
287 Type::Any(), MachineType::AnyTagged(), kFullWriteBarrier}; | 287 Type::NonInternal(), MachineType::AnyTagged(), kFullWriteBarrier}; |
288 return access; | 288 return access; |
289 } | 289 } |
290 | 290 |
291 | 291 |
292 // static | 292 // static |
293 FieldAccess AccessBuilder::ForJSIteratorResultValue() { | 293 FieldAccess AccessBuilder::ForJSIteratorResultValue() { |
294 FieldAccess access = { | 294 FieldAccess access = { |
295 kTaggedBase, JSIteratorResult::kValueOffset, MaybeHandle<Name>(), | 295 kTaggedBase, JSIteratorResult::kValueOffset, MaybeHandle<Name>(), |
296 Type::Any(), MachineType::AnyTagged(), kFullWriteBarrier}; | 296 Type::NonInternal(), MachineType::AnyTagged(), kFullWriteBarrier}; |
297 return access; | 297 return access; |
298 } | 298 } |
299 | 299 |
300 | 300 |
301 // static | 301 // static |
302 FieldAccess AccessBuilder::ForJSRegExpFlags() { | 302 FieldAccess AccessBuilder::ForJSRegExpFlags() { |
303 FieldAccess access = { | 303 FieldAccess access = { |
304 kTaggedBase, JSRegExp::kFlagsOffset, MaybeHandle<Name>(), | 304 kTaggedBase, JSRegExp::kFlagsOffset, MaybeHandle<Name>(), |
305 Type::Tagged(), MachineType::AnyTagged(), kFullWriteBarrier}; | 305 Type::Tagged(), MachineType::AnyTagged(), kFullWriteBarrier}; |
306 return access; | 306 return access; |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 Type::Internal(), | 529 Type::Internal(), |
530 MachineType::AnyTagged(), | 530 MachineType::AnyTagged(), |
531 kPointerWriteBarrier}; | 531 kPointerWriteBarrier}; |
532 return access; | 532 return access; |
533 } | 533 } |
534 | 534 |
535 | 535 |
536 // static | 536 // static |
537 FieldAccess AccessBuilder::ForValue() { | 537 FieldAccess AccessBuilder::ForValue() { |
538 FieldAccess access = { | 538 FieldAccess access = { |
539 kTaggedBase, JSValue::kValueOffset, Handle<Name>(), | 539 kTaggedBase, JSValue::kValueOffset, Handle<Name>(), |
540 Type::Any(), MachineType::AnyTagged(), kFullWriteBarrier}; | 540 Type::NonInternal(), MachineType::AnyTagged(), kFullWriteBarrier}; |
541 return access; | 541 return access; |
542 } | 542 } |
543 | 543 |
544 | 544 |
545 // static | 545 // static |
546 FieldAccess AccessBuilder::ForArgumentsLength() { | 546 FieldAccess AccessBuilder::ForArgumentsLength() { |
547 FieldAccess access = { | 547 FieldAccess access = { |
548 kTaggedBase, JSArgumentsObject::kLengthOffset, Handle<Name>(), | 548 kTaggedBase, JSArgumentsObject::kLengthOffset, Handle<Name>(), |
549 Type::Any(), MachineType::AnyTagged(), kFullWriteBarrier}; | 549 Type::NonInternal(), MachineType::AnyTagged(), kFullWriteBarrier}; |
550 return access; | 550 return access; |
551 } | 551 } |
552 | 552 |
553 | 553 |
554 // static | 554 // static |
555 FieldAccess AccessBuilder::ForArgumentsCallee() { | 555 FieldAccess AccessBuilder::ForArgumentsCallee() { |
556 FieldAccess access = {kTaggedBase, | 556 FieldAccess access = {kTaggedBase, |
557 JSSloppyArgumentsObject::kCalleeOffset, | 557 JSSloppyArgumentsObject::kCalleeOffset, |
558 Handle<Name>(), | 558 Handle<Name>(), |
559 Type::Any(), | 559 Type::NonInternal(), |
560 MachineType::AnyTagged(), | 560 MachineType::AnyTagged(), |
561 kPointerWriteBarrier}; | 561 kPointerWriteBarrier}; |
562 return access; | 562 return access; |
563 } | 563 } |
564 | 564 |
565 | 565 |
566 // static | 566 // static |
567 FieldAccess AccessBuilder::ForFixedArraySlot(size_t index) { | 567 FieldAccess AccessBuilder::ForFixedArraySlot(size_t index) { |
568 int offset = FixedArray::OffsetOfElementAt(static_cast<int>(index)); | 568 int offset = FixedArray::OffsetOfElementAt(static_cast<int>(index)); |
569 FieldAccess access = {kTaggedBase, | 569 FieldAccess access = {kTaggedBase, |
570 offset, | 570 offset, |
571 Handle<Name>(), | 571 Handle<Name>(), |
572 Type::Any(), | 572 Type::NonInternal(), |
573 MachineType::AnyTagged(), | 573 MachineType::AnyTagged(), |
574 kFullWriteBarrier}; | 574 kFullWriteBarrier}; |
575 return access; | 575 return access; |
576 } | 576 } |
577 | 577 |
578 | 578 |
579 // static | 579 // static |
580 FieldAccess AccessBuilder::ForContextSlot(size_t index) { | 580 FieldAccess AccessBuilder::ForContextSlot(size_t index) { |
581 int offset = Context::kHeaderSize + static_cast<int>(index) * kPointerSize; | 581 int offset = Context::kHeaderSize + static_cast<int>(index) * kPointerSize; |
582 DCHECK_EQ(offset, | 582 DCHECK_EQ(offset, |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 } | 672 } |
673 UNREACHABLE(); | 673 UNREACHABLE(); |
674 ElementAccess access = {kUntaggedBase, 0, Type::None(), MachineType::None(), | 674 ElementAccess access = {kUntaggedBase, 0, Type::None(), MachineType::None(), |
675 kNoWriteBarrier}; | 675 kNoWriteBarrier}; |
676 return access; | 676 return access; |
677 } | 677 } |
678 | 678 |
679 } // namespace compiler | 679 } // namespace compiler |
680 } // namespace internal | 680 } // namespace internal |
681 } // namespace v8 | 681 } // namespace v8 |
OLD | NEW |