| 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 9780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9791 | 9791 |
| 9792 void SharedFunctionInfo::DisableOptimization(BailoutReason reason) { | 9792 void SharedFunctionInfo::DisableOptimization(BailoutReason reason) { |
| 9793 // Disable optimization for the shared function info and mark the | 9793 // Disable optimization for the shared function info and mark the |
| 9794 // code as non-optimizable. The marker on the shared function info | 9794 // code as non-optimizable. The marker on the shared function info |
| 9795 // is there because we flush non-optimized code thereby loosing the | 9795 // is there because we flush non-optimized code thereby loosing the |
| 9796 // non-optimizable information for the code. When the code is | 9796 // non-optimizable information for the code. When the code is |
| 9797 // regenerated and set on the shared function info it is marked as | 9797 // regenerated and set on the shared function info it is marked as |
| 9798 // non-optimizable if optimization is disabled for the shared | 9798 // non-optimizable if optimization is disabled for the shared |
| 9799 // function info. | 9799 // function info. |
| 9800 set_optimization_disabled(true); | 9800 set_optimization_disabled(true); |
| 9801 set_bailout_reason(reason); |
| 9801 // Code should be the lazy compilation stub or else unoptimized. If the | 9802 // Code should be the lazy compilation stub or else unoptimized. If the |
| 9802 // latter, disable optimization for the code too. | 9803 // latter, disable optimization for the code too. |
| 9803 ASSERT(code()->kind() == Code::FUNCTION || code()->kind() == Code::BUILTIN); | 9804 ASSERT(code()->kind() == Code::FUNCTION || code()->kind() == Code::BUILTIN); |
| 9804 if (code()->kind() == Code::FUNCTION) { | 9805 if (code()->kind() == Code::FUNCTION) { |
| 9805 code()->set_optimizable(false); | 9806 code()->set_optimizable(false); |
| 9806 } | 9807 } |
| 9807 if (FLAG_trace_opt) { | 9808 if (FLAG_trace_opt) { |
| 9808 PrintF("[disabled optimization for "); | 9809 PrintF("[disabled optimization for "); |
| 9809 ShortPrint(); | 9810 ShortPrint(); |
| 9810 PrintF(", reason: %s]\n", GetBailoutReason(reason)); | 9811 PrintF(", reason: %s]\n", GetBailoutReason(reason)); |
| (...skipping 6157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15968 #define ERROR_MESSAGES_TEXTS(C, T) T, | 15969 #define ERROR_MESSAGES_TEXTS(C, T) T, |
| 15969 static const char* error_messages_[] = { | 15970 static const char* error_messages_[] = { |
| 15970 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 15971 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
| 15971 }; | 15972 }; |
| 15972 #undef ERROR_MESSAGES_TEXTS | 15973 #undef ERROR_MESSAGES_TEXTS |
| 15973 return error_messages_[reason]; | 15974 return error_messages_[reason]; |
| 15974 } | 15975 } |
| 15975 | 15976 |
| 15976 | 15977 |
| 15977 } } // namespace v8::internal | 15978 } } // namespace v8::internal |
| OLD | NEW |