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 #include "src/types-inl.h" | 6 #include "src/types-inl.h" |
7 | 7 |
8 namespace v8 { | 8 namespace v8 { |
9 namespace internal { | 9 namespace internal { |
10 namespace compiler { | 10 namespace compiler { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // static | 60 // static |
61 FieldAccess AccessBuilder::ForJSDateField(JSDate::FieldIndex index) { | 61 FieldAccess AccessBuilder::ForJSDateField(JSDate::FieldIndex index) { |
62 FieldAccess access = {kTaggedBase, | 62 FieldAccess access = {kTaggedBase, |
63 JSDate::kValueOffset + index * kPointerSize, | 63 JSDate::kValueOffset + index * kPointerSize, |
64 MaybeHandle<Name>(), Type::Number(), kMachAnyTagged}; | 64 MaybeHandle<Name>(), Type::Number(), kMachAnyTagged}; |
65 return access; | 65 return access; |
66 } | 66 } |
67 | 67 |
68 | 68 |
69 // static | 69 // static |
70 FieldAccess AccessBuilder::ForFixedArrayLength() { | 70 FieldAccess AccessBuilder::ForFixedArrayLength(Zone* zone) { |
71 // TODO(turbofan): 2^30 is a valid upper limit for the FixedArray::length | |
72 // field, although it's not the best. If we had a Zone we could create an | |
73 // appropriate range type instead. | |
74 STATIC_ASSERT(FixedArray::kMaxLength <= 1 << 30); | 71 STATIC_ASSERT(FixedArray::kMaxLength <= 1 << 30); |
75 FieldAccess access = { | 72 FieldAccess access = { |
76 kTaggedBase, FixedArray::kLengthOffset, MaybeHandle<Name>(), | 73 kTaggedBase, FixedArray::kLengthOffset, MaybeHandle<Name>(), |
77 Type::Intersect(Type::Unsigned30(), Type::TaggedSigned()), | 74 Type::Intersect(Type::Range(0, FixedArray::kMaxLength, zone), |
| 75 Type::TaggedSigned(), zone), |
78 kMachAnyTagged}; | 76 kMachAnyTagged}; |
79 return access; | 77 return access; |
80 } | 78 } |
81 | 79 |
82 | 80 |
83 // static | 81 // static |
84 FieldAccess AccessBuilder::ForDescriptorArrayEnumCache() { | 82 FieldAccess AccessBuilder::ForDescriptorArrayEnumCache() { |
85 FieldAccess access = {kTaggedBase, DescriptorArray::kEnumCacheOffset, | 83 FieldAccess access = {kTaggedBase, DescriptorArray::kEnumCacheOffset, |
86 Handle<Name>(), Type::TaggedPointer(), kMachAnyTagged}; | 84 Handle<Name>(), Type::TaggedPointer(), kMachAnyTagged}; |
87 return access; | 85 return access; |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 // static | 266 // static |
269 FieldAccess AccessBuilder::ForFrameMarker() { | 267 FieldAccess AccessBuilder::ForFrameMarker() { |
270 FieldAccess access = {kUntaggedBase, StandardFrameConstants::kMarkerOffset, | 268 FieldAccess access = {kUntaggedBase, StandardFrameConstants::kMarkerOffset, |
271 MaybeHandle<Name>(), Type::Tagged(), kMachAnyTagged}; | 269 MaybeHandle<Name>(), Type::Tagged(), kMachAnyTagged}; |
272 return access; | 270 return access; |
273 } | 271 } |
274 | 272 |
275 } // namespace compiler | 273 } // namespace compiler |
276 } // namespace internal | 274 } // namespace internal |
277 } // namespace v8 | 275 } // namespace v8 |
OLD | NEW |