OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/ast-graph-builder.h" | 5 #include "src/compiler/ast-graph-builder.h" |
6 | 6 |
7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
8 #include "src/compiler/ast-loop-assignment-analyzer.h" | 8 #include "src/compiler/ast-loop-assignment-analyzer.h" |
9 #include "src/compiler/control-builders.h" | 9 #include "src/compiler/control-builders.h" |
10 #include "src/compiler/js-type-feedback.h" | 10 #include "src/compiler/js-type-feedback.h" |
(...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1304 | 1304 |
1305 // These stack values are renamed in the case of OSR, so reload them | 1305 // These stack values are renamed in the case of OSR, so reload them |
1306 // from the environment. | 1306 // from the environment. |
1307 Node* index = environment()->Peek(0); | 1307 Node* index = environment()->Peek(0); |
1308 Node* cache_length = environment()->Peek(1); | 1308 Node* cache_length = environment()->Peek(1); |
1309 Node* cache_array = environment()->Peek(2); | 1309 Node* cache_array = environment()->Peek(2); |
1310 Node* cache_type = environment()->Peek(3); | 1310 Node* cache_type = environment()->Peek(3); |
1311 Node* obj = environment()->Peek(4); | 1311 Node* obj = environment()->Peek(4); |
1312 | 1312 |
1313 // Check loop termination condition. | 1313 // Check loop termination condition. |
| 1314 FrameStateBeforeAndAfter states(this, BailoutId::None()); |
1314 Node* exit_cond = NewNode(javascript()->LessThan(LanguageMode::SLOPPY), | 1315 Node* exit_cond = NewNode(javascript()->LessThan(LanguageMode::SLOPPY), |
1315 index, cache_length); | 1316 index, cache_length); |
1316 // TODO(jarin): provide real bailout id. | 1317 // TODO(jarin): provide real bailout id. |
1317 PrepareFrameState(exit_cond, BailoutId::None()); | 1318 states.AddToNode(exit_cond, BailoutId::None(), |
| 1319 OutputFrameStateCombine::Ignore()); |
1318 for_loop.BreakUnless(exit_cond); | 1320 for_loop.BreakUnless(exit_cond); |
1319 Node* pair = NewNode(javascript()->CallRuntime(Runtime::kForInNext, 4), obj, | 1321 Node* pair = NewNode(javascript()->CallRuntime(Runtime::kForInNext, 4), obj, |
1320 cache_array, cache_type, index); | 1322 cache_array, cache_type, index); |
1321 Node* value = NewNode(common()->Projection(0), pair); | 1323 Node* value = NewNode(common()->Projection(0), pair); |
1322 Node* should_filter = NewNode(common()->Projection(1), pair); | 1324 Node* should_filter = NewNode(common()->Projection(1), pair); |
1323 environment()->Push(value); | 1325 environment()->Push(value); |
1324 { | 1326 { |
1325 // Test if FILTER_KEY needs to be called. | 1327 // Test if FILTER_KEY needs to be called. |
1326 IfBuilder test_should_filter(this); | 1328 IfBuilder test_should_filter(this); |
1327 Node* should_filter_cond = NewNode( | 1329 Node* should_filter_cond = NewNode( |
(...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2524 break; | 2526 break; |
2525 case Token::IN: | 2527 case Token::IN: |
2526 op = javascript()->HasProperty(); | 2528 op = javascript()->HasProperty(); |
2527 break; | 2529 break; |
2528 default: | 2530 default: |
2529 op = NULL; | 2531 op = NULL; |
2530 UNREACHABLE(); | 2532 UNREACHABLE(); |
2531 } | 2533 } |
2532 VisitForValue(expr->left()); | 2534 VisitForValue(expr->left()); |
2533 VisitForValue(expr->right()); | 2535 VisitForValue(expr->right()); |
| 2536 FrameStateBeforeAndAfter states(this, expr->right()->id()); |
2534 Node* right = environment()->Pop(); | 2537 Node* right = environment()->Pop(); |
2535 Node* left = environment()->Pop(); | 2538 Node* left = environment()->Pop(); |
2536 Node* value = NewNode(op, left, right); | 2539 Node* value = NewNode(op, left, right); |
2537 PrepareFrameState(value, expr->id(), ast_context()->GetStateCombine()); | 2540 states.AddToNode(value, expr->id(), ast_context()->GetStateCombine()); |
2538 ast_context()->ProduceValue(value); | 2541 ast_context()->ProduceValue(value); |
2539 } | 2542 } |
2540 | 2543 |
2541 | 2544 |
2542 void AstGraphBuilder::VisitSpread(Spread* expr) { UNREACHABLE(); } | 2545 void AstGraphBuilder::VisitSpread(Spread* expr) { UNREACHABLE(); } |
2543 | 2546 |
2544 | 2547 |
2545 void AstGraphBuilder::VisitThisFunction(ThisFunction* expr) { | 2548 void AstGraphBuilder::VisitThisFunction(ThisFunction* expr) { |
2546 Node* value = GetFunctionClosure(); | 2549 Node* value = GetFunctionClosure(); |
2547 ast_context()->ProduceValue(value); | 2550 ast_context()->ProduceValue(value); |
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3636 // Phi does not exist yet, introduce one. | 3639 // Phi does not exist yet, introduce one. |
3637 value = NewPhi(inputs, value, control); | 3640 value = NewPhi(inputs, value, control); |
3638 value->ReplaceInput(inputs - 1, other); | 3641 value->ReplaceInput(inputs - 1, other); |
3639 } | 3642 } |
3640 return value; | 3643 return value; |
3641 } | 3644 } |
3642 | 3645 |
3643 } // namespace compiler | 3646 } // namespace compiler |
3644 } // namespace internal | 3647 } // namespace internal |
3645 } // namespace v8 | 3648 } // namespace v8 |
OLD | NEW |