OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 shared_info_(Handle<SharedFunctionInfo>(closure->shared())), | 85 shared_info_(Handle<SharedFunctionInfo>(closure->shared())), |
86 script_(Handle<Script>(Script::cast(shared_info_->script()))), | 86 script_(Handle<Script>(Script::cast(shared_info_->script()))), |
87 extension_(NULL), | 87 extension_(NULL), |
88 pre_parse_data_(NULL), | 88 pre_parse_data_(NULL), |
89 supports_deoptimization_(false), | 89 supports_deoptimization_(false), |
90 osr_ast_id_(AstNode::kNoNumber) { | 90 osr_ast_id_(AstNode::kNoNumber) { |
91 Initialize(BASE); | 91 Initialize(BASE); |
92 } | 92 } |
93 | 93 |
94 | 94 |
| 95 void CompilationInfo::DisableOptimization() { |
| 96 if (FLAG_optimize_closures) { |
| 97 // If we allow closures optimizations and it's an optimizable closure |
| 98 // mark it correspondingly. |
| 99 bool is_closure = closure_.is_null() && !scope_->HasTrivialOuterContext(); |
| 100 if (is_closure) { |
| 101 bool is_optimizable_closure = |
| 102 !scope_->outer_scope_calls_eval() && !scope_->inside_with(); |
| 103 if (is_optimizable_closure) { |
| 104 SetMode(BASE); |
| 105 return; |
| 106 } |
| 107 } |
| 108 } |
| 109 |
| 110 SetMode(NONOPT); |
| 111 } |
| 112 |
| 113 |
95 // Determine whether to use the full compiler for all code. If the flag | 114 // Determine whether to use the full compiler for all code. If the flag |
96 // --always-full-compiler is specified this is the case. For the virtual frame | 115 // --always-full-compiler is specified this is the case. For the virtual frame |
97 // based compiler the full compiler is also used if a debugger is connected, as | 116 // based compiler the full compiler is also used if a debugger is connected, as |
98 // the code from the full compiler supports mode precise break points. For the | 117 // the code from the full compiler supports mode precise break points. For the |
99 // crankshaft adaptive compiler debugging the optimized code is not possible at | 118 // crankshaft adaptive compiler debugging the optimized code is not possible at |
100 // all. However crankshaft support recompilation of functions, so in this case | 119 // all. However crankshaft support recompilation of functions, so in this case |
101 // the full compiler need not be be used if a debugger is attached, but only if | 120 // the full compiler need not be be used if a debugger is attached, but only if |
102 // break points has actually been set. | 121 // break points has actually been set. |
103 static bool AlwaysFullCompiler() { | 122 static bool AlwaysFullCompiler() { |
104 #ifdef ENABLE_DEBUGGER_SUPPORT | 123 #ifdef ENABLE_DEBUGGER_SUPPORT |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 *code, | 789 *code, |
771 *name)); | 790 *name)); |
772 OPROFILE(CreateNativeCodeRegion(*name, | 791 OPROFILE(CreateNativeCodeRegion(*name, |
773 code->instruction_start(), | 792 code->instruction_start(), |
774 code->instruction_size())); | 793 code->instruction_size())); |
775 } | 794 } |
776 } | 795 } |
777 } | 796 } |
778 | 797 |
779 } } // namespace v8::internal | 798 } } // namespace v8::internal |
OLD | NEW |