Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Side by Side Diff: src/compiler/access-builder.cc

Issue 617853002: [turbofan] Add BoundsCheckMode to ElementAccess. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rename Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 // static 47 // static
48 FieldAccess AccessBuilder::ForExternalArrayPointer() { 48 FieldAccess AccessBuilder::ForExternalArrayPointer() {
49 return {kTaggedBase, ExternalArray::kExternalPointerOffset, Handle<Name>(), 49 return {kTaggedBase, ExternalArray::kExternalPointerOffset, Handle<Name>(),
50 Type::UntaggedPtr(), kMachPtr}; 50 Type::UntaggedPtr(), kMachPtr};
51 } 51 }
52 52
53 53
54 // static 54 // static
55 ElementAccess AccessBuilder::ForFixedArrayElement() { 55 ElementAccess AccessBuilder::ForFixedArrayElement() {
56 return {kTaggedBase, FixedArray::kHeaderSize, Type::Any(), kMachAnyTagged}; 56 return {kNoBoundsCheck, kTaggedBase, FixedArray::kHeaderSize, Type::Any(),
57 kMachAnyTagged};
57 } 58 }
58 59
59 60
60 // static 61 // static
61 ElementAccess AccessBuilder::ForTypedArrayElement(ExternalArrayType type, 62 ElementAccess AccessBuilder::ForTypedArrayElement(ExternalArrayType type,
62 bool is_external) { 63 bool is_external) {
63 BaseTaggedness taggedness = is_external ? kUntaggedBase : kTaggedBase; 64 BaseTaggedness taggedness = is_external ? kUntaggedBase : kTaggedBase;
64 int header_size = is_external ? 0 : FixedTypedArrayBase::kDataOffset; 65 int header_size = is_external ? 0 : FixedTypedArrayBase::kDataOffset;
65 switch (type) { 66 switch (type) {
66 case kExternalInt8Array: 67 case kExternalInt8Array:
67 return {taggedness, header_size, Type::Signed32(), kMachInt8}; 68 return {kTypedArrayBoundsCheck, taggedness, header_size, Type::Signed32(),
69 kMachInt8};
68 case kExternalUint8Array: 70 case kExternalUint8Array:
69 case kExternalUint8ClampedArray: 71 case kExternalUint8ClampedArray:
70 return {taggedness, header_size, Type::Unsigned32(), kMachUint8}; 72 return {kTypedArrayBoundsCheck, taggedness, header_size,
73 Type::Unsigned32(), kMachUint8};
71 case kExternalInt16Array: 74 case kExternalInt16Array:
72 return {taggedness, header_size, Type::Signed32(), kMachInt16}; 75 return {kTypedArrayBoundsCheck, taggedness, header_size, Type::Signed32(),
76 kMachInt16};
73 case kExternalUint16Array: 77 case kExternalUint16Array:
74 return {taggedness, header_size, Type::Unsigned32(), kMachUint16}; 78 return {kTypedArrayBoundsCheck, taggedness, header_size,
79 Type::Unsigned32(), kMachUint16};
75 case kExternalInt32Array: 80 case kExternalInt32Array:
76 return {taggedness, header_size, Type::Signed32(), kMachInt32}; 81 return {kTypedArrayBoundsCheck, taggedness, header_size, Type::Signed32(),
82 kMachInt32};
77 case kExternalUint32Array: 83 case kExternalUint32Array:
78 return {taggedness, header_size, Type::Unsigned32(), kMachUint32}; 84 return {kTypedArrayBoundsCheck, taggedness, header_size,
85 Type::Unsigned32(), kMachUint32};
79 case kExternalFloat32Array: 86 case kExternalFloat32Array:
80 return {taggedness, header_size, Type::Number(), kRepFloat32}; 87 return {kTypedArrayBoundsCheck, taggedness, header_size, Type::Number(),
88 kRepFloat32};
81 case kExternalFloat64Array: 89 case kExternalFloat64Array:
82 return {taggedness, header_size, Type::Number(), kRepFloat64}; 90 return {kTypedArrayBoundsCheck, taggedness, header_size, Type::Number(),
91 kRepFloat64};
83 } 92 }
84 UNREACHABLE(); 93 UNREACHABLE();
85 return {kUntaggedBase, 0, Type::None(), kMachNone}; 94 return {kTypedArrayBoundsCheck, kUntaggedBase, 0, Type::None(), kMachNone};
86 } 95 }
87 96
88 } // namespace compiler 97 } // namespace compiler
89 } // namespace internal 98 } // namespace internal
90 } // namespace v8 99 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698