| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 !scope_->HasTrivialOuterContext() && | 102 !scope_->HasTrivialOuterContext() && |
| 103 !scope_->outer_scope_calls_non_strict_eval() && | 103 !scope_->outer_scope_calls_non_strict_eval() && |
| 104 !scope_->inside_with(); | 104 !scope_->inside_with(); |
| 105 SetMode(is_optimizable_closure ? BASE : NONOPT); | 105 SetMode(is_optimizable_closure ? BASE : NONOPT); |
| 106 } | 106 } |
| 107 | 107 |
| 108 | 108 |
| 109 void CompilationInfo::AbortOptimization() { | 109 void CompilationInfo::AbortOptimization() { |
| 110 Handle<Code> code(shared_info()->code()); | 110 Handle<Code> code(shared_info()->code()); |
| 111 SetCode(code); | 111 SetCode(code); |
| 112 Isolate* isolate = code->GetIsolate(); | |
| 113 isolate->compilation_cache()->MarkForLazyOptimizing(closure()); | |
| 114 } | 112 } |
| 115 | 113 |
| 116 | 114 |
| 117 // Determine whether to use the full compiler for all code. If the flag | 115 // Determine whether to use the full compiler for all code. If the flag |
| 118 // --always-full-compiler is specified this is the case. For the virtual frame | 116 // --always-full-compiler is specified this is the case. For the virtual frame |
| 119 // based compiler the full compiler is also used if a debugger is connected, as | 117 // based compiler the full compiler is also used if a debugger is connected, as |
| 120 // the code from the full compiler supports mode precise break points. For the | 118 // the code from the full compiler supports mode precise break points. For the |
| 121 // crankshaft adaptive compiler debugging the optimized code is not possible at | 119 // crankshaft adaptive compiler debugging the optimized code is not possible at |
| 122 // all. However crankshaft support recompilation of functions, so in this case | 120 // all. However crankshaft support recompilation of functions, so in this case |
| 123 // the full compiler need not be be used if a debugger is attached, but only if | 121 // the full compiler need not be be used if a debugger is attached, but only if |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 | 650 |
| 653 if (info->AllowOptimize() && !shared->optimization_disabled()) { | 651 if (info->AllowOptimize() && !shared->optimization_disabled()) { |
| 654 // If we're asked to always optimize, we compile the optimized | 652 // If we're asked to always optimize, we compile the optimized |
| 655 // version of the function right away - unless the debugger is | 653 // version of the function right away - unless the debugger is |
| 656 // active as it makes no sense to compile optimized code then. | 654 // active as it makes no sense to compile optimized code then. |
| 657 if (FLAG_always_opt && | 655 if (FLAG_always_opt && |
| 658 !Isolate::Current()->DebuggerHasBreakPoints()) { | 656 !Isolate::Current()->DebuggerHasBreakPoints()) { |
| 659 CompilationInfo optimized(function); | 657 CompilationInfo optimized(function); |
| 660 optimized.SetOptimizing(AstNode::kNoNumber); | 658 optimized.SetOptimizing(AstNode::kNoNumber); |
| 661 return CompileLazy(&optimized); | 659 return CompileLazy(&optimized); |
| 662 } else if (isolate->compilation_cache()->ShouldOptimizeEagerly( | |
| 663 function)) { | |
| 664 isolate->runtime_profiler()->OptimizeSoon(*function); | |
| 665 } | 660 } |
| 666 } | 661 } |
| 667 } | 662 } |
| 668 | 663 |
| 669 return true; | 664 return true; |
| 670 } | 665 } |
| 671 } | 666 } |
| 672 | 667 |
| 673 ASSERT(info->code().is_null()); | 668 ASSERT(info->code().is_null()); |
| 674 return false; | 669 return false; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 shared->DebugName())); | 780 shared->DebugName())); |
| 786 } | 781 } |
| 787 } | 782 } |
| 788 | 783 |
| 789 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 784 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
| 790 Handle<Script>(info->script()), | 785 Handle<Script>(info->script()), |
| 791 Handle<Code>(info->code()))); | 786 Handle<Code>(info->code()))); |
| 792 } | 787 } |
| 793 | 788 |
| 794 } } // namespace v8::internal | 789 } } // namespace v8::internal |
| OLD | NEW |