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/heap/heap.h" | 9 #include "src/heap/heap.h" |
10 #include "src/type-cache.h" | 10 #include "src/type-cache.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 // static | 68 // static |
69 FieldAccess AccessBuilder::ForJSFunctionSharedFunctionInfo() { | 69 FieldAccess AccessBuilder::ForJSFunctionSharedFunctionInfo() { |
70 FieldAccess access = {kTaggedBase, JSFunction::kSharedFunctionInfoOffset, | 70 FieldAccess access = {kTaggedBase, JSFunction::kSharedFunctionInfoOffset, |
71 Handle<Name>(), Type::Any(), kMachAnyTagged}; | 71 Handle<Name>(), Type::Any(), kMachAnyTagged}; |
72 return access; | 72 return access; |
73 } | 73 } |
74 | 74 |
75 | 75 |
76 // static | 76 // static |
| 77 FieldAccess AccessBuilder::ForJSArrayLength(ElementsKind elements_kind) { |
| 78 TypeCache const& type_cache = TypeCache::Get(); |
| 79 FieldAccess access = {kTaggedBase, JSArray::kLengthOffset, Handle<Name>(), |
| 80 type_cache.kJSArrayLengthType, kMachAnyTagged}; |
| 81 if (IsFastDoubleElementsKind(elements_kind)) { |
| 82 access.type = type_cache.kFixedDoubleArrayLengthType; |
| 83 } else if (IsFastElementsKind(elements_kind)) { |
| 84 access.type = type_cache.kFixedArrayLengthType; |
| 85 } |
| 86 return access; |
| 87 } |
| 88 |
| 89 |
| 90 // static |
77 FieldAccess AccessBuilder::ForJSArrayBufferBackingStore() { | 91 FieldAccess AccessBuilder::ForJSArrayBufferBackingStore() { |
78 FieldAccess access = {kTaggedBase, JSArrayBuffer::kBackingStoreOffset, | 92 FieldAccess access = {kTaggedBase, JSArrayBuffer::kBackingStoreOffset, |
79 MaybeHandle<Name>(), Type::UntaggedPointer(), kMachPtr}; | 93 MaybeHandle<Name>(), Type::UntaggedPointer(), kMachPtr}; |
80 return access; | 94 return access; |
81 } | 95 } |
82 | 96 |
83 | 97 |
84 // static | 98 // static |
85 FieldAccess AccessBuilder::ForJSArrayBufferBitField() { | 99 FieldAccess AccessBuilder::ForJSArrayBufferBitField() { |
86 FieldAccess access = {kTaggedBase, JSArrayBuffer::kBitFieldOffset, | 100 FieldAccess access = {kTaggedBase, JSArrayBuffer::kBitFieldOffset, |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 // static | 354 // static |
341 FieldAccess AccessBuilder::ForFrameMarker() { | 355 FieldAccess AccessBuilder::ForFrameMarker() { |
342 FieldAccess access = {kUntaggedBase, StandardFrameConstants::kMarkerOffset, | 356 FieldAccess access = {kUntaggedBase, StandardFrameConstants::kMarkerOffset, |
343 MaybeHandle<Name>(), Type::Tagged(), kMachAnyTagged}; | 357 MaybeHandle<Name>(), Type::Tagged(), kMachAnyTagged}; |
344 return access; | 358 return access; |
345 } | 359 } |
346 | 360 |
347 } // namespace compiler | 361 } // namespace compiler |
348 } // namespace internal | 362 } // namespace internal |
349 } // namespace v8 | 363 } // namespace v8 |
OLD | NEW |