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 7834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7845 // TODO(3025757): In case the recompiled isn't equivalent to the | 7845 // TODO(3025757): In case the recompiled isn't equivalent to the |
7846 // old code, we have to replace it. We should try to avoid this | 7846 // old code, we have to replace it. We should try to avoid this |
7847 // altogether because it flushes valuable type feedback by | 7847 // altogether because it flushes valuable type feedback by |
7848 // effectively resetting all IC state. | 7848 // effectively resetting all IC state. |
7849 set_code(recompiled); | 7849 set_code(recompiled); |
7850 } | 7850 } |
7851 ASSERT(has_deoptimization_support()); | 7851 ASSERT(has_deoptimization_support()); |
7852 } | 7852 } |
7853 | 7853 |
7854 | 7854 |
7855 void SharedFunctionInfo::DisableOptimization(JSFunction* function) { | 7855 void SharedFunctionInfo::DisableOptimization() { |
7856 // Disable optimization for the shared function info and mark the | 7856 // Disable optimization for the shared function info and mark the |
7857 // code as non-optimizable. The marker on the shared function info | 7857 // code as non-optimizable. The marker on the shared function info |
7858 // is there because we flush non-optimized code thereby loosing the | 7858 // is there because we flush non-optimized code thereby loosing the |
7859 // non-optimizable information for the code. When the code is | 7859 // non-optimizable information for the code. When the code is |
7860 // regenerated and set on the shared function info it is marked as | 7860 // regenerated and set on the shared function info it is marked as |
7861 // non-optimizable if optimization is disabled for the shared | 7861 // non-optimizable if optimization is disabled for the shared |
7862 // function info. | 7862 // function info. |
7863 set_optimization_disabled(true); | 7863 set_optimization_disabled(true); |
7864 // Code should be the lazy compilation stub or else unoptimized. If the | 7864 // Code should be the lazy compilation stub or else unoptimized. If the |
7865 // latter, disable optimization for the code too. | 7865 // latter, disable optimization for the code too. |
7866 ASSERT(code()->kind() == Code::FUNCTION || code()->kind() == Code::BUILTIN); | 7866 ASSERT(code()->kind() == Code::FUNCTION || code()->kind() == Code::BUILTIN); |
7867 if (code()->kind() == Code::FUNCTION) { | 7867 if (code()->kind() == Code::FUNCTION) { |
7868 code()->set_optimizable(false); | 7868 code()->set_optimizable(false); |
7869 } | 7869 } |
7870 if (FLAG_trace_opt) { | 7870 if (FLAG_trace_opt) { |
7871 PrintF("[disabled optimization for: "); | 7871 PrintF("[disabled optimization for: "); |
7872 function->PrintName(); | 7872 DebugName()->ShortPrint(); |
7873 PrintF(" / %" V8PRIxPTR "]\n", reinterpret_cast<intptr_t>(function)); | 7873 PrintF("]\n"); |
7874 } | 7874 } |
7875 } | 7875 } |
7876 | 7876 |
7877 | 7877 |
7878 bool SharedFunctionInfo::VerifyBailoutId(int id) { | 7878 bool SharedFunctionInfo::VerifyBailoutId(int id) { |
7879 // TODO(srdjan): debugging ARM crashes in hydrogen. OK to disable while | |
7880 // we are always bailing out on ARM. | |
7881 | |
7882 ASSERT(id != AstNode::kNoNumber); | 7879 ASSERT(id != AstNode::kNoNumber); |
7883 Code* unoptimized = code(); | 7880 Code* unoptimized = code(); |
7884 DeoptimizationOutputData* data = | 7881 DeoptimizationOutputData* data = |
7885 DeoptimizationOutputData::cast(unoptimized->deoptimization_data()); | 7882 DeoptimizationOutputData::cast(unoptimized->deoptimization_data()); |
7886 unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this); | 7883 unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this); |
7887 USE(ignore); | 7884 USE(ignore); |
7888 return true; // Return true if there was no ASSERT. | 7885 return true; // Return true if there was no ASSERT. |
7889 } | 7886 } |
7890 | 7887 |
7891 | 7888 |
(...skipping 5175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13067 if (break_point_objects()->IsUndefined()) return 0; | 13064 if (break_point_objects()->IsUndefined()) return 0; |
13068 // Single break point. | 13065 // Single break point. |
13069 if (!break_point_objects()->IsFixedArray()) return 1; | 13066 if (!break_point_objects()->IsFixedArray()) return 1; |
13070 // Multiple break points. | 13067 // Multiple break points. |
13071 return FixedArray::cast(break_point_objects())->length(); | 13068 return FixedArray::cast(break_point_objects())->length(); |
13072 } | 13069 } |
13073 #endif // ENABLE_DEBUGGER_SUPPORT | 13070 #endif // ENABLE_DEBUGGER_SUPPORT |
13074 | 13071 |
13075 | 13072 |
13076 } } // namespace v8::internal | 13073 } } // namespace v8::internal |
OLD | NEW |