Commit f7be4de9 authored by mythria's avatar mythria Committed by Commit bot

[Interpreter] Fixes VisitNewLocalBlockContext to reserve consecutive registers.

VisitNewLocalBlockContext funciton was allocating two registers and checking
if they are consecutive. This cl changes it to reserve consecutive registers.
The earlier code breaks this test mjsunit/regress/regress-542099.js.

BUG=v8:4280
LOG=N

Review URL: https://codereview.chromium.org/1545003003

Cr-Commit-Position: refs/heads/master@{#33086}
parent 96496454
......@@ -2074,9 +2074,10 @@ void BytecodeGenerator::VisitNewLocalBlockContext(Scope* scope) {
// Allocate a new local block context.
TemporaryRegisterScope temporary_register_scope(builder());
Register scope_info = temporary_register_scope.NewRegister();
Register closure = temporary_register_scope.NewRegister();
DCHECK(Register::AreContiguous(scope_info, closure));
temporary_register_scope.PrepareForConsecutiveAllocations(2);
Register scope_info = temporary_register_scope.NextConsecutiveRegister();
Register closure = temporary_register_scope.NextConsecutiveRegister();
builder()
->LoadLiteral(scope->GetScopeInfo(isolate()))
.StoreAccumulatorInRegister(scope_info);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment