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 #ifndef V8_COMPILER_ACCESS_BUILDER_H_ | 5 #ifndef V8_COMPILER_ACCESS_BUILDER_H_ |
6 #define V8_COMPILER_ACCESS_BUILDER_H_ | 6 #define V8_COMPILER_ACCESS_BUILDER_H_ |
7 | 7 |
8 #include "src/compiler/simplified-operator.h" | 8 #include "src/compiler/simplified-operator.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 namespace compiler { | 12 namespace compiler { |
13 | 13 |
14 // This access builder provides a set of static methods constructing commonly | 14 // This access builder provides a set of static methods constructing commonly |
15 // used FieldAccess and ElementAccess descriptors. These descriptors serve as | 15 // used FieldAccess and ElementAccess descriptors. These descriptors serve as |
16 // parameters to simplified load/store operators. | 16 // parameters to simplified load/store operators. |
17 class AccessBuilder final : public AllStatic { | 17 class AccessBuilder final : public AllStatic { |
18 public: | 18 public: |
| 19 // =========================================================================== |
| 20 // Access to heap object fields and elements (based on tagged pointer). |
| 21 |
19 // Provides access to HeapObject::map() field. | 22 // Provides access to HeapObject::map() field. |
20 static FieldAccess ForMap(); | 23 static FieldAccess ForMap(); |
21 | 24 |
22 // Provides access to JSObject::properties() field. | 25 // Provides access to JSObject::properties() field. |
23 static FieldAccess ForJSObjectProperties(); | 26 static FieldAccess ForJSObjectProperties(); |
24 | 27 |
25 // Provides access to JSObject::elements() field. | 28 // Provides access to JSObject::elements() field. |
26 static FieldAccess ForJSObjectElements(); | 29 static FieldAccess ForJSObjectElements(); |
27 | 30 |
28 // Provides access to JSFunction::context() field. | 31 // Provides access to JSFunction::context() field. |
29 static FieldAccess ForJSFunctionContext(); | 32 static FieldAccess ForJSFunctionContext(); |
30 | 33 |
| 34 // Provides access to JSFunction::shared() field. |
| 35 static FieldAccess ForJSFunctionSharedFunctionInfo(); |
| 36 |
31 // Provides access to JSArrayBuffer::backing_store() field. | 37 // Provides access to JSArrayBuffer::backing_store() field. |
32 static FieldAccess ForJSArrayBufferBackingStore(); | 38 static FieldAccess ForJSArrayBufferBackingStore(); |
33 | 39 |
34 // Provides access to JSDate fields. | 40 // Provides access to JSDate fields. |
35 static FieldAccess ForJSDateField(JSDate::FieldIndex index); | 41 static FieldAccess ForJSDateField(JSDate::FieldIndex index); |
36 | 42 |
37 // Provides access to FixedArray::length() field. | 43 // Provides access to FixedArray::length() field. |
38 static FieldAccess ForFixedArrayLength(); | 44 static FieldAccess ForFixedArrayLength(); |
39 | 45 |
40 // Provides access to ExternalArray::external_pointer() field. | 46 // Provides access to ExternalArray::external_pointer() field. |
(...skipping 16 matching lines...) Expand all Loading... |
57 | 63 |
58 // Provides access to String::length() field. | 64 // Provides access to String::length() field. |
59 static FieldAccess ForStringLength(Zone* zone); | 65 static FieldAccess ForStringLength(Zone* zone); |
60 | 66 |
61 // Provides access to JSValue::value() field. | 67 // Provides access to JSValue::value() field. |
62 static FieldAccess ForValue(); | 68 static FieldAccess ForValue(); |
63 | 69 |
64 // Provides access Context slots. | 70 // Provides access Context slots. |
65 static FieldAccess ForContextSlot(size_t index); | 71 static FieldAccess ForContextSlot(size_t index); |
66 | 72 |
67 // Provides access to the backing store of a StatsCounter. | |
68 static FieldAccess ForStatsCounter(); | |
69 | |
70 // Provides access to PropertyCell::value() field. | 73 // Provides access to PropertyCell::value() field. |
71 static FieldAccess ForPropertyCellValue(); | 74 static FieldAccess ForPropertyCellValue(); |
72 | 75 |
| 76 // Provides access to SharedFunctionInfo::feedback_vector() field. |
| 77 static FieldAccess ForSharedFunctionInfoTypeFeedbackVector(); |
| 78 |
73 // Provides access to FixedArray elements. | 79 // Provides access to FixedArray elements. |
74 static ElementAccess ForFixedArrayElement(); | 80 static ElementAccess ForFixedArrayElement(); |
75 | 81 |
76 // Provides access to Fixed{type}TypedArray and External{type}Array elements. | 82 // Provides access to Fixed{type}TypedArray and External{type}Array elements. |
77 static ElementAccess ForTypedArrayElement(ExternalArrayType type, | 83 static ElementAccess ForTypedArrayElement(ExternalArrayType type, |
78 bool is_external); | 84 bool is_external); |
79 | 85 |
80 // Provides access to the charaters of sequential strings. | 86 // Provides access to the characters of sequential strings. |
81 static ElementAccess ForSeqStringChar(String::Encoding encoding); | 87 static ElementAccess ForSeqStringChar(String::Encoding encoding); |
82 | 88 |
83 // Provides access to the SharedFunctionInfo in a JSFunction. | 89 // =========================================================================== |
84 static FieldAccess ForJSFunctionSharedFunctionInfo(); | 90 // Access to global per-isolate variables (based on external reference). |
85 | 91 |
86 // Provides access to the TypeFeedbackVector in SharedFunctionInfo. | 92 // Provides access to the backing store of a StatsCounter. |
87 static FieldAccess ForSharedFunctionInfoTypeFeedbackVector(); | 93 static FieldAccess ForStatsCounter(); |
| 94 |
| 95 // =========================================================================== |
| 96 // Access to activation records on the stack (based on frame pointer). |
88 | 97 |
89 // Provides access to the next frame pointer in a stack frame. | 98 // Provides access to the next frame pointer in a stack frame. |
90 static FieldAccess ForFrameCallerFramePtr(); | 99 static FieldAccess ForFrameCallerFramePtr(); |
91 | 100 |
92 // Provides access to the marker in a stack frame. | 101 // Provides access to the marker in a stack frame. |
93 static FieldAccess ForFrameMarker(); | 102 static FieldAccess ForFrameMarker(); |
94 | 103 |
95 private: | 104 private: |
96 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessBuilder); | 105 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessBuilder); |
97 }; | 106 }; |
98 | 107 |
99 } // namespace compiler | 108 } // namespace compiler |
100 } // namespace internal | 109 } // namespace internal |
101 } // namespace v8 | 110 } // namespace v8 |
102 | 111 |
103 #endif // V8_COMPILER_ACCESS_BUILDER_H_ | 112 #endif // V8_COMPILER_ACCESS_BUILDER_H_ |
OLD | NEW |