| 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 9786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9797 // TODO(3025757): In case the recompiled isn't equivalent to the | 9797 // TODO(3025757): In case the recompiled isn't equivalent to the |
| 9798 // old code, we have to replace it. We should try to avoid this | 9798 // old code, we have to replace it. We should try to avoid this |
| 9799 // altogether because it flushes valuable type feedback by | 9799 // altogether because it flushes valuable type feedback by |
| 9800 // effectively resetting all IC state. | 9800 // effectively resetting all IC state. |
| 9801 ReplaceCode(recompiled); | 9801 ReplaceCode(recompiled); |
| 9802 } | 9802 } |
| 9803 ASSERT(has_deoptimization_support()); | 9803 ASSERT(has_deoptimization_support()); |
| 9804 } | 9804 } |
| 9805 | 9805 |
| 9806 | 9806 |
| 9807 void SharedFunctionInfo::DisableOptimization(const char* reason) { | 9807 void SharedFunctionInfo::DisableOptimization(BailoutReason reason) { |
| 9808 // Disable optimization for the shared function info and mark the | 9808 // Disable optimization for the shared function info and mark the |
| 9809 // code as non-optimizable. The marker on the shared function info | 9809 // code as non-optimizable. The marker on the shared function info |
| 9810 // is there because we flush non-optimized code thereby loosing the | 9810 // is there because we flush non-optimized code thereby loosing the |
| 9811 // non-optimizable information for the code. When the code is | 9811 // non-optimizable information for the code. When the code is |
| 9812 // regenerated and set on the shared function info it is marked as | 9812 // regenerated and set on the shared function info it is marked as |
| 9813 // non-optimizable if optimization is disabled for the shared | 9813 // non-optimizable if optimization is disabled for the shared |
| 9814 // function info. | 9814 // function info. |
| 9815 set_optimization_disabled(true); | 9815 set_optimization_disabled(true); |
| 9816 // Code should be the lazy compilation stub or else unoptimized. If the | 9816 // Code should be the lazy compilation stub or else unoptimized. If the |
| 9817 // latter, disable optimization for the code too. | 9817 // latter, disable optimization for the code too. |
| 9818 ASSERT(code()->kind() == Code::FUNCTION || code()->kind() == Code::BUILTIN); | 9818 ASSERT(code()->kind() == Code::FUNCTION || code()->kind() == Code::BUILTIN); |
| 9819 if (code()->kind() == Code::FUNCTION) { | 9819 if (code()->kind() == Code::FUNCTION) { |
| 9820 code()->set_optimizable(false); | 9820 code()->set_optimizable(false); |
| 9821 } | 9821 } |
| 9822 if (FLAG_trace_opt) { | 9822 if (FLAG_trace_opt) { |
| 9823 PrintF("[disabled optimization for "); | 9823 PrintF("[disabled optimization for "); |
| 9824 ShortPrint(); | 9824 ShortPrint(); |
| 9825 PrintF(", reason: %s]\n", reason); | 9825 PrintF(", reason: %s]\n", GetBailoutReason(reason)); |
| 9826 } | 9826 } |
| 9827 } | 9827 } |
| 9828 | 9828 |
| 9829 | 9829 |
| 9830 bool SharedFunctionInfo::VerifyBailoutId(BailoutId id) { | 9830 bool SharedFunctionInfo::VerifyBailoutId(BailoutId id) { |
| 9831 ASSERT(!id.IsNone()); | 9831 ASSERT(!id.IsNone()); |
| 9832 Code* unoptimized = code(); | 9832 Code* unoptimized = code(); |
| 9833 DeoptimizationOutputData* data = | 9833 DeoptimizationOutputData* data = |
| 9834 DeoptimizationOutputData::cast(unoptimized->deoptimization_data()); | 9834 DeoptimizationOutputData::cast(unoptimized->deoptimization_data()); |
| 9835 unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this); | 9835 unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this); |
| (...skipping 6121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15957 | 15957 |
| 15958 | 15958 |
| 15959 void PropertyCell::AddDependentCode(Handle<Code> code) { | 15959 void PropertyCell::AddDependentCode(Handle<Code> code) { |
| 15960 Handle<DependentCode> codes = DependentCode::Insert( | 15960 Handle<DependentCode> codes = DependentCode::Insert( |
| 15961 Handle<DependentCode>(dependent_code()), | 15961 Handle<DependentCode>(dependent_code()), |
| 15962 DependentCode::kPropertyCellChangedGroup, code); | 15962 DependentCode::kPropertyCellChangedGroup, code); |
| 15963 if (*codes != dependent_code()) set_dependent_code(*codes); | 15963 if (*codes != dependent_code()) set_dependent_code(*codes); |
| 15964 } | 15964 } |
| 15965 | 15965 |
| 15966 | 15966 |
| 15967 const char* GetBailoutReason(BailoutReason reason) { |
| 15968 ASSERT(reason < kLastErrorMessage); |
| 15969 #define ERROR_MESSAGES_TEXTS(C, T) T, |
| 15970 static const char* error_messages_[] = { |
| 15971 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
| 15972 }; |
| 15973 #undef ERROR_MESSAGES_TEXTS |
| 15974 return error_messages_[reason]; |
| 15975 } |
| 15976 |
| 15977 |
| 15967 } } // namespace v8::internal | 15978 } } // namespace v8::internal |
| OLD | NEW |