Slightly improve r8367, fix to overflow of on-stack replacement.

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
This commit is contained in:
whesse@chromium.org 2011-06-22 15:30:00 +00:00
parent a8921c4681
commit 183efaee32
4 changed files with 5 additions and 1 deletions

View 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);
}

View File

@ -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);

View 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);
}

View 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);
}