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

Side by Side Diff: src/compiler/js-native-context-specialization.cc

Issue 2042013003: [builtins] Properly optimize TypedArray/DataView accessors. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address Yang's comments. Created 4 years, 6 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
« no previous file with comments | « src/compiler/access-info.cc ('k') | src/counters.h » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/js-native-context-specialization.h" 5 #include "src/compiler/js-native-context-specialization.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/compilation-dependencies.h" 9 #include "src/compilation-dependencies.h"
10 #include "src/compiler/access-builder.h" 10 #include "src/compiler/access-builder.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 if (access_mode == AccessMode::kStore) { 238 if (access_mode == AccessMode::kStore) {
239 Node* check = graph()->NewNode( 239 Node* check = graph()->NewNode(
240 simplified()->ReferenceEqual(Type::Tagged()), value, this_value); 240 simplified()->ReferenceEqual(Type::Tagged()), value, this_value);
241 this_control = this_effect = 241 this_control = this_effect =
242 graph()->NewNode(common()->DeoptimizeUnless(), check, frame_state, 242 graph()->NewNode(common()->DeoptimizeUnless(), check, frame_state,
243 this_effect, this_control); 243 this_effect, this_control);
244 } 244 }
245 } else { 245 } else {
246 DCHECK(access_info.IsDataField()); 246 DCHECK(access_info.IsDataField());
247 FieldIndex const field_index = access_info.field_index(); 247 FieldIndex const field_index = access_info.field_index();
248 FieldCheck const field_check = access_info.field_check();
249 Type* const field_type = access_info.field_type(); 248 Type* const field_type = access_info.field_type();
250 switch (field_check) {
251 case FieldCheck::kNone:
252 break;
253 case FieldCheck::kJSArrayBufferViewBufferNotNeutered: {
254 Node* this_buffer = this_effect =
255 graph()->NewNode(simplified()->LoadField(
256 AccessBuilder::ForJSArrayBufferViewBuffer()),
257 this_receiver, this_effect, this_control);
258 Node* this_buffer_bit_field = this_effect =
259 graph()->NewNode(simplified()->LoadField(
260 AccessBuilder::ForJSArrayBufferBitField()),
261 this_buffer, this_effect, this_control);
262 Node* check = graph()->NewNode(
263 machine()->Word32Equal(),
264 graph()->NewNode(machine()->Word32And(), this_buffer_bit_field,
265 jsgraph()->Int32Constant(
266 1 << JSArrayBuffer::WasNeutered::kShift)),
267 jsgraph()->Int32Constant(0));
268 this_control = this_effect =
269 graph()->NewNode(common()->DeoptimizeUnless(), check, frame_state,
270 this_effect, this_control);
271 break;
272 }
273 }
274 if (access_mode == AccessMode::kLoad && 249 if (access_mode == AccessMode::kLoad &&
275 access_info.holder().ToHandle(&holder)) { 250 access_info.holder().ToHandle(&holder)) {
276 this_receiver = jsgraph()->Constant(holder); 251 this_receiver = jsgraph()->Constant(holder);
277 } 252 }
278 Node* this_storage = this_receiver; 253 Node* this_storage = this_receiver;
279 if (!field_index.is_inobject()) { 254 if (!field_index.is_inobject()) {
280 this_storage = this_effect = graph()->NewNode( 255 this_storage = this_effect = graph()->NewNode(
281 simplified()->LoadField(AccessBuilder::ForJSObjectProperties()), 256 simplified()->LoadField(AccessBuilder::ForJSObjectProperties()),
282 this_storage, this_effect, this_control); 257 this_storage, this_effect, this_control);
283 } 258 }
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
1154 } 1129 }
1155 1130
1156 1131
1157 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { 1132 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const {
1158 return jsgraph()->simplified(); 1133 return jsgraph()->simplified();
1159 } 1134 }
1160 1135
1161 } // namespace compiler 1136 } // namespace compiler
1162 } // namespace internal 1137 } // namespace internal
1163 } // namespace v8 1138 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/access-info.cc ('k') | src/counters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698