Slightly improve r8367, fix to overflow of on-stack replacement.
authorwhesse@chromium.org <whesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 22 Jun 2011 15:30:00 +0000 (15:30 +0000)
committerwhesse@chromium.org <whesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 22 Jun 2011 15:30:00 +0000 (15:30 +0000)
The improvement is included in the port of r8367 to earlier versions of V8.
Review URL: http://codereview.chromium.org/7229011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8370 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/arm/lithium-arm.cc
src/compiler.cc
src/ia32/lithium-ia32.cc
src/x64/lithium-x64.cc

index 10c6662..c088986 100644 (file)
@@ -2122,6 +2122,7 @@ LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) {
   int spill_index = chunk()->GetNextSpillIndex(false);  // Not double-width.
   if (spill_index > LUnallocated::kMaxFixedIndex) {
     Abort("Too many spill slots needed for OSR");
+    spill_index = 0;
   }
   return DefineAsSpilled(new LUnknownOSRValue, spill_index);
 }
index c753d04..f8d1b3d 100755 (executable)
@@ -217,7 +217,8 @@ static bool MakeCrankshaftCode(CompilationInfo* info) {
   const int locals_limit = LUnallocated::kMaxFixedIndex;
   Scope* scope = info->scope();
   if ((scope->num_parameters() + 1) > parameter_limit ||
-      scope->num_stack_slots() > locals_limit) {
+      (info->osr_ast_id() != AstNode::kNoNumber &&
+       scope->num_parameters() + 1 + scope->num_stack_slots() > locals_limit)) {
     info->AbortOptimization();
     Handle<JSFunction> closure = info->closure();
     info->shared_info()->DisableOptimization(*closure);
index 1941597..20c13fd 100644 (file)
@@ -2170,6 +2170,7 @@ LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) {
   int spill_index = chunk()->GetNextSpillIndex(false);  // Not double-width.
   if (spill_index > LUnallocated::kMaxFixedIndex) {
     Abort("Too many spill slots needed for OSR");
+    spill_index = 0;
   }
   return DefineAsSpilled(new LUnknownOSRValue, spill_index);
 }
index 1571d62..f1a1da7 100644 (file)
@@ -2114,6 +2114,7 @@ LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) {
   int spill_index = chunk()->GetNextSpillIndex(false);  // Not double-width.
   if (spill_index > LUnallocated::kMaxFixedIndex) {
     Abort("Too many spill slots needed for OSR");
+    spill_index = 0;
   }
   return DefineAsSpilled(new LUnknownOSRValue, spill_index);
 }