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

Side by Side Diff: src/compiler/node-properties.cc

Issue 2836853002: [turbofan] Fix FinishRegion handling in NodeProperties::InferReceiverMaps. (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | no next file » | 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/node-properties.h" 5 #include "src/compiler/node-properties.h"
6 #include "src/compiler/common-operator.h" 6 #include "src/compiler/common-operator.h"
7 #include "src/compiler/graph.h" 7 #include "src/compiler/graph.h"
8 #include "src/compiler/js-operator.h" 8 #include "src/compiler/js-operator.h"
9 #include "src/compiler/linkage.h" 9 #include "src/compiler/linkage.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 } 397 }
398 break; 398 break;
399 } 399 }
400 case IrOpcode::kJSStoreMessage: 400 case IrOpcode::kJSStoreMessage:
401 case IrOpcode::kJSStoreModule: 401 case IrOpcode::kJSStoreModule:
402 case IrOpcode::kStoreElement: 402 case IrOpcode::kStoreElement:
403 case IrOpcode::kStoreTypedElement: { 403 case IrOpcode::kStoreTypedElement: {
404 // These never change the map of objects. 404 // These never change the map of objects.
405 break; 405 break;
406 } 406 }
407 case IrOpcode::kFinishRegion: {
408 // FinishRegion renames the output of allocations, so we need
409 // to update the {receiver} that we are looking for, if the
410 // {receiver} matches the current {effect}.
411 if (IsSame(receiver, effect)) receiver = GetValueInput(effect, 0);
412 break;
413 }
407 default: { 414 default: {
408 DCHECK_EQ(1, effect->op()->EffectOutputCount()); 415 DCHECK_EQ(1, effect->op()->EffectOutputCount());
409 if (effect->op()->EffectInputCount() != 1) { 416 if (effect->op()->EffectInputCount() != 1) {
410 // Didn't find any appropriate CheckMaps node. 417 // Didn't find any appropriate CheckMaps node.
411 return kNoReceiverMaps; 418 return kNoReceiverMaps;
412 } 419 }
413 if (!effect->op()->HasProperty(Operator::kNoWrite)) { 420 if (!effect->op()->HasProperty(Operator::kNoWrite)) {
414 // Without alias/escape analysis we cannot tell whether this 421 // Without alias/escape analysis we cannot tell whether this
415 // {effect} affects {receiver} or not. 422 // {effect} affects {receiver} or not.
416 result = kUnreliableReceiverMaps; 423 result = kUnreliableReceiverMaps;
417 } 424 }
418 break; 425 break;
419 } 426 }
420 } 427 }
428
429 // Stop walking the effect chain once we hit the definition of
430 // the {receiver} along the {effect}s.
431 if (IsSame(receiver, effect)) return kNoReceiverMaps;
432
433 // Continue with the next {effect}.
421 DCHECK_EQ(1, effect->op()->EffectInputCount()); 434 DCHECK_EQ(1, effect->op()->EffectInputCount());
422 effect = NodeProperties::GetEffectInput(effect); 435 effect = NodeProperties::GetEffectInput(effect);
423 } 436 }
424 } 437 }
425 438
426 // static 439 // static
427 MaybeHandle<Context> NodeProperties::GetSpecializationContext( 440 MaybeHandle<Context> NodeProperties::GetSpecializationContext(
428 Node* node, MaybeHandle<Context> context) { 441 Node* node, MaybeHandle<Context> context) {
429 switch (node->opcode()) { 442 switch (node->opcode()) {
430 case IrOpcode::kHeapConstant: 443 case IrOpcode::kHeapConstant:
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 // static 491 // static
479 bool NodeProperties::IsInputRange(Edge edge, int first, int num) { 492 bool NodeProperties::IsInputRange(Edge edge, int first, int num) {
480 if (num == 0) return false; 493 if (num == 0) return false;
481 int const index = edge.index(); 494 int const index = edge.index();
482 return first <= index && index < first + num; 495 return first <= index && index < first + num;
483 } 496 }
484 497
485 } // namespace compiler 498 } // namespace compiler
486 } // namespace internal 499 } // namespace internal
487 } // namespace v8 500 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698