| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/hydrogen.h" | 5 #include "src/hydrogen.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "src/v8.h" | 9 #include "src/v8.h" |
| 10 | 10 |
| (...skipping 7817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7828 int decl_count = decls->length(); | 7828 int decl_count = decls->length(); |
| 7829 for (int i = 0; i < decl_count; ++i) { | 7829 for (int i = 0; i < decl_count; ++i) { |
| 7830 if (!decls->at(i)->IsInlineable()) { | 7830 if (!decls->at(i)->IsInlineable()) { |
| 7831 TraceInline(target, caller, "target has non-trivial declaration"); | 7831 TraceInline(target, caller, "target has non-trivial declaration"); |
| 7832 return false; | 7832 return false; |
| 7833 } | 7833 } |
| 7834 } | 7834 } |
| 7835 | 7835 |
| 7836 // Generate the deoptimization data for the unoptimized version of | 7836 // Generate the deoptimization data for the unoptimized version of |
| 7837 // the target function if we don't already have it. | 7837 // the target function if we don't already have it. |
| 7838 if (!target_shared->has_deoptimization_support()) { | 7838 if (!Compiler::EnsureDeoptimizationSupport(&target_info)) { |
| 7839 // Note that we compile here using the same AST that we will use for | 7839 TraceInline(target, caller, "could not generate deoptimization info"); |
| 7840 // generating the optimized inline code. | 7840 return false; |
| 7841 target_info.EnableDeoptimizationSupport(); | |
| 7842 if (!FullCodeGenerator::MakeCode(&target_info)) { | |
| 7843 TraceInline(target, caller, "could not generate deoptimization info"); | |
| 7844 return false; | |
| 7845 } | |
| 7846 if (target_shared->scope_info() == ScopeInfo::Empty(isolate())) { | |
| 7847 // The scope info might not have been set if a lazily compiled | |
| 7848 // function is inlined before being called for the first time. | |
| 7849 Handle<ScopeInfo> target_scope_info = | |
| 7850 ScopeInfo::Create(target_info.scope(), zone()); | |
| 7851 target_shared->set_scope_info(*target_scope_info); | |
| 7852 } | |
| 7853 target_shared->EnableDeoptimizationSupport(*target_info.code()); | |
| 7854 target_shared->set_feedback_vector(*target_info.feedback_vector()); | |
| 7855 Compiler::RecordFunctionCompilation(Logger::FUNCTION_TAG, | |
| 7856 &target_info, | |
| 7857 target_shared); | |
| 7858 } | 7841 } |
| 7859 | 7842 |
| 7860 // ---------------------------------------------------------------- | 7843 // ---------------------------------------------------------------- |
| 7861 // After this point, we've made a decision to inline this function (so | 7844 // After this point, we've made a decision to inline this function (so |
| 7862 // TryInline should always return true). | 7845 // TryInline should always return true). |
| 7863 | 7846 |
| 7864 // Type-check the inlined function. | 7847 // Type-check the inlined function. |
| 7865 DCHECK(target_shared->has_deoptimization_support()); | 7848 DCHECK(target_shared->has_deoptimization_support()); |
| 7866 AstTyper::Run(&target_info); | 7849 AstTyper::Run(&target_info); |
| 7867 | 7850 |
| (...skipping 4636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12504 if (ShouldProduceTraceOutput()) { | 12487 if (ShouldProduceTraceOutput()) { |
| 12505 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12488 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 12506 } | 12489 } |
| 12507 | 12490 |
| 12508 #ifdef DEBUG | 12491 #ifdef DEBUG |
| 12509 graph_->Verify(false); // No full verify. | 12492 graph_->Verify(false); // No full verify. |
| 12510 #endif | 12493 #endif |
| 12511 } | 12494 } |
| 12512 | 12495 |
| 12513 } } // namespace v8::internal | 12496 } } // namespace v8::internal |
| OLD | NEW |