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 4002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4013 } | 4013 } |
4014 | 4014 |
4015 int count_before = AstNode::Count(); | 4015 int count_before = AstNode::Count(); |
4016 | 4016 |
4017 // Parse and allocate variables. | 4017 // Parse and allocate variables. |
4018 CompilationInfo inner_info(target); | 4018 CompilationInfo inner_info(target); |
4019 if (!ParserApi::Parse(&inner_info) || | 4019 if (!ParserApi::Parse(&inner_info) || |
4020 !Scope::Analyze(&inner_info)) { | 4020 !Scope::Analyze(&inner_info)) { |
4021 if (Top::has_pending_exception()) { | 4021 if (Top::has_pending_exception()) { |
4022 SetStackOverflow(); | 4022 SetStackOverflow(); |
| 4023 // Stop trying to optimize and inline this function. |
| 4024 target->shared()->set_optimization_disabled(true); |
4023 } | 4025 } |
4024 return false; | 4026 return false; |
4025 } | 4027 } |
4026 FunctionLiteral* function = inner_info.function(); | 4028 FunctionLiteral* function = inner_info.function(); |
4027 | 4029 |
4028 // Count the number of AST nodes added by inlining this call. | 4030 // Count the number of AST nodes added by inlining this call. |
4029 int nodes_added = AstNode::Count() - count_before; | 4031 int nodes_added = AstNode::Count() - count_before; |
4030 if (FLAG_limit_inlining && nodes_added > kMaxInlinedSize) { | 4032 if (FLAG_limit_inlining && nodes_added > kMaxInlinedSize) { |
4031 if (FLAG_trace_inlining) TraceInline(target, false); | 4033 if (FLAG_trace_inlining) TraceInline(target, false); |
4032 return false; | 4034 return false; |
(...skipping 2008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6041 } | 6043 } |
6042 } | 6044 } |
6043 | 6045 |
6044 #ifdef DEBUG | 6046 #ifdef DEBUG |
6045 if (graph_ != NULL) graph_->Verify(); | 6047 if (graph_ != NULL) graph_->Verify(); |
6046 if (allocator_ != NULL) allocator_->Verify(); | 6048 if (allocator_ != NULL) allocator_->Verify(); |
6047 #endif | 6049 #endif |
6048 } | 6050 } |
6049 | 6051 |
6050 } } // namespace v8::internal | 6052 } } // namespace v8::internal |
OLD | NEW |