| 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/js-inlining.h" | 5 #include "src/compiler/js-inlining.h" |
| 6 | 6 |
| 7 #include "src/ast/ast-numbering.h" | 7 #include "src/ast/ast-numbering.h" |
| 8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
| 9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
| 10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 } | 370 } |
| 371 return NoChange(); | 371 return NoChange(); |
| 372 } | 372 } |
| 373 | 373 |
| 374 if (!Compiler::EnsureDeoptimizationSupport(&info)) { | 374 if (!Compiler::EnsureDeoptimizationSupport(&info)) { |
| 375 TRACE("Not inlining %s into %s because deoptimization support failed\n", | 375 TRACE("Not inlining %s into %s because deoptimization support failed\n", |
| 376 shared_info->DebugName()->ToCString().get(), | 376 shared_info->DebugName()->ToCString().get(), |
| 377 info_->shared_info()->DebugName()->ToCString().get()); | 377 info_->shared_info()->DebugName()->ToCString().get()); |
| 378 return NoChange(); | 378 return NoChange(); |
| 379 } | 379 } |
| 380 |
| 380 // Remember that we inlined this function. This needs to be called right | 381 // Remember that we inlined this function. This needs to be called right |
| 381 // after we ensure deoptimization support so that the code flusher | 382 // after we ensure deoptimization support so that the code flusher |
| 382 // does not remove the code with the deoptimization support. | 383 // does not remove the code with the deoptimization support. |
| 383 info_->AddInlinedFunction(shared_info); | 384 info_->AddInlinedFunction(shared_info); |
| 384 | 385 |
| 385 // ---------------------------------------------------------------- | 386 // ---------------------------------------------------------------- |
| 386 // After this point, we've made a decision to inline this function. | 387 // After this point, we've made a decision to inline this function. |
| 387 // We shall not bailout from inlining if we got here. | 388 // We shall not bailout from inlining if we got here. |
| 388 | 389 |
| 389 TRACE("Inlining %s into %s\n", | 390 TRACE("Inlining %s into %s\n", |
| 390 shared_info->DebugName()->ToCString().get(), | 391 shared_info->DebugName()->ToCString().get(), |
| 391 info_->shared_info()->DebugName()->ToCString().get()); | 392 info_->shared_info()->DebugName()->ToCString().get()); |
| 392 | 393 |
| 394 // If function was lazily compiled, it's literals array may not yet be set up. |
| 395 JSFunction::EnsureLiterals(function); |
| 396 |
| 393 // Create the subgraph for the inlinee. | 397 // Create the subgraph for the inlinee. |
| 394 Node* start; | 398 Node* start; |
| 395 Node* end; | 399 Node* end; |
| 396 { | 400 { |
| 397 // Run the loop assignment analyzer on the inlinee. | 401 // Run the loop assignment analyzer on the inlinee. |
| 398 AstLoopAssignmentAnalyzer loop_assignment_analyzer(&zone, &info); | 402 AstLoopAssignmentAnalyzer loop_assignment_analyzer(&zone, &info); |
| 399 LoopAssignmentAnalysis* loop_assignment = | 403 LoopAssignmentAnalysis* loop_assignment = |
| 400 loop_assignment_analyzer.Analyze(); | 404 loop_assignment_analyzer.Analyze(); |
| 401 | 405 |
| 402 // Run the type hint analyzer on the inlinee. | 406 // Run the type hint analyzer on the inlinee. |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 } | 516 } |
| 513 | 517 |
| 514 return InlineCall(node, new_target, context, frame_state, start, end); | 518 return InlineCall(node, new_target, context, frame_state, start, end); |
| 515 } | 519 } |
| 516 | 520 |
| 517 Graph* JSInliner::graph() const { return jsgraph()->graph(); } | 521 Graph* JSInliner::graph() const { return jsgraph()->graph(); } |
| 518 | 522 |
| 519 } // namespace compiler | 523 } // namespace compiler |
| 520 } // namespace internal | 524 } // namespace internal |
| 521 } // namespace v8 | 525 } // namespace v8 |
| OLD | NEW |