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

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

Issue 2509623002: [turbofan] Sparse representation for state values (Closed)
Patch Set: Renaming and changing refs to pointers Created 4 years 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/compiler/escape-analysis.h" 5 #include "src/compiler/escape-analysis.h"
6 #include "src/bit-vector.h" 6 #include "src/bit-vector.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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 432
433 TEST_F(EscapeAnalysisTest, DeoptReplacement) { 433 TEST_F(EscapeAnalysisTest, DeoptReplacement) {
434 Node* object1 = Constant(1); 434 Node* object1 = Constant(1);
435 BeginRegion(); 435 BeginRegion();
436 Node* allocation = Allocate(Constant(kPointerSize)); 436 Node* allocation = Allocate(Constant(kPointerSize));
437 Store(FieldAccessAtIndex(0), allocation, object1); 437 Store(FieldAccessAtIndex(0), allocation, object1);
438 Node* finish = FinishRegion(allocation); 438 Node* finish = FinishRegion(allocation);
439 Node* effect1 = Store(FieldAccessAtIndex(0), allocation, object1, finish); 439 Node* effect1 = Store(FieldAccessAtIndex(0), allocation, object1, finish);
440 Branch(); 440 Branch();
441 Node* ifFalse = IfFalse(); 441 Node* ifFalse = IfFalse();
442 Node* state_values1 = graph()->NewNode(common()->StateValues(1), finish); 442 Node* state_values1 = graph()->NewNode(
443 Node* state_values2 = graph()->NewNode(common()->StateValues(0)); 443 common()->StateValues(1, SparseInputMask::Dense()), finish);
444 Node* state_values3 = graph()->NewNode(common()->StateValues(0)); 444 Node* state_values2 =
445 graph()->NewNode(common()->StateValues(0, SparseInputMask::Dense()));
446 Node* state_values3 =
447 graph()->NewNode(common()->StateValues(0, SparseInputMask::Dense()));
445 Node* frame_state = graph()->NewNode( 448 Node* frame_state = graph()->NewNode(
446 common()->FrameState(BailoutId::None(), OutputFrameStateCombine::Ignore(), 449 common()->FrameState(BailoutId::None(), OutputFrameStateCombine::Ignore(),
447 nullptr), 450 nullptr),
448 state_values1, state_values2, state_values3, UndefinedConstant(), 451 state_values1, state_values2, state_values3, UndefinedConstant(),
449 graph()->start(), graph()->start()); 452 graph()->start(), graph()->start());
450 Node* deopt = graph()->NewNode( 453 Node* deopt = graph()->NewNode(
451 common()->Deoptimize(DeoptimizeKind::kEager, DeoptimizeReason::kNoReason), 454 common()->Deoptimize(DeoptimizeKind::kEager, DeoptimizeReason::kNoReason),
452 frame_state, effect1, ifFalse); 455 frame_state, effect1, ifFalse);
453 Node* ifTrue = IfTrue(); 456 Node* ifTrue = IfTrue();
454 Node* load = Load(FieldAccessAtIndex(0), finish, effect1, ifTrue); 457 Node* load = Load(FieldAccessAtIndex(0), finish, effect1, ifTrue);
(...skipping 17 matching lines...) Expand all
472 TEST_F(EscapeAnalysisTest, DISABLED_DeoptReplacementIdentity) { 475 TEST_F(EscapeAnalysisTest, DISABLED_DeoptReplacementIdentity) {
473 Node* object1 = Constant(1); 476 Node* object1 = Constant(1);
474 BeginRegion(); 477 BeginRegion();
475 Node* allocation = Allocate(Constant(kPointerSize * 2)); 478 Node* allocation = Allocate(Constant(kPointerSize * 2));
476 Store(FieldAccessAtIndex(0), allocation, object1); 479 Store(FieldAccessAtIndex(0), allocation, object1);
477 Store(FieldAccessAtIndex(kPointerSize), allocation, allocation); 480 Store(FieldAccessAtIndex(kPointerSize), allocation, allocation);
478 Node* finish = FinishRegion(allocation); 481 Node* finish = FinishRegion(allocation);
479 Node* effect1 = Store(FieldAccessAtIndex(0), allocation, object1, finish); 482 Node* effect1 = Store(FieldAccessAtIndex(0), allocation, object1, finish);
480 Branch(); 483 Branch();
481 Node* ifFalse = IfFalse(); 484 Node* ifFalse = IfFalse();
482 Node* state_values1 = graph()->NewNode(common()->StateValues(1), finish); 485 Node* state_values1 = graph()->NewNode(
483 Node* state_values2 = graph()->NewNode(common()->StateValues(1), finish); 486 common()->StateValues(1, SparseInputMask::Dense()), finish);
484 Node* state_values3 = graph()->NewNode(common()->StateValues(0)); 487 Node* state_values2 = graph()->NewNode(
488 common()->StateValues(1, SparseInputMask::Dense()), finish);
489 Node* state_values3 =
490 graph()->NewNode(common()->StateValues(0, SparseInputMask::Dense()));
485 Node* frame_state = graph()->NewNode( 491 Node* frame_state = graph()->NewNode(
486 common()->FrameState(BailoutId::None(), OutputFrameStateCombine::Ignore(), 492 common()->FrameState(BailoutId::None(), OutputFrameStateCombine::Ignore(),
487 nullptr), 493 nullptr),
488 state_values1, state_values2, state_values3, UndefinedConstant(), 494 state_values1, state_values2, state_values3, UndefinedConstant(),
489 graph()->start(), graph()->start()); 495 graph()->start(), graph()->start());
490 Node* deopt = graph()->NewNode( 496 Node* deopt = graph()->NewNode(
491 common()->Deoptimize(DeoptimizeKind::kEager, DeoptimizeReason::kNoReason), 497 common()->Deoptimize(DeoptimizeKind::kEager, DeoptimizeReason::kNoReason),
492 frame_state, effect1, ifFalse); 498 frame_state, effect1, ifFalse);
493 Node* ifTrue = IfTrue(); 499 Node* ifTrue = IfTrue();
494 Node* load = Load(FieldAccessAtIndex(0), finish, effect1, ifTrue); 500 Node* load = Load(FieldAccessAtIndex(0), finish, effect1, ifTrue);
(...skipping 15 matching lines...) Expand all
510 ASSERT_EQ(object1, NodeProperties::GetValueInput(object_state, 0)); 516 ASSERT_EQ(object1, NodeProperties::GetValueInput(object_state, 0));
511 ASSERT_EQ(object_state, NodeProperties::GetValueInput(object_state, 1)); 517 ASSERT_EQ(object_state, NodeProperties::GetValueInput(object_state, 1));
512 518
513 Node* object_state2 = NodeProperties::GetValueInput(state_values1, 0); 519 Node* object_state2 = NodeProperties::GetValueInput(state_values1, 0);
514 ASSERT_EQ(object_state, object_state2); 520 ASSERT_EQ(object_state, object_state2);
515 } 521 }
516 522
517 } // namespace compiler 523 } // namespace compiler
518 } // namespace internal 524 } // namespace internal
519 } // namespace v8 525 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-js-typed-lowering.cc ('k') | test/unittests/compiler/graph-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698