| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |