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 4541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4552 TraceInline(target, caller, "target requires context change"); | 4552 TraceInline(target, caller, "target requires context change"); |
4553 return false; | 4553 return false; |
4554 } | 4554 } |
4555 #endif | 4555 #endif |
4556 | 4556 |
4557 | 4557 |
4558 // Don't inline deeper than kMaxInliningLevels calls. | 4558 // Don't inline deeper than kMaxInliningLevels calls. |
4559 HEnvironment* env = environment(); | 4559 HEnvironment* env = environment(); |
4560 int current_level = 1; | 4560 int current_level = 1; |
4561 while (env->outer() != NULL) { | 4561 while (env->outer() != NULL) { |
4562 if (FLAG_limit_inlining && current_level == Compiler::kMaxInliningLevels) { | 4562 if (current_level == (FLAG_limit_inlining |
| 4563 ? Compiler::kMaxInliningLevels |
| 4564 : 2 * Compiler::kMaxInliningLevels)) { |
4563 TraceInline(target, caller, "inline depth limit reached"); | 4565 TraceInline(target, caller, "inline depth limit reached"); |
4564 return false; | 4566 return false; |
4565 } | 4567 } |
4566 current_level++; | 4568 current_level++; |
4567 env = env->outer(); | 4569 env = env->outer(); |
4568 } | 4570 } |
4569 | 4571 |
4570 // Don't inline recursive functions. | 4572 // Don't inline recursive functions. |
4571 if (*target_shared == outer_info->closure()->shared()) { | 4573 if (*target_shared == outer_info->closure()->shared()) { |
4572 TraceInline(target, caller, "target is recursive"); | 4574 TraceInline(target, caller, "target is recursive"); |
(...skipping 2368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6941 } | 6943 } |
6942 } | 6944 } |
6943 | 6945 |
6944 #ifdef DEBUG | 6946 #ifdef DEBUG |
6945 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 6947 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
6946 if (allocator_ != NULL) allocator_->Verify(); | 6948 if (allocator_ != NULL) allocator_->Verify(); |
6947 #endif | 6949 #endif |
6948 } | 6950 } |
6949 | 6951 |
6950 } } // namespace v8::internal | 6952 } } // namespace v8::internal |
OLD | NEW |