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

Side by Side Diff: test/unittests/compiler/escape-analysis-unittest.cc

Issue 2161543002: [turbofan] Add support for eager/soft deoptimization reasons. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Do the ports properly Created 4 years, 5 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
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/bit-vector.h" 5 #include "src/bit-vector.h"
6 #include "src/compiler/escape-analysis.h" 6 #include "src/compiler/escape-analysis.h"
7 #include "src/compiler/escape-analysis-reducer.h" 7 #include "src/compiler/escape-analysis-reducer.h"
8 #include "src/compiler/graph-visualizer.h" 8 #include "src/compiler/graph-visualizer.h"
9 #include "src/compiler/js-graph.h" 9 #include "src/compiler/js-graph.h"
10 #include "src/compiler/node-properties.h" 10 #include "src/compiler/node-properties.h"
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 Branch(); 439 Branch();
440 Node* ifFalse = IfFalse(); 440 Node* ifFalse = IfFalse();
441 Node* state_values1 = graph()->NewNode(common()->StateValues(1), finish); 441 Node* state_values1 = graph()->NewNode(common()->StateValues(1), finish);
442 Node* state_values2 = graph()->NewNode(common()->StateValues(0)); 442 Node* state_values2 = graph()->NewNode(common()->StateValues(0));
443 Node* state_values3 = graph()->NewNode(common()->StateValues(0)); 443 Node* state_values3 = graph()->NewNode(common()->StateValues(0));
444 Node* frame_state = graph()->NewNode( 444 Node* frame_state = graph()->NewNode(
445 common()->FrameState(BailoutId::None(), OutputFrameStateCombine::Ignore(), 445 common()->FrameState(BailoutId::None(), OutputFrameStateCombine::Ignore(),
446 nullptr), 446 nullptr),
447 state_values1, state_values2, state_values3, UndefinedConstant(), 447 state_values1, state_values2, state_values3, UndefinedConstant(),
448 graph()->start(), graph()->start()); 448 graph()->start(), graph()->start());
449 Node* deopt = graph()->NewNode(common()->Deoptimize(DeoptimizeKind::kEager), 449 Node* deopt = graph()->NewNode(
450 frame_state, effect1, ifFalse); 450 common()->Deoptimize(DeoptimizeKind::kEager, DeoptimizeReason::kNoReason),
451 frame_state, effect1, ifFalse);
451 Node* ifTrue = IfTrue(); 452 Node* ifTrue = IfTrue();
452 Node* load = Load(FieldAccessAtIndex(0), finish, effect1, ifTrue); 453 Node* load = Load(FieldAccessAtIndex(0), finish, effect1, ifTrue);
453 Node* result = Return(load, effect1, ifTrue); 454 Node* result = Return(load, effect1, ifTrue);
454 EndGraph(); 455 EndGraph();
455 graph()->end()->AppendInput(zone(), deopt); 456 graph()->end()->AppendInput(zone(), deopt);
456 Analysis(); 457 Analysis();
457 458
458 ExpectVirtual(allocation); 459 ExpectVirtual(allocation);
459 ExpectReplacement(load, object1); 460 ExpectReplacement(load, object1);
460 461
(...skipping 18 matching lines...) Expand all
479 Branch(); 480 Branch();
480 Node* ifFalse = IfFalse(); 481 Node* ifFalse = IfFalse();
481 Node* state_values1 = graph()->NewNode(common()->StateValues(1), finish); 482 Node* state_values1 = graph()->NewNode(common()->StateValues(1), finish);
482 Node* state_values2 = graph()->NewNode(common()->StateValues(1), finish); 483 Node* state_values2 = graph()->NewNode(common()->StateValues(1), finish);
483 Node* state_values3 = graph()->NewNode(common()->StateValues(0)); 484 Node* state_values3 = graph()->NewNode(common()->StateValues(0));
484 Node* frame_state = graph()->NewNode( 485 Node* frame_state = graph()->NewNode(
485 common()->FrameState(BailoutId::None(), OutputFrameStateCombine::Ignore(), 486 common()->FrameState(BailoutId::None(), OutputFrameStateCombine::Ignore(),
486 nullptr), 487 nullptr),
487 state_values1, state_values2, state_values3, UndefinedConstant(), 488 state_values1, state_values2, state_values3, UndefinedConstant(),
488 graph()->start(), graph()->start()); 489 graph()->start(), graph()->start());
489 Node* deopt = graph()->NewNode(common()->Deoptimize(DeoptimizeKind::kEager), 490 Node* deopt = graph()->NewNode(
490 frame_state, effect1, ifFalse); 491 common()->Deoptimize(DeoptimizeKind::kEager, DeoptimizeReason::kNoReason),
492 frame_state, effect1, ifFalse);
491 Node* ifTrue = IfTrue(); 493 Node* ifTrue = IfTrue();
492 Node* load = Load(FieldAccessAtIndex(0), finish, effect1, ifTrue); 494 Node* load = Load(FieldAccessAtIndex(0), finish, effect1, ifTrue);
493 Node* result = Return(load, effect1, ifTrue); 495 Node* result = Return(load, effect1, ifTrue);
494 EndGraph(); 496 EndGraph();
495 graph()->end()->AppendInput(zone(), deopt); 497 graph()->end()->AppendInput(zone(), deopt);
496 Analysis(); 498 Analysis();
497 499
498 ExpectVirtual(allocation); 500 ExpectVirtual(allocation);
499 ExpectReplacement(load, object1); 501 ExpectReplacement(load, object1);
500 502
501 Transformation(); 503 Transformation();
502 504
503 ASSERT_EQ(object1, NodeProperties::GetValueInput(result, 0)); 505 ASSERT_EQ(object1, NodeProperties::GetValueInput(result, 0));
504 506
505 Node* object_state = NodeProperties::GetValueInput(state_values1, 0); 507 Node* object_state = NodeProperties::GetValueInput(state_values1, 0);
506 ASSERT_EQ(object_state->opcode(), IrOpcode::kObjectState); 508 ASSERT_EQ(object_state->opcode(), IrOpcode::kObjectState);
507 ASSERT_EQ(2, object_state->op()->ValueInputCount()); 509 ASSERT_EQ(2, object_state->op()->ValueInputCount());
508 ASSERT_EQ(object1, NodeProperties::GetValueInput(object_state, 0)); 510 ASSERT_EQ(object1, NodeProperties::GetValueInput(object_state, 0));
509 ASSERT_EQ(object_state, NodeProperties::GetValueInput(object_state, 1)); 511 ASSERT_EQ(object_state, NodeProperties::GetValueInput(object_state, 1));
510 512
511 Node* object_state2 = NodeProperties::GetValueInput(state_values1, 0); 513 Node* object_state2 = NodeProperties::GetValueInput(state_values1, 0);
512 ASSERT_EQ(object_state, object_state2); 514 ASSERT_EQ(object_state, object_state2);
513 } 515 }
514 516
515 } // namespace compiler 517 } // namespace compiler
516 } // namespace internal 518 } // namespace internal
517 } // namespace v8 519 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/test-cpu-profiler.cc ('k') | test/unittests/compiler/instruction-selector-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698