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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 // language, we cannot optimize functions with too many formal parameters | 210 // language, we cannot optimize functions with too many formal parameters |
211 // or perform on-stack replacement for function with too many | 211 // or perform on-stack replacement for function with too many |
212 // stack-allocated local variables. | 212 // stack-allocated local variables. |
213 // | 213 // |
214 // The encoding is as a signed value, with parameters and receiver using | 214 // The encoding is as a signed value, with parameters and receiver using |
215 // the negative indices and locals the non-negative ones. | 215 // the negative indices and locals the non-negative ones. |
216 const int parameter_limit = -LUnallocated::kMinFixedIndex; | 216 const int parameter_limit = -LUnallocated::kMinFixedIndex; |
217 const int locals_limit = LUnallocated::kMaxFixedIndex; | 217 const int locals_limit = LUnallocated::kMaxFixedIndex; |
218 Scope* scope = info->scope(); | 218 Scope* scope = info->scope(); |
219 if ((scope->num_parameters() + 1) > parameter_limit || | 219 if ((scope->num_parameters() + 1) > parameter_limit || |
220 scope->num_stack_slots() > locals_limit) { | 220 (info->osr_ast_id() != AstNode::kNoNumber && |
| 221 scope->num_parameters() + 1 + scope->num_stack_slots() > locals_limit)) { |
221 info->AbortOptimization(); | 222 info->AbortOptimization(); |
222 Handle<JSFunction> closure = info->closure(); | 223 Handle<JSFunction> closure = info->closure(); |
223 info->shared_info()->DisableOptimization(*closure); | 224 info->shared_info()->DisableOptimization(*closure); |
224 // True indicates the compilation pipeline is still going, not | 225 // True indicates the compilation pipeline is still going, not |
225 // necessarily that we optimized the code. | 226 // necessarily that we optimized the code. |
226 return true; | 227 return true; |
227 } | 228 } |
228 | 229 |
229 // Take --hydrogen-filter into account. | 230 // Take --hydrogen-filter into account. |
230 Vector<const char> filter = CStrVector(FLAG_hydrogen_filter); | 231 Vector<const char> filter = CStrVector(FLAG_hydrogen_filter); |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 shared->DebugName())); | 785 shared->DebugName())); |
785 } | 786 } |
786 } | 787 } |
787 | 788 |
788 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 789 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
789 Handle<Script>(info->script()), | 790 Handle<Script>(info->script()), |
790 Handle<Code>(info->code()))); | 791 Handle<Code>(info->code()))); |
791 } | 792 } |
792 | 793 |
793 } } // namespace v8::internal | 794 } } // namespace v8::internal |
OLD | NEW |