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

Side by Side Diff: src/compiler/simplified-operator-unittest.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 | « src/compiler/simplified-operator.cc ('k') | test/cctest/compiler/test-simplified-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/simplified-operator.h" 5 #include "src/compiler/simplified-operator.h"
6 6
7 #include "src/compiler/operator-properties-inl.h" 7 #include "src/compiler/operator-properties-inl.h"
8 #include "src/test/test-utils.h" 8 #include "src/test/test-utils.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 INSTANTIATE_TEST_CASE_P(SimplifiedOperatorTest, SimplifiedPureOperatorTest, 112 INSTANTIATE_TEST_CASE_P(SimplifiedOperatorTest, SimplifiedPureOperatorTest,
113 ::testing::ValuesIn(kPureOperators)); 113 ::testing::ValuesIn(kPureOperators));
114 114
115 115
116 // ----------------------------------------------------------------------------- 116 // -----------------------------------------------------------------------------
117 // Element access operators. 117 // Element access operators.
118 118
119 namespace { 119 namespace {
120 120
121 const ElementAccess kElementAccesses[] = { 121 const ElementAccess kElementAccesses[] = {
122 {kTaggedBase, FixedArray::kHeaderSize, Type::Any(), kMachAnyTagged}, 122 {kNoBoundsCheck, kTaggedBase, FixedArray::kHeaderSize, Type::Any(),
123 {kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag, Type::Any(), 123 kMachAnyTagged},
124 kMachInt8}, 124 {kNoBoundsCheck, kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag,
125 {kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag, Type::Any(), 125 Type::Any(), kMachInt8},
126 kMachInt16}, 126 {kNoBoundsCheck, kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag,
127 {kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag, Type::Any(), 127 Type::Any(), kMachInt16},
128 kMachInt32}, 128 {kNoBoundsCheck, kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag,
129 {kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag, Type::Any(), 129 Type::Any(), kMachInt32},
130 kMachUint8}, 130 {kNoBoundsCheck, kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag,
131 {kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag, Type::Any(), 131 Type::Any(), kMachUint8},
132 kMachUint16}, 132 {kNoBoundsCheck, kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag,
133 {kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag, Type::Any(), 133 Type::Any(), kMachUint16},
134 kMachUint32}, 134 {kNoBoundsCheck, kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag,
135 {kUntaggedBase, 0, Type::Signed32(), kMachInt8}, 135 Type::Any(), kMachUint32},
136 {kUntaggedBase, 0, Type::Unsigned32(), kMachUint8}, 136 {kTypedArrayBoundsCheck, kUntaggedBase, 0, Type::Signed32(), kMachInt8},
137 {kUntaggedBase, 0, Type::Signed32(), kMachInt16}, 137 {kTypedArrayBoundsCheck, kUntaggedBase, 0, Type::Unsigned32(), kMachUint8},
138 {kUntaggedBase, 0, Type::Unsigned32(), kMachUint16}, 138 {kTypedArrayBoundsCheck, kUntaggedBase, 0, Type::Signed32(), kMachInt16},
139 {kUntaggedBase, 0, Type::Signed32(), kMachInt32}, 139 {kTypedArrayBoundsCheck, kUntaggedBase, 0, Type::Unsigned32(), kMachUint16},
140 {kUntaggedBase, 0, Type::Unsigned32(), kMachUint32}, 140 {kTypedArrayBoundsCheck, kUntaggedBase, 0, Type::Signed32(), kMachInt32},
141 {kUntaggedBase, 0, Type::Number(), kRepFloat32}, 141 {kTypedArrayBoundsCheck, kUntaggedBase, 0, Type::Unsigned32(), kMachUint32},
142 {kUntaggedBase, 0, Type::Number(), kRepFloat64}, 142 {kTypedArrayBoundsCheck, kUntaggedBase, 0, Type::Number(), kRepFloat32},
143 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Signed32(), 143 {kTypedArrayBoundsCheck, kUntaggedBase, 0, Type::Number(), kRepFloat64},
144 kMachInt8}, 144 {kTypedArrayBoundsCheck, kTaggedBase, FixedTypedArrayBase::kDataOffset,
145 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Unsigned32(), 145 Type::Signed32(), kMachInt8},
146 kMachUint8}, 146 {kTypedArrayBoundsCheck, kTaggedBase, FixedTypedArrayBase::kDataOffset,
147 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Signed32(), 147 Type::Unsigned32(), kMachUint8},
148 kMachInt16}, 148 {kTypedArrayBoundsCheck, kTaggedBase, FixedTypedArrayBase::kDataOffset,
149 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Unsigned32(), 149 Type::Signed32(), kMachInt16},
150 kMachUint16}, 150 {kTypedArrayBoundsCheck, kTaggedBase, FixedTypedArrayBase::kDataOffset,
151 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Signed32(), 151 Type::Unsigned32(), kMachUint16},
152 kMachInt32}, 152 {kTypedArrayBoundsCheck, kTaggedBase, FixedTypedArrayBase::kDataOffset,
153 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Unsigned32(), 153 Type::Signed32(), kMachInt32},
154 kMachUint32}, 154 {kTypedArrayBoundsCheck, kTaggedBase, FixedTypedArrayBase::kDataOffset,
155 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Number(), 155 Type::Unsigned32(), kMachUint32},
156 kRepFloat32}, 156 {kTypedArrayBoundsCheck, kTaggedBase, FixedTypedArrayBase::kDataOffset,
157 {kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Number(), 157 Type::Number(), kRepFloat32},
158 kRepFloat64}}; 158 {kTypedArrayBoundsCheck, kTaggedBase, FixedTypedArrayBase::kDataOffset,
159 Type::Number(), kRepFloat64}};
159 160
160 } // namespace 161 } // namespace
161 162
162 163
163 class SimplifiedElementAccessOperatorTest 164 class SimplifiedElementAccessOperatorTest
164 : public TestWithZone, 165 : public TestWithZone,
165 public ::testing::WithParamInterface<ElementAccess> {}; 166 public ::testing::WithParamInterface<ElementAccess> {};
166 167
167 168
168 TEST_P(SimplifiedElementAccessOperatorTest, LoadElement) { 169 TEST_P(SimplifiedElementAccessOperatorTest, LoadElement) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 } 206 }
206 207
207 208
208 INSTANTIATE_TEST_CASE_P(SimplifiedOperatorTest, 209 INSTANTIATE_TEST_CASE_P(SimplifiedOperatorTest,
209 SimplifiedElementAccessOperatorTest, 210 SimplifiedElementAccessOperatorTest,
210 ::testing::ValuesIn(kElementAccesses)); 211 ::testing::ValuesIn(kElementAccesses));
211 212
212 } // namespace compiler 213 } // namespace compiler
213 } // namespace internal 214 } // namespace internal
214 } // namespace v8 215 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/simplified-operator.cc ('k') | test/cctest/compiler/test-simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698