| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 9705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9716 | 9716 |
| 9717 void SharedFunctionInfo::DisableOptimization(const char* reason) { | 9717 void SharedFunctionInfo::DisableOptimization(const char* reason) { |
| 9718 // Disable optimization for the shared function info and mark the | 9718 // Disable optimization for the shared function info and mark the |
| 9719 // code as non-optimizable. The marker on the shared function info | 9719 // code as non-optimizable. The marker on the shared function info |
| 9720 // is there because we flush non-optimized code thereby loosing the | 9720 // is there because we flush non-optimized code thereby loosing the |
| 9721 // non-optimizable information for the code. When the code is | 9721 // non-optimizable information for the code. When the code is |
| 9722 // regenerated and set on the shared function info it is marked as | 9722 // regenerated and set on the shared function info it is marked as |
| 9723 // non-optimizable if optimization is disabled for the shared | 9723 // non-optimizable if optimization is disabled for the shared |
| 9724 // function info. | 9724 // function info. |
| 9725 set_optimization_disabled(true); | 9725 set_optimization_disabled(true); |
| 9726 // Code should be the lazy compilation stub or else unoptimized. If the | 9726 // Code should be the lazy compilation stub or else unoptimized. |
| 9727 // latter, disable optimization for the code too. | |
| 9728 ASSERT(code()->kind() == Code::FUNCTION || code()->kind() == Code::BUILTIN); | 9727 ASSERT(code()->kind() == Code::FUNCTION || code()->kind() == Code::BUILTIN); |
| 9729 if (code()->kind() == Code::FUNCTION) { | |
| 9730 code()->set_optimizable(false); | |
| 9731 } | |
| 9732 if (FLAG_trace_opt) { | 9728 if (FLAG_trace_opt) { |
| 9733 PrintF("[disabled optimization for "); | 9729 PrintF("[disabled optimization for "); |
| 9734 ShortPrint(); | 9730 ShortPrint(); |
| 9735 PrintF(", reason: %s]\n", reason); | 9731 PrintF(", reason: %s]\n", reason); |
| 9736 } | 9732 } |
| 9737 } | 9733 } |
| 9738 | 9734 |
| 9739 | 9735 |
| 9740 bool SharedFunctionInfo::VerifyBailoutId(BailoutId id) { | 9736 bool SharedFunctionInfo::VerifyBailoutId(BailoutId id) { |
| 9741 ASSERT(!id.IsNone()); | 9737 ASSERT(!id.IsNone()); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9817 | 9813 |
| 9818 void SharedFunctionInfo::ResetForNewContext(int new_ic_age) { | 9814 void SharedFunctionInfo::ResetForNewContext(int new_ic_age) { |
| 9819 code()->ClearInlineCaches(); | 9815 code()->ClearInlineCaches(); |
| 9820 set_ic_age(new_ic_age); | 9816 set_ic_age(new_ic_age); |
| 9821 if (code()->kind() == Code::FUNCTION) { | 9817 if (code()->kind() == Code::FUNCTION) { |
| 9822 code()->set_profiler_ticks(0); | 9818 code()->set_profiler_ticks(0); |
| 9823 if (optimization_disabled() && | 9819 if (optimization_disabled() && |
| 9824 opt_count() >= FLAG_max_opt_count) { | 9820 opt_count() >= FLAG_max_opt_count) { |
| 9825 // Re-enable optimizations if they were disabled due to opt_count limit. | 9821 // Re-enable optimizations if they were disabled due to opt_count limit. |
| 9826 set_optimization_disabled(false); | 9822 set_optimization_disabled(false); |
| 9827 code()->set_optimizable(true); | |
| 9828 } | 9823 } |
| 9829 set_opt_count(0); | 9824 set_opt_count(0); |
| 9830 set_deopt_count(0); | 9825 set_deopt_count(0); |
| 9831 } | 9826 } |
| 9832 } | 9827 } |
| 9833 | 9828 |
| 9834 | 9829 |
| 9835 static void GetMinInobjectSlack(Map* map, void* data) { | 9830 static void GetMinInobjectSlack(Map* map, void* data) { |
| 9836 int slack = map->unused_property_fields(); | 9831 int slack = map->unused_property_fields(); |
| 9837 if (*reinterpret_cast<int*>(data) > slack) { | 9832 if (*reinterpret_cast<int*>(data) > slack) { |
| (...skipping 6033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15871 | 15866 |
| 15872 void PropertyCell::AddDependentCode(Handle<Code> code) { | 15867 void PropertyCell::AddDependentCode(Handle<Code> code) { |
| 15873 Handle<DependentCode> codes = DependentCode::Insert( | 15868 Handle<DependentCode> codes = DependentCode::Insert( |
| 15874 Handle<DependentCode>(dependent_code()), | 15869 Handle<DependentCode>(dependent_code()), |
| 15875 DependentCode::kPropertyCellChangedGroup, code); | 15870 DependentCode::kPropertyCellChangedGroup, code); |
| 15876 if (*codes != dependent_code()) set_dependent_code(*codes); | 15871 if (*codes != dependent_code()) set_dependent_code(*codes); |
| 15877 } | 15872 } |
| 15878 | 15873 |
| 15879 | 15874 |
| 15880 } } // namespace v8::internal | 15875 } } // namespace v8::internal |
| OLD | NEW |