| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 !scope_->outer_scope_calls_non_strict_eval() && | 107 !scope_->outer_scope_calls_non_strict_eval() && |
| 108 !scope_->inside_with(); | 108 !scope_->inside_with(); |
| 109 SetMode(is_optimizable_closure ? BASE : NONOPT); | 109 SetMode(is_optimizable_closure ? BASE : NONOPT); |
| 110 } | 110 } |
| 111 | 111 |
| 112 | 112 |
| 113 // Primitive functions are unlikely to be picked up by the stack-walking | 113 // Primitive functions are unlikely to be picked up by the stack-walking |
| 114 // profiler, so they trigger their own optimization when they're called | 114 // profiler, so they trigger their own optimization when they're called |
| 115 // for the SharedFunctionInfo::kCallsUntilPrimitiveOptimization-th time. | 115 // for the SharedFunctionInfo::kCallsUntilPrimitiveOptimization-th time. |
| 116 bool CompilationInfo::ShouldSelfOptimize() { | 116 bool CompilationInfo::ShouldSelfOptimize() { |
| 117 return FLAG_counting_profiler && | 117 return FLAG_self_optimization && |
| 118 FLAG_crankshaft && | 118 FLAG_crankshaft && |
| 119 !Serializer::enabled() && | 119 !Serializer::enabled() && |
| 120 !function()->flags()->Contains(kDontSelfOptimize) && | 120 !function()->flags()->Contains(kDontSelfOptimize) && |
| 121 (shared_info().is_null() || !shared_info()->optimization_disabled()); | 121 (shared_info().is_null() || !shared_info()->optimization_disabled()); |
| 122 } | 122 } |
| 123 | 123 |
| 124 | 124 |
| 125 void CompilationInfo::AbortOptimization() { | 125 void CompilationInfo::AbortOptimization() { |
| 126 Handle<Code> code(shared_info()->code()); | 126 Handle<Code> code(shared_info()->code()); |
| 127 SetCode(code); | 127 SetCode(code); |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 } | 804 } |
| 805 } | 805 } |
| 806 | 806 |
| 807 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 807 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
| 808 Handle<Script>(info->script()), | 808 Handle<Script>(info->script()), |
| 809 Handle<Code>(info->code()), | 809 Handle<Code>(info->code()), |
| 810 info)); | 810 info)); |
| 811 } | 811 } |
| 812 | 812 |
| 813 } } // namespace v8::internal | 813 } } // namespace v8::internal |
| OLD | NEW |