| 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-numbering.h" | 9 #include "src/ast-numbering.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1465 // TODO(titzer): reuse the AST and scope info from this compile. | 1465 // TODO(titzer): reuse the AST and scope info from this compile. |
| 1466 CompilationInfoWithZone nested(function); | 1466 CompilationInfoWithZone nested(function); |
| 1467 nested.EnableDeoptimizationSupport(); | 1467 nested.EnableDeoptimizationSupport(); |
| 1468 if (!GetUnoptimizedCodeCommon(&nested).ToHandle(¤t_code)) { | 1468 if (!GetUnoptimizedCodeCommon(&nested).ToHandle(¤t_code)) { |
| 1469 return MaybeHandle<Code>(); | 1469 return MaybeHandle<Code>(); |
| 1470 } | 1470 } |
| 1471 shared->ReplaceCode(*current_code); | 1471 shared->ReplaceCode(*current_code); |
| 1472 } | 1472 } |
| 1473 current_code->set_profiler_ticks(0); | 1473 current_code->set_profiler_ticks(0); |
| 1474 | 1474 |
| 1475 // TODO(mstarzinger): We cannot properly deserialize a scope chain containing |
| 1476 // an eval scope and hence would fail at parsing the eval source again. |
| 1477 if (shared->disable_optimization_reason() == kEval) { |
| 1478 return MaybeHandle<Code>(); |
| 1479 } |
| 1480 |
| 1481 // TODO(mstarzinger): We cannot properly deserialize a scope chain for the |
| 1482 // builtin context, hence Genesis::InstallExperimentalNatives would fail. |
| 1483 if (shared->is_toplevel() && isolate->bootstrapper()->IsActive()) { |
| 1484 return MaybeHandle<Code>(); |
| 1485 } |
| 1486 |
| 1487 // TODO(titzer): Some top-level code times out because of missing interrupt |
| 1488 // checks at back-branches, these are currently marked with --no-turbo-osr. |
| 1489 if (shared->is_toplevel() && !FLAG_turbo_osr) { |
| 1490 return MaybeHandle<Code>(); |
| 1491 } |
| 1492 |
| 1475 info->SetOptimizing(osr_ast_id, current_code); | 1493 info->SetOptimizing(osr_ast_id, current_code); |
| 1476 | 1494 |
| 1477 if (mode == CONCURRENT) { | 1495 if (mode == CONCURRENT) { |
| 1478 if (GetOptimizedCodeLater(info.get())) { | 1496 if (GetOptimizedCodeLater(info.get())) { |
| 1479 info.Detach(); // The background recompile job owns this now. | 1497 info.Detach(); // The background recompile job owns this now. |
| 1480 return isolate->builtins()->InOptimizationQueue(); | 1498 return isolate->builtins()->InOptimizationQueue(); |
| 1481 } | 1499 } |
| 1482 } else { | 1500 } else { |
| 1483 if (GetOptimizedCodeNow(info.get())) return info->code(); | 1501 if (GetOptimizedCodeNow(info.get())) return info->code(); |
| 1484 } | 1502 } |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1578 } | 1596 } |
| 1579 | 1597 |
| 1580 | 1598 |
| 1581 #if DEBUG | 1599 #if DEBUG |
| 1582 void CompilationInfo::PrintAstForTesting() { | 1600 void CompilationInfo::PrintAstForTesting() { |
| 1583 PrintF("--- Source from AST ---\n%s\n", | 1601 PrintF("--- Source from AST ---\n%s\n", |
| 1584 PrettyPrinter(isolate(), zone()).PrintProgram(function())); | 1602 PrettyPrinter(isolate(), zone()).PrintProgram(function())); |
| 1585 } | 1603 } |
| 1586 #endif | 1604 #endif |
| 1587 } } // namespace v8::internal | 1605 } } // namespace v8::internal |
| OLD | NEW |