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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 return access; | 298 return access; |
299 } | 299 } |
300 } | 300 } |
301 UNREACHABLE(); | 301 UNREACHABLE(); |
302 ElementAccess access = {kUntaggedBase, 0, Type::None(), kMachNone}; | 302 ElementAccess access = {kUntaggedBase, 0, Type::None(), kMachNone}; |
303 return access; | 303 return access; |
304 } | 304 } |
305 | 305 |
306 | 306 |
307 // static | 307 // static |
308 ElementAccess AccessBuilder::ForSeqStringChar(String::Encoding encoding) { | |
309 switch (encoding) { | |
310 case String::ONE_BYTE_ENCODING: { | |
311 ElementAccess access = {kTaggedBase, SeqString::kHeaderSize, | |
312 Type::Unsigned32(), kMachUint8}; | |
313 return access; | |
314 } | |
315 case String::TWO_BYTE_ENCODING: { | |
316 ElementAccess access = {kTaggedBase, SeqString::kHeaderSize, | |
317 Type::Unsigned32(), kMachUint16}; | |
318 return access; | |
319 } | |
320 } | |
321 UNREACHABLE(); | |
322 ElementAccess access = {kUntaggedBase, 0, Type::None(), kMachNone}; | |
323 return access; | |
324 } | |
325 | |
326 | |
327 // static | |
328 FieldAccess AccessBuilder::ForStatsCounter() { | 308 FieldAccess AccessBuilder::ForStatsCounter() { |
329 FieldAccess access = {kUntaggedBase, 0, MaybeHandle<Name>(), | 309 FieldAccess access = {kUntaggedBase, 0, MaybeHandle<Name>(), |
330 TypeCache::Get().kInt32, kMachInt32}; | 310 TypeCache::Get().kInt32, kMachInt32}; |
331 return access; | 311 return access; |
332 } | 312 } |
333 | 313 |
334 | 314 |
335 // static | 315 // static |
336 FieldAccess AccessBuilder::ForFrameCallerFramePtr() { | 316 FieldAccess AccessBuilder::ForFrameCallerFramePtr() { |
337 FieldAccess access = {kUntaggedBase, StandardFrameConstants::kCallerFPOffset, | 317 FieldAccess access = {kUntaggedBase, StandardFrameConstants::kCallerFPOffset, |
338 MaybeHandle<Name>(), Type::Internal(), kMachPtr}; | 318 MaybeHandle<Name>(), Type::Internal(), kMachPtr}; |
339 return access; | 319 return access; |
340 } | 320 } |
341 | 321 |
342 | 322 |
343 // static | 323 // static |
344 FieldAccess AccessBuilder::ForFrameMarker() { | 324 FieldAccess AccessBuilder::ForFrameMarker() { |
345 FieldAccess access = {kUntaggedBase, StandardFrameConstants::kMarkerOffset, | 325 FieldAccess access = {kUntaggedBase, StandardFrameConstants::kMarkerOffset, |
346 MaybeHandle<Name>(), Type::Tagged(), kMachAnyTagged}; | 326 MaybeHandle<Name>(), Type::Tagged(), kMachAnyTagged}; |
347 return access; | 327 return access; |
348 } | 328 } |
349 | 329 |
350 } // namespace compiler | 330 } // namespace compiler |
351 } // namespace internal | 331 } // namespace internal |
352 } // namespace v8 | 332 } // namespace v8 |
OLD | NEW |