OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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.h" | 5 #include "src/compiler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "src/ast/ast-numbering.h" | 9 #include "src/ast/ast-numbering.h" |
10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 DCHECK(AllowCompilation::IsAllowed(info->isolate())); | 778 DCHECK(AllowCompilation::IsAllowed(info->isolate())); |
779 if (!Compiler::Analyze(info->parse_info()) || | 779 if (!Compiler::Analyze(info->parse_info()) || |
780 !FullCodeGenerator::MakeCode(info)) { | 780 !FullCodeGenerator::MakeCode(info)) { |
781 Isolate* isolate = info->isolate(); | 781 Isolate* isolate = info->isolate(); |
782 if (!isolate->has_pending_exception()) isolate->StackOverflow(); | 782 if (!isolate->has_pending_exception()) isolate->StackOverflow(); |
783 return false; | 783 return false; |
784 } | 784 } |
785 return true; | 785 return true; |
786 } | 786 } |
787 | 787 |
788 | |
789 static bool UseIgnition(CompilationInfo* info) { | 788 static bool UseIgnition(CompilationInfo* info) { |
790 // Cannot use Ignition when the {function_data} is already used. | 789 // TODO(4681): Generator functions are not yet supported. |
791 if (info->has_shared_info() && info->shared_info()->HasBuiltinFunctionId()) { | |
792 return false; | |
793 } | |
794 | |
795 // TODO(4681): Generators are not yet supported. | |
796 if ((info->has_shared_info() && info->shared_info()->is_generator()) || | 790 if ((info->has_shared_info() && info->shared_info()->is_generator()) || |
797 (info->has_literal() && IsGeneratorFunction(info->literal()->kind()))) { | 791 (info->has_literal() && IsGeneratorFunction(info->literal()->kind()))) { |
798 return false; | 792 return false; |
799 } | 793 } |
800 | 794 |
| 795 // TODO(4681): Resuming a suspended frame is not supported. |
| 796 if (info->has_shared_info() && info->shared_info()->HasBuiltinFunctionId() && |
| 797 (info->shared_info()->builtin_function_id() == kGeneratorObjectNext || |
| 798 info->shared_info()->builtin_function_id() == kGeneratorObjectReturn || |
| 799 info->shared_info()->builtin_function_id() == kGeneratorObjectThrow)) { |
| 800 return false; |
| 801 } |
| 802 |
801 // Checks whether top level functions should be passed by the filter. | 803 // Checks whether top level functions should be passed by the filter. |
802 if (info->closure().is_null()) { | 804 if (info->closure().is_null()) { |
803 Vector<const char> filter = CStrVector(FLAG_ignition_filter); | 805 Vector<const char> filter = CStrVector(FLAG_ignition_filter); |
804 return (filter.length() == 0) || (filter.length() == 1 && filter[0] == '*'); | 806 return (filter.length() == 0) || (filter.length() == 1 && filter[0] == '*'); |
805 } | 807 } |
806 | 808 |
807 // Finally respect the filter. | 809 // Finally respect the filter. |
808 return info->closure()->PassesFilter(FLAG_ignition_filter); | 810 return info->closure()->PassesFilter(FLAG_ignition_filter); |
809 } | 811 } |
810 | 812 |
(...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1966 | 1968 |
1967 #if DEBUG | 1969 #if DEBUG |
1968 void CompilationInfo::PrintAstForTesting() { | 1970 void CompilationInfo::PrintAstForTesting() { |
1969 PrintF("--- Source from AST ---\n%s\n", | 1971 PrintF("--- Source from AST ---\n%s\n", |
1970 PrettyPrinter(isolate()).PrintProgram(literal())); | 1972 PrettyPrinter(isolate()).PrintProgram(literal())); |
1971 } | 1973 } |
1972 #endif | 1974 #endif |
1973 | 1975 |
1974 } // namespace internal | 1976 } // namespace internal |
1975 } // namespace v8 | 1977 } // namespace v8 |
OLD | NEW |