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" |
11 #include "src/types-inl.h" | 11 #include "src/types-inl.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 = {kTaggedBase, HeapObject::kMapOffset, | 19 FieldAccess access = {kTaggedBase, HeapObject::kMapOffset, "HeapObject::map", |
20 MaybeHandle<Name>(), Type::Any(), | 20 Type::Any(), MachineType::AnyTagged()}; |
21 MachineType::AnyTagged()}; | |
22 return access; | 21 return access; |
23 } | 22 } |
24 | 23 |
25 | 24 |
26 // static | 25 // static |
27 FieldAccess AccessBuilder::ForHeapNumberValue() { | 26 FieldAccess AccessBuilder::ForHeapNumberValue() { |
28 FieldAccess access = {kTaggedBase, HeapNumber::kValueOffset, | 27 FieldAccess access = {kTaggedBase, HeapNumber::kValueOffset, |
29 MaybeHandle<Name>(), TypeCache().Get().kFloat64, | 28 "HeapNumber::value", TypeCache().Get().kFloat64, |
30 MachineType::Float64()}; | 29 MachineType::Float64()}; |
31 return access; | 30 return access; |
32 } | 31 } |
33 | 32 |
34 | 33 |
35 // static | 34 // static |
36 FieldAccess AccessBuilder::ForJSObjectProperties() { | 35 FieldAccess AccessBuilder::ForJSObjectProperties() { |
37 FieldAccess access = {kTaggedBase, JSObject::kPropertiesOffset, | 36 FieldAccess access = {kTaggedBase, JSObject::kPropertiesOffset, |
38 MaybeHandle<Name>(), Type::Internal(), | 37 "JSObject::properties", Type::Internal(), |
39 MachineType::AnyTagged()}; | 38 MachineType::AnyTagged()}; |
40 return access; | 39 return access; |
41 } | 40 } |
42 | 41 |
43 | 42 |
44 // static | 43 // static |
45 FieldAccess AccessBuilder::ForJSObjectElements() { | 44 FieldAccess AccessBuilder::ForJSObjectElements() { |
46 FieldAccess access = {kTaggedBase, JSObject::kElementsOffset, | 45 FieldAccess access = {kTaggedBase, JSObject::kElementsOffset, |
47 MaybeHandle<Name>(), Type::Internal(), | 46 "JSObject::elements", Type::Internal(), |
48 MachineType::AnyTagged()}; | 47 MachineType::AnyTagged()}; |
49 return access; | 48 return access; |
50 } | 49 } |
51 | 50 |
52 | 51 |
53 // static | 52 // static |
54 FieldAccess AccessBuilder::ForJSObjectInObjectProperty(Handle<Map> map, | 53 FieldAccess AccessBuilder::ForJSObjectInObjectProperty(Handle<Map> map, |
55 int index) { | 54 int index) { |
56 int const offset = map->GetInObjectPropertyOffset(index); | 55 int const offset = map->GetInObjectPropertyOffset(index); |
57 FieldAccess access = {kTaggedBase, offset, MaybeHandle<Name>(), | 56 FieldAccess access = {kTaggedBase, offset, "JSObject::field[n]", |
58 Type::Tagged(), MachineType::AnyTagged()}; | 57 Type::Tagged(), MachineType::AnyTagged()}; |
59 return access; | 58 return access; |
60 } | 59 } |
61 | 60 |
62 | 61 |
63 // static | 62 // static |
64 FieldAccess AccessBuilder::ForJSFunctionContext() { | 63 FieldAccess AccessBuilder::ForJSFunctionContext() { |
65 FieldAccess access = {kTaggedBase, JSFunction::kContextOffset, | 64 FieldAccess access = {kTaggedBase, JSFunction::kContextOffset, |
66 MaybeHandle<Name>(), Type::Internal(), | 65 "JSFunction::context", Type::Internal(), |
67 MachineType::AnyTagged()}; | 66 MachineType::AnyTagged()}; |
68 return access; | 67 return access; |
69 } | 68 } |
70 | 69 |
71 | 70 |
72 // static | 71 // static |
73 FieldAccess AccessBuilder::ForJSFunctionSharedFunctionInfo() { | 72 FieldAccess AccessBuilder::ForJSFunctionSharedFunctionInfo() { |
74 FieldAccess access = {kTaggedBase, JSFunction::kSharedFunctionInfoOffset, | 73 FieldAccess access = {kTaggedBase, JSFunction::kSharedFunctionInfoOffset, |
75 Handle<Name>(), Type::Any(), MachineType::AnyTagged()}; | 74 "JSFunction::shared", Type::Any(), |
| 75 MachineType::AnyTagged()}; |
76 return access; | 76 return access; |
77 } | 77 } |
78 | 78 |
79 | 79 |
80 // static | 80 // static |
81 FieldAccess AccessBuilder::ForJSArrayLength(ElementsKind elements_kind) { | 81 FieldAccess AccessBuilder::ForJSArrayLength(ElementsKind elements_kind) { |
82 TypeCache const& type_cache = TypeCache::Get(); | 82 TypeCache const& type_cache = TypeCache::Get(); |
83 FieldAccess access = {kTaggedBase, JSArray::kLengthOffset, Handle<Name>(), | 83 FieldAccess access = {kTaggedBase, JSArray::kLengthOffset, "JSArray::length", |
84 type_cache.kJSArrayLengthType, | 84 type_cache.kJSArrayLengthType, |
85 MachineType::AnyTagged()}; | 85 MachineType::AnyTagged()}; |
86 if (IsFastDoubleElementsKind(elements_kind)) { | 86 if (IsFastDoubleElementsKind(elements_kind)) { |
87 access.type = type_cache.kFixedDoubleArrayLengthType; | 87 access.type = type_cache.kFixedDoubleArrayLengthType; |
88 } else if (IsFastElementsKind(elements_kind)) { | 88 } else if (IsFastElementsKind(elements_kind)) { |
89 access.type = type_cache.kFixedArrayLengthType; | 89 access.type = type_cache.kFixedArrayLengthType; |
90 } | 90 } |
91 return access; | 91 return access; |
92 } | 92 } |
93 | 93 |
94 | 94 |
95 // static | 95 // static |
96 FieldAccess AccessBuilder::ForJSArrayBufferBackingStore() { | 96 FieldAccess AccessBuilder::ForJSArrayBufferBackingStore() { |
97 FieldAccess access = {kTaggedBase, JSArrayBuffer::kBackingStoreOffset, | 97 FieldAccess access = {kTaggedBase, JSArrayBuffer::kBackingStoreOffset, |
98 MaybeHandle<Name>(), Type::UntaggedPointer(), | 98 "JSArrayBuffer::backing_store", Type::UntaggedPointer(), |
99 MachineType::Pointer()}; | 99 MachineType::Pointer()}; |
100 return access; | 100 return access; |
101 } | 101 } |
102 | 102 |
103 | 103 |
104 // static | 104 // static |
105 FieldAccess AccessBuilder::ForJSArrayBufferBitField() { | 105 FieldAccess AccessBuilder::ForJSArrayBufferBitField() { |
106 FieldAccess access = {kTaggedBase, JSArrayBuffer::kBitFieldOffset, | 106 FieldAccess access = {kTaggedBase, JSArrayBuffer::kBitFieldOffset, |
107 MaybeHandle<Name>(), TypeCache::Get().kInt8, | 107 "JSArrayBuffer::bit_field", TypeCache::Get().kInt8, |
108 MachineType::Int8()}; | 108 MachineType::Int8()}; |
109 return access; | 109 return access; |
110 } | 110 } |
111 | 111 |
112 | 112 |
113 // static | 113 // static |
114 FieldAccess AccessBuilder::ForJSArrayBufferViewBuffer() { | 114 FieldAccess AccessBuilder::ForJSArrayBufferViewBuffer() { |
115 FieldAccess access = {kTaggedBase, JSArrayBufferView::kBufferOffset, | 115 FieldAccess access = {kTaggedBase, JSArrayBufferView::kBufferOffset, |
116 MaybeHandle<Name>(), Type::TaggedPointer(), | 116 "JSArrayBufferView::buffer", Type::TaggedPointer(), |
117 MachineType::AnyTagged()}; | 117 MachineType::AnyTagged()}; |
118 return access; | 118 return access; |
119 } | 119 } |
120 | 120 |
121 | 121 |
122 // static | 122 // static |
123 FieldAccess AccessBuilder::ForJSDateField(JSDate::FieldIndex index) { | 123 FieldAccess AccessBuilder::ForJSDateField(JSDate::FieldIndex index) { |
124 FieldAccess access = { | 124 FieldAccess access = { |
125 kTaggedBase, JSDate::kValueOffset + index * kPointerSize, | 125 kTaggedBase, JSDate::kValueOffset + index * kPointerSize, |
126 MaybeHandle<Name>(), Type::Number(), MachineType::AnyTagged()}; | 126 "JSDate::field[n]", Type::Number(), MachineType::AnyTagged()}; |
127 return access; | 127 return access; |
128 } | 128 } |
129 | 129 |
130 | 130 |
131 // static | 131 // static |
132 FieldAccess AccessBuilder::ForFixedArrayLength() { | 132 FieldAccess AccessBuilder::ForFixedArrayLength() { |
133 FieldAccess access = { | 133 FieldAccess access = { |
134 kTaggedBase, FixedArray::kLengthOffset, MaybeHandle<Name>(), | 134 kTaggedBase, FixedArray::kLengthOffset, "FixedArray::length", |
135 TypeCache::Get().kFixedArrayLengthType, MachineType::AnyTagged()}; | 135 TypeCache::Get().kFixedArrayLengthType, MachineType::AnyTagged()}; |
136 return access; | 136 return access; |
137 } | 137 } |
138 | 138 |
139 | 139 |
140 // static | 140 // static |
141 FieldAccess AccessBuilder::ForDescriptorArrayEnumCache() { | 141 FieldAccess AccessBuilder::ForDescriptorArrayEnumCache() { |
142 FieldAccess access = {kTaggedBase, DescriptorArray::kEnumCacheOffset, | 142 FieldAccess access = {kTaggedBase, DescriptorArray::kEnumCacheOffset, |
143 Handle<Name>(), Type::TaggedPointer(), | 143 "DescriptorArray::enum_cache", Type::TaggedPointer(), |
144 MachineType::AnyTagged()}; | 144 MachineType::AnyTagged()}; |
145 return access; | 145 return access; |
146 } | 146 } |
147 | 147 |
148 | 148 |
149 // static | 149 // static |
150 FieldAccess AccessBuilder::ForDescriptorArrayEnumCacheBridgeCache() { | 150 FieldAccess AccessBuilder::ForDescriptorArrayEnumCacheBridgeCache() { |
151 FieldAccess access = { | 151 FieldAccess access = {kTaggedBase, |
152 kTaggedBase, DescriptorArray::kEnumCacheBridgeCacheOffset, Handle<Name>(), | 152 DescriptorArray::kEnumCacheBridgeCacheOffset, |
153 Type::TaggedPointer(), MachineType::AnyTagged()}; | 153 "DescriptorArray::enum_cache_bridge_cache", |
| 154 Type::TaggedPointer(), MachineType::AnyTagged()}; |
154 return access; | 155 return access; |
155 } | 156 } |
156 | 157 |
157 | 158 |
158 // static | 159 // static |
159 FieldAccess AccessBuilder::ForMapBitField3() { | 160 FieldAccess AccessBuilder::ForMapBitField3() { |
160 FieldAccess access = {kTaggedBase, Map::kBitField3Offset, Handle<Name>(), | 161 FieldAccess access = {kTaggedBase, Map::kBitField3Offset, "Map::bit_field3", |
161 TypeCache::Get().kInt32, MachineType::Int32()}; | 162 TypeCache::Get().kInt32, MachineType::Int32()}; |
162 return access; | 163 return access; |
163 } | 164 } |
164 | 165 |
165 | 166 |
166 // static | 167 // static |
167 FieldAccess AccessBuilder::ForMapDescriptors() { | 168 FieldAccess AccessBuilder::ForMapDescriptors() { |
168 FieldAccess access = {kTaggedBase, Map::kDescriptorsOffset, Handle<Name>(), | 169 FieldAccess access = {kTaggedBase, Map::kDescriptorsOffset, |
169 Type::TaggedPointer(), MachineType::AnyTagged()}; | 170 "Map::descriptors", Type::TaggedPointer(), |
| 171 MachineType::AnyTagged()}; |
170 return access; | 172 return access; |
171 } | 173 } |
172 | 174 |
173 | 175 |
174 // static | 176 // static |
175 FieldAccess AccessBuilder::ForMapInstanceType() { | 177 FieldAccess AccessBuilder::ForMapInstanceType() { |
176 FieldAccess access = {kTaggedBase, Map::kInstanceTypeOffset, Handle<Name>(), | 178 FieldAccess access = {kTaggedBase, Map::kInstanceTypeOffset, |
177 TypeCache::Get().kUint8, MachineType::Uint8()}; | 179 "Map::instance_type", TypeCache::Get().kUint8, |
| 180 MachineType::Uint8()}; |
178 return access; | 181 return access; |
179 } | 182 } |
180 | 183 |
181 | 184 |
182 // static | 185 // static |
183 FieldAccess AccessBuilder::ForMapPrototype() { | 186 FieldAccess AccessBuilder::ForMapPrototype() { |
184 FieldAccess access = {kTaggedBase, Map::kPrototypeOffset, Handle<Name>(), | 187 FieldAccess access = {kTaggedBase, Map::kPrototypeOffset, "Map::prototype", |
185 Type::TaggedPointer(), MachineType::AnyTagged()}; | 188 Type::TaggedPointer(), MachineType::AnyTagged()}; |
186 return access; | 189 return access; |
187 } | 190 } |
188 | 191 |
189 | 192 |
190 // static | 193 // static |
191 FieldAccess AccessBuilder::ForStringLength() { | 194 FieldAccess AccessBuilder::ForStringLength() { |
192 FieldAccess access = {kTaggedBase, String::kLengthOffset, Handle<Name>(), | 195 FieldAccess access = {kTaggedBase, String::kLengthOffset, "String::length", |
193 TypeCache::Get().kStringLengthType, | 196 TypeCache::Get().kStringLengthType, |
194 MachineType::AnyTagged()}; | 197 MachineType::AnyTagged()}; |
195 return access; | 198 return access; |
196 } | 199 } |
197 | 200 |
198 | 201 |
199 // static | 202 // static |
200 FieldAccess AccessBuilder::ForJSGlobalObjectGlobalProxy() { | 203 FieldAccess AccessBuilder::ForJSGlobalObjectGlobalProxy() { |
201 FieldAccess access = {kTaggedBase, JSGlobalObject::kGlobalProxyOffset, | 204 FieldAccess access = {kTaggedBase, JSGlobalObject::kGlobalProxyOffset, |
202 Handle<Name>(), Type::Receiver(), | 205 "JSGlobalObject::global_proxy", Type::Receiver(), |
203 MachineType::AnyTagged()}; | 206 MachineType::AnyTagged()}; |
204 return access; | 207 return access; |
205 } | 208 } |
206 | 209 |
207 | 210 |
208 // static | 211 // static |
209 FieldAccess AccessBuilder::ForJSGlobalObjectNativeContext() { | 212 FieldAccess AccessBuilder::ForJSGlobalObjectNativeContext() { |
210 FieldAccess access = {kTaggedBase, JSGlobalObject::kNativeContextOffset, | 213 FieldAccess access = {kTaggedBase, JSGlobalObject::kNativeContextOffset, |
211 Handle<Name>(), Type::Internal(), | 214 "JSGlobalObject::native_context", Type::Internal(), |
212 MachineType::AnyTagged()}; | 215 MachineType::AnyTagged()}; |
213 return access; | 216 return access; |
214 } | 217 } |
215 | 218 |
216 | 219 |
217 // static | 220 // static |
218 FieldAccess AccessBuilder::ForValue() { | 221 FieldAccess AccessBuilder::ForValue() { |
219 FieldAccess access = {kTaggedBase, JSValue::kValueOffset, Handle<Name>(), | 222 FieldAccess access = {kTaggedBase, JSValue::kValueOffset, "JSValue::value", |
220 Type::Any(), MachineType::AnyTagged()}; | 223 Type::Any(), MachineType::AnyTagged()}; |
221 return access; | 224 return access; |
222 } | 225 } |
223 | 226 |
224 | 227 |
225 // static | 228 // static |
226 FieldAccess AccessBuilder::ForArgumentsLength() { | 229 FieldAccess AccessBuilder::ForArgumentsLength() { |
227 int offset = | 230 int offset = |
228 JSObject::kHeaderSize + Heap::kArgumentsLengthIndex * kPointerSize; | 231 JSObject::kHeaderSize + Heap::kArgumentsLengthIndex * kPointerSize; |
229 FieldAccess access = {kTaggedBase, offset, Handle<Name>(), Type::Any(), | 232 FieldAccess access = {kTaggedBase, offset, "Arguments::length", Type::Any(), |
230 MachineType::AnyTagged()}; | 233 MachineType::AnyTagged()}; |
231 return access; | 234 return access; |
232 } | 235 } |
233 | 236 |
234 | 237 |
235 // static | 238 // static |
236 FieldAccess AccessBuilder::ForArgumentsCallee() { | 239 FieldAccess AccessBuilder::ForArgumentsCallee() { |
237 int offset = | 240 int offset = |
238 JSObject::kHeaderSize + Heap::kArgumentsCalleeIndex * kPointerSize; | 241 JSObject::kHeaderSize + Heap::kArgumentsCalleeIndex * kPointerSize; |
239 FieldAccess access = {kTaggedBase, offset, Handle<Name>(), Type::Any(), | 242 FieldAccess access = {kTaggedBase, offset, "Arguments::callee", Type::Any(), |
240 MachineType::AnyTagged()}; | 243 MachineType::AnyTagged()}; |
241 return access; | 244 return access; |
242 } | 245 } |
243 | 246 |
244 | 247 |
245 // static | 248 // static |
246 FieldAccess AccessBuilder::ForFixedArraySlot(size_t index) { | 249 FieldAccess AccessBuilder::ForFixedArraySlot(size_t index) { |
247 int offset = FixedArray::OffsetOfElementAt(static_cast<int>(index)); | 250 int offset = FixedArray::OffsetOfElementAt(static_cast<int>(index)); |
248 FieldAccess access = {kTaggedBase, offset, Handle<Name>(), Type::Any(), | 251 FieldAccess access = {kTaggedBase, offset, "FixedArray::slot[n]", Type::Any(), |
249 MachineType::AnyTagged()}; | 252 MachineType::AnyTagged()}; |
250 return access; | 253 return access; |
251 } | 254 } |
252 | 255 |
253 | 256 |
254 // static | 257 // static |
255 FieldAccess AccessBuilder::ForContextSlot(size_t index) { | 258 FieldAccess AccessBuilder::ForContextSlot(size_t index) { |
256 int offset = Context::kHeaderSize + static_cast<int>(index) * kPointerSize; | 259 int offset = Context::kHeaderSize + static_cast<int>(index) * kPointerSize; |
257 DCHECK_EQ(offset, | 260 DCHECK_EQ(offset, |
258 Context::SlotOffset(static_cast<int>(index)) + kHeapObjectTag); | 261 Context::SlotOffset(static_cast<int>(index)) + kHeapObjectTag); |
259 FieldAccess access = {kTaggedBase, offset, Handle<Name>(), Type::Any(), | 262 FieldAccess access = {kTaggedBase, offset, "Context::slot[n]", Type::Any(), |
260 MachineType::AnyTagged()}; | 263 MachineType::AnyTagged()}; |
261 return access; | 264 return access; |
262 } | 265 } |
263 | 266 |
264 | 267 |
265 // static | 268 // static |
266 FieldAccess AccessBuilder::ForPropertyCellValue() { | 269 FieldAccess AccessBuilder::ForPropertyCellValue() { |
267 return ForPropertyCellValue(Type::Tagged()); | 270 return ForPropertyCellValue(Type::Tagged()); |
268 } | 271 } |
269 | 272 |
270 | 273 |
271 // static | 274 // static |
272 FieldAccess AccessBuilder::ForPropertyCellValue(Type* type) { | 275 FieldAccess AccessBuilder::ForPropertyCellValue(Type* type) { |
273 FieldAccess access = {kTaggedBase, PropertyCell::kValueOffset, Handle<Name>(), | 276 FieldAccess access = {kTaggedBase, PropertyCell::kValueOffset, |
274 type, MachineType::AnyTagged()}; | 277 "PropertyCall::value", type, MachineType::AnyTagged()}; |
275 return access; | 278 return access; |
276 } | 279 } |
277 | 280 |
278 | 281 |
279 // static | 282 // static |
280 FieldAccess AccessBuilder::ForSharedFunctionInfoTypeFeedbackVector() { | 283 FieldAccess AccessBuilder::ForSharedFunctionInfoTypeFeedbackVector() { |
281 FieldAccess access = {kTaggedBase, SharedFunctionInfo::kFeedbackVectorOffset, | 284 FieldAccess access = {kTaggedBase, SharedFunctionInfo::kFeedbackVectorOffset, |
282 Handle<Name>(), Type::Any(), MachineType::AnyTagged()}; | 285 "SharedFunctionInfo::feedback_vector", Type::Any(), |
| 286 MachineType::AnyTagged()}; |
283 return access; | 287 return access; |
284 } | 288 } |
285 | 289 |
286 | 290 |
287 // static | 291 // static |
288 ElementAccess AccessBuilder::ForFixedArrayElement() { | 292 ElementAccess AccessBuilder::ForFixedArrayElement() { |
289 ElementAccess access = {kTaggedBase, FixedArray::kHeaderSize, Type::Tagged(), | 293 ElementAccess access = {kTaggedBase, FixedArray::kHeaderSize, Type::Tagged(), |
290 MachineType::AnyTagged()}; | 294 MachineType::AnyTagged()}; |
291 return access; | 295 return access; |
292 } | 296 } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 } | 353 } |
350 } | 354 } |
351 UNREACHABLE(); | 355 UNREACHABLE(); |
352 ElementAccess access = {kUntaggedBase, 0, Type::None(), MachineType::None()}; | 356 ElementAccess access = {kUntaggedBase, 0, Type::None(), MachineType::None()}; |
353 return access; | 357 return access; |
354 } | 358 } |
355 | 359 |
356 | 360 |
357 // static | 361 // static |
358 FieldAccess AccessBuilder::ForStatsCounter() { | 362 FieldAccess AccessBuilder::ForStatsCounter() { |
359 FieldAccess access = {kUntaggedBase, 0, MaybeHandle<Name>(), | 363 FieldAccess access = {kUntaggedBase, 0, "##StatsCounter##", |
360 TypeCache::Get().kInt32, MachineType::Int32()}; | 364 TypeCache::Get().kInt32, MachineType::Int32()}; |
361 return access; | 365 return access; |
362 } | 366 } |
363 | 367 |
364 | 368 |
365 // static | 369 // static |
366 FieldAccess AccessBuilder::ForFrameCallerFramePtr() { | 370 FieldAccess AccessBuilder::ForFrameCallerFramePtr() { |
367 FieldAccess access = {kUntaggedBase, StandardFrameConstants::kCallerFPOffset, | 371 FieldAccess access = {kUntaggedBase, StandardFrameConstants::kCallerFPOffset, |
368 MaybeHandle<Name>(), Type::Internal(), | 372 "##FrameCallerFP##", Type::Internal(), |
369 MachineType::Pointer()}; | 373 MachineType::Pointer()}; |
370 return access; | 374 return access; |
371 } | 375 } |
372 | 376 |
373 | 377 |
374 // static | 378 // static |
375 FieldAccess AccessBuilder::ForFrameMarker() { | 379 FieldAccess AccessBuilder::ForFrameMarker() { |
376 FieldAccess access = {kUntaggedBase, StandardFrameConstants::kMarkerOffset, | 380 FieldAccess access = {kUntaggedBase, StandardFrameConstants::kMarkerOffset, |
377 MaybeHandle<Name>(), Type::Tagged(), | 381 "##FrameMarker##", Type::Tagged(), |
378 MachineType::AnyTagged()}; | 382 MachineType::AnyTagged()}; |
379 return access; | 383 return access; |
380 } | 384 } |
381 | 385 |
| 386 |
| 387 // static |
| 388 const char* AccessBuilder::GetNameForTracing(Handle<Name> name, Zone* zone) { |
| 389 #ifdef OBJECT_PRINT |
| 390 if (FLAG_trace_turbo || FLAG_trace_turbo_graph) { |
| 391 std::ostringstream os; |
| 392 name->Print(os); |
| 393 char* result = zone->NewArray<char>(os.str().length() + 1); |
| 394 Vector<char> vector(result, os.str().length() + 1); |
| 395 SNPrintF(vector, "%s", os.str().c_str()); |
| 396 return result; |
| 397 } |
| 398 #endif |
| 399 return nullptr; |
| 400 } |
| 401 |
382 } // namespace compiler | 402 } // namespace compiler |
383 } // namespace internal | 403 } // namespace internal |
384 } // namespace v8 | 404 } // namespace v8 |
OLD | NEW |