| 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 | 376 |
| 377 | 377 |
| 378 OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() { | 378 OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() { |
| 379 DCHECK(info()->IsOptimizing()); | 379 DCHECK(info()->IsOptimizing()); |
| 380 | 380 |
| 381 // Do not use Crankshaft/TurboFan if we need to be able to set break points. | 381 // Do not use Crankshaft/TurboFan if we need to be able to set break points. |
| 382 if (info()->shared_info()->HasDebugInfo()) { | 382 if (info()->shared_info()->HasDebugInfo()) { |
| 383 return AbortOptimization(kFunctionBeingDebugged); | 383 return AbortOptimization(kFunctionBeingDebugged); |
| 384 } | 384 } |
| 385 | 385 |
| 386 // Resuming a suspended frame is not supported by Crankshaft/TurboFan. |
| 387 if (info()->shared_info()->HasBuiltinFunctionId() && |
| 388 (info()->shared_info()->builtin_function_id() == kGeneratorObjectNext || |
| 389 info()->shared_info()->builtin_function_id() == kGeneratorObjectReturn || |
| 390 info()->shared_info()->builtin_function_id() == kGeneratorObjectThrow)) { |
| 391 return AbortOptimization(kGeneratorResumeMethod); |
| 392 } |
| 393 |
| 386 // Limit the number of times we try to optimize functions. | 394 // Limit the number of times we try to optimize functions. |
| 387 const int kMaxOptCount = | 395 const int kMaxOptCount = |
| 388 FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000; | 396 FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000; |
| 389 if (info()->opt_count() > kMaxOptCount) { | 397 if (info()->opt_count() > kMaxOptCount) { |
| 390 return AbortOptimization(kOptimizedTooManyTimes); | 398 return AbortOptimization(kOptimizedTooManyTimes); |
| 391 } | 399 } |
| 392 | 400 |
| 393 // Check the whitelist for Crankshaft. | 401 // Check the whitelist for Crankshaft. |
| 394 if (!info()->closure()->PassesFilter(FLAG_hydrogen_filter)) { | 402 if (!info()->closure()->PassesFilter(FLAG_hydrogen_filter)) { |
| 395 return AbortOptimization(kHydrogenFilter); | 403 return AbortOptimization(kHydrogenFilter); |
| (...skipping 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1957 | 1965 |
| 1958 #if DEBUG | 1966 #if DEBUG |
| 1959 void CompilationInfo::PrintAstForTesting() { | 1967 void CompilationInfo::PrintAstForTesting() { |
| 1960 PrintF("--- Source from AST ---\n%s\n", | 1968 PrintF("--- Source from AST ---\n%s\n", |
| 1961 PrettyPrinter(isolate()).PrintProgram(literal())); | 1969 PrettyPrinter(isolate()).PrintProgram(literal())); |
| 1962 } | 1970 } |
| 1963 #endif | 1971 #endif |
| 1964 | 1972 |
| 1965 } // namespace internal | 1973 } // namespace internal |
| 1966 } // namespace v8 | 1974 } // namespace v8 |
| OLD | NEW |