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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 return true; | 206 return true; |
207 } | 207 } |
208 | 208 |
209 // Due to an encoding limit on LUnallocated operands in the Lithium | 209 // Due to an encoding limit on LUnallocated operands in the Lithium |
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 limit = LUnallocated::kMaxFixedIndices / 2; | 216 const int parameter_limit = (LUnallocated::kMaxFixedIndices / 2); |
| 217 const int locals_limit = parameter_limit - 1; |
217 Scope* scope = info->scope(); | 218 Scope* scope = info->scope(); |
218 if ((scope->num_parameters() + 1) > limit || | 219 if ((scope->num_parameters() + 1) > parameter_limit || |
219 scope->num_stack_slots() > limit) { | 220 scope->num_stack_slots() > locals_limit) { |
220 info->AbortOptimization(); | 221 info->AbortOptimization(); |
221 Handle<JSFunction> closure = info->closure(); | 222 Handle<JSFunction> closure = info->closure(); |
222 info->shared_info()->DisableOptimization(*closure); | 223 info->shared_info()->DisableOptimization(*closure); |
223 // True indicates the compilation pipeline is still going, not | 224 // True indicates the compilation pipeline is still going, not |
224 // necessarily that we optimized the code. | 225 // necessarily that we optimized the code. |
225 return true; | 226 return true; |
226 } | 227 } |
227 | 228 |
228 // Take --hydrogen-filter into account. | 229 // Take --hydrogen-filter into account. |
229 Vector<const char> filter = CStrVector(FLAG_hydrogen_filter); | 230 Vector<const char> filter = CStrVector(FLAG_hydrogen_filter); |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 shared->DebugName())); | 782 shared->DebugName())); |
782 } | 783 } |
783 } | 784 } |
784 | 785 |
785 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 786 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
786 Handle<Script>(info->script()), | 787 Handle<Script>(info->script()), |
787 Handle<Code>(info->code()))); | 788 Handle<Code>(info->code()))); |
788 } | 789 } |
789 | 790 |
790 } } // namespace v8::internal | 791 } } // namespace v8::internal |
OLD | NEW |