Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/compiler.cc

Issue 7231008: Fix an overflow in on-stack replacement spill-slot allocation for Crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 parameter_limit = (LUnallocated::kMaxFixedIndices / 2); 216 const int parameter_limit = -LUnallocated::kMinFixedIndex;
217 const int locals_limit = parameter_limit - 1; 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 scope->num_stack_slots() > locals_limit) {
221 info->AbortOptimization(); 221 info->AbortOptimization();
222 Handle<JSFunction> closure = info->closure(); 222 Handle<JSFunction> closure = info->closure();
223 info->shared_info()->DisableOptimization(*closure); 223 info->shared_info()->DisableOptimization(*closure);
224 // True indicates the compilation pipeline is still going, not 224 // True indicates the compilation pipeline is still going, not
225 // necessarily that we optimized the code. 225 // necessarily that we optimized the code.
226 return true; 226 return true;
227 } 227 }
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 shared->DebugName())); 784 shared->DebugName()));
785 } 785 }
786 } 786 }
787 787
788 GDBJIT(AddCode(Handle<String>(shared->DebugName()), 788 GDBJIT(AddCode(Handle<String>(shared->DebugName()),
789 Handle<Script>(info->script()), 789 Handle<Script>(info->script()),
790 Handle<Code>(info->code()))); 790 Handle<Code>(info->code())));
791 } 791 }
792 792
793 } } // namespace v8::internal 793 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698