| 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 7773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7784 // TODO(3025757): In case the recompiled isn't equivalent to the | 7784 // TODO(3025757): In case the recompiled isn't equivalent to the |
| 7785 // old code, we have to replace it. We should try to avoid this | 7785 // old code, we have to replace it. We should try to avoid this |
| 7786 // altogether because it flushes valuable type feedback by | 7786 // altogether because it flushes valuable type feedback by |
| 7787 // effectively resetting all IC state. | 7787 // effectively resetting all IC state. |
| 7788 set_code(recompiled); | 7788 set_code(recompiled); |
| 7789 } | 7789 } |
| 7790 ASSERT(has_deoptimization_support()); | 7790 ASSERT(has_deoptimization_support()); |
| 7791 } | 7791 } |
| 7792 | 7792 |
| 7793 | 7793 |
| 7794 void SharedFunctionInfo::DisableOptimization() { | 7794 void SharedFunctionInfo::DisableOptimization(const char* reason) { |
| 7795 // Disable optimization for the shared function info and mark the | 7795 // Disable optimization for the shared function info and mark the |
| 7796 // code as non-optimizable. The marker on the shared function info | 7796 // code as non-optimizable. The marker on the shared function info |
| 7797 // is there because we flush non-optimized code thereby loosing the | 7797 // is there because we flush non-optimized code thereby loosing the |
| 7798 // non-optimizable information for the code. When the code is | 7798 // non-optimizable information for the code. When the code is |
| 7799 // regenerated and set on the shared function info it is marked as | 7799 // regenerated and set on the shared function info it is marked as |
| 7800 // non-optimizable if optimization is disabled for the shared | 7800 // non-optimizable if optimization is disabled for the shared |
| 7801 // function info. | 7801 // function info. |
| 7802 set_optimization_disabled(true); | 7802 set_optimization_disabled(true); |
| 7803 // Code should be the lazy compilation stub or else unoptimized. If the | 7803 // Code should be the lazy compilation stub or else unoptimized. If the |
| 7804 // latter, disable optimization for the code too. | 7804 // latter, disable optimization for the code too. |
| 7805 ASSERT(code()->kind() == Code::FUNCTION || code()->kind() == Code::BUILTIN); | 7805 ASSERT(code()->kind() == Code::FUNCTION || code()->kind() == Code::BUILTIN); |
| 7806 if (code()->kind() == Code::FUNCTION) { | 7806 if (code()->kind() == Code::FUNCTION) { |
| 7807 code()->set_optimizable(false); | 7807 code()->set_optimizable(false); |
| 7808 } | 7808 } |
| 7809 if (FLAG_trace_opt) { | 7809 if (FLAG_trace_opt) { |
| 7810 PrintF("[disabled optimization for %s]\n", *DebugName()->ToCString()); | 7810 PrintF("[disabled optimization for %s, reason: %s]\n", |
| 7811 *DebugName()->ToCString(), reason); |
| 7811 } | 7812 } |
| 7812 } | 7813 } |
| 7813 | 7814 |
| 7814 | 7815 |
| 7815 bool SharedFunctionInfo::VerifyBailoutId(BailoutId id) { | 7816 bool SharedFunctionInfo::VerifyBailoutId(BailoutId id) { |
| 7816 ASSERT(!id.IsNone()); | 7817 ASSERT(!id.IsNone()); |
| 7817 Code* unoptimized = code(); | 7818 Code* unoptimized = code(); |
| 7818 DeoptimizationOutputData* data = | 7819 DeoptimizationOutputData* data = |
| 7819 DeoptimizationOutputData::cast(unoptimized->deoptimization_data()); | 7820 DeoptimizationOutputData::cast(unoptimized->deoptimization_data()); |
| 7820 unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this); | 7821 unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this); |
| (...skipping 5322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13143 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 13144 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
| 13144 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 13145 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
| 13145 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 13146 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
| 13146 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 13147 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
| 13147 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 13148 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
| 13148 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 13149 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
| 13149 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 13150 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
| 13150 } | 13151 } |
| 13151 | 13152 |
| 13152 } } // namespace v8::internal | 13153 } } // namespace v8::internal |
| OLD | NEW |