OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 6076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6087 // TODO(3025757): In case the recompiled isn't equivalent to the | 6087 // TODO(3025757): In case the recompiled isn't equivalent to the |
6088 // old code, we have to replace it. We should try to avoid this | 6088 // old code, we have to replace it. We should try to avoid this |
6089 // altogether because it flushes valuable type feedback by | 6089 // altogether because it flushes valuable type feedback by |
6090 // effectively resetting all IC state. | 6090 // effectively resetting all IC state. |
6091 set_code(recompiled); | 6091 set_code(recompiled); |
6092 } | 6092 } |
6093 ASSERT(has_deoptimization_support()); | 6093 ASSERT(has_deoptimization_support()); |
6094 } | 6094 } |
6095 | 6095 |
6096 | 6096 |
| 6097 void SharedFunctionInfo::DisableOptimization(JSFunction* function) { |
| 6098 // Disable optimization for the shared function info and mark the |
| 6099 // code as non-optimizable. The marker on the shared function info |
| 6100 // is there because we flush non-optimized code thereby loosing the |
| 6101 // non-optimizable information for the code. When the code is |
| 6102 // regenerated and set on the shared function info it is marked as |
| 6103 // non-optimizable if optimization is disabled for the shared |
| 6104 // function info. |
| 6105 set_optimization_disabled(true); |
| 6106 // Code should be the lazy compilation stub or else unoptimized. If the |
| 6107 // latter, disable optimization for the code too. |
| 6108 ASSERT(code()->kind() == Code::FUNCTION || code()->kind() == Code::BUILTIN); |
| 6109 if (code()->kind() == Code::FUNCTION) { |
| 6110 code()->set_optimizable(false); |
| 6111 } |
| 6112 if (FLAG_trace_opt) { |
| 6113 PrintF("[disabled optimization for: "); |
| 6114 function->PrintName(); |
| 6115 PrintF(" / %" V8PRIxPTR "]\n", reinterpret_cast<intptr_t>(function)); |
| 6116 } |
| 6117 } |
| 6118 |
| 6119 |
6097 bool SharedFunctionInfo::VerifyBailoutId(int id) { | 6120 bool SharedFunctionInfo::VerifyBailoutId(int id) { |
6098 // TODO(srdjan): debugging ARM crashes in hydrogen. OK to disable while | 6121 // TODO(srdjan): debugging ARM crashes in hydrogen. OK to disable while |
6099 // we are always bailing out on ARM. | 6122 // we are always bailing out on ARM. |
6100 | 6123 |
6101 ASSERT(id != AstNode::kNoNumber); | 6124 ASSERT(id != AstNode::kNoNumber); |
6102 Code* unoptimized = code(); | 6125 Code* unoptimized = code(); |
6103 DeoptimizationOutputData* data = | 6126 DeoptimizationOutputData* data = |
6104 DeoptimizationOutputData::cast(unoptimized->deoptimization_data()); | 6127 DeoptimizationOutputData::cast(unoptimized->deoptimization_data()); |
6105 unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this); | 6128 unsigned ignore = Deoptimizer::GetOutputInfo(data, id, this); |
6106 USE(ignore); | 6129 USE(ignore); |
(...skipping 4359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10466 if (break_point_objects()->IsUndefined()) return 0; | 10489 if (break_point_objects()->IsUndefined()) return 0; |
10467 // Single beak point. | 10490 // Single beak point. |
10468 if (!break_point_objects()->IsFixedArray()) return 1; | 10491 if (!break_point_objects()->IsFixedArray()) return 1; |
10469 // Multiple break points. | 10492 // Multiple break points. |
10470 return FixedArray::cast(break_point_objects())->length(); | 10493 return FixedArray::cast(break_point_objects())->length(); |
10471 } | 10494 } |
10472 #endif | 10495 #endif |
10473 | 10496 |
10474 | 10497 |
10475 } } // namespace v8::internal | 10498 } } // namespace v8::internal |
OLD | NEW |