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(common()->StateValues(1, 0u), finish); |
443 Node* state_values2 = graph()->NewNode(common()->StateValues(0)); | 443 Node* state_values2 = graph()->NewNode(common()->StateValues(0, 0u)); |
444 Node* state_values3 = graph()->NewNode(common()->StateValues(0)); | 444 Node* state_values3 = graph()->NewNode(common()->StateValues(0, 0u)); |
445 Node* frame_state = graph()->NewNode( | 445 Node* frame_state = graph()->NewNode( |
446 common()->FrameState(BailoutId::None(), OutputFrameStateCombine::Ignore(), | 446 common()->FrameState(BailoutId::None(), OutputFrameStateCombine::Ignore(), |
447 nullptr), | 447 nullptr), |
448 state_values1, state_values2, state_values3, UndefinedConstant(), | 448 state_values1, state_values2, state_values3, UndefinedConstant(), |
449 graph()->start(), graph()->start()); | 449 graph()->start(), graph()->start()); |
450 Node* deopt = graph()->NewNode( | 450 Node* deopt = graph()->NewNode( |
451 common()->Deoptimize(DeoptimizeKind::kEager, DeoptimizeReason::kNoReason), | 451 common()->Deoptimize(DeoptimizeKind::kEager, DeoptimizeReason::kNoReason), |
452 frame_state, effect1, ifFalse); | 452 frame_state, effect1, ifFalse); |
453 Node* ifTrue = IfTrue(); | 453 Node* ifTrue = IfTrue(); |
454 Node* load = Load(FieldAccessAtIndex(0), finish, effect1, ifTrue); | 454 Node* load = Load(FieldAccessAtIndex(0), finish, effect1, ifTrue); |
(...skipping 17 matching lines...) Expand all Loading... |
472 TEST_F(EscapeAnalysisTest, DISABLED_DeoptReplacementIdentity) { | 472 TEST_F(EscapeAnalysisTest, DISABLED_DeoptReplacementIdentity) { |
473 Node* object1 = Constant(1); | 473 Node* object1 = Constant(1); |
474 BeginRegion(); | 474 BeginRegion(); |
475 Node* allocation = Allocate(Constant(kPointerSize * 2)); | 475 Node* allocation = Allocate(Constant(kPointerSize * 2)); |
476 Store(FieldAccessAtIndex(0), allocation, object1); | 476 Store(FieldAccessAtIndex(0), allocation, object1); |
477 Store(FieldAccessAtIndex(kPointerSize), allocation, allocation); | 477 Store(FieldAccessAtIndex(kPointerSize), allocation, allocation); |
478 Node* finish = FinishRegion(allocation); | 478 Node* finish = FinishRegion(allocation); |
479 Node* effect1 = Store(FieldAccessAtIndex(0), allocation, object1, finish); | 479 Node* effect1 = Store(FieldAccessAtIndex(0), allocation, object1, finish); |
480 Branch(); | 480 Branch(); |
481 Node* ifFalse = IfFalse(); | 481 Node* ifFalse = IfFalse(); |
482 Node* state_values1 = graph()->NewNode(common()->StateValues(1), finish); | 482 Node* state_values1 = graph()->NewNode(common()->StateValues(1, 0u), finish); |
483 Node* state_values2 = graph()->NewNode(common()->StateValues(1), finish); | 483 Node* state_values2 = graph()->NewNode(common()->StateValues(1, 0u), finish); |
484 Node* state_values3 = graph()->NewNode(common()->StateValues(0)); | 484 Node* state_values3 = graph()->NewNode(common()->StateValues(0, 0u)); |
485 Node* frame_state = graph()->NewNode( | 485 Node* frame_state = graph()->NewNode( |
486 common()->FrameState(BailoutId::None(), OutputFrameStateCombine::Ignore(), | 486 common()->FrameState(BailoutId::None(), OutputFrameStateCombine::Ignore(), |
487 nullptr), | 487 nullptr), |
488 state_values1, state_values2, state_values3, UndefinedConstant(), | 488 state_values1, state_values2, state_values3, UndefinedConstant(), |
489 graph()->start(), graph()->start()); | 489 graph()->start(), graph()->start()); |
490 Node* deopt = graph()->NewNode( | 490 Node* deopt = graph()->NewNode( |
491 common()->Deoptimize(DeoptimizeKind::kEager, DeoptimizeReason::kNoReason), | 491 common()->Deoptimize(DeoptimizeKind::kEager, DeoptimizeReason::kNoReason), |
492 frame_state, effect1, ifFalse); | 492 frame_state, effect1, ifFalse); |
493 Node* ifTrue = IfTrue(); | 493 Node* ifTrue = IfTrue(); |
494 Node* load = Load(FieldAccessAtIndex(0), finish, effect1, ifTrue); | 494 Node* load = Load(FieldAccessAtIndex(0), finish, effect1, ifTrue); |
(...skipping 15 matching lines...) Expand all Loading... |
510 ASSERT_EQ(object1, NodeProperties::GetValueInput(object_state, 0)); | 510 ASSERT_EQ(object1, NodeProperties::GetValueInput(object_state, 0)); |
511 ASSERT_EQ(object_state, NodeProperties::GetValueInput(object_state, 1)); | 511 ASSERT_EQ(object_state, NodeProperties::GetValueInput(object_state, 1)); |
512 | 512 |
513 Node* object_state2 = NodeProperties::GetValueInput(state_values1, 0); | 513 Node* object_state2 = NodeProperties::GetValueInput(state_values1, 0); |
514 ASSERT_EQ(object_state, object_state2); | 514 ASSERT_EQ(object_state, object_state2); |
515 } | 515 } |
516 | 516 |
517 } // namespace compiler | 517 } // namespace compiler |
518 } // namespace internal | 518 } // namespace internal |
519 } // namespace v8 | 519 } // namespace v8 |
OLD | NEW |